The ShellAdapter provided by the host app
ShellCapabilities with domains/protocols (conformant 0.13 shape) plus naps (NAP vocab) and sandbox (perm:-prefixed) arrays
const caps = buildShellCapabilities(hooks);
// caps.domains => ['relay','outbox','identity','storage','inc','theme','keys','media','notify','config','resource','cvm']
// (relay + outbox present when hooks.relayPool is provided; 'upload'/'intent'
// appended under their hooks; perm:<x> sandbox entries appended when extended)
// caps.protocols => { inc: ['NAP-01','NAP-02','NAP-03','NAP-04','NAP-05','NAP-06'] }
// caps.naps => ['relay','outbox','identity','storage','inc','theme','keys','media','notify','config','resource','cvm',
// 'inc:NAP-01','inc:NAP-02','inc:NAP-03','inc:NAP-04','inc:NAP-05','inc:NAP-06']
// (relay + outbox present when hooks.relayPool is provided; 'upload'
// appended when hooks.upload is provided; 'intent' appended when
// hooks.intent.isAvailable() is true)
// caps.sandbox => [] // host app may extend with 'perm:popups', etc.
Build the shell's static capability set from adapter configuration.
Returns the conformant NAP-SHELL
domains/protocolsshape (consumed by@napplet/shim >=0.13via@napplet/nap@0.12'screateShellEnvironment+makeSupports) alongside the flatnapsarray (consumed by@napplet/shim >=0.9.0) and thesandboxarray.naps array (NAP vocabulary)
Bare domain
inc+inc:NAP-01..inc:NAP-06. Conditional:relay+outboxprepended when hooks.relayPool;uploadappended when hooks.upload;intentappended when hooks.intent.isAvailable();linkappended when hooks.link.isAvailable();commonappended when hooks.common.isAvailable().Sandbox permissions are left empty by default — host apps may extend after construction. Sandbox entries (and any host-app extensions) MUST use the canonical
perm:<permission>form — e.g.'perm:popups','perm:modals','perm:downloads'. Napplets rely on theperm:prefix to distinguish sandbox permissions from NAP-capability lookups; see the living NIP-5D at https://github.com/nostr-protocol/nips/pull/2303/domains array + protocols map (conformant NAP-SHELL — @napplet/core@0.12)
The structured shape the released
@napplet/shim@0.13actually reads via@napplet/nap@0.12'screateShellEnvironment+makeSupports:domains— bare NAP domain names (thenapsset MINUS theinc:NAP-NNprotocol strings) with the same conditional entries (relay/outbox underhooks.relayPool, upload/intent/link/common under their hooks). Anyperm:<x>sandbox entries are appended here too — the 0.13 shim resolvessupports('perm:<x>')as a plaindomainsmembership check.protocols—{ inc: ['NAP-01'..'NAP-06'] }, derived fromNAP_INC_PROTOCOLSby stripping theinc:prefix.Emitted as a SUPERSET alongside
naps/sandbox(TERM-05 back-compat).