@kehto/paja 0.10.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 +99 -14
- package/dist/browser-host.js +11723 -7027
- 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,88 @@ 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.
|
|
117
|
+
|
|
118
|
+
## Standard identity and social-cache boundary
|
|
119
|
+
|
|
120
|
+
A signed-in napplet reads Paja identity and social data only through existing
|
|
121
|
+
`identity.getPublicKey`, `identity.getFollows`, and ordinary kind-0
|
|
122
|
+
`outbox.query` messages. Paja exposes no social namespace, direct networking,
|
|
123
|
+
or signer/key capability for this behavior.
|
|
124
|
+
|
|
125
|
+
Paja privately validates the active account's replacement kind-3 contact list,
|
|
126
|
+
then warms followed kind-0 profile records through its established outbox router.
|
|
127
|
+
The resulting snapshot is active-account-scoped and memory-only. It is distinct
|
|
128
|
+
from generic simulation cache mode; it is not napplet-owned storage and has no
|
|
129
|
+
durable-cache controls. Captured-key request correlation keeps a follows request
|
|
130
|
+
bound to the account that started it, while generation-safe background writes
|
|
131
|
+
prevent stale-account data from becoming the active snapshot.
|
|
132
|
+
|
|
133
|
+
A normal query can include matching cached `RelayEventResult` values, but Paja
|
|
134
|
+
retains the base router's query-wide `incomplete` and `error` fields. A cache hit
|
|
135
|
+
does not make a degraded query complete. Profile winner selection, pagination,
|
|
136
|
+
follow mutation, durable-cache management, and per-author completeness are
|
|
137
|
+
outside this behavior.
|
|
138
|
+
|
|
139
|
+
[NAP-IDENTITY at `6461e4b37c29dc09a20dff35d9515889c4433874`](https://github.com/napplet/naps/blob/6461e4b37c29dc09a20dff35d9515889c4433874/naps/NAP-IDENTITY.md)
|
|
140
|
+
is byte-identical to the recorded `napplet/naps` master document for this phase.
|
|
141
|
+
Pinned [NAP-OUTBOX at `4589a8f9a16d8aa29b3740e2b3b0cdca11e0976e`](https://github.com/napplet/naps/blob/4589a8f9a16d8aa29b3740e2b3b0cdca11e0976e/naps/NAP-OUTBOX.md)
|
|
142
|
+
together with installed `@napplet/nap@0.31.2` types is the PoC contract because
|
|
143
|
+
current master has no NAP-OUTBOX path. Paja therefore makes no current-master
|
|
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).
|
|
69
146
|
|
|
70
147
|
The static Paja Runtime build is served at `/web/paja/` in the GitHub Pages
|
|
71
148
|
artifact. It uses the same browser host and service adapters, but loads verified
|
|
@@ -102,7 +179,7 @@ identity. A superseded target/source, failed open/readiness, or terminal send is
|
|
|
102
179
|
handled by the controller's replacement/retry/terminal policy and produces a
|
|
103
180
|
canonical failed `IntentResult`.
|
|
104
181
|
|
|
105
|
-
`@napplet/shim@0.29.
|
|
182
|
+
`@napplet/shim@0.29.2` supplies no generic shell API. Kehto deliberately keeps
|
|
106
183
|
its host-owned mandatory `window.napplet.shell` prelude: it installs the live
|
|
107
184
|
receiver before the one bare `shell.ready`, caches the first `shell.init`, and
|
|
108
185
|
provides local `ready()`, `supports()`, read-only `services`, and one-shot
|
|
@@ -149,11 +226,19 @@ kehto paja \
|
|
|
149
226
|
}
|
|
150
227
|
```
|
|
151
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
|
+
|
|
152
236
|
## NAP-UPLOAD modes
|
|
153
237
|
|
|
154
|
-
Paja keeps `memory` as the default upload
|
|
155
|
-
`
|
|
156
|
-
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:
|
|
157
242
|
|
|
158
243
|
```bash
|
|
159
244
|
kehto paja \
|