Skip to content

@kehto/shell

Browser adapter over @kehto/runtime for iframe/session hosting.

Alpha status: Kehto is an early runtime implementation for a draft NIP-5D protocol. Shell capabilities, supports() behavior, and NAP contracts are not final.

Install

bash
pnpm add @kehto/shell @kehto/runtime @kehto/acl @napplet/core @napplet/nap nostr-tools

Manifest Facts

FieldValue
Sourcepackages/shell/package.json, packages/shell/src/index.ts
Version0.14.2
Runtime entry./dist/index.js
Types entry./dist/index.d.ts
Dependencies@kehto/acl, @kehto/runtime
Side effectsfalse

Peer Dependencies

PackageRange
@napplet/core>=0.20.0 <0.21.0
@napplet/nap>=0.20.0 <0.21.0
nostr-tools>=2.23.3 <3.0.0

Primary APIs

AreaExports
FactorycreateShellBridge, ShellBridge
HooksadaptHooks, BrowserDeps, ShellAdapter, ShellCapabilities, UploadHooks, IntentHooks, LinkHooks, CommonHooks, ListsHooks, SerialHooks, BleHooks, WebrtcHooks, UnroutedMessageInfo
Protocol and capability typesNostrEvent, NostrFilter, NappletMessage, Capability, ALL_CAPABILITIES
Shell initbuildShellCapabilities
Registries and cachessessionRegistry, nappKeyRegistry, originRegistry, manifestCache, audioManager, PendingUpdate, ManifestCacheEntry, AudioSource
Enforcement re-exportscreateEnforceGate, createNapEnforceGate, formatDenialReason, EnforceResult, EnforceConfig, NapEnforceConfig, IdentityResolver, AclChecker, NapMessage
Proxies and forwarderscreateIdentityProxy, createThemeProxy, createKeysProxy, createMediaProxy, createNotifyProxy, createKeysForwarder
Shell-owned internal modelsresource request/result/error types
TopicsTOPICS, TopicKey, TopicValue

Scope Boundaries

  • Owns browser integration: window, postMessage, iframe session identity, gateway loading, shell capabilities, origin/session registries, and browser-specific adapters.
  • Surfaces unroutable inbound messages via the optional ShellAdapter.onUnroutedMessage hook (UnroutedMessageInfo) — observe-only; the bridge still drops messages from unidentified or unregistered windows, but hosts can now log them instead of debugging a silent vanish.
  • Must not expose window.nostr to napplets.
  • Does not implement service behavior itself; register reference services from @kehto/services on the underlying runtime.

API Reference