@kehto/paja 0.11.0 → 0.12.0
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 +73 -16
- package/dist/browser-host.js +11985 -7624
- package/dist/browser-host.js.map +1 -1
- package/dist/{chunk-EOCGC7A2.js → chunk-3KMCJVEA.js} +87 -7
- package/dist/chunk-3KMCJVEA.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/{server-efRTBcMR.d.ts → server-BUL6CdbZ.d.ts} +1 -1
- package/package.json +6 -6
- package/dist/chunk-EOCGC7A2.js.map +0 -1
package/README.md
CHANGED
|
@@ -28,12 +28,13 @@ page, and host config surface. Local target-url mode keeps one target iframe
|
|
|
28
28
|
with a reload loop and a development console wired through a real
|
|
29
29
|
`ShellBridge`, `@kehto/runtime`, and service adapters for the current web NAP
|
|
30
30
|
surface: relay/outbox, storage, identity, keys, config, resource, theme, notify,
|
|
31
|
-
media, upload, intent,
|
|
31
|
+
media, upload, intent, count, link, common, lists, serial, BLE, WebRTC, DM, FS,
|
|
32
|
+
CVM, and inc. Relay/outbox defaults to live public relays
|
|
32
33
|
and uses NIP-65 relay-list bootstrap plus kind `3` contact-list reads for
|
|
33
34
|
identity flows; `--relay-mode memory` is the explicit deterministic fixture
|
|
34
|
-
mode
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
mode and does not advertise relay, outbox, count, or DM. `shell` is the
|
|
36
|
+
mandatory, non-toggleable handshake domain; the deprecated legacy package path
|
|
37
|
+
remains an upstream compatibility alias to `inc`.
|
|
37
38
|
|
|
38
39
|
## Dev-server CORS requirement
|
|
39
40
|
|
|
@@ -60,12 +61,59 @@ The console shows supported interfaces with per-domain injection toggles,
|
|
|
60
61
|
runtime ACL controls, signer controls, and a filterable message log with visible
|
|
61
62
|
error details. Paja auto-connects a browser NIP-07 signer when `window.nostr` is
|
|
62
63
|
available, can connect to a bunker/NIP-46 URI, and only uses the generated local
|
|
63
|
-
development signer when the Dev signer button is selected.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
development signer when the Dev signer button is selected. Sign, publish, DM
|
|
65
|
+
send, filesystem picker, Blossom upload, and external-link requests use one serialized in-page
|
|
66
|
+
confirmation dialog. Deny has initial focus, Escape denies, and there is no
|
|
67
|
+
bypass list. Upload consent identifies the requesting napplet, file, MIME type,
|
|
68
|
+
size, selected server, and durable public effect before bytes leave the browser.
|
|
69
|
+
A denial or a live publish with no accepting relay returns a canonical failure
|
|
70
|
+
and is not added to Paja's in-memory relay view. Paja's scoped-relay hook
|
|
71
|
+
likewise waits for the backend result and returns `false` after denial or
|
|
72
|
+
transport failure.
|
|
73
|
+
|
|
74
|
+
WebRTC is advertised only when the host has the browser WebRTC API, a live
|
|
75
|
+
relay boundary, and a connected signer with NIP-44 support. Paja owns the
|
|
76
|
+
`RTCPeerConnection` and data channels, uses signed kind-25050 Nostr events for
|
|
77
|
+
encrypted offer/answer signaling, and asks for explicit session consent with a
|
|
78
|
+
network-metadata warning. Napplets receive only NAP session/events and JSON data
|
|
79
|
+
channel payloads—never SDP, ICE state, relay sockets, or peer-connection objects.
|
|
80
|
+
This implementation tracks pinned
|
|
81
|
+
[NAP-WEBRTC `5fae95dd2c8e59bd06c654e0845656add077dcda`](https://github.com/napplet/naps/blob/5fae95dd2c8e59bd06c654e0845656add077dcda/naps/NAP-WEBRTC.md)
|
|
82
|
+
and the kind/tag conventions in
|
|
83
|
+
[NIP-100 PR #363 at `ead1cd6`](https://github.com/nostr-protocol/nips/pull/363).
|
|
84
|
+
|
|
85
|
+
DM is advertised only with live relays and Paja's selected Dev signer, whose
|
|
86
|
+
runtime-owned secret key can create and unwrap real NIP-17 gift wraps. Sends
|
|
87
|
+
receive one explicit plaintext/recipient confirmation, publish only verified
|
|
88
|
+
kind-1059 envelopes through the authorized relay path, and reload encrypted
|
|
89
|
+
history from relays rather than treating a memory fixture as persistence.
|
|
90
|
+
Napplets receive normalized NAP-DM messages, never secret keys, seals, rumors,
|
|
91
|
+
or relay sockets. This implementation follows draft
|
|
92
|
+
[NAP-DM `a0a48588`](https://github.com/napplet/naps/blob/a0a48588b3c9caca9540cccec19635b85231a00f/naps/NAP-DM.md).
|
|
93
|
+
|
|
94
|
+
FS is advertised only after Paja successfully opens the browser's real
|
|
95
|
+
origin-private filesystem. Each verified napplet identity gets a durable OPFS
|
|
96
|
+
`/workspace`; browser file/directory pickers add session-only opaque virtual
|
|
97
|
+
mounts after host approval. The backend implements metadata, directory lists,
|
|
98
|
+
bounded range reads, canonical padded-base64 writes, replace/append/patch,
|
|
99
|
+
revisions and preconditions, recursive mkdir/remove, atomic handle moves when
|
|
100
|
+
the browser supports them, and advisory watches over actual storage. Host
|
|
101
|
+
paths and handles never cross the NIP-5D boundary. This implementation follows
|
|
102
|
+
draft [NAP-FS `b640cf33`](https://github.com/napplet/naps/blob/b640cf337c0481f0f9a0216c00843f797a5c6df6/naps/NAP-FS.md).
|
|
103
|
+
|
|
104
|
+
Other domains are equally capability-bound. Relay, outbox, and count require
|
|
105
|
+
live relays; count uses NIP-45 `COUNT` without downloading events. Storage
|
|
106
|
+
requires writable `localStorage`; the memory setting is an unadvertised fixture.
|
|
107
|
+
Keys requires a document listener, media requires the browser Media Session
|
|
108
|
+
API, notifications require Paja's host renderer, links require browser
|
|
109
|
+
navigation, and intent requires the installed-catalog/runtime-tab host
|
|
110
|
+
controller. DM also requires the Dev signer and live relays; FS requires a
|
|
111
|
+
successful OPFS probe, while picker calls additionally require the corresponding
|
|
112
|
+
browser API and a host-owned approval click. Missing host boundaries remove
|
|
113
|
+
those domains from `shell.init`.
|
|
114
|
+
Live relay URLs are validated before advertisement, fixture events and local
|
|
115
|
+
publish echoes never enter live reads, and relay event sidecars disclose only
|
|
116
|
+
sources that the relay pool actually observed.
|
|
69
117
|
|
|
70
118
|
## Standard identity and social-cache boundary
|
|
71
119
|
|
|
@@ -91,9 +139,10 @@ outside this behavior.
|
|
|
91
139
|
[NAP-IDENTITY at `6461e4b37c29dc09a20dff35d9515889c4433874`](https://github.com/napplet/naps/blob/6461e4b37c29dc09a20dff35d9515889c4433874/naps/NAP-IDENTITY.md)
|
|
92
140
|
is byte-identical to the recorded `napplet/naps` master document for this phase.
|
|
93
141
|
Pinned [NAP-OUTBOX at `4589a8f9a16d8aa29b3740e2b3b0cdca11e0976e`](https://github.com/napplet/naps/blob/4589a8f9a16d8aa29b3740e2b3b0cdca11e0976e/naps/NAP-OUTBOX.md)
|
|
94
|
-
together with installed `@napplet/nap@0.
|
|
142
|
+
together with installed `@napplet/nap@0.31.2` types is the PoC contract because
|
|
95
143
|
current master has no NAP-OUTBOX path. Paja therefore makes no current-master
|
|
96
|
-
OUTBOX conformance claim. Blossom behavior
|
|
144
|
+
OUTBOX conformance claim. Blossom upload behavior targets pinned
|
|
145
|
+
[NAP-UPLOAD at `a7cc17463cbf5d9cb87884b31071bc4fc826034c`](https://github.com/napplet/naps/blob/a7cc17463cbf5d9cb87884b31071bc4fc826034c/naps/NAP-UPLOAD.md).
|
|
97
146
|
|
|
98
147
|
The static Paja Runtime build is served at `/web/paja/` in the GitHub Pages
|
|
99
148
|
artifact. It uses the same browser host and service adapters, but loads verified
|
|
@@ -130,7 +179,7 @@ identity. A superseded target/source, failed open/readiness, or terminal send is
|
|
|
130
179
|
handled by the controller's replacement/retry/terminal policy and produces a
|
|
131
180
|
canonical failed `IntentResult`.
|
|
132
181
|
|
|
133
|
-
`@napplet/shim@0.29.
|
|
182
|
+
`@napplet/shim@0.29.2` supplies no generic shell API. Kehto deliberately keeps
|
|
134
183
|
its host-owned mandatory `window.napplet.shell` prelude: it installs the live
|
|
135
184
|
receiver before the one bare `shell.ready`, caches the first `shell.init`, and
|
|
136
185
|
provides local `ready()`, `supports()`, read-only `services`, and one-shot
|
|
@@ -177,11 +226,19 @@ kehto paja \
|
|
|
177
226
|
}
|
|
178
227
|
```
|
|
179
228
|
|
|
229
|
+
Configured `config.values` are only a seed for identities with no saved
|
|
230
|
+
settings. A napplet must register a valid NAP-CONFIG schema before any values
|
|
231
|
+
are delivered. Paja then validates/defaults the seed, persists commits under
|
|
232
|
+
the host-resolved `(dTag, aggregateHash)`, and exposes a shell-owned settings
|
|
233
|
+
dialog; napplets remain read-only. If durable browser storage or that host UI
|
|
234
|
+
is unavailable, Paja does not advertise `config`.
|
|
235
|
+
|
|
180
236
|
## NAP-UPLOAD modes
|
|
181
237
|
|
|
182
|
-
Paja keeps `memory` as the default upload
|
|
183
|
-
`
|
|
184
|
-
with a shell-owned server and an active Dev, NIP-07, or NIP-46
|
|
238
|
+
Paja keeps `memory` as the default unadvertised upload fixture. It does not
|
|
239
|
+
register `window.napplet.upload`, return success, or store bytes. Opt into real
|
|
240
|
+
Blossom storage with a shell-owned server and an active Dev, NIP-07, or NIP-46
|
|
241
|
+
signer:
|
|
185
242
|
|
|
186
243
|
```bash
|
|
187
244
|
kehto paja \
|