Apps · runtime

Hosting, leases and the bridge.

Installed apps are not trusted shell code. The platform authorizes a launch for a live account, gives the window a short-lived lease and exposes only declared bridge methods.

10 min readUpdated 26 November 2026rumahl.bridge.v1

Catalog and launch authority

The catalog is bounded and session-filtered. A launch is authorized again for the live account, installation and grants; an installation that was removed cannot authorize a replacement.

RoutePurpose
GET /api/v1/shell/appsBounded, session-filtered app catalog
POST /api/v1/shell/apps/{id}/launchAuthorize launch and return a frame URL plus short-lived lease
GET/POST /api/v1/shell/apps/{id}/runtimeRead runtime state or send a runtime action
POST /api/v1/shell/apps/importImport a verified package
POST /api/v1/shell/capabilities/invokeInvoke a declared capability through the platform

A launch response carries a frame URL, a lease and a renewal interval. The shell refreshes the catalog on snapshot revisions and at a regular interval, failing closed on errors. Web and container apps launch through the frame route. Native apps are headless and use the runtime route to start and stop their sandbox instead.

Web isolation and leases

  • Each installation uses <installation-uuid>.<RUMAHL_APP_HOST_SUFFIX>, normally apps.<shell-host>.
  • Assets are served under /launch/<256-bit-random-lease>/<manifest-path>.
  • A lease is bound to one session and installation, expires after 90 seconds without renewal and lives in memory only.
  • The iframe uses sandbox="allow-scripts" without allow-same-origin.
  • App hosts never route to shell APIs and strip cookies and Authorization.
  • Apps receive no shell session token or broad platform bearer credential.

The bridge protocol

Web apps reach the shell only through window.postMessage using rumahl.bridge.v1. The channel is bound to the frame’s contentWindow; event.origin is "null" for a sandboxed app. Container apps are served on their installation host through the app-host proxy and do not receive a general action bridge. Native apps are headless and have no bridge channel in this release.

MethodPurpose
os.infoBounded shell and app information
os.theme.get / os.theme.changedRead and follow the semantic OS palette
os.settings.get / os.settings.setRead or write the app’s own manifest settings
os.notificationSend a user notification
os.window.*Close, minimize or focus the app window
os.capabilities.invokeInvoke another installed app’s declared capability
os.warnings.*Register, publish, test or clear OS weather warnings
os.files.request / read / writeConsented personal-file access
os.settings.get / os.settings.setRead or write the app’s own settings
os.net.requestBrokered HTTP(S) request to a consented origin
pets.*Optional pet interaction surface
hosted app
import { connectRumahlBridge } from "@rumahl/bridge-client";

const rumahl = connectRumahlBridge();
await rumahl.ready();

// Providers register one handler per declared capability.
rumahl.provide('com.example.notes.search', async (invocation) => {
  const query = String(invocation.resource?.key ?? '').toLowerCase();
  return notes
    .filter((note) => note.title.toLowerCase().includes(query))
    .map((note) => ({ id: note.id, title: note.title }));
});

The app-side bridge client ships with the shell contracts. It binds messages to the current frame and refuses methods the app did not declare. The same client exposes settings, network, theme and window helpers.

Capabilities and channels

The capability registry is derived from installed apps. The platform grants each capability to existing accounts at install, but a grant still needs a live session and installation when it is used.

  • A web provider is reached through its frame; an always-on service can connect over the persistent rumahl.channel.v1 loopback channel with a hello/token handshake.
  • Deliveries wait for the bridge handshake so provider registration is not raced.
  • Theme changes are pushed to apps and streamed services as --rumahl-* variables.
  • Standalone services can be embedded through the same-origin stream proxy under /api/v1/shell/streams/{id}/.

Settings and brokered network

Apps that declare com.rumahl.os.settings persist manifest values bound to the installation. Apps that declare com.rumahl.os.network ask the platform to perform an HTTP(S) request to an origin the user approved for that installation.

  • Settings: GET/PUT /api/v1/shell/apps/{id}/settings.
  • Consent and file access: /apps/{id}/grants and /apps/{id}/files/content.
  • Network consent: GET/PUT/DELETE /apps/{id}/network/consent.
  • Brokered request: POST /apps/{id}/network/request.
  • The broker allows HTTP(S) only, follows no redirects, refuses link-local targets and never sends cookies.

Runtime publication boundary

Web: assets are published under $RUMAHL_STATE_DIR/app-assets/<installation-uuid>/<manifest-path> and contain public assets only. The iframe is sandboxed without same-origin access.

Container: the signed image archive is staged by the runtime supervisor, the container runs on a per-installation network without a published host port, and the root broker points nginx at the container’s private address. The app host sets a __Host- launch cookie and redirects to the declared endpoint; shell cookies and credentials are not forwarded.

Native: the signed executable is staged by the supervisor and runs headless in a bubblewrap sandbox. There is no frame, no app-host route and no bridge. The app gets only its private /data directory and an isolated network unless the manifest requests egress.

Next