---
title: The extension contract
summary: What SpaceMIX promises extension developers: what the contract consists of, how it is versioned, what may change and how, what you may rely on, and what is still open before we freeze it.
audience: both
stability: stable
since: protocol 1
---

# The extension contract

This page is our promise to people who build extensions for SpaceMIX. It says what the contract between an extension and SpaceMIX consists of, how it is versioned, what we will and won't change, and how we will tell you. It is also honest about what we haven't settled yet.

## The promise

**An extension that works today, using only what these docs mark `stable`, keeps working without a rebuild on every SpaceMIX release that speaks protocol 1.** Within protocol 1 we only add to the contract. The rename to SpaceMIX is the one exception, made before anything was in production: see [Versions](#versions). When something has to go, we deprecate it first, keep it working for at least 12 months, and remove it only in a new protocol version. A host that speaks a new protocol will keep running packages built for protocol 1 for at least 12 months after that protocol ships.

Today a package doesn't say which protocol it was built for (see [Open questions](#open-questions-before-we-freeze)). Until it can, a new protocol version can't tell old packages apart, so in practice **we will not make a breaking change at all** until the manifest carries that information, the rename's [one-off exception](#versions) aside.

"Works" means: does what these pages say it does. If the code and these pages disagree, the pages describe what we promise, and we fix the code. The changelog says when we do.

## What the contract consists of

| Part | Defined in | Documented in |
|---|---|---|
| The manifest: identity, permissions, collections, actions, events, notification kinds, search | `ExtensionManifest` and friends in `packages/sdk/src/index.ts` | [Manifest](reference/manifest.md) |
| Permission strings and what each unlocks | `Permission`; the `need` checks in `apps/desktop/src/lib/extensionHost.ts` | [Permissions](reference/permissions.md) |
| The package format: `ExtensionPackage`, its hash, the bundle's module shape, `HOST_MODULES`, CSS and tokens | `packages/sdk/src/index.ts`, `scripts/build-extensions.mjs`, `apps/desktop/src/lib/extensionBuild.ts` | [Package format](reference/package-format.md) |
| The `host` object and every `host.*` API | `packages/sdk/src/index.ts`, `runtime.ts`, `widgets.ts`, `widgetLayout.ts`, `media.ts` | [Host API](reference/host/index.md) |
| React hooks, `@spacemix/sdk/react` | `packages/sdk/src/react.ts` | [React hooks](reference/react.md) |
| The UI kit `@spacemix/ui` and the design tokens in `tokens.css` | `packages/ui/src/` | [UI kit](reference/ui.md) |
| Widgets | `packages/sdk/src/widgets.ts`, `widgetLayout.ts` | [Widget reference](reference/widgets.md) |
| Projects: one item inside an extension that a project links to | `ProjectItem` in `packages/sdk/src/index.ts` | [Projects](reference/projects.md) |
| The widget frame that saved widgets run in: its document and CSP, its messages, the `spacemix` global and `spacemix.ui`, the `op-*` classes and `--op-*` variables, `WIDGET_FRAME_VERSION` | `apps/desktop/src-tauri/src/widget_frame.html`, `src-tauri/src/widget.rs`, `packages/sdk/src/widgets.ts`, `WidgetFrame` in `packages/sdk/src/react.ts` | [The widget contract](reference/widgets.md#the-widget-contract) |
| The frame: sandbox, CSP, lifecycle, the wire between frame and host, `PROTOCOL_VERSION` | `packages/sdk/src/protocol.ts`, `runtime.ts`, `apps/desktop/frame/main.tsx`, `src-tauri/src/ext_frame.rs` | [Frame protocol](reference/protocol.md) |
| What the assistant gets from your manifest: tool names, tool shapes, approval defaults, collection events | `apps/desktop/src/lib/tools.ts`, `lib/data.ts`, `collectionEvents` | [Manifest](reference/manifest.md) |
| The registry API in SpaceMIX Hub, `/v1/registry/*`, and package signing | `packages/sdk/src/registry.ts` | [Registry](reference/registry.md) |

Everything a reference page marks `stable`, as a whole page or one section of it, is covered by the promise. `experimental` and `internal` items are not; see [Stability labels](#stability-labels).

## Versions

There are six version numbers. Each guards something different.

| Version | Today | Guards | Checked where |
|---|---|---|---|
| `PROTOCOL_VERSION` | `1` | The wire between the host and the frame runtime, and the protocol line this promise is made for. | The frame runtime refuses an `init` with a different number. The host doesn't check yet. |
| `PACKAGE_FORMAT` | `2` | The shape of `ExtensionPackage` and how a bundle is loaded (`HOST_MODULES`, `__opExtension`). | Install, publish, the Studio, and every registry download refuse any other format. |
| `WIDGET_FRAME_VERSION` | `3` | The widget frame surface saved widgets depend on: the document, its CSP and sandbox, its messages, `spacemix`, `spacemix.ui` and its options, the `op-*` classes and `--op-*` variables; also the grid constants and `WIDGET_TOKEN_RE`. | `npm run docs:check` fails on any removal or change against the `widgetFrame` section of the snapshot; `npm run docs:update` refuses to record one unless this moved (for the grid constants and `WIDGET_TOKEN_RE`, also `PROTOCOL_VERSION` or the SDK's breaking line). The frame reports it as `spacemix.version`. |
| `@spacemix/sdk` | `0.3.0` | The types, `host`, the helpers and hooks extension code calls. | Not checked: the bundle runs against whatever SDK the host provides. |
| `@spacemix/ui` | `0.2.0` | Components and design tokens. | Not checked, same as the SDK. |
| Your manifest's `version` | yours | Your extension, as other people and extensions see it. | Publishing needs a higher version than every one before it. |

The registry API is versioned in its path: `/v1/registry`.

How they move:

- **`PROTOCOL_VERSION`** changes only for a breaking change. Additive changes (a new message `type`, a new optional field, a new method or channel) keep it at `1`. `FrameInit.route` is an example: it was added as an optional field, and a host that doesn't send it means `""`.
- **`PACKAGE_FORMAT`** changes only when the package shape or the way a bundle is loaded changes incompatibly: a host module removed, a global renamed, a new major version of React, `lucide-react` or `motion`. Adding a host module doesn't change it.
- **`WIDGET_FRAME_VERSION`** changes only for a breaking change to the widget frame, and the new frame must keep widgets saved for the old version rendering: they are stored as HTML and never rebuilt. Frame 3 (the SpaceMIX rename) is the one exception: saved widgets were carried over by a one-time migration. A new `spacemix.ui` helper, option, class or message to the frame keeps it where it is. The frame's CSP, sandbox and navigation limits may be tightened for security without a bump (with a changelog entry); loosening them, or a new message from the frame that the parent acts on, needs a security review and a bump. See [The widget contract](reference/widgets.md#the-widget-contract).
- **The SDK** follows semver. While it is `0.x`, a minor release (`0.3.0` → `0.4.0`) only adds, and a patch release only fixes. A breaking SDK release would be `1.0.0` or later and would come with a new protocol version.
- **The UI kit** follows the same rules as the SDK.

**One-off exception: the rename to SpaceMIX.** Renaming the product broke the SDK and the UI kit in a minor release (`@spacemix/sdk` `0.3.0`, `@spacemix/ui` `0.2.0`) and kept `PROTOCOL_VERSION` at `1`, because nothing was in production yet and the owner approved it. It also changed what a package's `hash` is computed over, under `PACKAGE_FORMAT` `2`: length-prefixed fields, with the canonical manifest among them. Widgets saved before it are rewritten by a one-off migration rather than kept rendering. This exception covers only that rename: every later breaking change follows the rules above, including `1.0.0` and a new protocol version for the SDK.

## How your code meets the host

The most important fact behind these rules: **your bundle doesn't contain the SDK, React or the UI kit.** It imports them, and the frame hands it SpaceMIX's own copies as globals (`HOST_MODULES`). `host`, `defineExtension`, `useCollection`, `Button`, `useState`: all of them are whatever version the server you're running on ships.

That has two consequences.

- **Old bundle, new host.** A bundle built against SDK 0.3.0 runs against SDK 0.4.0 next year without being rebuilt. That only works if 0.4.0 still has everything 0.3.0 had, with the same meaning. This is why every change to the contract must be additive.
- **New bundle, old host.** A bundle built against a newer SDK can run on a server that hasn't updated. A method added in 0.4.0 is missing there. The manifest can't declare a minimum yet, so test for what you use: `if (host.tools)`, `typeof host.view.focused === "function"`. Optional APIs (`host.fs`, `host.net`, …) are absent when the permission isn't approved, too.

## Compatibility rules

### Additive: allowed within protocol 1

- New `host.*` APIs and methods, new optional arguments at the end, new fields in results.
- New optional manifest fields, new optional fields in declarations (`CollectionDefinition`, `ActionDefinition`, …).
- New permission strings. An existing extension doesn't have them and is unaffected.
- New `HostToFrame` and `FrameToHost` message types, new optional fields in messages, new bridge methods, new subscription channels. Each side ignores what it doesn't know.
- New exports from `@spacemix/sdk`, `@spacemix/sdk/react` and `@spacemix/ui`; new design tokens; new host modules.
- New registry routes, new optional request fields, new response fields.
- Raising a limit or a timeout.
- Fixing behavior that contradicts these docs.

### Breaking: needs a new protocol version, a changelog entry, and the deprecation period

- Removing or renaming a `host` API, method, type, field, export, component, design token or host module.
- Changing a signature, a type, a default or the meaning of anything documented. Defaults count: `requireApproval` defaulting to `["delete"]`, `list` tools defaulting to 20 items, `searchFields` defaulting to every string field, the names and payloads of collection events.
- Making something optional required, in the manifest, in a call or in a message.
- Rejecting something that was accepted: tighter checks in `defineExtension` (which runs from the host's SDK, so a tighter check would stop old bundles from loading), on install, on publish, or in argument validation.
- Starting to enforce a permission that was declared but not enforced (`storage` today).
- Removing a permission string, or making one grant less.
- Changing how tool names are derived (`<ns>_<collection>_<op>`, `<ns>_<action>`), how `<ns>` is derived, or the hash input.
- Removing a message type, a method, a channel, or changing the shape of a field on the wire.
- A new major version of a host module (React, `lucide-react`, `motion`).
- Tightening the extension frame's sandbox or CSP in a way that stops documented code from working. (The widget frame's CSP and sandbox may be tightened at any time; its other changes go by `WIDGET_FRAME_VERSION`, see [The widget contract](reference/widgets.md#the-widget-contract).)
- Lowering a documented limit or timeout.
- Removing or changing a `/v1` registry route or field.

## Deprecation

When something has to change incompatibly, we:

1. Add the replacement first, as an additive change.
2. Mark the old thing deprecated in three places: `@deprecated` in its JSDoc (so your editor shows it), a **Deprecated** note on its reference page, and an entry under **Deprecated** in the [changelog](changelog.md), with the date and what to use instead.
3. Keep it working for **at least 12 months** after that changelog entry, and in every host that speaks the protocol version it was deprecated in.
4. Remove it only in a new protocol version (or `/v2` for the registry), listed under **Removed** in the changelog.

Nothing is deprecated today.

## What you may rely on

- Every signature, behavior, default, limit and error condition a reference page documents as `stable`.
- `host` being connected before the first line of your bundle runs; `host.manifest` and `host.env` at module level.
- Your storage and collections being scoped to your extension's id, kept when the extension is uninstalled, and shared by everyone on the same server. They are erased only by the server's owner's explicit choice: deleting the extension with **Erase its data on this server**, or choosing to erase them while approving a listing that replaces a build made on this server (see [When a listing takes a build's id](reference/permissions.md#when-a-listing-takes-a-builds-id)). That is offered only for a build installed on this server from a package file, the Studio or a dev build, never for an id this server ever installed from SpaceMIX Hub or the Marketplace. See [Deleting your own build](reference/permissions.md#deleting-your-own-build).
- The tools and collection events the host derives from your manifest, with the names and shapes on the [manifest](reference/manifest.md) page.
- The modules in `HOST_MODULES` being there, at the major versions listed in [Package format](reference/package-format.md#host-modules).
- The design tokens and their utilities (`bg-surface`, `text-muted`, `border-border`, …) following the light and dark theme, and `data-theme` on `<html>` naming the theme.
- Your route being part of the app's address as `#/@<server>/<extension id>/<route>`. `@<server>` is the server's shortcode (the first 16 characters of its id), so a link opens on the same server for everyone; an address without it still opens on the active server. A link with an 8- to 15-character shortcode (links made before the shortcode grew to 16 had 8) or with a server's id from before it moved to key-based identity asks **Open this link on <name>?** before switching. A server's id, and so its shortcode, changes once, when the server moves to key-based identity, and stays the same after that, also when the server is renamed. The host writes the shortcode; extensions never build it.
- Search calling only the read-only action your manifest names in `search`, with a trimmed, non-empty `query` and a `limit`, and showing what it returns as plain text; without `search`, Search reading your collections without starting your frame. See [Being found in Search](guide/search.md).
- The frame having no scripted network access (`connect-src 'none'`), and `host.net.fetch` being the way out.
- A package with a matching hash and a valid signature being installed as published.

## What you may not rely on

- **SpaceMIX's DOM, styles or routes.** Your frame can't reach the app's document, and nothing about it is promised.
- **The storage layout.** The `kv:` prefix on storage keys, how collections are laid out in tables (one table per collection, one row per record, today), the namespace and table names, and the keys of the `stored` subscription channel are implementation details. Use `host.storage`, `host.collection`, `useStored` and `useCollection`.
- **Timing.** When a frame starts, how long a hidden frame stays alive, how many instances run (one per open window or browser tab today), the order in which instances hear an event, or how quickly a write reaches another window. Use `host.events.claim` for anything that must happen once. Likewise how often Search calls your search action, how long it waits for an answer, and how many results it shows.
- **Durability on resolve.** A resolved `host.storage.set` or collection write means the change is applied in this window and on its way to the server, not that the server has stored it.
- **Error wording.** Errors cross the bridge as strings. Show them; don't parse them.
- **Anything not documented**: other globals in the frame, the frame document's structure, the Studio's probe, the `/api/*` routes of a SpaceMIX server, the blank page at `/api/ext-page`, `@spacemix/sdk/runtime`'s `request`, `subscribe` and `connect`.
- **Fields that do nothing yet**: `ExtensionManifest.order` and `ExtensionManifest.entry` are accepted and ignored.
- **Tailwind theme variables beyond the design tokens**, and Tailwind's `dark:` variant (it follows the operating system, not SpaceMIX). See [CSS](reference/package-format.md#css).

## Stability labels

Every reference page and API carries one of three labels. A page's front matter gives the label for the page as a whole; a page can override it part by part with a Stability table or a **Stability** line per section, as the [Widget reference](reference/widgets.md#the-widget-contract) does.

- **`stable`**: covered by this promise. Changes are additive; anything else goes through deprecation.
- **`experimental`**: works and is documented, but may change in a minor SDK release without the deprecation period. Each experimental item says why. Today:
  - camera, microphone and screen capture (the `camera`, `microphone` and `screen` permissions, `media.*` and `MediaWire`): the capture proxy hasn't been tested with real devices in every browser ([Media](reference/host/media.md));
  - `host.git`: not yet exercised against many hosts ([Git](reference/host/git.md));
  - `host.chat`: its notifications and events are tied to one extension id, and `via` is taken from the caller ([Team chat](reference/host/chat.md));
  - `host.events`: not yet exercised live with several windows and extensions; limits may change ([Events](reference/host/events.md));
  - `host.tools`: not yet exercised live across many extensions; the `{ error }` convention is likely to change ([Tools](reference/host/tools.md));
  - `host.ai`: one completion per call, no streaming or model choice yet ([AI](reference/host/ai.md));
  - `host.mcp`: requests depend on the server's CORS policy and its host check differs from `host.net.fetch` ([MCP](reference/host/mcp.md));
  - `host.widgets` (`WidgetsApi`, `WidgetsViewApi`), the widget types, `useWidgetList`, `useWidgetFeed`, `WidgetFrame` and the widget layout helpers: built for Dashboards and Team Chat and not yet exercised live by others ([Widget reference](reference/widgets.md#the-widget-contract)). The widget frame itself, the grid constants and the widget token format are `stable`.
  - Who can use an extension (`extension:*`, `extension:<id>`, `mcp:*`, `mcp:<id>` and the `server:` permissions people hold): new, and the people-side permissions may still change; what an extension sees doesn't ([Permissions](reference/permissions.md#who-can-use-an-extension)).
  - The `@spacemix/ui` components added with the design system, by module: `layout.tsx` (`Page`, `Stack`, `Grid`, `SplitView`, `ListDetail`, `SidebarLayout` and the rest of [Layout](reference/ui/layout.md)), the actions in `components.tsx` (`IconButton`, `ButtonGroup`, `SegmentedControl`, `Toggle`, `CopyButton`, `Link`, `Spinner`, [Actions](reference/ui/actions.md)), `forms.tsx` and `field.ts` ([Forms](reference/ui/forms.md)), `popovers.tsx` ([Pickers](reference/ui/pickers.md) and [Overlays](reference/ui/overlays.md)), `floating.ts` and `host.ts` (the floating helpers and `PortalContainer`), `data.tsx` ([Data display](reference/ui/data-display.md)), `charts.tsx` ([Charts](reference/ui/charts.md)), `navigation.tsx` ([Navigation](reference/ui/navigation.md)), `feedback.tsx` ([Feedback](reference/ui/feedback.md)), `types.ts` (`Size`, `Tone`) and `controllable.ts` (`useControllableState`); and the new props of the stable components (`Button`'s `size`, `loading`, `leftIcon`, `rightIcon`, `fullWidth` and `"danger"` variant; `Input`'s `size` scale, `invalid`, `leftIcon`, `rightIcon`, `leftAddon`, `rightAddon` and `htmlSize`; `PageHeader`'s `title` and `subtitle` as nodes and `below`; `EmptyState`'s `title` and `body` as nodes, optional `body`, `size`, and `className`, `ref` and the other `<div>` props; `Kbd`'s and `Markdown`'s `className`; `ConfirmDialog`'s `title` as a node): new in this release, and names and props may still be adjusted before they are promised. The components that were there before and the design tokens stay `stable`; `ButtonVariant`, exported for the first time in this release, is `stable` and may gain members ([UI kit](reference/ui.md#stability)).
  - `host.view.setFullscreen` and `host.view.fullscreen`: the shell's ways out of full screen may still change; the two methods and what they mean won't ([Full screen](reference/host/view.md#full-screen)).
  - The paid Marketplace (`/v1/market/*`, `Listing.price`, `VersionInfo.paid`, `UpdateInfo.paid`, the Marketplace types in `packages/sdk/src/registry.ts`, the `402` `payment_required` download, the server's signed requests) and what a server does with an extension until it's paid for: new, and not yet exercised with real payments; prices, the grace period and the signed-request format may still change. A free extension sees none of it ([Marketplace](reference/market.md), [Turned off until it's paid for](reference/permissions.md#turned-off-until-its-paid-for)).
  - `ProjectItem`: there is no `host.projects` API yet to hand it over; the type may grow but its fields won't change meaning ([Projects](reference/projects.md)).
  - The SpaceMIX API (`/api/v1`, API keys and their scopes): new, server surface rather than extension surface, and not yet exercised by many integrations. What an extension sees of it (`ctx.via` with `extension: "ai.spacemix.api"`, events and notifications with `source: "api"`) follows the pages it is on ([SpaceMIX API](reference/api.md)).
- **`internal`**: visible in the code but not for extensions. It can change or disappear at any time.

## Your extension's own contract

Your manifest's `version` is your promise to the people and extensions that depend on you. Automations call your tools by name and react to your events by type; other extensions read your event payloads. Treat removing or renaming a collection, field, action or event, or tightening a schema, as a major version. Adding a permission makes an update from the registry wait until someone who manages extensions on the server (the owner, or a member with `server:extensions`) approves it; a local install applies at once only for whoever it runs for: the owner's for the team, and a member's own build only for its builder, until the owner approves it for the team (see [How far a member's build reaches](reference/permissions.md#how-far-a-members-build-reaches)). See [Manifest versions](reference/manifest.md#versions).

## Known gaps in protocol 1

These are true today and documented as they are. They are part of what we must settle before we freeze the contract.

- `storage` is declared but not checked: storage and collections work without it.
- `data:<ns>:read` and `data:<ns>:write` are accepted and shown in the store, and grant nothing.
- `order` and `entry` in the manifest are ignored.
- `defineExtension`'s checks run when the bundle loads in a frame and in the Studio, not in the build script or on install, so a package can install and then fail to load.
- The bridge and the core match `net:` permissions slightly differently (bare domains for `net:*.<domain>`, ports for `net:<host>`); the core's stricter rule applies to `host.net.fetch`, the bridge's looser one to MCP.
- A package's CSS can use Tailwind theme variables the frame doesn't define.
- Errors have no codes.
- A widget on a dashboard or in a Team Chat card, in the desktop app as in the browser, can navigate its frame to any URL and leak what it puts in that URL, and a page that never finishes loading keeps a bridge to every installed extension's read-only tools; see [Widgets: Known gaps](reference/widgets.md#known-gaps).
- `RTCPeerConnection` isn't covered by the CSP, so a widget may leak data over WebRTC (STUN, DNS) in any engine; untested. See [Widgets: Known gaps](reference/widgets.md#known-gaps).
- The site behind a widget's [web source](reference/widgets.md#web-sources) sees when and how often the widget is viewed, and `host.widgets.refresh` lets an extension with `widgets:view` make it fetch, a slow timing channel to that site. See [Widgets: Known gaps](reference/widgets.md#known-gaps).
- The same holds for every extension frame: `RTCPeerConnection` works in an extension's view (calls between people use it, see [Media](reference/host/media.md)) and the CSP doesn't cover it, so an extension can send data over WebRTC without a `net:` permission. Neither the egress log nor the network switch covers it (see [What the server logs](reference/host/net.md#what-the-server-logs-and-the-network-switch)).

## Open questions before we freeze

Each of these would be hard to change once third parties depend on the current behavior. We intend to answer all of them, additively where possible, before declaring protocol 1 frozen.

1. **The manifest declares no target.** A package doesn't say which protocol, package format or SDK version it was built for (`ExtensionManifest`, `packages/sdk/src/index.ts`). Without it, no future host can run old and new packages side by side, and no old host can refuse a package that needs a newer one. Proposal: an optional `sdk` (or `protocol`) field the build fills in, and a minimum the host checks; missing means protocol 1.
2. **Extensions can't see the host's version.** `HostEnv` has no protocol or SDK version, so feature detection is the only option. Proposal: add `host.env.protocol` and `host.env.sdk`.
3. **Host module versions aren't pinned per protocol.** React, `lucide-react` and `motion` come from the host. A `lucide-react` minor release that removes an icon would break bundles importing it. Proposal: pin the majors per `PACKAGE_FORMAT` and keep removed icons as aliases.
4. **Tailwind theme variables.** Package CSS references variables (`--container-3xl`, `--text-xl`, `--color-amber-500`) that exist in the frame only if SpaceMIX's own frame code uses the same utility (`apps/desktop/frame/styles.css`, `scripts/build-extensions.mjs:165`). The set changes whenever SpaceMIX's code does. Proposal: the frame defines Tailwind's full default theme, or the build emits the variables a package uses.
5. **`dark:` doesn't follow SpaceMIX's theme.** Proposal: define a `dark` custom variant on `[data-theme=dark]` in `tokens.css`; that changes what existing `dark:` classes do, so decide before freezing.
6. **`storage` enforcement.** Enforce it (breaking for extensions that don't declare it) or document it as informational for good.
7. **`data:<ns>:*`.** Implement cross-extension collection access or remove the strings from `Permission`. Removing them later is breaking.
8. **Tool name collisions.** `<ns>` is only the last segment of the id (`namespaceOf`), so `com.acme.tasks` and `ai.spacemix.tasks` collide, and the one first in navigation order wins (`apps/desktop/src/lib/tools.ts:215`). Nothing checks collisions between an action and a collection tool, or tool names over 64 characters. Proposal: detect collisions at install and refuse or prefix.
9. **One set of manifest checks.** `defineExtension`, the build script (which stubs it, `scripts/build-extensions.mjs:143`), install (`check_local`) and publish (`check_package`) check different things; ids allowed by install and the registry (`-` in the first segment) fail `defineExtension`. Proposal: one validator, run at build, install and publish. Any check added later rejects packages that were accepted, so the full set must be decided now.
10. **Errors have no codes.** Every error is a string (`protocol.ts`, `handleRequest` in `extensionHost.ts:1109`). Proposal: an optional `code` on `res` and `call-result` errors and on the rejected `Error`.
11. **The handshake has no range.** The frame requires an exact `PROTOCOL_VERSION` (`apps/desktop/frame/main.tsx:128`) and the host ignores the one in `ready` (`onMessage` in `extensionHost.ts:1134`). In a browser the frame comes from the active server, which can run another version than the page. Proposal: both sides send the range they support.
12. **`net:` matching differs between the bridge and the core** (`extensionHost.ts:501`, `src-tauri/src/net.rs:151`). Proposal: one rule, the core's, in both places.
13. **The frame CSP allows images, media and nested frames from any `http:`/`https:` host** (`src-tauri/src/ext_frame.rs:58-59`). Extensions rely on it (remote avatars, embedded editors), so removing it would break them; keeping it means data can leave the frame without a `net:` permission. Decide which we promise.
14. **Timeouts are asymmetric.** `tools.call` may wait 10 minutes in the frame, but the host gives every action 60 seconds (`extensionHost.ts:58`, `runtime.ts:26`). There is no load timeout for a frame.
15. **Storage at scale.** Collections are now stored one record per row and merged on the server, but `host.storage` values (now capped at 64 KB) are still written whole, with cross-window lost updates, and writes that resolve before they are stored (`writeStored` in `lib/useStored.ts:66`). Changing any of this changes behavior people may depend on.
16. **Partly-permissioned objects.** `host.mcp` and `host.events` are always present, but most of their methods need a permission, and a refused subscription only logs to the console (`runtime.ts:117`). Proposal: make the absent-when-not-permitted rule uniform, or have `subscribe` report failure.
17. **The storage layout leaks through the `stored` channel.** Its `key` is the raw storage key, `kv:<key>` (`protocol.ts:42`, `runtime.ts:136`). Collections moved to their own `records` channel; proposal: a `storage` channel keyed without the prefix, so the layout can change.
18. **The blank page has no API.** The WordPress extension finds `/api/ext-page` from its frame's own location (`extensions/wordpress/view/editor/wpRuntime.ts:173`, `frameSrc`). Proposal: expose its URL through `host`, or keep it internal and say so in the extension.
19. **Prerelease ordering** compares prerelease tags as strings (`packages/sdk/src/registry.ts:175`, and the same on the server and the Hub): `beta.10` sorts before `beta.9`. Changing the order later could reorder published versions.
20. **Size limits disagree**: 2 MB in the Studio, 8 MB for publishing, none in the build script (`extensionBuild.ts:29`).
21. **Unused manifest fields.** `order` and `entry` are accepted and ignored. Giving them a meaning later is additive only if the meaning matches what packages already put there.
22. **A client-supplied preview stands in for the approved permissions.** The approved permissions and `net:*` grants live in the core's `installed_extensions` table (extension `spacemix`), which clients can read but not write: the records API refuses it with `installed_extensions changes only through the extension commands.` (`server_owned` in `src-tauri/src/records.rs:1404`), and the only client path to a new grant is `POST /api/extensions/grant-host`, which needs access to the extension (`grant_host` in `src-tauri/src/registry.rs:2189`). But `net.fetch` takes a `preview` from the client in place of that record (`fetch` in `src-tauri/src/net.rs:386`): someone with `server:extensions` who may use an installed extension, or who is working on an id that was never installed, can fetch as it with any `net:` permissions. Extensions can't reach this, but approving permissions is enforced for previews only in the app's UI.
23. **Install reports are unauthenticated**, so anyone can inflate install counts, and anyone signed in to some server can make that server eligible to review any extension.
24. **Chat's `via` is taken from the caller** (`src-tauri/src/chat.rs:1669-1678`), so any extension with `chat` can post "as SpaceMIX" naming another extension. Proposal: the host stamps `via.extension`, as `tools.call` does.
25. **Chat is tied to one extension id.** Its notifications and events name `ai.spacemix.chat` (`SOURCE` in `src-tauri/src/chat.rs:41`), so `host.chat` from any other extension sends people to that extension. Proposal: use the calling extension's id, or say in the contract that `chat` belongs to one view.
26. **A result shaped like `{ error: string }` becomes an error.** `tools.call` and widgets treat it as a failure (`extensionHost.ts:833`), so an action can't return that shape. Proposal: carry failures out of band before people rely on the shape.
27. **`widgets:view` reaches every extension's read-only tools.** `widgets.call` runs any read-only tool without checking the widget exists or that the tool is one of its sources (`extensionHost.ts:992`, `callFromWidget` in `widgetRuntime.ts:126`). Proposal: limit it to the widget's sources, or document `widgets:view` as read access to all extensions' data.

## Where changes are recorded

Every change to the contract, additive or not, gets an entry in the [changelog](changelog.md), with the protocol and SDK version it shipped in.
