@kehto/shell 0.16.7 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @kehto/shell
2
2
 
3
- Browser adapter over @kehto/runtime — ShellBridge, domain proxies, keys-forwarder.
3
+ Browser adapter over @kehto/runtime — ShellBridge and domain proxies.
4
4
 
5
5
  > **Alpha status:** Kehto is an early runtime implementation for a draft NIP-5D
6
6
  > protocol. NAP contracts and injected-domain behavior are still draft; treat
@@ -21,10 +21,10 @@ The primary entry point is `createShellBridge()` — it owns the postMessage lis
21
21
  Current draft behaviors this package enforces:
22
22
 
23
23
  - The shell does not inject a host-provided nostr object into napplets — NIP-5D explicitly forbids napplet-visible signing. Napplets call `relay.publish` / `relay.publishEncrypted` and the shell mediates the signing flow internally (NIP-44 default, NIP-04 opt-in for encrypted envelopes).
24
- - `injectNappletNamespacePrelude()` implements the current draft NIP-5D injected-domain bootstrap: hosts prepend a `window.napplet` prelude to `srcdoc` outside the verified artifact bytes, so callable NAP domain interfaces exist before napplet-authored scripts run. Assigned namespaces are filtered back to the explicit bare-domain allowlist; the playground does not inject `shell`.
25
- - Legacy `window.napplet.shell.supports()` compatibility is not the current NIP-5D availability primitive. New host and napplet availability checks should use injected `window.napplet.<domain>` presence and leave per-domain semantic checks to the matching NAP.
24
+ - `injectNappletNamespacePrelude()` implements the NIP-5D injected-domain bootstrap and mandatory NAP-SHELL shim: hosts prepend it to `srcdoc` outside verified artifact bytes, install the parent-bound `shell.init` receiver, emit one `shell.ready`, and expose callable NAP interfaces before authored scripts run. Optional namespaces are filtered to the bare-domain allowlist; `shell` is always retained.
25
+ - `window.napplet.shell.supports()` answers synchronously from the cached NAP-SHELL environment. Optional-domain presence remains the NIP-5D binding, while method semantics and numbered protocols remain owned by their matching NAP specs.
26
26
  - Five optional per-domain proxies — `createIdentityProxy`, `createThemeProxy`, `createKeysProxy`, `createMediaProxy`, `createNotifyProxy` — can be composed between napplet and runtime to intercept or augment traffic per NAP. They are NOT wired by default (Kehto's runtime already owns dispatch for the currently supported domains); they exist as host-app composition seams.
27
- - The keys-forwarder pumps host keydown events into `keys.forward` envelopes for napplets that hold the `keys:forward` capability.
27
+ - `keys.forward` is napplet-to-shell only. Active napplets suppress locally-bound keys from `keys.bindings` before forwarding; shell-initiated action triggers use `keys.action`.
28
28
  - `buildShellCapabilities()` advertises `dm` when the host adapter provides `hooks.dm`, and disabled-domain overrides remove it from both `domains` and `naps`.
29
29
 
30
30
  ## Quick Start
@@ -79,13 +79,10 @@ const bridge = createShellBridge({
79
79
  - `createMediaProxy` — intercept `media.*` playback control
80
80
  - `createNotifyProxy` — intercept `notify.send/list/read/dismiss`
81
81
 
82
- ### Keys forwarder
83
- - `createKeysForwarder` — host-keydown pump into `keys.forward` envelopes; auto-attached by `createShellBridge`, also exported for hosts that manage their own forwarder instance
84
-
85
82
  ### Session / origin registry
86
83
  - `sessionRegistry` — canonical windowId ↔ verified-napplet registry singleton
87
84
  - `nappKeyRegistry` — deprecated alias for `sessionRegistry`
88
- - `originRegistry` — origin-to-windowId map used by proxies and the keys-forwarder
85
+ - `originRegistry` — origin-to-windowId map used by proxies and bridge broadcasts
89
86
  - `PendingUpdate` — type for pending aggregate-hash change prompts
90
87
 
91
88
  ### Manifest cache