Documentation
    Preparing search index...

    Interface ShellCapabilities

    Static capability set sent to napplet iframes through the shell.ready / shell.init handshake. Used by hosted window.napplet.shell.supports() for synchronous capability queries after the shim consumes shell.init.

    Per canonical NIP-5D (https://github.com/nostr-protocol/nips/pull/2303/), supports() distinguishes two namespaces:

    • Bare names for NAP-capability lookups, resolved against the naps array — e.g. supports('relay'), supports('identity').
    • The perm:<permission> prefix for sandbox-permission lookups, resolved against the sandbox array — e.g. supports('perm:popups'), supports('perm:modals').

    The two namespaces do not cross: a bare-name lookup never matches a sandbox entry and a perm:-prefixed lookup never matches a NAP entry.

    The released 0.13 shim no longer reads the flat naps array. On shell.init it calls @napplet/nap@0.12's createShellEnvironment(msg) + makeSupports(env), which read the STRUCTURED capabilities.{ domains: string[], protocols: Record<string, string[]> }:

    • supports('relay') → true iff 'relay' ∈ capabilities.domains
    • supports('inc','NAP-01')→ true iff capabilities.protocols['inc'] includes 'NAP-01'

    domains and protocols are emitted as a SUPERSET ALONGSIDE the naps/sandbox fields (TERM-05 back-compat). The 0.13 shim has NO special perm: logic — supports('perm:popups') is an ordinary bare-domain membership check, so kehto's perm:-prefixed sandbox entries are folded into domains (empty by default, preserving the default-empty sandbox behavior).

    interface ShellCapabilities {
        domains: string[];
        naps: string[];
        protocols: Record<string, string[]>;
        sandbox: string[];
    }
    Index

    Properties

    domains: string[]

    Conformant NAP-SHELL domain list (PRIMARY for @napplet/shim >=0.13). Bare NAP domain names the shell offers — 'identity', 'storage', 'inc', 'theme', etc. — with the same conditional entries as naps (relay/outbox when a relay pool is wired, upload/intent under their hooks). Carries NO inc:NAP-NN protocol strings (those live in protocols). Any perm:<x> sandbox entries are appended here too, since the 0.13 shim resolves supports('perm:<x>') against this list.

    Read by createShellEnvironment(msg).capabilities.domainsmakeSupports for supports('<domain>') queries.

    naps: string[]

    NAP-vocabulary domain entries the shell handles (PRIMARY — consumed by @napplet/shim >=0.9.0). Bare domain inc (the NAP rename of inc) plus protocol IDs inc:NAP-01..inc:NAP-06. Conditional entries: relay, outbox prepended when a relay pool is wired; upload appended when an upload backend is wired; intent appended when an intent dispatcher is available.

    Contains NO NAP-NN protocol strings (those live in protocols).

    protocols: Record<string, string[]>

    Conformant NAP-SHELL per-domain numbered protocols (PRIMARY for @napplet/shim >=0.13). Maps a domain to the NAP-NN protocol IDs it speaks — { inc: ['NAP-01','NAP-02','NAP-03','NAP-04','NAP-05','NAP-06'] } (derived from NAP_INC_PROTOCOLS by stripping the inc: prefix).

    Read by createShellEnvironment(msg).capabilities.protocolsmakeSupports for supports('<domain>','NAP-NN') queries.

    sandbox: string[]

    Sandbox permissions under the perm:<permission> namespace. Each entry MUST begin with the literal prefix 'perm:' — e.g. 'perm:popups', 'perm:modals', 'perm:downloads'. Napplets call shell.supports('perm:<permission>') to check sandbox entitlements.

    The perm: prefix is what separates sandbox permissions from NAP capabilities; bare-name entries here violate the NIP-5D contract and will be unreachable through supports() (see the living NIP-5D at https://github.com/nostr-protocol/nips/pull/2303/). NAP-capability lookups (on naps) retain the bare-name convention and do NOT use the perm: prefix.