Plan

Napplets in Flotilla

Communities on Flotilla install apps on their relay. An app can add a content type such as wiki pages or tasks, appear as an item in the space menu, or take over a room. Apps are napplets (NIP-5D), so each one is built once and runs in any space and in any compatible shell. This page summarizes the plan, and each area has its own page.

Pages9 area and background pagesStatusProposal30 Nov 2026

What gets built#

  • Content types. A napplet declares the kinds it handles and the surfaces it renders for them: a create form, an edit form, a detail page, a list page and the content of an item. Flotilla puts each surface where its native content types already go: the compose menu, the space menu, chat cards and detail routes. Comments, reactions, zaps, bookmarks and unread counts stay native around the napplet's content.
  • Pinned apps. A napplet with a parameterless open intent becomes an item in the space menu when an admin pins it.
  • App rooms. A room whose metadata names a napplet runs the app beside the room's chat.
  • Directory. Each space lists the napplets its relay holds. Members open them with consent, and admins pin from the list.
  • Installing. Admins of hosted relays install apps and bundles from the hosting panel. Admins elsewhere pin from the directory.
  • Links and cards. A napplet shared in chat shows as a card, and a link to one opens it outside any space.

Decisions#

These hold across every area page.

  • Napplets run in a scope: global, a space, or a room. Flotilla enforces the scope, and the proposed context NAP tells the napplet which space or room it serves, so the same build works in every space.
  • Kinds go in the intent: napplet:kind-1068/view names the detail surface for kind 1068. Admin pins decide whether an app appears, and its intents decide where.
  • Admins install apps per space. A pin names an exact version.
  • Apps installed by admins run without prompts inside their own space, for actions that stay in the space. Posting as the user goes through Flotilla's delayed send with an undo toast that names the app.
  • Napplets never receive event signatures.
  • Flotilla embeds napplets through a static host page with its own CSP.
  • Welshman gets a host core written from scratch, @welshman/napplet. It reuses Kehto only for verification and frame preparation.

One build for every space#

A napplet doesn't need to be built for a particular space. Building per space would also be harmful: each build would have different bytes and so a different identity, which rules out a shared catalog, shared caches and one update for every space.

Instead, the shell runs each instance in a scope and rewrites its requests. NAP-RELAY already lets the shell choose relays when a request names none, so this "single relay mode" is shell policy, and it can differ between shells. The napplet learns where it runs from a proposed context NAP, whose context.get() returns one string: the relay URL for a space, or url'h for a room. A napplet that wants names or pictures loads the relay's NIP-11 document or the room's metadata itself.

Napplet callWhat the shell does in a room scope
relay.subscribe for kind 30818Sends it to the space relay with #h set to the room
outbox.publish(template)Adds the room's h tag, publishes to the space relay only, through the delayed send
relay.subscribe naming another relayRefuses it
outbox.query for kind 0 profilesUses normal outbox routing, since profiles are public and live outside the space
context.get()Returns wss://relay.example.com'game-night
storage.setItemStores the value under the napplet, the user and the space

Two specs need changes for this to be compliant. NAP-OUTBOX publishes to the user's own write relays by default, which would leak a private space's posts. NAP-STORAGE keys storage by artifact hash and has no space partition. The spec page covers both, and the trust model covers what each scope allows.

Architecture#

LayerWhereResponsibilityPage
Upstream specsNIP-5D and napplet/napsKind intents, a context NAP, unsigned events, stable storage keys, app listsspec
Host pageNew dependency-free package, bundled by each shellNapplet frame, port handoff, teardown signals, CSP floorhost
Host core@welshman/nappletVerification, sessions, dispatch, scopes, policies, intent routingcore
Welshman glueNapplets plugin in @welshman/appDomain handlers built on welshman's network, router, publisher and profilesglue
Flotilla core glueapp/tools/nappletsFlotilla's policies, storage, theme, intent handlers and hooksglue
Flotilla UIcomponents, routes, areas/spacesContent types, pinned apps, app rooms, directory, cards, consentflotilla
Hosting and relayHosting panel, hosting backend, zooidInstalling apps, Blossom mirroring, relay-signed app lists, kind policyhosting
First-party nappsSeparate repositoriesAuthoring kit and the built-in appsnapps

A publish from an app installed in a room takes this path.

Napplet
MessagePort
outbox.publish(template)
Session
@welshman/napplet
Identifies the napplet and its room scope
Policy
app/tools/napplets
Installed by admins in this space, kind declared: allow
Handler
Napplets plugin
Adds h, removes other relays, signs
Publish
PublishBuilder
Delayed send with an undo toast, to the space relay

The host page only sets up the channel. After the handoff, the napplet's port talks to Flotilla directly.

Milestones#

MilestoneDeliversDone when
M0CardsManifest kinds and reader in welshman. Manifest cards and links in Flotilla. Spec conversations open.No napplet code runs.
M1RunHost page. @welshman/napplet with identity, theme and reads. Apps open from cards and links in global scope behind ENABLE_NAPPLETS.@napplet/conformance passes, and the host page works in both Capacitor WebViews.
M2SpacesScopes, storage, publishing with undo, the directory, admin app lists, pinned app items, Settings → Apps.Nothing a scoped app publishes leaves its space. A third-party napplet runs in a space.
M3Content typesContent surfaces, compose menu items, list and detail routes, fallback items. A Polls napp, then Wiki.The Polls napp matches native polls.
M4HostingInstall, update and remove from the hosting panel. Blossom mirroring, relay-signed app lists, kind policy, bundles.Install, use, update and uninstall on a hosted relay.
M5Rooms and badgesApp rooms and notify badges.Relays keep a napplet tag in room metadata.

Upstream proposals run alongside every milestone. Most of the behavior Flotilla needs is shell policy that today's specs already allow, such as choosing relays and dropping signatures, so it ships before the proposals merge. The kind intents and the context NAP are Flotilla conventions until upstream accepts them. Kind intents already fit today's intent grammar.

Areas beyond the original list#

  • Trust model. Scopes, grants, pins and data minimization touch every layer, so they have one page.
  • Relay support. Zooid has to accept installed apps' kinds, sign app lists, store mirrored artifacts and keep a room's app tag. This is on the hosting page.
  • First-party napps and the authoring kit. Someone has to build the apps the hosting panel offers, and a development mode lets authors load an unsigned napplet in a Flotilla dev build. Both are on the napps page.
  • Mobile. The host page has to work in Android's WebView and iOS's WKWebView before the flag turns on for mobile. That is a gate for M1.
  • Activity, search and moderation. Custom kinds need unread counts, search through their alt tags, and admin deletion. Flotilla's existing hooks and event menu cover these, as described on the Flotilla page.

Open questions#

QuestionRecommendationPage
How does a pin name a version with the author's signature?Pin author-signed snapshots (kind 5129), and have the napplet CLI publish one on every deploy.spec
Where does the host page package live?Build it without welshman dependencies in the welshman monorepo, and offer it to the napplet org once its API settles.host
Does a space scope include content posted in rooms?Match Flotilla's native list pages for the same surface.flotilla
Who signs app lists on relays the platform doesn't host?Space admins, verified against the space's roles.hosting
Which kinds do new content types use?Existing NIP kinds where they fit. New kinds get a NIP draft before they ship in a bundle.napps
Are napplets on iOS?Off at first, like hosting and paid spaces.flotilla

Risks#

RiskMitigation
Upstream rejects the context proposal, and Flotilla's napps only run in FlotillaPropose early and keep each proposal small
The napplet packages keep breaking, with 47 releases of @napplet/core since AprilDepend on few modules and pin them exactly
An admin-installed app misuses prompt-free publishingPins name exact versions, scopes confine publishing, and every post has an undo window
Many frames make mobile slowItems in chat render from alt text without a frame, and frames are limited to forms, pages and rooms. Rendering items natively is outside napplets' scope.
App Review rejects napplets on iOSKeep napplets off on iOS, as hosting and paid spaces are