# Agent Setup (/agents) OpenIslands is built for an AI agent to own a dashboard. Any agent that speaks the **Model Context Protocol** can drive it — this page covers connecting four of them: [Hermes](#hermes), [OpenClaw](#openclaw), [Claude Code](#claude-code), and [Codex CLI](#codex-cli). ## What's common to all of them [#whats-common-to-all-of-them] Every agent drives the **same MCP edit loop**. OpenIslands ships a standard **stdio** MCP server, `@openislands/mcp`, in **Code Mode** — one `execute` tool the agent drives by writing JavaScript against the `oi` API — and `init` scaffolds everything an agent needs to find it: * a `.mcp.json` wiring the server (pointed at the project root that holds your apps under `apps//`), * an `AGENTS.md` pointing the agent at the conventions, * the OpenIslands skill under `.agents/skills/openislands/`. So the agent reads the live contract, stages a validated `oi.app().patchManifest` / `replaceManifest`, applies it, and can roll it back — the tool and guarantees are identical whichever agent you use. See the [MCP Server](/mcp) page for the full `oi` API and the read-many/write-one model; this page only covers the per-agent **wiring**. The server invocation is always the same — `npx -y @openislands/mcp ` over stdio — so if an agent isn't listed below, point its MCP config at that command and drop an `AGENTS.md` (or its own project-instructions file) at the project root. ```jsonc title=".mcp.json" { "mcpServers": { "openislands": { "command": "npx", "args": ["-y", "@openislands/mcp", "."] } } } ``` ## Hermes [#hermes] [Hermes](https://hermes-agent.nousresearch.com) is Nous Research's self-hosted autonomous agent — it runs on your own hardware, writes and runs code, and calls external tools over MCP. **Wire up the server.** Hermes reads its config from `~/.hermes/config.yaml`, under an `mcp_servers` map (or run `hermes mcp add openislands` to add it interactively): ```yaml title="~/.hermes/config.yaml" mcp_servers: openislands: command: npx args: ["-y", "@openislands/mcp", "/path/to/your/project"] ``` **Project guidance.** Hermes loads an `AGENTS.md` from the working directory into its system prompt at session start — the one `init` already wrote. Point it at your project directory and it picks up the conventions; the skill under `.agents/skills/` documents the full edit loop. **Tips.** * Hermes is a long-running autonomous agent, so lean on the safety boundary: every manifest change is staged, diffed, and reversible. Let it propose and apply through the MCP rather than touching files directly. * Since it self-hosts, the `npx` invocation needs Node ≥ 20 available in the environment Hermes runs in. Hermes's MCP config schema (the `mcp_servers` map and its `command` / `args` / `env` keys) is taken from the [Hermes docs](https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp); the generic stdio invocation above is what matters. If a Hermes release changes the YAML shape, follow its docs and keep the same `npx -y @openislands/mcp ` command. ## OpenClaw [#openclaw] [OpenClaw](https://docs.openclaw.ai) is an open-source personal agent that runs anywhere and connects to external tools over MCP (it integrates `mcporter`). **Wire up the server.** OpenClaw reads `~/.openclaw/openclaw.json`. Note its MCP servers live under a **nested** `mcp.servers` key (not Claude Code's top-level `mcpServers`): ```json title="~/.openclaw/openclaw.json" { "mcp": { "servers": { "openislands": { "command": "npx", "args": ["-y", "@openislands/mcp", "/path/to/your/project"] } } } } ``` Or add it from the CLI with `openclaw mcp add` (check `openclaw mcp --help` for the current flag spelling), then `openclaw mcp doctor openislands` to confirm it launches. **Project guidance.** OpenClaw reads `AGENTS.md` as its project rules — the same file `init` drops. It also honors a sibling `CLAUDE.md`, so the convention of symlinking `CLAUDE.md → AGENTS.md` keeps one source of truth. **Tips.** * Mind the nesting: `mcp.servers`, not `mcpServers`. It's the easiest thing to get wrong moving a config over from Claude Code. * Confirm the connection with `openclaw mcp doctor` before driving it — a misnested key fails silently otherwise. OpenClaw's config path and the `mcp.servers` nesting come from the [OpenClaw docs](https://docs.openclaw.ai/cli/mcp); confirm the CLI flag spelling against the live page before scripting `openclaw mcp add`. The stdio command itself — `npx -y @openislands/mcp ` — is stable. ## Claude Code [#claude-code] [Claude Code](https://code.claude.com) is Anthropic's agentic coding CLI, and the default OpenIslands target — `init`'s scaffold is already shaped for it. **Wire up the server.** Claude Code reads project-scoped MCP servers from **`.mcp.json` at the project root** — exactly the file `init` writes, so there's nothing to do: ```jsonc title=".mcp.json" { "mcpServers": { "openislands": { "command": "npx", "args": ["-y", "@openislands/mcp", "."] } } } ``` To add it by hand, `claude mcp add --transport stdio openislands --scope project -- npx -y @openislands/mcp .` writes the same project-scoped entry. (Claude Code prompts to approve a project `.mcp.json` server on first use.) **Project guidance.** Claude Code reads `CLAUDE.md` as project memory and discovers skills under `.agents/skills/`. The scaffold ships the OpenIslands skill, so it loads automatically whenever you edit an OpenIslands workspace (a project with apps under `apps//`). (`AGENTS.md` is conventionally symlinked to `CLAUDE.md`.) **Tips.** * Just open the scaffolded folder — project-scoped `.mcp.json` and the skill are picked up with no manual MCP setup. * The skill's edit loop is the contract: drive it through `execute`, prefer `oi.app().patchManifest`, pass JSON objects, and never work around a binding error. ## Codex CLI [#codex-cli] [Codex CLI](https://developers.openai.com/codex) is OpenAI's coding agent CLI. It reads `AGENTS.md` natively, so the scaffold's conventions apply out of the box. **Wire up the server.** Codex configures MCP servers in `~/.codex/config.toml`, as `[mcp_servers.]` TOML tables: ```toml title="~/.codex/config.toml" [mcp_servers.openislands] command = "npx" args = ["-y", "@openislands/mcp", "/path/to/your/project"] ``` Or add it from the CLI: `codex mcp add openislands -- npx -y @openislands/mcp /path/to/your/project`. (Environment variables go in a `[mcp_servers.openislands.env]` sub-table — not the unrelated `env_vars` allowlist key.) **Project guidance.** Codex reads `AGENTS.md` — the file `init` writes. It merges `AGENTS.md` files from your home directory down to the working directory, concatenated root-to-cwd with the closest-to-cwd file taking precedence, so the project's `AGENTS.md` lands on top. **Tips.** * Codex's MCP config is global (`~/.codex/config.toml`), not per-project, so pass an **absolute** project path in `args` rather than `.`. * The project `AGENTS.md` points at the skill under `.agents/skills/openislands/` — read it for the full edit loop and CRUD recipes. ## Where to go next [#where-to-go-next] * [MCP Server](/mcp) — the full tool set and the read-many/write-one safety model every agent shares. * [Getting Started](/getting-started) — scaffold a project and drive your first edit. * [The Manifest](/concepts/manifest) — what every edit validates against. # CLI (/cli) `openislands` is the keyboard path. Every move the agent makes over [MCP](/mcp) you can make by hand — same validation, same files, same refusal to write something that won't render. Reach for it to bootstrap a project, drive a quick change without an agent in the loop, or wire a connector into cron. No global install needed: `npx openislands ` runs the latest published CLI. Install it (`npm i -g openislands`) once you're using it daily. ## The everyday loop [#the-everyday-loop] Most sessions are the same rhythm: **infer fast, formalize immediately**. See a file's shape with no commitment, then bind it, add an island, and validate. ### Infer a file's shape [#infer-a-files-shape] Drop a CSV (or JSON / JSONL / Parquet) into `data/` and ask what's in it: ```bash npx openislands infer data/spending.csv ``` You get the inferred columns and types, a proposed dataset contract, and a few suggested islands. Nothing is written — it's a read-only look. ### Bind it, then add an island [#bind-it-then-add-an-island] Re-run with `--bind` to write the dataset into the manifest, then scaffold an island: ```bash npx openislands infer data/spending.csv --bind npx openislands add category.bar ``` `--bind` re-validates before saving, so a bad write is refused, not persisted. Then open the app's `apps//manifest.json`, set the island's `dataset`, and fill in its required fields from the columns `infer` showed you. ### Validate [#validate] ```bash npx openislands validate ``` Green means the dashboard renders. A binding to a field that doesn't exist fails here and **names the island** — the same check the agent's `oi.app().replaceManifest` runs. ## Commands [#commands] Every project is a **workspace**: apps live under `apps//`, and the commands below run at the project root and fan out across them. `--app ` narrows a command to one app; `validate` and `sync` default to **all** apps. ### `init` [#init] ```bash openislands init [project] --app --template ``` Scaffolds a complete, working project workspace into `project` (default: `openislands/`), with the first app at `apps//`. `--template` (`-t`) picks the starting point and defaults to `finance` — net worth, allocation, holdings, and transactions as typed islands over CSVs you own; `health`, `operations`, and the blank `empty` are the others. `--app` names that first app id; it defaults to the template name (`finance`, `health`, …), or `main` for `empty`. ### `serve` [#serve] ```bash openislands serve [project] [--port 4321] [--host 127.0.0.1] [--mcp] [--mcp-token ] ``` Boots your dashboard as a long-running local app (the TanStack Start SSR runtime), querying your files on every request. It scans `apps/*`, compiles each, and serves them all in one process on one port — the UI gets a left rail to switch apps (hidden when there's only one). It binds to loopback by default — this is your data. Leave it running: edit a file and the page live-updates over SSE. `--mcp` also mounts the MCP server over Streamable HTTP on the same port at a single `/mcp` endpoint — one server for the whole workspace, with the app chosen by the `app` tool param — so a remote agent can drive the dashboard. `--mcp-token` sets the bearer token it requires — mandatory when binding off loopback, since MCP is a write surface. Every flag has an environment equivalent (`OPENISLANDS_PORT`, `OPENISLANDS_HOST`, `OPENISLANDS_MCP`, `OPENISLANDS_MCP_TOKEN`), which is how the [Docker image](/self-hosting) is configured; flags win when both are set. When you bind off loopback, `OPENISLANDS_ALLOWED_IPS` restricts which client IPs may reach the port (comma-separated IPs and IPv4 CIDRs; default allow-all). See [Self-hosting](/self-hosting) for the container story. ### `infer` [#infer] ```bash openislands infer [project] [--app ] [--bind] ``` Reads a data file through the same DuckDB core the runtime uses and prints its columns, a proposed dataset contract, and suggested islands. Read-only by default; `--bind` writes the dataset into the target app's `apps//manifest.json` (re-validating first). The file must live inside the app — move it under its `data/` before binding. Operates on one app: it defaults to the sole app and errors if the project has several, so pass `--app`. ### `add` [#add] ```bash openislands add [project] [--app ] ``` Appends an island skeleton to the first page, then validates before writing — if the skeleton wouldn't render, nothing is saved. Fill in its `dataset` and fields afterward. Targets one app (defaults to the sole app; `--app` when there's more than one). Any built-in type works; see the [island registry](/islands/overview). ### `add-app` [#add-app] ```bash openislands add-app [project] --template ``` Adds another app to an existing workspace, scaffolding a full template into `apps//` — the CLI parity for the MCP `oi.createApp` method. The `id` must be a single safe path segment and not already exist. ### `validate` [#validate-1] ```bash openislands validate [project] [--app ] ``` Compiles **every** app's manifest and checks each island's binding against the live data; `--app` narrows it to one. On failure it names the app, page, island, and missing field, and exits non-zero if any app fails — the safety net behind every edit, agent or human. ### `sync` [#sync] ```bash openislands sync [project] [connector] [--app ] ``` Pulls configured [connectors](/data/connectors) once across **all** apps and writes their datasets; name a connector and/or pass `--app` to narrow. Cron this for headless refresh; an OAuth connector needs to be authorized once from the running dashboard first. ## Next [#next] * [MCP Server](/mcp): the same surface, driven by an agent. * [The Manifest](/concepts/manifest): the JSON these commands read and write. * [Islands](/islands/overview): the building blocks `add` scaffolds. # Data Contracts (/concepts/data-contracts) An island never reaches for a file directly. It binds to a **dataset**: a named, typed contract declared in the manifest. The runtime resolves each dataset through a DuckDB query core, infers its columns and types from the live data, and checks every island binding against that shape. Your files are the source of truth; there are no snapshots to drift out of date. ## Datasets [#datasets] `datasets` maps a name to a source. A dataset is one of three shapes: ```jsonc title="manifest.json" "datasets": { "net_worth": { "source": "data/net_worth_monthly.csv" }, // a file you own "allocation": { "sql": "models/transforms/allocation.sql" }, // a SQL transform over other datasets "tracks": { "source": "data/library.sqlite", "table": "tracks" } // a table in a SQLite database } ``` * **A file source.** `source` points at a CSV, JSON, JSONL, or Parquet file, relative to the project root. DuckDB reads it directly and infers the column types. * **A SQL transform.** `sql` points at a `.sql` file under `models/` (typically `models/transforms/`). This is a derived, read-only view (see below). * **A SQLite table.** A `.sqlite` / `.db` source plus a `table` name. A SQLite source *requires* `table`; supplying `table` on any other source is a named validation error. A file or SQLite-backed dataset is a **`source`** dataset: it can be written to (by actions and connectors). A `sql` dataset is **derived** and never writable. ## Shaping lives in SQL, never in island configs [#shaping-lives-in-sql-never-in-island-configs] A golden rule: islands stay declarative. You never put a sum, a filter, or a join inside an island's config. Data shaping happens in the data layer, in a `sql` transform, so the manifest only ever names fields that already exist. Drop a `.sql` file in `models/transforms/` and register it as a dataset. It's a plain DuckDB `SELECT` over your other datasets (referenced by their dataset name): ```sql title="models/transforms/allocation.sql" -- models/transforms/allocation.sql SELECT class, SUM(value_eur) AS value_eur, SUM(value_eur) / SUM(SUM(value_eur)) OVER () AS share FROM holdings GROUP BY class ORDER BY value_eur DESC; ``` ```jsonc title="manifest.json" "datasets": { "holdings": { "source": "data/holdings.csv" }, "allocation": { "sql": "models/transforms/allocation.sql" } } ``` Now a `breakdown.treemap` can bind cleanly to `allocation` with `label: "class"` and `value: "value_eur"`. Every value it reads is a real column, computed once in SQL. ## The contract check [#the-contract-check] This is the safety net. When you run `validate` (or an agent calls `oi.app().replaceManifest`), the compiler materializes each dataset, asks DuckDB for its columns and types, and checks every island binding against that live schema: * Bind to a column that exists → the island is green. * Bind to a column that **doesn't** → the build fails and names the page, the island index, the island type, and the missing field. Because the check runs against the *live* data, not a cached schema, renaming a CSV column or changing a transform surfaces immediately as a named error, never as a silently-empty chart. The same machinery guards custom-island configs and page filter bindings. The check is type-aware where it matters. A page date-range filter, for instance, compares correctly whether the bound column is a real `DATE`/`TIMESTAMP` or a `YYYY-MM` string: a `YYYY-MM` month is matched against the prefix of the range bound. ## Markdown datasets [#markdown-datasets] A Markdown file can be a dataset too, useful for `source.doc` islands that embed notes or strategy docs alongside your charts. Point a dataset's `source` at a `.md` file and reference it from a `source.doc` island, keeping prose under the same typed, file-owned contract as your numbers. ## Writing back: actions and connectors [#writing-back-actions-and-connectors] Contracts aren't read-only. Two typed write paths feed `source` datasets through a checkpointed pipeline, so writes are reversible: * **Actions.** A manifest-declared, typed `insert` into a `source` dataset. Every row is validated against the dataset's inferred schema before anything is written. * **Connectors.** Vendored integrations that sync an external provider's data into `source` datasets on a schedule. Both run through the same snapshot-before-write machinery the agent edit loop uses. See [MCP Server](/mcp) for how an agent drives actions (`oi.app().runActions`) and connectors (`oi.app().runSync`) safely, and the [Manifest Reference](/reference/manifest) for their full declaration shape. # The Manifest (/concepts/manifest) An OpenIslands app is a typed **manifest**: a JSON declaration of reusable visual **islands** bound to **typed data contracts** built from files you own. You edit the manifest. You never write rendering code; the runtime owns that. The payoff is durability: a manifest is small, declarative, and validated, so an agent can maintain it for months without the dashboard rotting. ## The skeleton [#the-skeleton] Every manifest has the same spine: a version, a title, the datasets it reads, and the pages that render them. ```jsonc title="manifest.json" { "version": 1, "title": "Finance Overview", "icon": "wallet", // optional, the app's tile icon "datasets": { "net_worth": { "source": "data/net_worth_monthly.csv" } // a file you own (see Data Contracts) }, "pages": [ { "id": "overview", // one sidebar entry per page "icon": "house", "islands": [ { "type": "metric.kpi", "title": "Net worth", "dataset": "net_worth", // names a dataset above "value": "net_worth_eur", // a field that must exist in it "compareTo": "prev", "format": "eur", "span": 3 } ] } ] } ``` That single KPI island, fed its data, renders exactly like this. The docs run the real renderer, not a screenshot: ## Pages and groups [#pages-and-groups] Each page is one entry in the left sidebar (a single-page app stays chrome-free). A page holds **either** a flat list of `islands` **or** tabbed `groups`, never both. Groups render as tabs under the page header, deep-linked via `?group=`: ```jsonc title="manifest.json" { "id": "holdings", "groups": [ { "id": "positions", "title": "Positions", "islands": [ /* ... */ ] }, { "id": "activity", "title": "Activity", "islands": [ /* ... */ ] } ] } ``` A page may also declare shared `filters` rendered in the page header — a `daterange` over a date column (optionally opening on a `default` period like `last-90-days`, resolved live against today), or a `select` that narrows a categorical column (single or `multiple`, its choices drawn from the column's live distinct values) — each re-querying every island bound to the filtered column at once. A filter only touches the datasets named in its `bind` map; an island whose dataset isn't bound (e.g. a SQL transform you add to a filtered page later) keeps showing all-time until you add it to `bind`. See the [Manifest Reference](/reference/manifest) for the full shape. ## Spans and the grid [#spans-and-the-grid] Every page (and every group) is a 12-column grid. An island's `span` is how many columns it takes, from 1 to 12. Each island type carries three bounds: * A **minimum span** below which it stops being legible — a `table.grid` needs 5, most charts need 4, a `metric.kpi` needs 2. Below it, `validate` rejects the manifest with a named error like *"span 1 is below the minimum 4 for timeseries.line."* * A **maximum span** above which it only stretches into dead space — and the over-max error is the mirror of the under-min one: *"span 12 exceeds the maximum 6 for funnel.steps — it only stretches into empty space past that width."* Compact, single-value islands (KPIs, funnels, gauges, pies, radars) are capped well below full width; data-dense islands (tables, charts, feeds, calendars) run the full 12. * A **recommended span** in between — what the island renders at when you omit `span`. A `funnel.steps`, for instance, is min 3, recommended 4, max 6. `validate` (and the MCP edit path) also runs an advisory **layout linter** that emits non-blocking warnings for composition smells — a lone `metric.kpi` (group them or use `metric.scorecard`), or a compact island stretched past its recommended width. The dashboard still renders; the warning just nudges you toward a tidier layout. The schema is the source of truth for all three numbers: see `ISLAND_MIN_SPAN`, `ISLAND_DEFAULT_SPAN`, and `ISLAND_MAX_SPAN` in `packages/schema/src/index.ts`, or read an island's range straight from `oi.app().getIslandSchema(type)` over the MCP. The runtime also floors spans responsively, so a tile never renders narrower than its usable width on a small screen. ## Fail loudly [#fail-loudly] The manifest's job is to make a broken dashboard **impossible to ship silently.** Every island binds to named fields, and `validate` (and the agent's `oi.app().replaceManifest`) checks each one against the live, DuckDB-inferred columns of the data: * Bind to a field that exists → the island renders. * Bind to a field that **doesn't** → the build fails and **names the page, the island, and the missing field.** You never get a silently-wrong chart pointed at a column that isn't there. That check is the safety net the whole design rests on. Keep the manifest declarative, with no data transforms inside island configs (shaping lives in the [data layer](/concepts/data-contracts)), and the net stays taut. ## Where to go next [#where-to-go-next] * [Data Contracts](/concepts/data-contracts): datasets, SQL transforms, and the binding check in detail. * [Islands](/islands/overview): every built-in island and its required fields, with live previews. * [Manifest Reference](/reference/manifest): the exhaustive, schema-generated field list. # SQL Transforms (/concepts/sql-transforms) A `sql` dataset is a saved DuckDB query over your other datasets. It's where data shaping lives: the sums, joins, and filters an island must never carry. The manifest stays declarative because the arithmetic happens here, in a file you own, and the island only ever names columns that already exist. ## Why shaping belongs in SQL [#why-shaping-belongs-in-sql] An island config names fields; it never computes them. You don't put a `SUM`, a `GROUP BY`, or a join inside an island, because that buries logic in a layer that can't validate it and can't be reused. Move the computation into a transform and two things follow: the shaped table can feed several islands, and `validate` can check every binding against real, materialized columns. ## Writing one [#writing-one] Drop a `.sql` file under `models/` (the convention is `models/transforms/`) and register it as a dataset by its `sql` path: ```jsonc title="manifest.json" "datasets": { "transactions": { "source": "data/transactions.csv" }, "monthly": { "sql": "models/transforms/monthly.sql" } } ``` The file is a single DuckDB `SELECT`. It reads your other datasets by their dataset name, as if each were a table: ```sql title="models/transforms/monthly.sql" -- models/transforms/monthly.sql SELECT date_trunc('month', ts) AS month, SUM(amount_eur) AS spend_eur, COUNT(*) AS txns FROM transactions GROUP BY 1 ORDER BY 1; ``` Now a `timeseries.line` binds to `monthly` with `x: "month"` and `y: "spend_eur"`, and every value it reads is a column DuckDB computed once. Each dataset registers as a DuckDB view named after the dataset, so a transform can use the full dialect: joins, CTEs, window functions, date math, anything DuckDB supports. A trailing semicolon is fine. The file must be one statement, a `SELECT` optionally led by a `WITH`. ## Transforms can build on transforms [#transforms-can-build-on-transforms] Because every dataset is a view, a transform can read another transform, not only a file. The one rule is order. Datasets register in the order they appear under `datasets`, so a transform has to be declared after everything it reads: ```jsonc title="manifest.json" "datasets": { "transactions": { "source": "data/transactions.csv" }, "monthly": { "sql": "models/transforms/monthly.sql" }, // reads transactions "monthly_net": { "sql": "models/transforms/monthly_net.sql" } // reads monthly, declared after it } ``` A transform that references a dataset declared later in `datasets` fails to register: the view it needs doesn't exist yet. Put upstream datasets first. ## Derived and read-only [#derived-and-read-only] A `sql` dataset is derived. It's a query, not a file, so nothing can write to it: no [action](/data/actions) and no [connector](/data/connectors) may target it. Data flows one way, from the `source` files it reads, through the `SELECT`, into the islands. To change what a transform returns, change its SQL or the files beneath it. A transform renders to islands and takes no parameters. For a parameterized, on-demand read over a dataset — one an agent calls and gets rows back from, not a chart — declare a [query](/data/queries) instead. A query is a declarative spec the compiler turns into SQL, and it often points at a transform: the transform does the joins and shaping, the query parameterizes the read. ## The binding check still applies [#the-binding-check-still-applies] Islands bind to a transform's *output* columns, and `validate` checks them against the live result. The compiler materializes the view, asks DuckDB for its columns and types, and rejects any island bound to a column the `SELECT` doesn't produce, naming the page, the island, and the missing field. Rename a column in the SQL and forget to update the island, and the build fails loudly instead of rendering an empty chart. It works upstream too: drop a column from a source CSV that the transform selects, and the error surfaces the moment you validate. ## Where to go next [#where-to-go-next] * [Data Contracts](/concepts/data-contracts): the three dataset shapes and the contract check. * [Actions](/data/actions): typed writes into the `source` files a transform reads. * [The Manifest](/concepts/manifest): how datasets and islands fit together. # Actions (/data/actions) An action is a typed write into a `source` dataset. It's how new rows reach your data through the same checkpointed path the agent edit loop uses: validated before anything touches disk, snapshotted before the write, reversible after. You declare an action in the manifest; an agent runs it over [MCP](/mcp). ## What an action can write [#what-an-action-can-write] Only a `source` dataset. A file-backed dataset (CSV, JSON, JSONL) or a SQLite table takes inserts. A derived [`sql` dataset](/concepts/sql-transforms) never does, because it's a query, not a file. Pointing an action at a `sql` dataset is a named validation error. ## Declaring one [#declaring-one] An action names its target dataset and a `mode`. Four modes are available: | Mode | What it does | | --------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `insert` | Appends rows (default). | | `replace` | Overwrites **all** rows in the dataset with the new rows. | | `delete` | Drops rows where every column in the `match` predicate equals the given value (equality, multi-column AND). An empty `match` is rejected. | | `update` | Patches matching rows: `match` selects the rows, `set` applies the new values. An empty `match` is rejected. | ```jsonc title="manifest.json" "actions": { "log_meal": { "dataset": "meals", "mode": "insert" }, "delete_meal": { "dataset": "meals", "mode": "delete" }, "fix_meal": { "dataset": "meals", "mode": "update" } } ``` The match predicate and new values for `delete` and `update` are passed **at call time** via `runActions`, not in the manifest. `match` is equality-only in v1 — no ranges or operators. That alone inserts rows whose columns match the `meals` data. Most actions add a `fields` block to constrain or annotate specific columns. ## The row schema [#the-row-schema] An action carries no hand-written schema. It derives one from the live data: the compiler infers each column's type from the dataset, then layers your `fields` overrides on top. The result is a strict schema (unknown columns are rejected) that an agent reads before it sends a single row. A `fields.` entry narrows one column: ```jsonc title="manifest.json" "actions": { "log_meal": { "dataset": "meals", "mode": "insert", "fields": { "meal_type": { "enum": ["breakfast", "lunch", "dinner", "snack"] }, "calories": { "type": "number", "min": 0 }, "source": { "default": "manual" } } } } ``` Each override key does one job: * `type`: constrain the column to `string`, `number`, `boolean`, or `date`, overriding what was inferred. * `enum`: restrict a string column to a fixed set of values. * `min` / `max`: numeric bounds. * `default`: a value applied when a row omits the column. * `description`: a note that rides along with the schema, so the agent knows what the column means. A key in `fields` that doesn't match a real column is an error. You can only override columns that exist. ## What happens on a write [#what-happens-on-a-write] An agent calls `oi.app().runActions([{ action, rows? }])`. Before a single byte lands: * **Every row (for `insert` / `replace`) is validated** against the resolved schema. One bad row (wrong type, a value outside `min`/`max`, an unknown column) rejects the whole call with an error naming the row index and the field, and nothing is written. * **For `delete` / `update`, the `match` predicate is checked** — an empty `match` is rejected outright to prevent an accidental full-table wipe. * **The target file is snapshotted** to `.openislands/history/`, so every write is reversible with `rollback`. Then the write lands: rows appended or replaced in a flat file, or the matched rows deleted / patched. A SQLite insert needs the file and table to exist already; a flat file is created if it's missing. All writes are all-or-nothing and path-confined: an action can only write the one `source` file its dataset names. There is no general file write. CSV and other flat-file datasets store no null. Pass `""` for an empty string value, or omit the field entirely to apply its `default`. Sending `null` in a row is a validation error. ## Running an action [#running-an-action] Actions belong to the agent edit loop, not to a CLI command. An agent: 1. Calls **`oi.app().listActions()`** to get each declared action and its resolved row JSON Schema (the live schema merged with `fields`). That schema is its grounding for a valid row. 2. Calls **`oi.app().runActions([...])`** with one call object per action: | Mode | Call shape | | --------- | ----------------------------------------------------------------- | | `insert` | `{ action, rows: [{ col: val, ... }, ...] }` | | `replace` | `{ action, rows: [{ col: val, ... }, ...] }` | | `delete` | `{ action, match: { col: val, ... } }` | | `update` | `{ action, match: { col: val, ... }, set: { col: newVal, ... } }` | Multiple calls in one `runActions` are atomic by default — if any call fails validation, nothing is written; a mid-batch write failure rolls back earlier writes automatically. Because every mutation is schema-checked and snapshotted before it runs, data that tries to talk an agent into a bad write still can't get past validation or escape `rollback`. ## Surfacing an action to humans [#surfacing-an-action-to-humans] An action isn't agent-only. Drop a [`form.entry`](/islands/content-and-layout#formentry) island on a page and point it at an **insert** action, and the runtime renders a form — one typed input per field, the action's types, enums, ranges, and defaults carried straight through — with a submit button that inserts a row. Point a [`board.kanban`](/islands/content-and-layout#boardkanban) at an **update** action and dragging a card POSTs `match` + `set` the same way. Both share the write path `runActions` uses: validate, snapshot, write, then the bound dataset's islands refresh live. See [MCP Server](/mcp) for Code Mode and the full `oi` API, and [Connectors](/data/connectors) for syncing a provider's data into `source` datasets on a schedule, through this same write path. # Connectors (/data/connectors) A connector syncs an external provider's data into your `source` datasets. It pulls from an API, shapes the rows, and writes them through the same checkpointed path [actions](/data/actions) use, so a sync is as reversible as any other write. The code lives in your project, the manifest declares an instance of it, and authorization happens in the dashboard, never from an agent. ## Using a connector [#using-a-connector] A connector is a directory under `connectors/` whose name is the connector's name, mirroring custom islands. Adopting one is three steps: copy the directory in, declare it, set its secrets. ### Declare it [#declare-it] Add an entry under `connectors`, parallel to `actions`: ```jsonc title="manifest.json" "connectors": { "whoop": { "module": "connectors/whoop", // the directory, relative to the project root "datasets": { "recovery": "whoop_recovery" }, // connector output -> your source dataset "schedule": "6h", // optional, overrides the connector's default "config": { "lookbackDays": 30 } // optional, validated by the connector's schema } } ``` `datasets` maps each of the connector's declared **outputs** to a writable `source` dataset in your manifest. Every key must be one of the connector's outputs, and every value must name a `source` dataset, never a [`sql` transform](/concepts/sql-transforms). `validate` loads the module, parses `config` against the connector's own schema, and checks the outputs and schedule, so a typo'd output name or a bad config is a named error before anything runs. ### Authorize it [#authorize-it] How a connector authorizes depends on the auth mode its code declares: * **Keyless.** A connector that uses a plain API key declares its key env vars in `secrets` and reads them from `.env`. Nothing to click — it's connected once every secret is set. * **OAuth2.** A connector that talks to an OAuth provider needs its client credentials in `.env` (the connector declares which keys, e.g. `WHOOP_CLIENT_ID` and `WHOOP_CLIENT_SECRET`), then a one-time sign-in. Authorization is human-only: run `openislands serve`, open the dashboard, and click **Connect**. The runtime walks the OAuth flow in the browser and stores the resulting tokens at `.openislands/connectors/.json` (gitignored). An agent never authorizes on its own; if a sync reports a connector isn't connected, it asks you to. * **Bearer.** A connector that takes a static long-lived API token or JWT declares the `.env` key holding it (`tokenEnv`). You paste the token into `.env` and that's it — there's no Connect click, like a keyless connector. It's connected once the env var is set, and the token is handed to `sync` as `ctx.tokens.accessToken`, identical to an OAuth access token. ### Sync it [#sync-it] Once connected, rows arrive three ways: * **On a schedule.** The runtime runs each connector on its `schedule`, syncing right away if it's overdue and on the interval after that. * **From the CLI.** `openislands sync` pulls every configured connector once and exits; `openislands sync . whoop` runs a single one. Cron this for a headless refresh. * **From an agent.** `oi.app().runSync(name)` over [MCP](/mcp) pulls and writes, returning rows-per-dataset and a `checkpoint_id`. Every path writes through the snapshot-before-write machinery, so `rollback` undoes a sync the same as it undoes an edit. ## Building a connector [#building-a-connector] A connector is a single `index.ts` that default-exports `defineConnector({ ... })` from `@openislands/connector-kit`: ```text connectors/whoop/ index.ts # default-exports defineConnector({ ... }) ``` ```ts title="connectors/whoop/index.ts" import { defineConnector } from "@openislands/connector-kit"; import { z } from "zod"; export default defineConnector({ description: "Whoop recovery, sleep, and workouts", config: z.object({ lookbackDays: z.number().int().positive().default(30), }), schedule: "6h", auth: { type: "oauth2", data: { authorizeUrl: "https://api.prod.whoop.com/oauth/oauth2/auth", tokenUrl: "https://api.prod.whoop.com/oauth/oauth2/token", scopes: ["read:recovery", "read:sleep", "offline"], clientIdEnv: "WHOOP_CLIENT_ID", clientSecretEnv: "WHOOP_CLIENT_SECRET", }, }, outputs: { recovery: { description: "daily recovery score, replaced each sync" }, sleep: { description: "per-sleep records, inserted by cursor" }, }, async sync(ctx) { const rows = await fetchRecovery(ctx.tokens!.accessToken, ctx.config.lookbackDays); await ctx.replace("recovery", rows); // ... }, }); ``` ### outputs [#outputs] `outputs` declares the named tables this connector produces. The manifest's `datasets` keys must be a subset of them, and each output carries an optional `description`. An author decides, per output, whether a sync inserts or replaces it. ### config [#config] An optional Zod schema. The runtime parses the manifest's `config` block against it and hands the result to `sync` as `ctx.config`, fully typed. A config that fails the schema is caught at `validate`. ### auth [#auth] A connector picks one of three auth modes: * **Keyless.** Omit `auth` and list its API-key env vars in `secrets: ["SOME_API_KEY"]`; they arrive as `ctx.secrets`. Connected once every secret is set. * **OAuth2.** Set `auth.type` to `"oauth2"` and give it the provider's `authorizeUrl`, `tokenUrl`, the `scopes` to request, and the `.env` keys holding the client id and secret. The runtime owns the rest: the Connect flow, token storage, and refreshing an access token that's about to expire before each sync. * **Bearer.** Set `auth.type` to `"bearer"` and name the `.env` key holding a static long-lived API token or JWT in `data.tokenEnv`. There's no Connect flow: the runtime reads the env token and hands it to `sync` as `ctx.tokens.accessToken`, exactly like an OAuth access token, so your request code (`Authorization: Bearer …`) is the same either way. Connected once the env var is set. ```ts title="connectors/acme/index.ts" export default defineConnector({ description: "Reads a service behind a static API token", auth: { type: "bearer", data: { tokenEnv: "ACME_API_TOKEN" } }, outputs: { events: { description: "appended events" } }, async sync(ctx) { const res = await fetch("https://api.acme.dev/events", { headers: { authorization: `Bearer ${ctx.tokens!.accessToken}` }, }); await ctx.insert("events", await res.json()); }, }); ``` ### sync(ctx) [#syncctx] The heart of a connector. It receives a context, writes rows, and returns nothing. The context gives you: * `ctx.config`: the parsed config. * `ctx.secrets`: the declared `.env` secrets, keyed by name. * `ctx.tokens`: for an OAuth connector, `{ accessToken, refreshToken?, expiresAt? }`, refreshed automatically when it's near expiry; for a bearer connector, `{ accessToken }` carrying the static token from `.env`. Absent for keyless connectors. * `ctx.state`: a mutable object that persists between syncs. Keep a cursor here (the timestamp or id you last pulled) so the next run fetches only what's new. It's saved after a successful sync. * `ctx.insert(output, rows)`: append rows to an output's dataset. For immutable records, a workout that happened, a sleep that's logged. Advance a cursor in `ctx.state` so you don't re-insert them next time. * `ctx.replace(output, rows)`: overwrite an output's dataset wholesale. For records the provider revises after the fact, like a recovery score that gets recomputed, where the latest pull is the truth. * `ctx.log(message)`: a line in the sync log. Insert versus replace is chosen per output by which method you call, and a connector can do both: replace the volatile outputs, insert-and-advance the append-only ones. You shape the rows in your own code. The first sync into an empty dataset takes whatever columns you write; later syncs are checked against the dataset's settled schema. Tokens and `ctx.state` live together at `.openislands/connectors/.json`, outside your data files and outside git. The dataset files hold only rows. ### Types without an install [#types-without-an-install] Your project's `package.json` and `tsconfig.json` (scaffolded by `init`) exist so `connectors/` and `components/custom/` typecheck in your editor. Run `npm install` once and `@openislands/connector-kit` and `zod` resolve for the type checker. The runtime never uses the project's `node_modules`: it bundles the connector on demand and resolves both packages to its own copies. ## Status and troubleshooting [#status-and-troubleshooting] `oi.app().listConnectors()` over MCP, `openislands sync`, and the dashboard all read the same status per connector: * `connected`: OAuth is complete, the bearer token env var is set, or for a keyless connector, every secret is present. * `missingSecrets`: env keys the connector needs that aren't set. * `lastSync` / `lastError`: when it last ran, and why it failed if it did. * `schedule`: the effective interval, the manifest's value falling back to the connector's default. * `loadError`: the module failed to compile, or didn't export a valid connector. A complete OAuth2 reference connector lives at `apps/examples/health/connectors/whoop/`: three outputs, a cursor for the append-only ones, and a full pull-and-shape `sync`. ## Where to go next [#where-to-go-next] * [Actions](/data/actions): the manual write path connectors build on. * [Data Contracts](/concepts/data-contracts): what makes a dataset a writable `source`. * [MCP Server](/mcp): `oi.app().listConnectors()` and `runSync` inside the agent loop. # Queries (/data/queries) A query is the read mirror of an [action](/data/actions). Where an action is a typed write into a `source` dataset, a query is a typed, read-only read over one dataset, declared in the manifest and called on demand. You don't write SQL: a query is a declarative spec (a dataset, optional filters, a projection, an order) that the compiler translates to a parameterized `SELECT`. You declare a query; an agent runs it over [MCP](/mcp) with `oi.app().runQuery`. ## Why declarative [#why-declarative] A query is a spec, not raw SQL in a JSON string. The compiler reads the spec and emits the SQL. That buys five things: * **No casting footgun.** The translator emits type-aware casts itself. You never write a `TRY_CAST` or an `ILIKE`; you name a field and an op and it compiles to the right comparison. * **Fields are validated.** Every `field` you reference is checked against the dataset's live columns at build time, like an island binding. A field that doesn't exist is a named error, not an empty result. * **Injection-safe.** Every param and every literal `value` is bound, never interpolated. Only verified column identifiers are quoted into the SQL. * **Agent-authorable.** The spec is plain JSON, so an agent writes a query through the normal `oi.app().patchManifest` → `applyEdit` loop, the same loop it uses for islands (see [Authoring queries](#authoring-queries)). * **No joins by design.** A query reads one dataset. When a read needs joins or other heavy shaping, that lives in a [`sql` transform](/concepts/sql-transforms) the query's `dataset` points at. ## What a query reads [#what-a-query-reads] One dataset: a raw `source` dataset or a `sql` transform, named by `dataset`. Because a transform is itself a dataset, a query over a transform reads already-shaped, already-joined columns. Think of a query as a saved, named, typed version of the ad-hoc `oi.app().runSql` read, scoped to a single dataset. A query is the dual of a transform, not a replacement for one. A transform is a file-backed view bound to islands: it renders, takes no parameters, and shapes data once. A query renders nothing, takes parameters, and returns rows when called. A query often selects from a transform: let the transform do the joins and aggregation, and let the query parameterize the read. ## Declaring one [#declaring-one] A query names its `dataset` and, optionally, the `params` it accepts and how to `where` / `select` / `orderBy` / `limit` the rows: ```jsonc title="manifest.json" "queries": { "get_daily_macros": { "description": "Macros + goals for one day; omit date for the latest.", "dataset": "macros_daily", "params": { "date": { "type": "date", "required": false } }, "where": [{ "field": "date", "op": "eq", "param": "date" }], "orderBy": [{ "field": "date", "dir": "desc" }], "limit": 1 } } ``` That reads one row from `macros_daily`. With a `date`, it's that day; with no `date`, the filter drops and the `orderBy` + `limit` return the latest row (see [Filters](#filters)). ### Parameters [#parameters] `params` maps each parameter name to its declaration. A `where` clause references a param by name in its `param` field; the value is bound when the query runs. | Field | Type | Description | | ------------- | --------------------------------------------- | --------------------------------------------------------------------------------- | | `type` | `"string" \| "number" \| "boolean" \| "date"` | The parameter's type. Defaults to `string`. | | `required` | `boolean` | Whether the caller must supply it. Defaults to `true`. `false` makes it optional. | | `enum` | `array of string` | Restrict a string parameter to a fixed set of values. | | `min` / `max` | `number` | Numeric bounds. | | `default` | `string \| number \| boolean` | A value used when the caller omits it. Implies optional. | | `description` | `string` | A note that rides along with the param, so the agent knows what it means. | ### Filters [#filters] `where` is a list of filters, ANDed together. Each names a `field`, an `op`, and exactly one of `param` (bind a declared param) or `value` (a literal): | Op | Match | | --------------------------- | -------------------------------------------- | | `eq` / `ne` | Equal / not equal. | | `lt` / `lte` / `gt` / `gte` | Ordered comparison. | | `contains` | Case-insensitive substring. | | `sameDay` | A timestamp field falls on a given date. | | `in` | The field is one of a literal `value` array. | A filter bound to an **optional** param the caller omits is **dropped**; the query runs as if the filter weren't there. That's the latest-row pattern above: omit `date` and the day filter disappears, leaving `order by date desc limit 1`. ### Projection [#projection] `select` is a list of columns to return; omit it for all of them. An entry is either a column name or `{ field, fn?, as? }`, where `fn` is `sum`, `avg`, `count`, `min`, or `max`. Aggregates pair with `groupBy`, a list of columns to group by: ```jsonc title="manifest.json" "queries": { "spend_by_category": { "dataset": "transactions", "select": [{ "field": "category" }, { "field": "amount", "fn": "sum", "as": "total" }], "groupBy": ["category"], "orderBy": [{ "field": "total", "dir": "desc" }], "limit": 10 } } ``` `orderBy` is a list of `{ field, dir? }` sort keys (`dir` is `asc` or `desc`, default `asc`), and `limit` caps the rows. ### Search [#search] `search` turns a query into a relevance-ranked full-text search over text columns. It compiles to DuckDB's full-text index and ranks rows by BM25, so a multi-word term matches rows that share *any* token, best match first. That's the difference from a `contains` filter: `contains` is a whole-phrase, case-insensitive substring match and returns rows unranked; `search` tokenizes both the columns and the term and orders by likeliness. Searching `greek yogurt` returns `Greek Yogurt` above `Olympus Yogurt` — which only shares the token *yogurt* — and excludes `Banana`. ```jsonc title="manifest.json" "queries": { "search_ingredients": { "description": "Find ingredients by name or brand, best match first.", "dataset": "ingredients", "params": { "q": { "type": "string" } }, "search": { "fields": ["name", "brand"], "param": "q", "scoreField": "score" }, "limit": 20 } } ``` A `search` clause names: | Field | Type | Description | | ------------ | --------------------- | --------------------------------------------------------------------------------------------------------------------- | | `fields` | `array of string` | The text columns to index and search across. Each must be a real column of the dataset, checked like any other field. | | `param` | `string` | The name of a declared **string** `param` that holds the search term. | | `stemmer` | `"porter" \| "none"` | How tokens are folded. `porter` (default) collapses plurals and tenses; `none` matches exact tokens. | | `stopwords` | `"english" \| "none"` | Whether to drop common words from the index and the term. `english` (default) drops them; `none` keeps them. | | `scoreField` | `string` | Optional. Names a column to expose the BM25 relevance score under; omit to keep the score internal (ordering only). | `search` composes with the rest of the spec. A `where` clause further filters the matched rows; an omitted `orderBy` defaults to relevance (highest BM25 first), and an explicit `orderBy` overrides that order; `limit` caps the rows as always. `search` reads a `source` dataset, not a `sql` transform. (A full-text index can't track changes to the files a transform reads, so it would silently go stale.) Because the index needs a real table, declaring `search` materializes the dataset into an indexed table at build time — the manifest gates that, and it's invisible to the query. ## Running a query [#running-a-query] Queries belong to the agent edit loop, not to a CLI command. An agent: 1. Calls **`oi.app().listQueries()`** to get each declared query: its `name`, `description`, its `params` as a JSON Schema, and the result `columns`. That's its grounding for what to pass and what comes back. 2. Calls **`oi.app().runQuery(name, params?, { limit? })`**, which validates the params and runs the compiled `SELECT`. On success it returns `{ ok: true, rowCount, columns, rows }`. A bad param rejects the whole call with `{ ok: false, errors }` (all-or-nothing); an unknown name or a query error returns `{ ok: false, error }`. `limit` is 1–500 and the result is row-capped regardless. ## Authoring queries [#authoring-queries] Because a query is declarative JSON, an agent writes one end-to-end through the same `oi.app().patchManifest` → `applyEdit` loop it uses for islands and actions. No new tool, no file write. It reads the data, drafts the `queries` block, stages the change, reviews the diff, and applies it. The MCP write path only ever writes `manifest.json`, so a JSON spec is what lets an agent create a read tool, not just run one. `patchManifest` / `replaceManifest` and `validate` enforce the same checks: the `dataset` must exist, and every `field` in `where`, `select`, `groupBy`, and `orderBy` must be a real column on it. A field that doesn't exist is a named error, caught before the manifest lands: the same fail-loud binding check an island gets. A query is read-only by construction: the compiler emits a single `SELECT`, every param and literal is bound rather than interpolated, only verified column identifiers are quoted, and the result is row-capped. Data that tries to talk an agent into a harmful read still can't escape validation or the row cap. ## Where to go next [#where-to-go-next] * [SQL Transforms](/concepts/sql-transforms): the file-backed views a query selects from. * [Actions](/data/actions): the typed write a query mirrors. * [MCP Server](/mcp): `oi.app().listQueries()` and `runQuery` inside the agent loop. # Getting Started (/getting-started) OpenIslands is built for an **agent** to own a dashboard over months — but you bootstrap it. You scaffold a project, connect your agent to it over MCP, then drive it with prompts. From there the agent reads your data, stages a change, validates it, and applies it — and can undo any of it. It drives all of this in **Code Mode**: one `execute` tool it programs against the OpenIslands `oi` API. Here's the path from nothing to an agent-maintained dashboard. Already have a coding agent open? Paste this and let it take the wheel — it reads a short briefing, scaffolds a project, and starts building: ``` Read https://openislands.sh/start.md then help me build my first agent-maintained dashboard. ``` The steps below are that same path, done by hand. ### Scaffold a project [#scaffold-a-project] `init` drops a complete, working project **workspace** in the target directory — your apps live under `apps//`, starting with one. With no flag it scaffolds the `empty` template — a blank starter with one welcome note and an empty `data/`, so you and your agent build it up from your own files. ```bash npx openislands init my-dashboard cd my-dashboard ``` Want a populated example instead? Pass `--template`: ```bash npx openislands init my-dashboard --template finance ``` `finance` is the flagship — net worth, allocation, holdings, and transactions as typed islands over CSVs you own. `health` and `operations` are there too. ### Connect your agent over MCP [#connect-your-agent-over-mcp] `init` already did this. The scaffold ships a local `.mcp.json` wiring the `@openislands/mcp` server, an `AGENTS.md`, and the OpenIslands skill under `.agents/skills/openislands/` — so any agent that reads the project picks up the `execute` tool and the conventions. Open the folder in your agent and you're connected. If you're wiring it into a project by hand, this is the config it expects, pointed at the project root that holds your apps under `apps//`: ```jsonc title=".mcp.json" { "mcpServers": { "openislands": { "command": "npx", "args": ["-y", "@openislands/mcp", "."] } } } ``` `npx` runs the latest published server on demand; its `-y` flag skips the install prompt, so there's nothing to install globally. The last argument is the project directory — `.` if your agent runs from inside it. To add the skill to a project that doesn't have it (or to your own agent setup): ```bash npx skills add lukaisailovic/openislands --skill openislands ``` ### Serve it so you can watch [#serve-it-so-you-can-watch] ```bash npx openislands serve ``` This renders the dashboard at [127.0.0.1:4321](http://127.0.0.1:4321), querying your files on every request. Leave it running — each edit the agent applies live-updates the page over SSE. ### Prompt the agent [#prompt-the-agent] Now just ask. The agent grounds itself first (it reads the manifest, the dataset schema, and real rows), stages the change so you see a diff before anything is written, applies it with a snapshot of the prior version, and rolls back if the result is wrong. A binding to a column that doesn't exist comes back as a named error, so a broken dashboard never ships. Prompts that work well: > Drop `data/spending.csv` into the project and add a page that charts monthly spend by category. > Give the net-worth KPI a delta against last month, and add a gauge for my savings-rate goal. That loop runs as long as you keep the agent pointed at the project: it adds islands, wires in new files, and fixes bindings without the app rotting. The same surface drives data writes ([actions](/data/actions)) and provider syncs ([connectors](/data/connectors)), reversible through the same snapshots. Read [MCP Server](/mcp) for Code Mode, the full `oi` API, and the safety posture behind it. Prefer to drive it by hand? The [CLI](/cli) mirrors every step. ## Where to go next [#where-to-go-next] * [MCP Server](/mcp): the agent edit loop in full, and why each guarantee is structural. * [CLI](/cli): the keyboard path — `init`, `serve`, `infer`, `add`, `validate`, `sync`. * [The Manifest](/concepts/manifest): the mental model behind that JSON file. * [Islands](/islands/overview): the visual building blocks, with live previews. # Introduction (/introduction) OpenIslands is a local-first compiler and runtime for **agent-maintained data apps**. An app is a typed **manifest** of reusable visual **islands** bound to **typed data contracts** built from files you own. You edit the manifest; you never write rendering code. The point is that an agent can maintain a dashboard for months without it rotting. * **Declarative.** A dashboard is a JSON manifest of islands bound to datasets. * **Typed and safe.** Every binding is checked against your live data. A missing field fails the build and names the island, so a dashboard can't silently break. * **Local-first.** Your files are the source of truth. The runtime queries them live, so there are no snapshots to drift out of date. The headline use is an agent maintaining the dashboard for you over the [MCP server](/mcp), in Code Mode — one `execute` tool it programs against the `oi` API: it reads the manifest and your data, stages a manifest edit, sees the diff, applies it, and rolls back if it was wrong. Every change is validated and snapshotted, so the agent can't hand-edit your files, ship a broken binding, or make a change you can't undo. ## Start here [#start-here] * [Getting Started](/getting-started): point an agent at a project and let it build the dashboard. The CLI path is here too. * [MCP Server](/mcp): Code Mode and the safe edit loop the agent runs. * [The Manifest](/concepts/manifest): how an app is described. * [Data Contracts](/concepts/data-contracts): how islands bind to data. * [Islands](/islands/overview): the visual building blocks, with live previews. # Charts (/islands/charts) A family of islands for shape, comparison, distribution, and geography: lines and bars, parts of a whole, scatter and radar, heatmaps and a calendar, funnels, and a world map. Each preview below is a real OpenIslands renderer running the same code a live dashboard uses. For the full registry, see [Islands](/islands/overview). ## timeseries.line [#timeseriesline] A line chart over time, the island for trends. `y` may be a single field or an array of fields, so one tile can track several measures at once; add a goal line with `options.goalField`. When two or more series render, a legend with each series' latest value appears beneath the chart. ```jsonc title="manifest.json" { "type": "timeseries.line", "title": "Revenue vs target", "dataset": "monthly", "x": "month", "y": ["revenue_eur", "expenses_eur"], "options": { "goalField": "target_eur" }, "format": "eur" } ``` * `x`: the date/time field; accepts `YYYY-MM`, `YYYY-Www`, `YYYY-MM-DD`, or a real timestamp (required). * `y`: a numeric field, or an array of fields for a multi-line chart (required). * `series`: split one `y` field into a line per distinct value; many values auto-show a searchable picker (`options.seriesPicker` forces or disables it). * `options.goalField`: a column drawn as a neutral goal line; `options.area` fills under the lines. * `colors`: CSS colors per `y` field (or per series value), overriding the palette; [`format`](/reference/value-formats) styles the axis and tooltips. With many series values, pass `series` and let the picker keep the chart legible: it draws one series at a time instead of crowding every line onto the canvas. ## category.bar [#categorybar] A bar chart across discrete categories, the island for comparing groups. Add `group` for a bar per subgroup, and `stacked: true` to stack those subgroups into one bar per category. ```jsonc title="manifest.json" { "type": "category.bar", "title": "Spend by category", "dataset": "spend", "x": "category", "y": "amount_eur", "group": "quarter", "format": "eur" } ``` * `x`: the category field (required); `y`: the numeric field (required). * `group`: a field that splits each category into a bar per distinct value. * `stacked`: `true` stacks the grouped bars into one bar per category (default `false`). * `colors`: CSS colors per series (group value or `y` field), overriding the palette. ## category.combo [#categorycombo] A dual-axis chart: `bars` on the primary y-axis and `lines` on a secondary one, the island for reading a level against a rate. Plot revenue against margin, volume against price, or any two measures whose scales would flatten each other on a shared axis. Both `bars` and `lines` accept a single field or an array. ```jsonc title="manifest.json" { "type": "category.combo", "title": "Revenue vs. margin", "dataset": "monthly", "x": "month", "bars": "revenue_eur", "lines": "margin_pct", "format": "eur", "lineFormat": "pct" } ``` * `x`: the category or date field (required); accepts a category label or any date the bar chart understands. * `bars`: a numeric field, or an array of fields, drawn as bars on the primary y-axis (required). * `lines`: a numeric field, or an array of fields, drawn as lines on the secondary y-axis (required). * `stacked`: `true` stacks the bar series into one bar per category (default `false`). * `colors`: CSS colors per series (bars first, then lines), overriding the palette. * `format` / `lineFormat`: [value formats](/reference/value-formats) for the bar (primary) and line (secondary) axes. ## waterfall.bars [#waterfallbars] A waterfall, or bridge, chart: an opening anchor, signed `+`/`−` steps that float on the running total, and closing anchors. Reach for it to walk a P\&L (revenue down to profit), explain a variance, or bridge an opening balance to a closing one. Mark each anchor row by setting its `kind` field to `"total"`; every other row is a signed delta. The running-total math lives in the renderer, so the dataset stays a flat list of `(step, delta, kind)` rows. ```jsonc title="manifest.json" { "type": "waterfall.bars", "title": "Operating profit bridge", "dataset": "pnl_bridge", "label": "step", "value": "amount_eur", "kind": "kind", "format": "eur" } ``` * `label`: the step-name field on the x axis (required); `value`: the signed delta per step, or the absolute level for a `total` row (required). * `kind`: a field marking anchor rows — a row whose value here is `"total"` draws as an absolute bar from zero (opening, closing, or a subtotal). Omit it to make every row a delta. * `colors`: per-tone CSS colors overriding the defaults (`increase` green, `decrease` red, `total` neutral grey) — e.g. `{ "increase": "#16a34a", "decrease": "#dc2626" }`. * [`format`](/reference/value-formats) styles the y axis and the per-step tooltip, which shows each step's signed value. ## divergence.bars [#divergencebars] A diverging bar chart: one signed bar per category or day, extending above or below a zero baseline and colored by which value band it falls into. Reach for it to show deviation from a reference — a daily calorie surplus/deficit, budget variance, net cash flow, or a temperature anomaly. Pick it over `category.bar` when the values are signed and the up/down direction is the message, and over `waterfall.bars` when each bar stands on its own rather than accumulating into a running total. The island reads a pre-computed signed `value`; to diverge from a non-zero target, compute the delta in SQL. ```jsonc title="manifest.json" { "type": "divergence.bars", "title": "Daily calorie delta", "dataset": "calorie_delta", "x": "day", "value": "delta", "buckets": [ { "gte": 300, "color": "#16a34a", "label": "High surplus" }, { "gte": 0, "lt": 300, "color": "#4ade80", "label": "Surplus" }, { "gte": -500, "lt": 0, "color": "#fb923c", "label": "Deficit" }, { "lt": -500, "color": "#ef4444", "label": "Large deficit" } ] } ``` * `x`: the category or date field — one bar per row (required); `value`: the signed numeric field, rising above the zero baseline when positive and dropping below it when negative (required). Rows with a null or non-numeric `value` are skipped. * `buckets`: color each bar by the band its value falls in, matched top-to-bottom with half-open bounds `[gte, lt)` (omit either bound for an open end). Give every bucket a `label` to show a legend; a value matching no band renders neutral grey. Omit `buckets` entirely for a default green-positive / red-negative two-tone. * [`format`](/reference/value-formats) styles the y axis and the per-bar tooltip. ## rank.list [#ranklist] A ranked Top-N list with proportional horizontal bars, the island for a leaderboard: top products, customers, errors, or movers. Rows are sorted by `value`, cut to `limit`, and each bar is sized against the largest in the visible set, so the list reads as a ranking at a glance. ```jsonc title="manifest.json" { "type": "rank.list", "title": "Top products by revenue", "dataset": "product_revenue", "label": "product", "value": "revenue_eur", "secondary": "region", "sort": "descending", "limit": 5, "format": "eur" } ``` * `label`: the field naming each row (required); `value`: the numeric field rows are ranked by (required). * `sort`: `descending` (the default, largest first) or `ascending` to surface the smallest. * `limit`: the maximum number of rows shown (default `10`). * `secondary`: an optional field shown beside each row's value (e.g. a region or owner). * `color`: a CSS color for the bars, overriding the default accent; [`format`](/reference/value-formats) styles each row's value. ## breakdown.treemap [#breakdowntreemap] A treemap of part-to-whole composition, the island for how a total splits across parts, optionally nested. Each leaf's area is proportional to its `value`; supply `parent` to group leaves under a hierarchy. ```jsonc title="manifest.json" { "type": "breakdown.treemap", "title": "Portfolio allocation", "dataset": "portfolio", "label": "asset", "value": "value_eur", "parent": "class" } ``` * `label`: the field naming each leaf (required); `value`: the numeric field sizing it (required). Only positive values render. * `parent`: an optional field grouping leaves into a two-level hierarchy; omit it for a flat treemap. * `colors`: CSS colors cycled across the top-level nodes, overriding the palette. ## category.pie [#categorypie] A pie, or a donut with `donut: true`, of one series' share across a handful of categories. Slices sum by `label` and sort largest-first; each shows its percentage and the tooltip carries the formatted value. Reach for a treemap instead when the parts nest or there are many of them. ```jsonc title="manifest.json" { "type": "category.pie", "title": "Revenue by product", "dataset": "product_revenue", "label": "category", "value": "revenue", "donut": true, "format": "eur" } ``` * `label`: the field naming each slice (required); `value`: the numeric field sizing it (required). Slices sum by label; only positive values render. * `donut`: `true` cuts an inner radius (a donut); omit for a full pie. * `colors`: CSS colors per slice (largest-first), overriding the palette; [`format`](/reference/value-formats) styles the tooltip values. ## correlation.scatter [#correlationscatter] A scatter plot of two numeric fields, for exploring how they relate. Split points into colored series with `series`, and turn dots into bubbles by pointing `size` at a third field. The `x`/`y` fields (and their `xFormat`/`format`) drive the axes and the tooltip. ```jsonc title="manifest.json" { "type": "correlation.scatter", "title": "Spend vs. conversions by channel", "dataset": "channel_performance", "x": "marketing_spend_eur", "y": "conversions", "series": "channel", "size": "customers", "label": "channel", "xFormat": "eur", "format": "int" } ``` * `x`, `y`: the numeric fields for the axes (both required); points with a non-numeric `x` or `y` are dropped. * `series`: splits points into one colored series per distinct value, with a legend. * `size`: a numeric field scaling each point into a bubble; omit for fixed-size dots. * `label`: names each point in the tooltip; `colors` overrides the per-series palette; `xFormat`/[`format`](/reference/value-formats) style the x/y values. ## distribution.heatmap [#distributionheatmap] A matrix heatmap: one value across two categorical dimensions, each cell shaded on a continuous color scale. Reach for it to show day-by-hour activity, a cohort grid, or a correlation matrix. Pre-aggregate to one value per `x`/`y` cell in SQL; the renderer keeps the last value seen for a repeated cell. ```jsonc title="manifest.json" { "type": "distribution.heatmap", "title": "Orders by weekday and hour", "dataset": "orders_by_hour", "x": "hour", "y": "weekday", "value": "orders", "format": "int" } ``` * `x`, `y`: the column and row category fields (both required); a cell sits at each `x`/`y` pair. * `value`: the numeric field shading each cell (required); the scale spans its range, and cell labels show for small grids. * `colors`: gradient stops overriding the default blues; [`format`](/reference/value-formats) styles cells, tooltip, and the legend. ## activity.calendar [#activitycalendar] A calendar heatmap of a daily value, GitHub-contributions style: each day is a cell shaded by its value, laid out in weeks across the months the data spans. Any parseable date works, and rows landing on the same day sum. Give it a half-width or wider tile. ```jsonc title="manifest.json" { "type": "activity.calendar", "title": "Commits per day", "dataset": "commits", "date": "day", "value": "commits", "format": "int" } ``` * `date`: the day field; any parseable date or timestamp, bucketed to a UTC day (required). * `value`: a numeric field mapped to each day's color; same-day rows sum (required). * `colors`: gradient stops overriding the default blues; [`format`](/reference/value-formats) styles the tooltip value. ## funnel.steps [#funnelsteps] A funnel of sequential stages, for conversion or drop-off. Each stage's width is its share of the largest, so the narrowing reads as the fall-off between steps. By default the stages follow the row order; set `sort` to reorder them. ```jsonc title="manifest.json" { "type": "funnel.steps", "title": "Signup conversion", "dataset": "signup_funnel", "label": "stage", "value": "users", "sort": "descending", "format": "int" } ``` * `label`: the stage-name field (required); `value`: the numeric count at each stage (required). * `sort`: `none` (the default, keeping row order), `descending`, or `ascending`. * `colors`: per-stage CSS colors overriding the palette; [`format`](/reference/value-formats) styles the labels and tooltip. ## compare.radar [#compareradar] A radar (spider) chart for comparing entities across several metrics at once. Each field in `metrics` becomes an axis, and each row becomes a polygon named by `series`. Share one `max` across every axis when the metrics are on a common scale (e.g. all 0-100 scores). ```jsonc title="manifest.json" { "type": "compare.radar", "title": "Product comparison", "dataset": "product_scores", "metrics": ["performance", "price", "design", "support", "ecosystem"], "series": "product", "max": 100 } ``` * `metrics`: the numeric fields that become the axes (at least one, required). * `series`: a field naming each row's polygon; omitted, polygons are numbered Series 1, 2, … * `max`: a fixed max shared by every axis; omitted, each axis maxes at its own metric's peak. * `colors`: per-polygon CSS colors overriding the palette; [`format`](/reference/value-formats) styles the tooltip values. ## map.choropleth [#mapchoropleth] A geographic choropleth: regions shaded by a value on a continuous scale. The map ships as vendored GeoJSON, so it renders fully offline, with no tiles and no network. Each row's `region` must match the map's region name; for the built-in `world` map that is the English country name. ```jsonc title="manifest.json" { "type": "map.choropleth", "title": "Revenue by country", "dataset": "revenue_by_country", "region": "country", "value": "revenue_eur", "format": "eur" } ``` * `region`: the field holding each row's region name, matching the map's names (required). * `value`: the numeric field shading each region (required); regions with no row stay neutral. * `map`: the registered map name (default `world`); `colors` overrides the gradient; [`format`](/reference/value-formats) styles the tooltip and legend. Region names must match the map exactly. The `world` map uses full English country names: `United States of America` (not "United States" or "USA"), `United Kingdom`, `Russia`, and so on. Normalize your data's names in SQL to match. # Content & Layout (/islands/content-and-layout) The islands that aren't charts of your data: a **note** for prose, a **source doc** for a file or link, a **content editor** for a whole workspace of markdown files, a **form entry** for adding rows by hand, and a **layout row** to control how a page wraps — plus tabbed **groups** to split a busy page. See the [islands overview](/islands/overview) for the full registry. ## `note.card` [#notecard] **What it is.** A static Markdown card with no data binding. **When to use it:** commentary, a caption, instructions, or a link, dropped right between data islands. It renders `markdown`: headings, lists, inline code, bold/italic, and links all render. Set a `tone` to turn it into a callout that stands out from the prose around it. ```jsonc title="manifest.json" { "type": "note.card", "title": "How to read this page", "markdown": "The top row tracks **net worth**..." } ``` **Key options.** * `markdown`: the only required field; no `dataset`. Use `\n\n` between blocks and `\n` for a soft break inside one. * `tone: "info" | "success" | "warning" | "danger"` (optional): renders the note as a callout — a tinted panel with a colored left accent and a matching icon. Omit it for plain prose. **Tones.** Reach for a tone when the note is an aside the reader shouldn't miss — a caveat next to a metric, a heads-up about stale data, a confirmation. Without one, the note reads as quiet commentary. ```jsonc title="manifest.json" { "type": "note.card", "title": "Heads up", "tone": "warning", "markdown": "Balances settle overnight, so **today's row updates after midnight UTC**." } ``` `note.card` is the lightest island, perfect for explaining a dashboard to whoever opens it next. Its minimum span is `3`, so it sits comfortably beside a metric or a small chart. ## `source.doc` [#sourcedoc] **What it is.** A document card that surfaces a source right next to the data it backs: a PDF statement, a Markdown brief, an image, or a plain link out. **When to use it:** when a reader will want the underlying file. Every card shows a type icon, a readable name, and an **Open** button that opens the source in a new tab. Set `kind` to choose how it renders, and give it either a `file` (a path inside the project) or an `href` (an external URL). ```jsonc title="manifest.json" { "type": "source.doc", "title": "Methodology", "kind": "link", "label": "OpenIslands on GitHub", "description": "Source, issues, and the manifest schema", "href": "https://github.com/lukaisailovic/openislands" } ``` **Key options.** * `kind: "pdf" | "markdown" | "image" | "link"` (default `link`): how the source renders. `pdf` embeds the file in a viewer below the card header, `markdown` renders it inline, `image` shows a preview that opens full size, `link` is an external link out. * `file`: a path relative to the project root; it resolves through the runtime's confined file route. `href` is an external URL used as-is. * `label`: the name shown on the card. Without it, the card falls back to the file's name or the link's host — never the raw file URL. * `description`: a short line under the name explaining what the document is. A `file`-based doc needs a real file in the project (resolved through the runtime's `/api/file` route), so it can't be previewed here in the docs. The live example above uses `kind: "link"` with an `href`, which renders the same everywhere. ## `content.editor` [#contenteditor] **What it is.** A full-page, Obsidian-style content workspace. **When to use it:** when the page *is* a body of documents — a knowledge base, a set of runbooks, a notebook — rather than a chart of your data. It's the one island that binds **no dataset** and runs no SQL: it reads and writes markdown files on disk directly. It renders full-bleed (no card header or title bar) and wants a full-width `span` of `12`; its minimum is `6`. Point it at **either** a single `file` or a whole `dir` — exactly one, never both: ```jsonc title="manifest.json" { "type": "content.editor", "title": "Runbook", "span": 12, "file": "data/docs/oncall.md" } ``` ```jsonc title="manifest.json" { "type": "content.editor", "title": "Docs", "span": 12, "dir": "data", "csv": true, "groups": [ { "id": "specs", "label": "Specs", "icon": "files", "match": ["specs/**", "architecture.md"] }, { "id": "runbooks", "label": "Runbooks", "icon": "list-bullets", "match": ["runbooks/**", "incident-*.md"] }, { "id": "notes", "label": "Notes", "icon": "folder", "match": ["notes/**", "roadmap.md"] } ] } ``` **Key options.** * `file` / `dir`: the source, and exactly one is required — `file` is one document under `data/` or `docs/`, `dir` is a directory (recursed). Both, or neither, is a named validation error. * `include` (`dir` only): globs of files to surface; defaults to markdown (`**/*.md`, `**/*.markdown`). * `csv` (`dir` only, default `false`): also surface `.csv` files alongside the markdown. CSVs open as an **editable table** — edit cells, add and delete rows, and Save writes valid CSV back to the file. They're read-only only when `readOnly` is set. (Adding or removing columns is out of scope; edit the header in your own editor.) * `groups` (`dir` only): virtual folders, each `{ id, label?, icon?, match }`. See below. * `readOnly` (default `false`): make the whole workspace a viewer — no editing, no saving. Setting `include`, `csv`, or `groups` together with `file` (rather than `dir`) is a named validation error. **Editing and version history.** Unless `readOnly` is set, edits **autosave** about a second after you stop typing — no Save click needed, though Save and ⌘S still force one. The header shows a *Saving…* / *Saved* hint as it goes. The file on disk stays the source of truth — change it in your own editor and the open workspace refreshes within a second or two (unsaved edits in the browser are never clobbered). Every save also records a restorable snapshot in a per-app SQLite store at `.openislands/editor.sqlite`; the workspace surfaces that history and lets you roll a file back to any earlier version, so edits are never lossy. **Virtual folders (`groups`).** A `dir` is browsed as its real tree by default. `groups` overlay **virtual folders** that gather scattered files into tidy sidebar buckets regardless of where they live on disk: each group's `match` is an array of globs relative to `dir`, `label` names it (it defaults to the `id`), and `icon` is a [Phosphor](https://phosphoricons.com) name (e.g. `files`, `folder`) that falls back to a folder icon. Files matching no group collect in an **Ungrouped** bucket, so nothing is hidden. The New-note dialog picks the folder a note starts in, and you can move a note between folders later — drag it onto a group or use its move menu — which renames it on disk into that folder and carries its version history along. There's no live preview for `content.editor` here: it reads and writes real files through the runtime's file routes and fills the whole page, so it only means something inside a served app. The [`knowledge` example](https://github.com/lukaisailovic/openislands/tree/main/apps/examples/knowledge) is a full workspace bound to a `data/` tree with an editable CSV and the three virtual folders above. ## `board.kanban` [#boardkanban] **What it is.** A full-bleed kanban board that groups rows of a dataset into columns by a status or stage field. **When to use it:** work queues, incident triage, or any pipeline where cards move between columns. Pick it over [`table.grid`](/islands/tables-and-feeds#tablegrid) / [`status.grid`](/islands/metrics-and-gauges#statusgrid) when the main interaction is *moving* a row between stages, and over [`form.entry`](#formentry) when you're reassigning an existing row rather than inserting one. Cards show `titleField` plus optional `details` fields. Declared `columns` always render (even when empty); values present in the data but missing from `columns` still appear so nothing is hidden. Moving a card — HTML5 drag-and-drop or the per-card column select — POSTs `match` + `set` through the bound update [action](/data/actions) (match on `key`, set `column`), then the dataset refreshes live. Without `action`, or with `readOnly: true`, the board is view-only. Renders full-bleed like [`content.editor`](#contenteditor) (no ordinary island card chrome). ```jsonc title="manifest.json" { "type": "board.kanban", "title": "Incidents", "dataset": "incidents", "key": "incident_id", "column": "status", "titleField": "title", "columns": ["investigating", "monitoring", "resolved"], "details": ["severity", "service"], "action": "move_incident", "span": 12 } ``` **Key options.** * `dataset`, `key`, `column`, `titleField` — required. `key` is the row identity used in the update match; `column` is the field that places a card; `titleField` is the card headline. * `columns` (optional): ordered column values to always show, including empty ones. * `details` (optional): extra dataset columns shown under each card title. * `action` (optional): a manifest action with `mode: "update"` on the same dataset. Omit (or set `readOnly`) to disable moves. * `readOnly` (optional, default `false`): force a viewer. There's no live preview for `board.kanban` here: moves write through the action path. See the operations example's Incidents board for a working setup. ## `form.entry` [#formentry] **What it is.** A data-entry form card bound to a manifest [action](/data/actions). **When to use it:** when a human, not just an agent, should add rows — log an incident, record a meal, file an expense — right next to the data it feeds. It's the human-facing mirror of the agent's `runActions`: you don't re-declare fields, you point it at an action and it derives one typed input per field from that action's resolved row schema. So it binds **no dataset** of its own — the action already names the target. The card renders a text, number, or date input per field, a dropdown for an `enum` field, and a checkbox for a boolean, with a submit button in the bottom-right. A field is required unless the action gives it a `default`. On submit it inserts a row through the **same path** as the MCP `oi.app().runActions` — the row is validated, snapshotted to history for `rollback`, then inserted — and the bound dataset's islands refresh live. ```jsonc title="manifest.json" { "type": "form.entry", "title": "Report incident", "action": "log_incident", "submitLabel": "Report" } ``` **Key options.** * `action`: the only required field; the name of a manifest `actions` entry this form writes to. Its inputs — types, `enum` dropdowns, `min`/`max`, `default`s, and field descriptions — all come from that action's resolved row schema, so the form stays in step with the data. * `fields` (optional): the action's columns to render, in this order. Omit it to render every insertable column; each name must be a real column of the action's dataset, checked at compile. * `submitLabel` (optional, default `"Add"`): the text on the submit button. There's no live preview for `form.entry` here: submitting writes a real row through the action's checkpointed insert path, so it only means something inside a served app bound to an action. See [Actions](/data/actions) for the write path it shares with the agent. ## `layout.row` [#layoutrow] **What it is.** A structural full-width row that holds other islands. **When to use it:** when you want a group of islands to sit on their *own* grid row rather than flowing into the page's column packing. It carries no `span`, no `title`, no `dataset`, and can't be nested; it exists purely to arrange its children. Its children render on their own fresh 12-column grid row, each sized by its own `span`. The row itself is transparent to island indexing: a validation error names the child island, not the row. ```jsonc title="manifest.json" { "type": "layout.row", "islands": [ { "type": "metric.kpi", "title": "Net worth", "dataset": "net_worth", "value": "net_worth_eur", "format": "eur", "span": 6 }, { "type": "metric.kpi", "title": "Cash", "dataset": "net_worth", "value": "cash_eur", "format": "eur", "span": 6 } ] } ``` **Key points.** * `islands`: the only field; one or more child islands, each a normal built-in island with its own `span`. * No `span`, `title`, or data binding on the row itself. * No nesting: a `layout.row` can't contain another `layout.row`. There's no live preview for `layout.row` because it's a layout primitive, not a visual; it only means something in the context of a full page grid. Reach for it when two or three tiles should always share a row regardless of what comes before them. ## Tabs (`groups`) [#tabs-groups] **What it is.** A page-level split into tabs. A page holds **either** a flat `islands` array **or** a `groups` array — never both. Each group is `{ id, title?, islands }` and renders as a tab under the page header, deep-linked via `?group=`. **When to use it:** when one page carries more than fits a single scroll — split related islands into tabs instead of spilling onto a second sidebar page. ```jsonc title="manifest.json" { "id": "labs", "groups": [ { "id": "latest", "title": "Latest", "islands": [ /* ... */ ] }, { "id": "panels", "title": "Panels", "islands": [ /* ... */ ] }, { "id": "history", "title": "History", "islands": [ /* ... */ ] } ] } ``` **Key points.** * Each group is its own fresh 12-column grid, sized exactly like a flat page. * `groups` is **not an island** — it's page structure, the same tier as the page itself. It lives on the page, not in an island list, so it can't sit inside a `layout.row` or another group, and it won't appear in the island catalog or `oi.app().listIslands()`. See [Pages and groups](/concepts/manifest#pages-and-groups) for the page-level shape and the `islands`/`groups` rule. # Custom Islands (/islands/custom) When no [built-in island](/islands/overview) fits, you register your own. A custom island is a React renderer that lives in *your* project, gets a typed config like a built-in, and is checked by the same validator. It isn't a second-class escape hatch. Several built-ins started here: `gauge.rings` shipped as a custom island before it was promoted into the core registry. ## The shape [#the-shape] A custom island is a directory under `components/custom/`. The directory name **is** the island type, so a `heatmap.calendar` island lives at `components/custom/heatmap.calendar/`: ```text components/custom/heatmap.calendar/ index.tsx # default-exports the React component schema.ts # default-exports a Zod object for the config ``` Reference the type from the manifest exactly like a built-in; `validate` and the runtime resolve it to your component (an agent stages it through `oi.app().patchManifest` like any other island): ```jsonc title="manifest.json" { "type": "heatmap.calendar", "title": "Activity", "dataset": "commits", "date": "day", "value": "count" } ``` ## `index.tsx` [#indextsx] Default-export a React component. It receives the **same** props the built-ins get: `config` (the manifest island, including your custom fields) and `data` (the query result: `{ dataset, columns, rows }`, absent until the client query resolves). ```tsx title="components/custom/heatmap.calendar/index.tsx" import type { ReactNode } from "react"; interface CalendarConfig { date: string; value: string; } interface QueryData { columns: { name: string; type: string }[]; rows: Record[]; } export default function HeatmapCalendar({ config, data, }: { config: CalendarConfig & { type: string }; data?: QueryData; }): ReactNode { const rows = data?.rows ?? []; if (rows.length === 0) return
No data
; const max = Math.max(...rows.map((r) => Number(r[config.value] ?? 0))); return (
{rows.map((row, i) => { const intensity = max === 0 ? 0 : Number(row[config.value] ?? 0) / max; return (
); })}
); } ``` ## `schema.ts` [#schemats] Default-export a Zod object describing the config. Import from `"zod"`; the runtime bundles against its own copy, so you don't add a dependency. This is what makes a bad custom config a *named* error instead of a silent placeholder: ```ts title="components/custom/heatmap.calendar/schema.ts" import { z } from "zod"; export default z.object({ date: z.string().describe("date column, one cell per day"), value: z.string().describe("numeric column driving cell intensity"), }); ``` ## How the runtime treats it [#how-the-runtime-treats-it] * **Bundled on demand.** `serve` compiles `index.tsx` to ESM the first time the island is requested, with no build step and no `node_modules` in your project. React resolves to the runtime's own copy. * **Validated like a built-in.** `validate` (and `oi.app().replaceManifest`) check the manifest config against `schema.ts` with the *same* machinery that guards the built-ins. A config that violates the schema is a named compile error: it names the page, island index, and type, just like a missing built-in binding. * **Hot reload.** Editing anything under `components/` remounts the island on the next live-reload event; you don't restart `serve`. A custom type **without** `index.tsx` still validates and renders the built-in placeholder, handy for sketching a manifest before the renderer exists. A type **without** `schema.ts` is accepted but *unchecked*, so its config isn't validated. Ship both to get the full safety net. The directory name is the island type verbatim, so a dotted name like `heatmap.calendar` maps to a `heatmap.calendar` directory. The type must be a safe path segment, with no slashes or `..`. # Metrics & Gauges (/islands/metrics-and-gauges) Six islands for at-a-glance state: a headline KPI, a multi-stat scorecard, three gauges, and a status grid of service/check tiles. Each previewed below is a real OpenIslands renderer: the same code a live dashboard runs, not a screenshot. For the full registry, see [Islands](/islands/overview). Every gauge reads the **last row** of its dataset, so feed it data already aggregated to the value you want shown: the most recent day, the current month-to-date, the running total. The KPI reads the last row too, plus the row before it for the delta. ## metric.kpi [#metrickpi] A single headline number off the last row, with an optional delta versus the previous row and a sparkline drawn over the time axis it finds. Reach for it when one number (net worth, MRR, today's steps) deserves the top of a page. ```jsonc title="manifest.json" { "type": "metric.kpi", "title": "Monthly revenue", "dataset": "revenue", "value": "revenue_eur", "compareTo": "prev", "format": "eur" } ``` * `value`: the field holding the headline number (required). * `compareTo`: `"prev"` draws a delta against the previous row; a field name compares to that column instead; `"none"` (the default) shows no delta. * `target`: a field holding a target to measure the value against. * `format`: any [value format](/reference/value-formats); `unit` appends a free-form suffix. * `color`: a 6-digit hex (e.g. `"#22C55E"`) for the sparkline, overriding the palette. ## metric.scorecard [#metricscorecard] A compact scorecard of several KPIs read off the last row, each with an optional delta versus the previous row. Reach for it when a handful of related numbers (MRR, active users, churn, NPS) belong together in one tidy tile instead of separate KPI cards. ```jsonc title="manifest.json" { "type": "metric.scorecard", "title": "This month", "dataset": "saas_metrics", "stats": [ { "value": "mrr_eur", "label": "MRR", "format": "eur", "compareTo": "prev" }, { "value": "active_users", "label": "Active users", "format": "int", "compareTo": "prev" }, { "value": "churn", "label": "Churn", "format": "pct" }, { "value": "nps", "label": "NPS", "format": "int" } ] } ``` * `stats`: the list of numbers to show (at least one), each reading its `value` off the last row. * `stats[].label` defaults to the field name; a [value format](/reference/value-formats) (`format`) or free-form `unit` styles the value; `compareTo: "prev"` adds a delta badge versus the previous row. * `columns`: a fixed grid column count (1-6); omitted, the grid is responsive. ## gauge.rings [#gaugerings] Up to four concentric progress rings read off the last row: the dashboard view when several goals or budgets share one tile. Each ring fills toward its `max` (a column or a fixed number); the center shows the outermost ring's percentage. ```jsonc title="manifest.json" { "type": "gauge.rings", "title": "Today's targets", "dataset": "daily_targets", "rings": [ { "value": "calories", "max": "calorie_goal", "label": "Calories" }, { "value": "protein_g", "max": "protein_goal", "label": "Protein" }, { "value": "water_ml", "max": "water_goal", "label": "Water" } ] } ``` * `rings`: one to four rings, outermost first (required). Each is `{ value, max, label?, color?, direction? }`. * `max`: a column name or a fixed number; the goal the ring fills toward. * `direction`: `atLeast` (default, fills toward a goal) or `atMost` (a budget: crossing the limit turns the ring danger-red). * `color`: a CSS color per ring; defaults to a built-in palette. ## gauge.goal [#gaugegoal] One ring per goal, each comparing the last row's value to a goal or a target band. Reach for it when a number has a defined good range: within the band reads success-green, under it amber, over it danger-red. The three rings below hit all three tones at once — heart rate over its band, sleep clear of its floor, activity short of it. ```jsonc title="manifest.json" { "type": "gauge.goal", "title": "Today vs goals", "dataset": "vitals", "size": "small", "goals": [ { "value": "rhr", "goal": { "min": 50, "max": 60 }, "label": "Resting HR", "unit": "bpm", "format": "int" }, { "value": "sleep_h", "goal": { "min": 7 }, "label": "Sleep", "unit": "h", "format": "int" }, { "value": "active_min", "goal": { "min": 30 }, "label": "Active", "unit": "min", "format": "int" } ] } ``` * `goals`: one to six goals, each its own ring side by side in a row that wraps (required). Each is `{ value, goal, label?, unit?, format? }`, read off the last row. * `goal`: at least one of `min` / `max`, each a column or a number; supplying both makes a target band, the value reads green inside it, amber below, red above. * `value`: the field holding the ring's current number; `format` is any [value format](/reference/value-formats), `unit`/`label` annotate the ring. * `size`: the footprint shared by every ring — `small`, `medium` (the default), or `large`. `small` packs several rings across a row and swaps each badge for a compact status dot; `large` emphasizes one or two. Each goal needs at least one bound: a `goal` with neither `min` nor `max` is a named validation error, so a misconfigured ring fails the build rather than rendering blank. ## gauge.meter [#gaugemeter] One or more horizontal usage bars read off the last row: the quota- or capacity-style view. Each meter shows `value / max` and fills proportionally in its own color. ```jsonc title="manifest.json" { "type": "gauge.meter", "title": "Plan usage", "dataset": "plan_usage", "meters": [ { "value": "storage_gb", "max": "storage_cap", "label": "Storage (GB)" }, { "value": "seats_used", "max": "seat_cap", "label": "Seats" }, { "value": "api_calls", "max": "api_cap", "label": "API calls" } ] } ``` * `meters`: one or more bars, top to bottom (required). Each is `{ value, max, label?, color? }`. * `max`: a column name or a fixed number; the capacity the bar fills against. * `color`: a CSS color per meter; defaults to a built-in palette. ## status.grid [#statusgrid] A responsive grid of state tiles, one per row: the ops & status-page view for service or check health. Each tile labels an entity, badges its state, and can show a metric underneath; the badge tone comes from the state value. ```jsonc title="manifest.json" { "type": "status.grid", "title": "Service status", "dataset": "services", "label": "service", "state": "status", "value": "p95_ms", "format": "int", "tones": { "maintenance": "warning" } } ``` * `label`: the field naming each entity — a service, check, or host (required). * `state`: the field holding each entity's status value, shown as the tile's badge (required). * `value`: an optional metric shown under the label; `format` is any [value format](/reference/value-formats). * `tones`: a `state → tone` map (`success` / `warning` / `danger` / `neutral`) to override the tone of specific state values. Unmapped values fall back to a keyword convention: `up` / `ok` / `healthy` / `online` → success, `warn` / `degraded` / `pending` → warning, `down` / `error` / `critical` / `fail` → danger, anything else → neutral. # Islands (/islands/overview) An **island** is a reusable, typed visual block. You don't write rendering code. You declare an island in the manifest, bind it to fields that exist in your data, and the runtime renders it. The same renderers the runtime ships power the live previews below: each tile is a real OpenIslands island, not a screenshot. ## A metric, live [#a-metric-live] A `metric.kpi` reads the last row of its dataset for the value, the row before it for the delta, and draws a sparkline over the time axis it finds. ```jsonc title="manifest.json" { "type": "metric.kpi", "title": "Net worth", "dataset": "net_worth", "value": "net_worth_eur", "compareTo": "prev", "format": "eur" } ``` ## A note, live [#a-note-live] A `note.card` renders Markdown and binds to no data, handy for context, captions, and links right inside a dashboard. ## The island registry [#the-island-registry] Every built-in island and the fields it requires. Pick the built-in that fits before reaching for a custom renderer. Each type links to its section with a live preview and full configuration. | Type | Required fields | What it is | | ----------------------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | [`metric.kpi`](/islands/metrics-and-gauges#metrickpi) | `dataset`, `value` | A single number off the last row, with an optional delta and sparkline. | | [`metric.scorecard`](/islands/metrics-and-gauges#metricscorecard) | `dataset`, `stats` | A compact scorecard of several KPIs off the last row. | | [`gauge.rings`](/islands/metrics-and-gauges#gaugerings) | `dataset`, `rings` | Concentric goal rings off the last row. | | [`gauge.goal`](/islands/metrics-and-gauges#gaugegoal) | `dataset`, `goals` | One ring per goal, each measured against a goal or band. | | [`gauge.meter`](/islands/metrics-and-gauges#gaugemeter) | `dataset`, `meters` | Horizontal usage bars off the last row. | | [`status.grid`](/islands/metrics-and-gauges#statusgrid) | `dataset`, `label`, `state` | A responsive grid of service/check status tiles. | | [`timeseries.line`](/islands/charts#timeseriesline) | `dataset`, `x`, `y` | A line chart over time; `y` may be one field or many. | | [`category.bar`](/islands/charts#categorybar) | `dataset`, `x`, `y` | A bar chart, optionally grouped or stacked. | | [`category.combo`](/islands/charts#categorycombo) | `dataset`, `x`, `bars`, `lines` | Bars on a primary axis and lines on a secondary one. | | [`waterfall.bars`](/islands/charts#waterfallbars) | `dataset`, `label`, `value` | A waterfall of signed steps to a running total. | | [`divergence.bars`](/islands/charts#divergencebars) | `dataset`, `x`, `value` | Signed bars diverging up/down from a zero baseline, colored by value band. | | [`rank.list`](/islands/charts#ranklist) | `dataset`, `label`, `value` | A ranked Top-N list with proportional bars. | | [`breakdown.treemap`](/islands/charts#breakdowntreemap) | `dataset`, `label`, `value` | A treemap of parts of a whole. | | [`category.pie`](/islands/charts#categorypie) | `dataset`, `label`, `value` | A pie or donut of one series' share across a few categories. | | [`correlation.scatter`](/islands/charts#correlationscatter) | `dataset`, `x`, `y` | A scatter or bubble plot of two numeric fields. | | [`distribution.heatmap`](/islands/charts#distributionheatmap) | `dataset`, `x`, `y`, `value` | A matrix heatmap of a value across two category axes. | | [`activity.calendar`](/islands/charts#activitycalendar) | `dataset`, `date`, `value` | A GitHub-style calendar heatmap of a daily value. | | [`funnel.steps`](/islands/charts#funnelsteps) | `dataset`, `label`, `value` | A conversion funnel of sequential stages. | | [`compare.radar`](/islands/charts#compareradar) | `dataset`, `metrics` | A radar chart comparing rows across several metrics. | | [`map.choropleth`](/islands/charts#mapchoropleth) | `dataset`, `region`, `value` | A geographic choropleth shading regions by a value. | | [`table.grid`](/islands/tables-and-feeds#tablegrid) | `dataset` | A data table with optional details, grouping, and drilldown. | | [`timeline.feed`](/islands/tables-and-feeds#timelinefeed) | `dataset`, `ts`, `titleField` | A chronological feed of rows, plain or rich. | | [`search.box`](/islands/tables-and-feeds#searchbox) | `dataset`, `fields`, `titleField` | A client-side search over a dataset. | | [`note.card`](/islands/content-and-layout#notecard) | `markdown` | Markdown content; no data. | | [`source.doc`](/islands/content-and-layout#sourcedoc) | (none) | An embedded document or link (`file` or `href`). | | [`content.editor`](/islands/content-and-layout#contenteditor) | (none) | A full-page workspace to browse and edit markdown files (`file` or `dir`); no data. | | [`layout.row`](/islands/content-and-layout#layoutrow) | `islands` | A full-width structural row holding other islands. | | [`form.entry`](/islands/content-and-layout#formentry) | `action` | A data-entry form bound to an action; one typed input per field inserts a row. No data binding of its own. | | [`board.kanban`](/islands/content-and-layout#boardkanban) | `dataset`, `key`, `column`, `titleField` | A full-bleed kanban board; drag/select moves persist via an update action. | One layout construct isn't in the table because it isn't an island: a page can split into tabbed [`groups`](/islands/content-and-layout#tabs-groups). Groups are page structure, not a tile, so they won't appear in `oi.app().listIslands()` either — see [Pages and groups](/concepts/manifest#pages-and-groups). Browse the per-category pages for the full picture: [Metrics & Gauges](/islands/metrics-and-gauges), [Charts](/islands/charts), [Tables & Feeds](/islands/tables-and-feeds), [Content & Layout](/islands/content-and-layout), and [Custom Islands](/islands/custom). # Tables & Feeds (/islands/tables-and-feeds) Three islands for rows you read one at a time: a **table** when exact values matter, a **feed** for things that happened in order, and a **search box** to find one row in many. Each is a real island below: bind it to fields in your data and the runtime renders it. See the [islands overview](/islands/overview) for the full registry. ## `table.grid` [#tablegrid] **What it is.** A paginated table of raw rows. **When to use it:** when the exact numbers matter and a chart would hide them: positions, transactions, line items. It needs only a `dataset`; with no `columns` it shows every column in the data. ```jsonc title="manifest.json" { "type": "table.grid", "title": "Positions", "dataset": "positions", "columns": [ { "field": "ticker", "label": "Ticker" }, { "field": "shares", "label": "Shares", "format": "int" }, { "field": "value_eur", "label": "Value", "format": "eur" } ] } ``` **Key options.** * `columns: [{ field, label?, format? }]`: pick and order the columns and set each column's [value format](/reference/value-formats). Omit it to show every column. * `details: [{ field, label?, format? }]`: fields *hidden* from the row and revealed in a click-to-open dialog, each with its own optional [value format](/reference/value-formats). Declaring `details` makes each row clickable. * `groupBy: { field, titleField?, subtitleField? }`: render rows as collapsible sections by `field`; the section title and subtitle read from each group's first row. * `drilldown: { island, match }`: embed another island in the row-details dialog, its rows filtered by `match` (a map of *drilldown-dataset column* → *clicked-row field*). One level deep: a drilldown island has no drilldown of its own. * `expand: false`: drop the see-all dialog and render every row inline (default `true`). `details` and `drilldown` only do something once a row is clickable. A row becomes clickable the moment you declare `details` (or a `drilldown`), so a table that's just for scanning needs neither. ## `timeline.feed` [#timelinefeed] **What it is.** A reverse-chronological feed of rows. **When to use it:** logs, activity streams, a journal, anything that reads as "what happened, newest first." It needs a `ts` (the timestamp) and a `titleField`; the runtime sorts so the newest row is on top and renders each timestamp smartly (a date-only value as `Jun 11, 2026`, a real timestamp as `Jun 11, 21:30`). ```jsonc title="manifest.json" { "type": "timeline.feed", "title": "Activity", "dataset": "activity", "ts": "ts", "titleField": "action", "detail": "actor" } ``` **Key options.** * `detail`: a secondary string shown next to the title. `kind`: a category string. * `details` / `drilldown` / `expand`: exactly as on `table.grid` (click-to-open dialog, embedded filtered island, render-all toggle). * `groupBy: { field, titleField?, subtitleField? }`: collapsible sections, same shape as on the table. * **Rich rows.** Setting any of `highlight`, `stats`, or `footer` switches a row from a single line to a header/stats/footer layout: * `highlight: { field, format?, unit? }`: an emphasized value pinned to the right of the title. * `stats: [{ field, label?, format?, unit?, color? }]`: labeled inline stats under the title; labels default to a palette, `color` pins one. * `footer: [{ field, label?, format?, unit?, pill? }]`: a meta line led by the timestamp; `pill: true` renders the value as a badge. Each of these takes an optional [value format](/reference/value-formats) (`format`) or free-form `unit` to style its value. ```jsonc title="manifest.json" { "type": "timeline.feed", "title": "Workouts", "dataset": "workouts", "ts": "ts", "titleField": "name", "highlight": { "field": "strain", "format": "int" }, "stats": [ { "field": "avg_hr", "label": "HR", "unit": "bpm" }, { "field": "kcal", "label": "Cal", "unit": "kcal" } ], "footer": [{ "field": "sport", "pill": true }] } ``` ## `search.box` [#searchbox] **What it is.** A client-side search input over a dataset. **When to use it:** the dataset is large enough that you'd rather look a row up than scroll. Typing matches rows case-insensitively across `fields`; results drop down as an autocomplete showing `titleField`, and selecting one opens that row's full details. ```jsonc title="manifest.json" { "type": "search.box", "dataset": "ingredients", "fields": ["name", "category"], "titleField": "name", "detail": "category", "placeholder": "Search foods…" } ``` **Key options.** * `fields: [...]`: the columns a query matches against (substring, case-insensitive). * `titleField`: what each result row shows; `detail`: an optional secondary line under it. * `placeholder?`: the input's placeholder text. * `limit?`: the maximum number of visible results (default `10`). `search.box` matches with a plain client-side substring over the rows already loaded; it isn't a SQL `LIKE` and doesn't page through the whole dataset. For a huge table, shape a narrower `sql` dataset for it to search. # MCP Server (/mcp) The MCP server is how an **agent** maintains a dashboard: safely, for months, without it rotting. It's the primary way to run OpenIslands. It runs in **Code Mode** — instead of a tool per operation, the agent calls **one tool, `execute`**, and passes it a small async JavaScript program that drives the `oi` API. The whole surface sits on one principle: > **Read many, write one.** An agent can read everything (the manifest, the schemas, the live > data), but every change funnels through a single proposal-and-apply pipeline that validates > before it writes and snapshots before it changes anything. This is the moat. An agent can't hand-edit your files, can't ship a broken binding, and can't make a change you can't undo. ## Wiring it up [#wiring-it-up] The server ships as `@openislands/mcp`. Point your MCP client's config at your **project root** — the workspace that holds your apps under `apps//`: ```jsonc title=".mcp.json" { "mcpServers": { "openislands": { "command": "npx", "args": ["-y", "@openislands/mcp", "/path/to/your/project"] } } } ``` The first positional argument is the project root: the server scans `apps/*`, and reads and writes each app's manifest, data, and history under `apps//`. `npx` fetches and runs the latest published server on demand; its `-y` flag skips the install prompt, so there's nothing to install globally. One server hosts the whole workspace. Inside a script, `oi.app(id)` picks an app; omit the `id` when the project has a single app and it resolves automatically. With several apps, pass the ``, or you get an error naming the available ids — call `oi.listApps()` first to discover them. ## Running over HTTP [#running-over-http] The config above runs the server over **stdio** — the client spawns it as a child process. For a remote or always-on setup, the same server also speaks **Streamable HTTP** (the modern MCP transport): `openislands serve --mcp`, or the [Docker image](/self-hosting), mounts it on the dashboard's port at `POST/GET/DELETE /mcp`. One endpoint hosts the whole workspace — pick the app inside the script with `oi.app(id)`, not in the URL. An HTTP-aware client points its `url:` at that endpoint instead of spawning a command; the tool surface below is identical either way. Off loopback it requires a bearer token — see [Self-hosting](/self-hosting) for the full deployment and security story. ## Code Mode: one tool, driven with JavaScript [#code-mode-one-tool-driven-with-javascript] `execute` replaces the old per-operation tools — it's the **entire** tool surface (plus two read-only resources, below). You write a small async JavaScript program that calls the `oi` API, compose as many steps as you like in a single call (loops, conditionals, chaining), and `return` a value and/or `console.log` what you want back. It runs in a `node:vm` sandbox — no `require`, no `process`, no network, only `oi`. (`execute`'s own tool description carries the full `oi` TypeScript API — read it once; the essentials are below.) ```js const app = oi.app(); // the sole app; oi.app("id") to pick one in a multi-app workspace const ov = await app.getOverview(); // orient: manifest + live columns + actions/queries/connectors console.log(ov.datasets); return ov.title; ``` `execute` returns `{ ok, result, logs, checkpoints_created? }` — `result` is whatever you returned, `logs` is your `console.log` output, and `checkpoints_created` lists every checkpoint the script landed (the audit trail for a half-failed run). A thrown error comes back as `{ ok: false, error, logs }`. Every operation — reads, SQL, the manifest edit pipeline, actions, queries, connectors, and even creating or deleting an app — is a method on `oi`, reached from inside `execute`. There are no separate per-operation tools to call; one tool means a tiny, stable context cost no matter how rich the API grows, and the agent composes a whole read-ground-stage-apply loop without a round-trip per step. ## The `oi` API [#the-oi-api] `oi.listApps()`, `oi.createApp({ id, title? })`, and `oi.deleteApp({ id })` are workspace-level. `oi.app(id?)` returns the **app-scoped API** — omit `id` when there's only one app, else pass the `` under `apps/`. Every method returns a plain JSON object carrying an `ok` flag (the one exception is `getManifest()`, which returns the raw manifest object). On `ok:false`, read `error` (or `errors` — each names the page, island, and field) and fix it. Pass JSON **objects**, not JSON strings. ### The read methods [#the-read-methods] An agent grounds itself before it ever proposes a change. These methods are all read-only: | Method | What it returns | | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `app.getOverview({ verbosity? })` | **Start here.** The manifest, every dataset's live columns, and the declared actions / queries / connectors (with status), plus the rollback checkpoint count — one call instead of a `getManifest` + a `getDataSchema` per dataset + `listActions` / `listQueries` / `listConnectors` fan-out. Concise by default; pass `verbosity: 'detailed'` to also include per-action row schemas and per-query params + result columns. | | `app.listIslands()` | The built-in island types, the fields each requires, and each one's `minSpan` / `recommendedSpan` / `maxSpan`. | | `app.getIslandSchema(type)` | The exact config schema for one island type, plus its `layout` (`{ minSpan, recommendedSpan, maxSpan }`) and `notes` — so the sizing rules reach you at discovery time. | | `app.getManifest()` | The current manifest (the raw object). | | `app.getDataSchema(dataset)` | A dataset's live, DuckDB-inferred columns and types. | | `app.runSql({ dataset } \| { sql }, limit)` | Rows from a dataset, or a read-only `SELECT` over the registered dataset views. Alias: `app.previewDataset(dataset)`. | | `app.validateSql(sql)` | Dry-runs a read-only `SELECT` against the dataset views; returns its result columns or the exact DuckDB error. | | `app.validateManifest(manifest?)` | Validates a manifest (the one on disk, or one you pass) and checks every binding against the data; also returns advisory layout `warnings`. | | `app.listCheckpoints()` | The rollback points, newest last. | `runSql` takes a `dataset` name for a whole dataset *or* a read-only `sql` SELECT over the dataset views, never both — it pairs with `validateSql` (the dry-run) and is the ad-hoc counterpart to `runQuery` (a *saved, named, parameterized* read). Both are row-capped and take a `verbosity` (`concise` default / `detailed`) that widens the output token budget. This is how an agent confirms a column exists and what its values look like *before* binding an island to it. `validateSql` is the same read-only surface, aimed at **authoring a transform**: pass the SQL you intend to save as a `sql` dataset and get back its result columns, or the exact DuckDB error, before you wire it into the manifest. See [CRUD recipes](#crud-recipes). `getIslandSchema` and `listIslands` also carry each island's **span range** — its `minSpan`, `recommendedSpan`, and `maxSpan` on the 12-column grid — so you can size a tile correctly before you set `span`, not after `validate` rejects it. Compact islands (a `metric.kpi`, `funnel.steps`, the gauges) cap well below 12; data-dense ones run the full width. See [Spans and the grid](/concepts/manifest#spans-and-the-grid). ## Apps [#apps] A project is a **workspace**: every app lives under `apps//`, and one server hosts them all. Three workspace-level methods on `oi` manage the set (they're not scoped to an app): | Method | What it does | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `oi.listApps()` | Lists the apps in the workspace — `{ apps: [{ id, title, dir }] }`. Call it first when a project might hold more than one app, then pass the chosen `id` to `oi.app(id)`. | | `oi.createApp({ id, title? })` | Scaffolds `apps//` with a minimal starter manifest (one welcome note, empty `data/`). Errors if the `id` is unsafe or already taken. | | `oi.deleteApp({ id })` | **Soft-archive** — moves `apps//` into the workspace's `.openislands/trash/`. It's reversible (nothing is hard-deleted), never a hard delete. | Two read-only **resources** expose the same surface for clients that prefer resource reads to tool calls: `openislands://apps` (the app list) and `openislands://apps//manifest.json` (one app's current manifest). ## The manifest write path [#the-manifest-write-path] Exactly one pipeline writes the manifest, in two steps with a human-reviewable diff between them. An agent stages an edit (`patchManifest` or `replaceManifest`), reviews the returned diff, then applies it. | Method | What it does | | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `app.patchManifest({ ... })` | **The preferred editor.** Merges one or more sections into the current manifest, validates the result, and stages it. | | `app.replaceManifest({ manifest })` | Stages a **full** manifest rewrite. | | `app.applyEdit(proposal_id)` | Writes a staged proposal and snapshots the prior manifest. | | `app.rollback(checkpoint_id?)` | Restores a snapshot byte-for-byte (the latest if no id). | ### `patchManifest` — the incremental editor [#patchmanifest--the-incremental-editor] `patchManifest` is how an agent should normally edit the manifest. It takes a **partial** manifest — `{ title?, icon?, datasets?, actions?, queries?, connectors?, pages?, remove_pages? }` — merges it into the document on disk, validates the merged result against the live data, and returns a unified `diff` plus a `proposal_id` (it writes **nothing** yet). You never re-send, or re-typo, the whole manifest. The merge follows the shape of each section: * **Record sections** (`datasets`, `actions`, `queries`, `connectors`) are keyed maps. Each entry is upserted by name: `name → spec` adds or replaces that one entry, and **`name → null` deletes it**. Untouched entries are left alone. * **`pages`** is a list, so it's upserted **by `id`**: a page whose `id` already exists is replaced, a new `id` is appended. **`remove_pages: ["id", …]`** deletes pages by id. * **Scalars** (`title`, `icon`) are overwritten when present. ```js // patchManifest — add one dataset and one page, delete a stale query, all in one call const s = await app.patchManifest({ datasets: { spending: { source: "data/spending.csv", description: "monthly spend" } }, pages: [ { id: "spending", title: "Spending", islands: [ { type: "category.bar", title: "By category", dataset: "spending", x: "category", y: "amount_eur" }, ] }, ], queries: { legacy_rollup: null }, }); if (!s.ok) return s.errors; return await app.applyEdit(s.proposal_id); ``` The validation is identical to `replaceManifest`'s: if a binding fails, you get `{ ok: false, errors, diff }` (each error naming the page, island, and field) and **no** `proposal_id`. Fix the patch and call again. On success: `{ ok: true, proposal_id, diff }`. Both shapes also carry an advisory **`warnings`** array — the layout linter's non-blocking suggestions (a lone `metric.kpi`, a compact island stretched past its recommended span). Warnings never set `ok` to `false` or block the apply; they're a nudge toward a tidier layout, not a gate. ### `replaceManifest` — the full rewrite [#replacemanifest--the-full-rewrite] **`replaceManifest({ manifest })`** takes the whole manifest when you really do want to replace it end to end. It accepts a manifest **object** (preferred) or a JSON string — no double-encoding. It validates the structure, checks every binding against the live data, and returns the same `{ ok, proposal_id?, diff, errors?, warnings? }` shape as `patchManifest`. **Reach for `patchManifest` first** — it's the preferred incremental editor; `replaceManifest` is for a full rewrite or a brand-new manifest, where re-sending the whole document is the point. A proposed manifest is validated **against itself**: new datasets, `sql` transforms, and markdown sources introduced in the same edit resolve and bind correctly, even starting from an empty manifest. `app.validateManifest(manifest?)` runs that same check (errors **and** advisory layout `warnings`) without staging anything — pass a manifest object to dry-run it, or omit it to validate the one on disk. ### Apply and roll back [#apply-and-roll-back] **`applyEdit(proposal_id)`** writes a staged proposal (from either editor). Before writing it **snapshots the current manifest** as a checkpoint and returns its `checkpoint_id`. A proposal is rejected if it's unknown or **stale**: if the manifest on disk changed since it was staged (a content-hash check), re-stage the edit. A `proposal_id` persists across `execute` calls, so you can stage in one call and apply in the next. **`rollback(checkpoint_id?)`** restores a checkpoint **byte-for-byte** (the latest if no id is given). It restores the manifest *and* any data checkpoints, so it undoes data writes too. History doesn't grow without bound: it auto-prunes to the newest few checkpoints after every `applyEdit`. **`app.pruneCheckpoints(keep?)`** prunes it on demand — keeping the newest `keep` checkpoints and deleting the rest — to reclaim space sooner or keep fewer. Trimmed checkpoints become unrecoverable. There is no raw file-write tool and no git dependency by design. Safety is the stage/apply/rollback loop plus on-disk snapshots, not trust. ## CRUD recipes [#crud-recipes] Author against the live contract, stage with `patchManifest`, apply — usually one script. Each recipe assumes `const app = oi.app();` at the top. **Add a dataset from a file.** Drop the file under `data/` (or `models/` / `docs/` / `app/`), then upsert it and confirm its inferred columns in one script: ```js const s = await app.patchManifest({ datasets: { crypto: { source: "data/crypto.csv", description: "holdings" } } }); if (!s.ok) return s.errors; await app.applyEdit(s.proposal_id); return await app.getDataSchema("crypto"); // confirm columns before binding islands to it ``` **Add a SQL transform — dry-run it first.** `validateSql` lets you get the SQL right before it ever touches the manifest: ```js // 1. validateSql — returns the result columns, or the exact DuckDB error const check = await app.validateSql("SELECT class, SUM(value_eur) AS value_eur FROM holdings GROUP BY class"); if (!check.ok) return check.error; // 2. once it's valid, save it under models/ (with your file tools) and wire it in const s = await app.patchManifest({ datasets: { allocation: { sql: "models/transforms/allocation.sql" } } }); return s.ok ? await app.applyEdit(s.proposal_id) : s.errors; ``` A transform can read any other dataset by its name; `validateSql` resolves those same views. **Add an island to a page.** A page is upserted by `id`, so read the page, append the island, and send just that page back (everything you omit on the page is replaced, so include the existing islands): ```js const ov = await app.getOverview(); const page = ov.pages.find((p) => p.id === "overview"); page.islands.push({ type: "rank.list", title: "Top assets", dataset: "allocation", label: "class", value: "value_eur", span: 6 }); const s = await app.patchManifest({ pages: [page] }); return s.ok ? await app.applyEdit(s.proposal_id) : s.errors; ``` **Remove something.** Set a record entry to `null`, or list page ids in `remove_pages`: ```js return await app.patchManifest({ queries: { by_class: null }, actions: { log_txn: null }, remove_pages: ["scratch"] }); ``` ## The data write path: actions [#the-data-write-path-actions] Actions are typed writes into a `source` dataset, declared in the manifest. Four modes are available: `insert` (append), `replace` (overwrite all rows), `delete` (drop rows matching a predicate), and `update` (patch matching rows). The agent discovers and runs them: * **`app.listActions()`** returns each declared action with its **resolved row JSON Schema** (derived from the live data, merged with the action's `fields` overrides). This is the agent's grounding for what a valid row looks like. * **`app.runActions([...])`** accepts a call per action. The call shape depends on the mode: * `insert` / `replace`: `{ action, rows: [{ col: val }, ...] }` * `delete`: `{ action, match: { col: val, ... } }` — equality match, multi-column AND; empty `match` is rejected. * `update`: `{ action, match: { col: val }, set: { col: newVal } }` Every row is validated against the resolved schema before a single byte lands. A bad row (or an empty `match`) rejects the whole call, and **nothing is written.** On success the target file is snapshotted (so `rollback` covers it) and the result reports rows affected plus a `checkpoint_id`. Multiple calls in one `runActions` are atomic by default. Writes are all-or-nothing and path-confined to the project: an action can only write the `source` file its declared dataset names. CSV and other flat-file datasets store no null. Pass `""` for an empty string, or omit the field to apply its `default`. Sending `null` is a validation error. ## The read query path: queries [#the-read-query-path-queries] Queries are typed, read-only reads over a dataset, declared in the manifest. They're the read mirror of actions: a saved, named, parameterized version of `runSql`. A query is a declarative spec — a dataset, filters, a projection — that the compiler translates to a parameterized `SELECT`, not raw SQL. The agent discovers and runs them: * **`app.listQueries()`** returns each declared query with its `name`, `description`, its `params` as a **JSON Schema**, and the result `columns`. This is the agent's grounding for what to pass and what comes back. * **`app.runQuery(name, params?, { limit? })`** validates the params, then runs the compiled `SELECT`. On success it returns `{ ok: true, rowCount, columns, rows }`. A bad param rejects the whole call with `{ ok: false, errors }` (all-or-nothing); an unknown name or a query error returns `{ ok: false, error }`. `limit` is 1–500 and the result is row-capped either way. Params and literals are bound, never interpolated, and every `field` is validated against the live columns. A query is plain JSON in the manifest. Because the only thing the write path writes is the manifest, an agent authors a query through the normal `patchManifest` / `applyEdit` loop, exactly like an island or an action — it creates the read tool, it doesn't just run one. See [Queries](/data/queries) for the full shape. ## Connectors [#connectors] Connectors sync an external provider's data into `source` datasets on a schedule, through the same checkpointed write path. The agent's two methods: * **`app.listConnectors()`** returns each connector's live status: `connected`, `missingSecrets`, `lastSync`, `lastError`, effective `schedule`, and any `loadError`. This is how an agent discovers whether a connector needs human action before it can run. * **`app.runSync(name)`** pulls from the provider and writes rows, returning rows-per-dataset, the write mode (`insert` / `replace`), and a `checkpoint_id`, so a sync is reversible with `rollback`. Whether a connector needs human involvement depends on its `auth` type: * **Keyless connectors** (`auth: none` — no OAuth, no bearer token) need no human authorization. An agent can call `runSync(name)` directly as long as the connector's `connected` status shows no `missingSecrets`. * **OAuth2 / bearer connectors** require a human to authorize first. If `listConnectors()` shows the connector isn't `connected` (OAuth not completed, or secrets missing), the agent must tell you to open the dashboard (`openislands serve`) and click **Connect**. It must never attempt to authorize on its own. For `oauth2` and `bearer` connectors, authorization runs in the dashboard browser, not from the agent. Check `listConnectors()` first — only call `runSync` when `connected` is `true`. ## Safety posture [#safety-posture] Every guarantee is structural, not advisory: * **Sandboxed code.** `execute` runs your program in a `node:vm` with only `oi` in scope — no `require`, no `process`, no network, no filesystem. The only way to act is through an `oi` method, and every `oi` method is the same validated surface above. * **Validate before write.** `patchManifest`, `replaceManifest`, and `runActions` all fail closed: an invalid manifest or a bad row never reaches disk. * **Snapshot before change.** `applyEdit`, `runActions`, and `runSync` each snapshot to `.openislands/history/` first, and `rollback` restores any of them byte-for-byte. History is count- and byte-capped, oldest pruned first. * **Path confinement.** Writes are scoped to the project's declared `source` files; there is no general filesystem access. * **Reads are bounded too.** `runSql` and `runQuery` only run read-only `SELECT`s; a query compiles from a declarative spec with its `field`s validated and its params and literals bound, not interpolated, and every result is row-capped. * **Prompt-injection posture.** Because the *only* mutations are a validated manifest edit (`patchManifest` or `replaceManifest`) and a schema-checked row insert — both diffed or reported, both reversible — data that tries to talk an agent into a harmful edit still can't bypass validation, the diff, or the rollback snapshot. ## Related [#related] * [Getting Started](/getting-started): the human CLI loop the MCP edit loop mirrors. * [The Manifest](/concepts/manifest): what `replaceManifest` validates. * [Data Contracts](/concepts/data-contracts): the binding check behind every write. # Manifest Reference (/reference/manifest) {/* Generated from @openislands/schema by scripts/gen-reference.ts. Do not edit by hand. */} > Generated from `@openislands/schema` by `scripts/gen-reference.ts`. Do not edit by hand. > Run `pnpm gen:reference` to refresh it after a schema change. A manifest is the typed declaration of a data app: the datasets it reads, the pages and islands that render them, the optional actions and connectors that write to them, and the queries that read from them. This page documents every field the schema accepts. The schema is the single source of truth: the CLI, runtime, and MCP server all validate against it, so an island bound to a field that doesn't exist fails the build and names the island. ## Top level [#top-level] A manifest is a JSON object with the following top-level shape: ```jsonc title="manifest.json" { "version": 1, // required: the manifest format version, always 1 "title": "Finance Overview", // required: the app title "icon": "wallet", // optional: the app's tile icon in the workspace app rail "datasets": { /* ... */ }, // required: named data sources (see Datasets) "pages": [ /* ... */ ], // required: the app's pages (see Pages) "actions": { /* ... */ }, // optional: typed data writes (see Actions) "queries": { /* ... */ }, // optional: typed, parameterized reads (see Queries) "connectors": { /* ... */ } // optional: vendored sync integrations (see Connectors) } ``` | Field | Type | Required | Description | | ------------ | ----------------- | -------- | ---------------------------------------------------------------------------------- | | `version` | `1` | yes | The manifest format version. Always `1`. | | `title` | `string` | yes | The app title, shown in the chrome. | | `icon` | `string` | no | One of the curated icon names, used for the app's tile in the workspace app rail. | | `datasets` | `object` | yes | A map of dataset name to a dataset declaration. See [Datasets](#datasets). | | `pages` | `array of object` | yes | The app's pages, one sidebar entry each. See [Pages](#pages). | | `actions` | `object` | no | A map of action name to an action declaration. See [Actions](#actions). | | `queries` | `object` | no | A map of query name to a query declaration. See [Queries](#queries). | | `connectors` | `object` | no | A map of connector name to a connector declaration. See [Connectors](#connectors). | ## Datasets [#datasets] `datasets` maps each dataset name to a source. A dataset is one of three shapes: a file source, a SQL transform, or a SQLite table. ```jsonc title="manifest.json" "datasets": { "net_worth": { "source": "data/net_worth.csv" }, // a CSV / JSON / Parquet / SQLite file "monthly": { "sql": "models/transforms/monthly.sql" }, // a DuckDB SQL transform over other datasets "tracks": { "source": "data/library.sqlite", "table": "tracks" } // a table within a SQLite database } ``` | Field | Type | Required | Description | | ------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------- | | `source` | `string` | no | Path to a CSV / JSON / Parquet / SQLite file. One of `source` or `sql` is required. | | `sql` | `string` | no | Path to a DuckDB SQL transform. One of `source` or `sql` is required. | | `table` | `string` | no | The table within a `.sqlite` / `.db` source. Required for a SQLite source; an error on any other source. | | `description` | `string` | no | Free-form note describing the dataset. | A `.sqlite` / `.db` source requires `table`; supplying `table` for any other source is a validation error. A `sql` dataset is derived and read-only; it can never be the target of an action or a connector. ## Pages [#pages] Each entry in `pages` is a page: one sidebar entry. A page holds **either** a flat `islands` list **or** tabbed `groups`, never both: ```jsonc title="manifest.json" { "id": "overview", // required: unique page id, used in the URL "title": "Overview", // optional: sidebar label "icon": "house", // optional: one of the curated page icons "filters": [ /* ... */ ], // optional: page-level shared filters (see Page filters) "islands": [ /* ... */ ] // a page has EITHER islands ... // "groups": [ { "id": "...", "title": "...", "islands": [ /* ... */ ] } ] // ... OR groups } ``` | Field | Type | Required | Description | | --------- | ----------------- | -------- | --------------------------------------------------------------------- | | `id` | `string` | yes | Unique page id, used in the `//` URL. | | `title` | `string` | no | Sidebar label for the page. | | `icon` | `string` | no | One of the curated page icons (e.g. `house`, `chart-line`, `wallet`). | | `filters` | `array of object` | no | Page-level shared filters: a date range or a categorical select. | | `islands` | `array of object` | no | The page's islands. Exactly one of `islands` or `groups`. | | `groups` | `array of object` | no | Tabbed groups of islands. Exactly one of `islands` or `groups`. | A **group** is `{ id, title?, islands }`: a string `id`, an optional `title`, and its own `islands` list. Groups render as tabs under the page header, deep-linked via `?group=`. ### Page filters [#page-filters] A page's optional `filters` declare shared controls in the page header. Each filter's `bind` maps each affected dataset to the column the filter applies to; islands whose `dataset` appears in `bind` re-query when the filter changes, and the rest ignore it. Two kinds are supported: a `daterange` over a date column, and a `select` that narrows a categorical column. ```jsonc title="manifest.json" "filters": [ { "id": "period", "type": "daterange", "label": "Period", "bind": { "net_worth": "month", "transactions": "ts" } }, { "id": "team", "type": "select", "label": "Team", "multiple": true, "bind": { "services": "owner" } } ] ``` | Field | Type | Required | Description | | ---------- | ----------------- | -------- | ---------------------------------------------------------------------------------------------------------- | | `id` | `string` | yes | Unique filter id within the page. | | `type` | `string` | yes | The filter kind: `daterange` or `select`. | | `label` | `string` | no | Label shown on the control. | | `bind` | `object` | yes | A map of dataset name to the column the filter applies to. Each column is validated against the live data. | | `multiple` | `boolean` | no | `select` only: allow several values (`IN`); default single (`=`). | | `options` | `array of string` | no | `select` only: explicit choices; when omitted, the bound column's live distinct values are used. | ## Actions [#actions] An **action** is a manifest-declared, typed write into a `source` dataset (a `sql` dataset is never writable). `mode: "insert"` appends rows: an append for a flat file (CSV / JSON(L)), an `INSERT` for a SQLite table. The row schema is derived from the live data; `fields` only narrows or annotates it. ```jsonc title="manifest.json" "actions": { "log_meal": { "dataset": "meals", "mode": "insert", "fields": { "meal_type": { "enum": ["breakfast", "lunch", "dinner", "snack"] } } } } ``` | Field | Type | Required | Description | | ------------- | ---------- | -------- | --------------------------------------------------------------------- | | `dataset` | `string` | yes | The `source` dataset to insert into. Must not be a `sql` dataset. | | `mode` | `"insert"` | yes | The write mode. v1 supports `insert`. | | `fields` | `object` | no | Per-column overrides on the derived row schema (see field overrides). | | `description` | `string` | no | Free-form note describing the action. | A **field override** (`fields.`) narrows one column of the derived row schema: | Field | Type | Required | Description | | ------------- | --------------------------------------------- | -------- | ----------------------------------------------------- | | `type` | `"string" \| "number" \| "boolean" \| "date"` | no | Constrain the column to one type. | | `enum` | `array of string` | no | Constrain the column to a fixed set of string values. | | `min` | `number` | no | Minimum for a numeric column. | | `max` | `number` | no | Maximum for a numeric column. | | `default` | `string \| number \| boolean` | no | Value applied when the column is omitted. | | `description` | `string` | no | Free-form note describing the column. | ## Queries [#queries] A **query** is a manifest-declared, read-only read over one dataset, written as a declarative spec — not raw SQL. The compiler translates it to a parameterized, type-aware `SELECT`, validates every `field` against the live columns, and binds every param and value (so it's injection-safe). Its `dataset` is a `source` dataset or a `sql` transform; there are no joins, so heavy shaping lives in a transform the query points at. ```jsonc title="manifest.json" "queries": { "get_daily_macros": { "description": "Macros + goals for one day; omit date for the latest.", "dataset": "macros_daily", "params": { "date": { "type": "date", "required": false } }, "where": [{ "field": "date", "op": "eq", "param": "date" }], "orderBy": [{ "field": "date", "dir": "desc" }], "limit": 1 } } ``` | Field | Type | Required | Description | | ------------- | --------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `dataset` | `string` | yes | The dataset to read: a `source` dataset or a `sql` transform. | | `select` | `array of string \| object` | no | Columns to return: a column name or `{ field, fn?, as? }` where `fn` is `sum` / `avg` / `count` / `min` / `max`. Omit for all columns. | | `where` | `array of object` | no | Filters, ANDed together; each is `{ field, op, param }` or `{ field, op, value }` (see filter ops). | | `groupBy` | `array of string` | no | Columns to group by, for aggregate `select` entries. | | `orderBy` | `array of object` | no | Sort keys, each `{ field, dir? }` where `dir` is `asc` / `desc` (default `asc`). | | `limit` | `number` | no | Max rows returned. | | `params` | `object` | no | A map of parameter name to a parameter declaration (see query params). | | `description` | `string` | no | Free-form note describing the query. | A **query param** (`params.`) declares one parameter, referenced by a `where` clause's `param`: | Field | Type | Required | Description | | ------------- | --------------------------------------------- | -------- | --------------------------------------------------------------------------------- | | `type` | `"string" \| "number" \| "boolean" \| "date"` | no | The parameter type. Defaults to `string`. | | `required` | `boolean` | no | Whether the caller must supply it. Defaults to `true`; `false` makes it optional. | | `enum` | `array of string` | no | Constrain a string parameter to a fixed set of values. | | `min` | `number` | no | Minimum for a numeric parameter. | | `max` | `number` | no | Maximum for a numeric parameter. | | `default` | `string \| number \| boolean` | no | Value used when the caller omits it; implies optional. | | `description` | `string` | no | Free-form note describing the parameter. | A **filter** (`where[]`) names a `field`, an `op`, and exactly one of `param` (bind a declared param) or `value` (a literal). The ops are `eq`, `ne`, `lt`, `lte`, `gt`, `gte`, `contains` (case-insensitive substring), `sameDay` (match a timestamp field to a date), and `in` (a literal `value` array). A filter bound to an **optional** param the caller omits is dropped, so the query runs without it. ## Connectors [#connectors] A **connector** is a vendored integration that syncs a provider's data into `source` datasets through the same checkpointed write path actions use. The integration code lives in the user's project at `/index.ts`; the manifest declares an instance: ```jsonc title="manifest.json" "connectors": { "whoop": { "module": "connectors/whoop", // connector directory, relative to project root "datasets": { "recovery": "whoop_recovery" }, // connector output name → manifest dataset name "schedule": "6h", // optional: sync interval, overrides the connector default "config": { "lookbackDays": 30 } // optional: validated against the connector's own schema } } ``` | Field | Type | Required | Description | | ------------- | -------- | -------- | -------------------------------------------------------------------------------------- | | `module` | `string` | yes | Connector directory relative to project root, e.g. `connectors/whoop`. | | `datasets` | `object` | yes | A map of connector output name to the writable `source` dataset it syncs into. | | `schedule` | `string` | no | Sync interval, overriding the connector default (`m`, `h`, `d`, or ms-style). | | `config` | `object` | no | Free-form config, validated against the connector's own schema at load time. | | `description` | `string` | no | Free-form note describing the connector instance. | Each `datasets` value must name a writable `source` dataset (never a `sql` dataset), and each key must be one of the connector's declared outputs. ## Islands [#islands] Each island in a page's `islands` (or a group's `islands`) is an object discriminated by its `type`. Below is every built-in type with its grid span range and the fields its config accepts. `id`, `title`, and `span` are common optional fields on every data-bound island; `span` is a 1–12 grid column count that must sit within the island's `min`–`max` range (a value below min or above max is a named validation error), and defaults to the recommended width when omitted. Compact, single-value islands cap well below full width; data-dense ones run the full 12. Bind an island only to fields that exist in its dataset; a missing field fails validation and names the island. A `layout.row` is a structural wrapper: it holds other islands and forces them onto their own full-width grid row. It carries no `span`, `title`, or data binding, and it cannot nest another `layout.row`. **Built-in islands:** [`metric.kpi`](#metrickpi) · [`metric.scorecard`](#metricscorecard) · [`timeseries.line`](#timeseriesline) · [`category.bar`](#categorybar) · [`category.combo`](#categorycombo) · [`waterfall.bars`](#waterfallbars) · [`divergence.bars`](#divergencebars) · [`breakdown.treemap`](#breakdowntreemap) · [`distribution.heatmap`](#distributionheatmap) · [`activity.calendar`](#activitycalendar) · [`funnel.steps`](#funnelsteps) · [`rank.list`](#ranklist) · [`compare.radar`](#compareradar) · [`map.choropleth`](#mapchoropleth) · [`correlation.scatter`](#correlationscatter) · [`category.pie`](#categorypie) · [`table.grid`](#tablegrid) · [`timeline.feed`](#timelinefeed) · [`gauge.rings`](#gaugerings) · [`gauge.goal`](#gaugegoal) · [`gauge.meter`](#gaugemeter) · [`status.grid`](#statusgrid) · [`search.box`](#searchbox) · [`note.card`](#notecard) · [`source.doc`](#sourcedoc) · [`content.editor`](#contenteditor) · [`form.entry`](#formentry) · [`board.kanban`](#boardkanban) ### `metric.kpi` [#metrickpi] A single headline number, optionally with a delta vs the previous row or a target — use for at-a-glance KPIs. **Span:** min 2, recommended 4, max 6 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ----------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `value` | `string` | yes | field holding the headline value | | `compareTo` | `string` | no | 'prev', 'none', or a field name | | `target` | `string` | no | field holding a target to compare against | | `unit` | `string` | no | | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | | `color` | `string` | no | 6-digit hex color (e.g. "#22C55E") for the sparkline, overriding the default palette | ### `metric.scorecard` [#metricscorecard] A compact scorecard of several KPIs off the last row — use for a tidy row of related numbers, each with an optional delta vs the previous row. **Span:** min 3, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ----------------- | -------- | ----------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `stats` | `array of object` | yes | the stats to show, each read off the last row | | `columns` | `number` | no | fixed grid column count; defaults to responsive | ### `timeseries.line` [#timeseriesline] A line chart over time — use for trends; supports multiple y fields, a series split, and a goal line. **Span:** min 4, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | --------------------------- | -------- | ------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `x` | `string` | yes | date/time field | | `y` | `string \| array of string` | yes | numeric field(s) | | `series` | `string` | no | field to split series by | | `colors` | `array of string` | no | CSS colors per y field (or per series value, in first-seen order), overriding the default palette | | `options` | `object` | no | | ### `category.bar` [#categorybar] A bar chart across categories — use to compare discrete groups; supports grouped or stacked bars. **Span:** min 4, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ----------------- | -------- | ------------------------------------------------------------------------------ | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `x` | `string` | yes | category field | | `y` | `string` | yes | numeric field | | `group` | `string` | no | | | `stacked` | `boolean` | no | | | `colors` | `array of string` | no | CSS colors per series (group value or y field), overriding the default palette | ### `category.combo` [#categorycombo] A dual-axis chart: bars on the primary axis, lines on a secondary axis — use to compare a level against a rate (revenue vs margin, volume vs price). **Span:** min 4, recommended 8, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------ | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `x` | `string` | yes | category or date field (x axis) | | `bars` | `string \| array of string` | yes | numeric field(s) drawn as bars on the primary y-axis | | `lines` | `string \| array of string` | yes | numeric field(s) drawn as lines on the secondary y-axis | | `stacked` | `boolean` | no | stack the bar series into one bar per category | | `colors` | `array of string` | no | CSS colors per series (bars first, then lines), overriding the default palette | | `format` | [`value format`](/reference/value-formats) | no | format for the primary (bar) y-axis | | `lineFormat` | `"usd" \| "eur" \| "gbp" \| "jpy" \| "int" \| "decimal" \| "pct" \| "compact" \| "kg" \| "bytes" \| "duration" \| "date" \| "datetime" \| "time" \| "month" \| string` | no | format for the secondary (line) y-axis | ### `waterfall.bars` [#waterfallbars] A waterfall / bridge chart — use for a P\&L walk or variance: an opening anchor, signed +/− steps that accumulate, and closing anchors. Mark anchor rows via a kind field whose value is "total". **Span:** min 4, recommended 8, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `label` | `string` | yes | step-name field (x axis) | | `value` | `string` | yes | signed delta per step; for a total/anchor row, its absolute level | | `kind` | `string` | no | field marking anchor rows: a row whose value here is "total" draws as an absolute bar from zero (opening/closing/subtotal). Omit to make every row a delta. | | `colors` | `object` | no | CSS colors per tone, overriding the defaults (increase green, decrease red, total neutral) | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `divergence.bars` [#divergencebars] A diverging bar chart: one signed bar per category extending above or below a zero baseline, optionally colored by which value band it falls into. Use for deviation from a reference — daily calorie surplus/deficit, budget variance, net cash flow, sentiment, temperature anomaly. Pick this over category.bar when values are signed and the up/down direction is the message, and over waterfall.bars when each bar stands on its own rather than accumulating into a running total. **Span:** min 4, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `x` | `string` | yes | category or date field (x axis) — one bar per row | | `value` | `string` | yes | signed numeric field: the bar rises above the zero baseline for positive values and drops below it for negative. Rows with a null or non-numeric value are skipped. Pre-compute the difference in SQL to diverge from a non-zero target. | | `buckets` | `array of object` | no | color each bar by the value band it falls in — e.g. surplus tiers green, deficit tiers red. Bands are matched top-to-bottom with half-open bounds \[gte, lt); a value matching none renders neutral grey. Omit entirely for a default green-positive / red-negative two-tone. | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `breakdown.treemap` [#breakdowntreemap] A treemap of part-to-whole composition — use to show how a total splits across (optionally hierarchical) parts. **Span:** min 4, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ----------------- | -------- | ------------------------------------------------------------------------ | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `label` | `string` | yes | | | `value` | `string` | yes | | | `parent` | `string` | no | field for hierarchy parent | | `colors` | `array of string` | no | CSS colors cycled across top-level nodes, overriding the default palette | ### `distribution.heatmap` [#distributionheatmap] A matrix heatmap — use to show one value across two categorical dimensions (x × y), shaded by a continuous color scale. **Span:** min 4, recommended 8, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `x` | `string` | yes | column-category field (x axis) | | `y` | `string` | yes | row-category field (y axis) | | `value` | `string` | yes | numeric field mapped to each cell's color | | `colors` | `array of string` | no | gradient color stops for the scale, overriding the default | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `activity.calendar` [#activitycalendar] A calendar heatmap — use to show a daily value over weeks and months, GitHub-contributions style; rows on the same day sum. **Span:** min 6, recommended 12, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `date` | `string` | yes | date field — any parseable date or timestamp | | `value` | `string` | yes | numeric field mapped to the day's color intensity | | `colors` | `array of string` | no | gradient color stops, overriding the default | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `funnel.steps` [#funnelsteps] A funnel of sequential stages — use for conversion or drop-off; each stage's width is its share, ordered by the rows unless sort is set. **Span:** min 3, recommended 4, max 6 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `label` | `string` | yes | stage-name field | | `value` | `string` | yes | numeric field — the count at each stage | | `sort` | `"none" \| "ascending" \| "descending"` | no | funnel ordering; 'none' keeps the declared row order | | `colors` | `array of string` | no | CSS colors per stage, overriding the default palette | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `rank.list` [#ranklist] A ranked Top-N list with proportional bars — use for leaderboards: top products, customers, errors, or movers. **Span:** min 3, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ----------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `label` | `string` | yes | field naming each row | | `value` | `string` | yes | numeric field the rows are ranked by | | `limit` | `number` | no | max rows shown | | `sort` | `"descending" \| "ascending"` | no | rank order by value | | `secondary` | `string` | no | optional field shown beside each row's value | | `color` | `string` | no | CSS color for the bars, overriding the default accent | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `compare.radar` [#compareradar] A radar (spider) chart — use to compare entities across several metrics at once; each metric is an axis, each row a polygon. **Span:** min 4, recommended 6, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `metrics` | `array of string` | yes | numeric fields, one radar axis each | | `series` | `string` | no | field naming each polygon (one per row); omitted numbers them Series 1, 2, … | | `max` | `number` | no | fixed max for every axis; omitted maxes each axis at its metric's peak | | `colors` | `array of string` | no | CSS colors per polygon, overriding the default palette | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `map.choropleth` [#mapchoropleth] A geographic choropleth — use to shade regions (world countries) by a value; region names must match the map's names. Local-first: the map ships as vendored GeoJSON, no network. **Span:** min 5, recommended 8, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `region` | `string` | yes | field holding each row's region name, matching the map's region names (e.g. a country name like "France") | | `value` | `string` | yes | numeric field mapped to each region's color | | `map` | `string` | no | the registered map name | | `colors` | `array of string` | no | gradient color stops, overriding the default | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `correlation.scatter` [#correlationscatter] A scatter or bubble plot of two numeric fields — use to explore correlation; split into series by a field and size points by a third. **Span:** min 4, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | ----------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `x` | `string` | yes | numeric field for the x axis | | `y` | `string` | yes | numeric field for the y axis | | `series` | `string` | no | field splitting points into one colored series per distinct value | | `size` | `string` | no | numeric field driving bubble radius; omit for fixed-size dots | | `label` | `string` | no | field naming each point, shown in the tooltip | | `colors` | `array of string` | no | CSS colors per series, overriding the default palette | | `format` | [`value format`](/reference/value-formats) | no | formats the y value (axis + tooltip) | | `xFormat` | [`value format`](/reference/value-formats) | no | formats the x value (axis + tooltip) | ### `category.pie` [#categorypie] A pie or donut chart of part-to-whole composition — use for one series' share across a handful of categories; set donut for a hole. **Span:** min 3, recommended 4, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `label` | `string` | yes | category field naming each slice | | `value` | `string` | yes | numeric field sizing each slice | | `donut` | `boolean` | no | render with an inner radius (a donut hole) | | `colors` | `array of string` | no | CSS colors per slice (in descending-value order), overriding the default palette | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | ### `table.grid` [#tablegrid] A paginated table of raw rows: use when exact values matter; supports column formats, click-to-open details, and collapsible groups. **Span:** min 5, recommended 8, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ----------- | ----------------- | -------- | -------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `columns` | `array of object` | no | | | `details` | `array of object` | no | fields hidden from the row, revealed by clicking it | | `groupBy` | `object` | no | | | `pageSize` | `number` | no | | | `expand` | `boolean` | no | offer the see-all / expand dialog; false renders every row inline instead | | `drilldown` | `object` | no | an embedded island shown in a clicked row's details dialog, filtered to that row | ### `timeline.feed` [#timelinefeed] A reverse-chronological feed of events: use for logs and activity; supports detail dialogs and collapsible groups, and a rich row layout (header value, inline stats, meta footer) when highlight/stats/footer are set. **Span:** min 4, recommended 7, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ------------ | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `ts` | `string` | yes | timestamp field | | `titleField` | `string` | yes | | | `detail` | `string` | no | | | `kind` | `string` | no | | | `details` | `array of object` | no | fields hidden from the row, revealed by clicking it | | `groupBy` | `object` | no | | | `highlight` | `object` | no | right-aligned emphasized value in the row header | | `stats` | `array of object` | no | labeled inline stats rendered under the title | | `footer` | `array of object` | no | small meta line below the row; the row timestamp always leads it. Setting any of highlight/stats/footer switches the row from a single line to the rich layout | | `expand` | `boolean` | no | offer the see-all dialog; false renders every row inline instead | | `drilldown` | `object` | no | an embedded island shown in a clicked row's details dialog, filtered to that row | ### `gauge.rings` [#gaugerings] Up to four concentric progress rings read off the last row — use for tracking several goals or budgets at once. **Span:** min 4, recommended 5, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ----------------- | -------- | ---------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `rings` | `array of object` | yes | concentric rings, outermost first; reads the last row (max 4 for legible geometry) | ### `gauge.goal` [#gaugegoal] One ring per goal comparing the last row's value to a goal or target band — use for numbers with a defined good range; within the band reads success-green, under amber, over danger-red. `size` sets the shared ring footprint so several share a row. **Span:** min 2, recommended 5, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | -------------------------------- | -------- | ----------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `goals` | `array of object` | yes | one ring per goal, side by side in a row that wraps; each reads the last row (max 6 to stay legible) | | `size` | `"small" \| "medium" \| "large"` | no | footprint shared by every ring: `small` packs several goals into a row, `large` emphasizes one or two | ### `gauge.meter` [#gaugemeter] One or more horizontal usage meters read off the last row — use for quota- or capacity-style values. **Span:** min 3, recommended 4, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ----------------- | -------- | -------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `meters` | `array of object` | yes | horizontal usage bars, top to bottom; reads the last row | ### `status.grid` [#statusgrid] A responsive grid of state tiles — use for service/check health on ops & status-page dashboards; each tile's tone comes from its state value. **Span:** min 4, recommended 8, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | --------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `label` | `string` | yes | field naming each entity (service, check, host) | | `state` | `string` | yes | field holding each entity's status value | | `value` | `string` | no | optional metric shown under the label | | `format` | [`value format`](/reference/value-formats) | no | Display format for a value. Currency: usd, eur, gbp, jpy. Number: int, decimal, pct (a 0–1 fraction shown as a %), compact (1.2K). Unit: kg, bytes (1024-scale), duration (a number of seconds → 1h 5m). Date/time: date, datetime, time, month. Omit for a plain number with up to 2 decimals. For any other ISO 4217 currency use 'currency:\' (e.g. currency:RSD). See the Value formats reference (/reference/value-formats). | | `tones` | `object` | no | map a state value to a tone; unmapped values fall back to a keyword convention (up/ok/healthy/online → success, warn/degraded/pending → warning, down/error/critical/fail → danger, else neutral) | ### `search.box` [#searchbox] A search box over a dataset — typing matches rows case-insensitively across `fields`, results drop down as an autocomplete; selecting a result opens the row's details. **Span:** min 3, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ------------- | ----------------- | -------- | ------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `fields` | `array of string` | yes | columns the query matches against | | `titleField` | `string` | yes | field each result shows | | `detail` | `string` | no | field shown as a secondary line under each result | | `placeholder` | `string` | no | | | `limit` | `number` | no | max visible results | ### `note.card` [#notecard] A static markdown card with no data binding — use for commentary, instructions, or context between islands; set `tone` to render it as an info/success/warning/danger callout. **Span:** min 3, recommended 6, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ---------- | ---------------------------------------------- | -------- | -------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `tone` | `"info" \| "success" \| "warning" \| "danger"` | no | renders the card as a colored callout with a matching icon; omit for plain prose | | `markdown` | `string` | yes | | ### `source.doc` [#sourcedoc] An embedded file or external link (pdf, markdown, image, link) — use to surface source documents alongside the data; renders as a document card with a type icon, name, and open affordance. **Span:** min 2, recommended 4, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ------------- | ------------------------------------------ | -------- | ----------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `file` | `string` | no | | | `href` | `string` | no | | | `kind` | `"pdf" \| "markdown" \| "image" \| "link"` | no | | | `label` | `string` | no | human-readable name shown on the card; defaults to the file name or the link's host | | `description` | `string` | no | a short caption shown under the document | ### `content.editor` [#contenteditor] A full-page content workspace — browse and edit a directory of markdown files (and CSVs) Obsidian-style, with virtual folders and version history. Set exactly one of `file` (one doc) or `dir` (a tree). Binds no dataset and renders full-bleed. **Span:** min 6, recommended 12, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ---------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `file` | `string` | no | path to a single document under data/ or docs/ — mutually exclusive with `dir` | | `dir` | `string` | no | path to a directory under data/ or docs/ whose files are browsable and editable — mutually exclusive with `file` | | `include` | `array of string` | no | globs of files to surface when `dir` is set; defaults to markdown (\*\*/*.md, \*\*/*.markdown) | | `csv` | `boolean` | no | also surface .csv files (an editable table — cells and row add/delete; read-only when `readOnly`) when `dir` is set | | `readOnly` | `boolean` | no | disable editing/saving — a viewer only | | `groups` | `array of object` | no | virtual folders grouping scattered files; only meaningful with `dir` | ### `form.entry` [#formentry] A data-entry form card bound to a manifest `action` — renders one typed input per action field, with a submit button in the bottom-right that inserts a row; the bound dataset's islands then refresh live. The human-facing mirror of the agent's runActions insert: it reuses the action's typing and so binds no dataset of its own. **Span:** min 3, recommended 5, max 8 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ------------- | ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `action` | `string` | yes | name of a manifest `actions` entry this form writes to; the form's inputs are derived from that action's resolved row schema — types, enums, ranges, and defaults all come from the action | | `fields` | `array of string` | no | the action's columns to render as inputs, in this order; omit to show every insertable column. Each must be a column of the action's dataset | | `submitLabel` | `string` | no | text on the submit button; defaults to "Add" | ### `board.kanban` [#boardkanban] A full-bleed kanban board grouping rows into columns by a status/stage field — use for work queues, incidents, or pipeline stages. Pick this over `table.grid` / `status.grid` when cards should move between columns, and over `form.entry` when the interaction is reassigning an existing row rather than inserting one. Moving a card POSTs match+set through the bound update action; without `action` or with `readOnly`, the board is view-only. **Span:** min 6, recommended 12, max 12 (of 12). Omit `span` to render at the recommended width; below min or above max is a named error. | Field | Type | Required | Description | | ------------ | ----------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | `string` | no | | | `title` | `string` | no | | | `span` | `number` | no | | | `dataset` | `string` | yes | | | `key` | `string` | yes | field uniquely identifying each card — used as the match key when moving a card via the bound update action | | `column` | `string` | yes | field whose value places each row into a board column (e.g. status, stage) | | `titleField` | `string` | yes | field shown as the card title | | `columns` | `array of string` | no | ordered column values to always show (including empty ones); omit to derive columns from distinct values in the data, in first-seen order. Values present in the data but missing here still appear after the listed ones so nothing is hidden | | `details` | `array of string` | no | optional extra fields shown on each card under the title; each must be a column of the dataset | | `action` | `string` | no | name of a manifest `actions` entry with mode `update` that persists a column move (match on `key`, set `column`); omit or set `readOnly` to disable moves | | `readOnly` | `boolean` | no | disable drag/keyboard moves — a viewer only; default false when `action` is set | ## Custom islands [#custom-islands] When no built-in fits, register a renderer in the user's project under `components/custom//`; the directory name is the island type. An unknown island `type` is accepted as a custom island: with a `schema.ts` its manifest config is validated by the same machinery that guards the built-ins; without one it renders a placeholder. See the [Custom Islands](/islands/custom) guide for the full shape. # Value formats (/reference/value-formats) A `format` is the optional display format applied to a numeric or date value. It is available on every island and spec that renders a value: `metric.kpi`, every `metric.scorecard` stat, `gauge.goal`, `table.grid` columns and details, `timeline.feed` highlight/stats/footer, and every chart's `format` (and `xFormat` on the scatter). The set is identical everywhere, so a format you learn on one island works the same on the next. `format` is distinct from `unit`: `unit` appends a free-form suffix string (`bpm`, `kcal`), while `format` controls how the number itself is rendered. Omitting `format` shows a plain number with up to two decimals (the same as `decimal`). For the field-by-field schema, see the [Manifest Reference](/reference/manifest); for where each island accepts a `format`, see the [Islands overview](/islands/overview). ## Currency [#currency] Whole units in the locale symbol, no decimals. | Format | Example | Notes | | ---------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- | | `usd` | `1234 → $1,234` | US dollar | | `eur` | `1234 → €1,234` | Euro | | `gbp` | `1234 → £1,234` | Pound sterling | | `jpy` | `1234 → ¥1,234` | Japanese yen | | `currency:` | `currency:RSD` | Any [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code — rendered in that currency's locale symbol and formatting. | ## Number [#number] | Format | Example | Notes | | --------- | ------------------ | ----------------------------------------------------------------- | | `int` | `1500.6 → 1,501` | Thousands-separated integer (rounds). | | `decimal` | `1234.5 → 1,234.5` | Thousands-separated, up to 2 decimals; same as omitting `format`. | | `pct` | `0.125 → 12.5%` | Expects a 0–1 fraction; multiplies by 100. | | `compact` | `1200 → 1.2K` | Abbreviated large numbers (`3400000 → 3.4M`). | `pct` expects a 0–1 fraction and multiplies it by 100, so `0.125` renders as `12.5%`. Pass an already-multiplied percentage (`12.5`) and you get `1,250%`. Keep the raw ratio in your data. ## Unit [#unit] | Format | Example | Notes | | ---------- | --------------- | --------------------------------------------------------------- | | `kg` | `7.25 → 7.3 kg` | Kilograms, one decimal. | | `bytes` | `1536 → 1.5 KB` | 1024-scale (B/KB/MB/GB/TB/PB); `1572864 → 1.5 MB`. | | `duration` | `90 → 1m 30s` | Input is a number of seconds; `3900 → 1h 5m`, `273600 → 3d 4h`. | `duration` reads its input as a count of seconds, and `bytes` scales in powers of 1024 (not 1000\). Convert to seconds or raw bytes in the data layer before binding. ## Date & time [#date--time] Dates and times render without a timezone, so the value matches the data's wall clock and the server and client always agree. | Format | Example | Notes | | ---------- | ---------------------------------- | -------------------- | | `date` | `2026-06-11 → Jun 11, 2026` | Day, no time. | | `datetime` | `2026-06-11 21:30 → Jun 11, 21:30` | Day and time of day. | | `time` | `2026-06-11 21:30 → 21:30` | Time of day only. | | `month` | `2026-06-11 → Jun 2026` | Month and year. | Date and time formats render with no timezone conversion: they show the wall-clock value in the data exactly as stored. That keeps SSR deterministic — the server and the browser never disagree on what a timestamp says. # Self-hosting (/self-hosting) `openislands serve` is already a long-running local app. To keep a dashboard always-on — on a home server or NAS, reachable by a remote agent — run the published Docker image. One Node process serves **both** surfaces on one port: * the **dashboard** at `/`, and * the **MCP server** over [Streamable HTTP](/mcp#running-over-http) at a single `/mcp` — one endpoint for the whole workspace, with the app picked by `oi.app(id)` inside an `execute` script. Because both share the process, an MCP edit and the live dashboard stay in lockstep: when an agent applies a change, the file watcher fires and the open page live-updates over SSE — no second service, no second port. stdio stays available for local agent configs; HTTP is the addition for remote, always-on use. This is your data on your hardware — one process, one port, one volume you mount. It is not a hosted tier or a multi-tenant service; it's the same engine you run with `serve`, packaged to stay up. ## Quick start [#quick-start] The image is published to `ghcr.io/lukaisailovic/openislands`. Mount a project workspace at `/project` — the directory holding your apps under `apps//`. `serve` scans them and serves them all in one process, whether the workspace has one app or several. ### Generate a token [#generate-a-token] The container binds `0.0.0.0` so its port is reachable, and ships with MCP **on**. MCP is a write surface (it can edit your manifest and insert rows), so the server **refuses to start** off loopback without a token. Make one: ```bash export OPENISLANDS_MCP_TOKEN=$(openssl rand -hex 32) ``` Running dashboard-only with no agent write path? Skip the token and set `OPENISLANDS_MCP=0` instead (see [Security](#security)). ### Run it [#run-it] With Docker directly: ```bash docker run -d --name openislands \ -p 127.0.0.1:4321:4321 \ -e OPENISLANDS_MCP_TOKEN \ -v "$PWD/my-dashboard:/project" \ ghcr.io/lukaisailovic/openislands:latest ``` Or with Compose — drop this `docker-compose.yml` next to a `./project` directory and bring it up: ```yaml title="docker-compose.yml" services: openislands: image: ghcr.io/lukaisailovic/openislands:latest container_name: openislands restart: unless-stopped ports: - "${OPENISLANDS_BIND:-127.0.0.1}:${OPENISLANDS_HOST_PORT:-4321}:4321" environment: OPENISLANDS_MCP_TOKEN: ${OPENISLANDS_MCP_TOKEN:-} volumes: - ./project:/project ``` ```bash docker compose up -d ``` The mounted `/project` must be **writable by uid 1000** — the container runs as a non-root `node` user and writes app state under `.openislands/` there. ### Open it [#open-it] Visit [127.0.0.1:4321](http://127.0.0.1:4321). Edit a file under the mounted project and the page live-updates, exactly like local `serve`. ## Configuration [#configuration] Everything is environment-driven (CLI flags win if you also pass them): | Variable | Default | What it does | | ------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `OPENISLANDS_BIND` | `127.0.0.1` | Host interface the port maps to. Set `0.0.0.0` to reach it across your LAN/NAS *(compose only — the host side of the port mapping)*. | | `OPENISLANDS_HOST_PORT` | `4321` | Host port that maps to the container's `4321` *(compose only)*. | | `OPENISLANDS_MCP` | `1` | `1`/`true` mounts the MCP HTTP endpoint. Set `0` for a dashboard-only container. | | `OPENISLANDS_MCP_TOKEN` | *(unset)* | Bearer token required on MCP requests. Required to bind off loopback with MCP on. | | `OPENISLANDS_PORT` | `4321` | Port the server listens on **inside** the container. | | `OPENISLANDS_HOST` | `0.0.0.0` | Interface the server binds **inside** the container. Leave as is. | | `OPENISLANDS_ALLOWED_IPS` | `*` (all) | IP allowlist for the whole port — comma-separated exact IPs and IPv4 CIDRs (e.g. `192.168.1.0/24`). Loopback is always allowed; unset means any host that can reach the port may connect. | ## Security [#security] Two boundaries, both yours to set: * **The port mapping is the network boundary.** It defaults to `127.0.0.1`, so nothing is exposed beyond the host until you set `OPENISLANDS_BIND=0.0.0.0` (or publish the port directly with `docker run -p`). * **The token is the auth boundary on the MCP write surface.** Binding off loopback with MCP on **requires** `OPENISLANDS_MCP_TOKEN` or the server exits with a clear error — loopback alone is local trust (parity with stdio), but a write surface on the network is not. Generate one with `openssl rand -hex 32`. * **The IP allowlist is the network ACL on the runtime port.** Once the port is reachable across your LAN, `OPENISLANDS_ALLOWED_IPS` decides which client IPs may connect at all — it gates the dashboard, the API, server functions, and `/mcp` alike, before any handler runs. It defaults to allow-all and always permits loopback. It's an ACL, not authentication: for real per-user auth, front the container with a reverse proxy (Caddy/nginx). To expose OpenIslands on your LAN or NAS, set **both** `OPENISLANDS_BIND=0.0.0.0` **and** `OPENISLANDS_MCP_TOKEN=$(openssl rand -hex 32)`. Lock it to just your devices with `OPENISLANDS_ALLOWED_IPS=192.168.1.0/24` (your LAN subnet). Want the dashboard reachable but no agent write path at all? Set `OPENISLANDS_MCP=0` and the container boots token-free — the `/mcp` endpoint is simply not mounted. ## Connecting an HTTP MCP client [#connecting-an-http-mcp-client] Point an HTTP-aware MCP client at the single `/mcp` endpoint — `http://:4321/mcp` — and pass the token as a bearer header. One endpoint hosts the whole workspace; inside an `execute` script the client picks the app with `oi.app(id)` (omit the id when there's only one), and `oi.listApps()` enumerates them. A client that takes a server URL — for example Nous Research's Hermes Agent, via its `url:` server config — connects like this: ```jsonc { "mcpServers": { "openislands": { "url": "http://:4321/mcp", "headers": { "Authorization": "Bearer " } } } } ``` A missing or wrong token returns `401`. The same Code Mode surface (the `execute` tool + the `oi` API) and read-many/write-one safety posture from the [MCP page](/mcp) apply — the transport is the only thing that changes. App ids never appear in the URL, so the single `/mcp` endpoint serves every app in the workspace. ## Image tags [#image-tags] | Tag | Platforms | Use | | --------------------------- | ---------------------------- | ------------------------------------------------------------------------- | | `:latest`, `:X.Y.Z`, `:X.Y` | `linux/amd64`, `linux/arm64` | The artifact to deploy. ARM builds cover ARM NAS boxes and Apple silicon. | | `:main`, `:sha-` | `linux/amd64` | Rolling build of the tip, for tracking development. | ## Related [#related] * [MCP Server](/mcp): the tool surface and safety posture, identical over HTTP. * [CLI](/cli): `serve --mcp` runs the same thing without Docker.