@kehto/shell 0.16.6 → 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 +5 -8
- package/dist/index.d.ts +61 -464
- package/dist/index.js +224 -63
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @kehto/shell
|
|
2
2
|
|
|
3
|
-
Browser adapter over @kehto/runtime — ShellBridge
|
|
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
|
|
25
|
-
-
|
|
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
|
-
-
|
|
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
|
|
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
|