@kehto/paja 0.6.3 → 0.8.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 CHANGED
@@ -1,6 +1,7 @@
1
1
  # @kehto/paja
2
2
 
3
- Single-window development runtime for local napplet authoring.
3
+ Development runtime for local napplet authoring and static pointer-loaded
4
+ napplet testing.
4
5
 
5
6
  The runtime is designed to be used from a napplet package script:
6
7
 
@@ -14,29 +15,43 @@ The runtime is designed to be used from a napplet package script:
14
15
 
15
16
  The target URL is explicit on purpose. Kehto can spawn any framework command and
16
17
  wait for that URL, but it does not guess which URL the framework chose. Loading
17
- that URL directly in the runtime iframe preserves the app's own HMR behavior
18
- without Vite, Svelte, React, or any other framework lock-in.
18
+ that URL through Paja as injected `srcdoc` lets Kehto install mandatory
19
+ `window.napplet.shell` plus enabled optional domains before app code runs. The
20
+ shell shim completes `shell.ready` / `shell.init` and caches capability queries,
21
+ while a `<base>` tag keeps the
22
+ app's own assets and HMR pointed at the target dev server without Vite, Svelte,
23
+ React, or any other framework lock-in.
19
24
 
20
25
  The package provides the typed option model, CLI parser, runtime server, host
21
- page, and host config surface. The browser host keeps one target iframe with a
22
- reload loop and a development console wired through a real
23
- `ShellBridge`, `@kehto/runtime`, and deterministic development service adapters
24
- for the current web NAP surface: relay/outbox, storage, identity, keys, config,
25
- resource, theme, notify, media, upload, intent, cvm, and inc. `shell` is the
26
- mandatory handshake domain; the deprecated legacy package path remains an
27
- upstream compatibility alias to `inc`. The upstream `dm` domain is not
28
- advertised until Paja wires a deterministic development DM backend.
26
+ page, and host config surface. Local target-url mode keeps one target iframe
27
+ with a reload loop and a development console wired through a real
28
+ `ShellBridge`, `@kehto/runtime`, and service adapters for the current web NAP
29
+ surface: relay/outbox, storage, identity, keys, config, resource, theme, notify,
30
+ media, upload, intent, cvm, and inc. Relay/outbox defaults to live public relays
31
+ and uses NIP-65 relay-list bootstrap plus kind `3` contact-list reads for
32
+ identity flows; `--relay-mode memory` is the explicit deterministic fixture
33
+ mode. `shell` is the mandatory, non-toggleable handshake domain; the deprecated legacy package
34
+ path remains an upstream compatibility alias to `inc`. The upstream `dm` domain
35
+ is not advertised until Paja wires a deterministic development DM backend.
29
36
 
30
37
  The console shows supported interfaces with per-domain injection toggles,
31
38
  runtime ACL controls, signer controls, and a filterable message log with visible
32
- error details. Paja creates a generated local development signer by default and
33
- can switch to a browser NIP-07 signer or a bunker/NIP-46 connection. Every
34
- signing or publish operation still uses a browser confirmation prompt. There is
35
- no bypass list.
39
+ error details. Paja auto-connects a browser NIP-07 signer when `window.nostr` is
40
+ available, can connect to a bunker/NIP-46 URI, and only uses the generated local
41
+ development signer when the Dev signer button is selected. Every signing or
42
+ publish operation still uses a browser confirmation prompt. There is no bypass
43
+ list.
36
44
 
37
45
  The static Paja Runtime build is served at `/web/paja/` in the GitHub Pages
38
46
  artifact. It uses the same browser host and service adapters, but loads verified
39
- napplet HTML from a pasted `naddr` or `nevent` pointer with `hmr: none`.
47
+ napplet HTML from pasted `naddr` or `nevent` pointers with `hmr: none`. Each
48
+ loaded pointer becomes a closeable header tab; loading an already-running
49
+ napplet opens a choice to load another instance, switch to the existing tab, or
50
+ cancel. Each tab includes a share control that copies a `/web/paja/?naddr=...`
51
+ or `/web/paja/?nevent=...` link for that pointer, and the browser remembers open
52
+ runtime tabs in local storage so returning to `/web/paja/` restores the previous
53
+ pointer set. An explicit pointer in the URL still takes precedence over restored
54
+ tabs.
40
55
 
41
56
  Environment simulation can be supplied through CLI flags or a JSON config file:
42
57
 
@@ -68,6 +83,40 @@ kehto paja \
68
83
  }
69
84
  ```
70
85
 
86
+ ## NAP-UPLOAD modes
87
+
88
+ Paja keeps `memory` as the default upload simulator. It returns deterministic
89
+ `kehto-dev://` results and does not store bytes. Opt into real Blossom storage
90
+ with a shell-owned server and an active Dev, NIP-07, or NIP-46 signer:
91
+
92
+ ```bash
93
+ kehto paja \
94
+ --target-url http://127.0.0.1:5173 \
95
+ --upload-mode blossom \
96
+ --upload-server https://blossom.example \
97
+ -- pnpm vite --host 127.0.0.1
98
+ ```
99
+
100
+ Paja prompts with the napplet identity, file details, selected server, and a
101
+ public/durable warning before it signs or sends bytes. Production servers must
102
+ use HTTPS; plain HTTP is accepted only for loopback development hosts. The
103
+ server must allow Paja's browser origin, `PUT` and `OPTIONS`, plus the
104
+ `Authorization` and `Content-Type` CORS headers.
105
+
106
+ Explicit servers win. With no explicit server, Paja may use an independently
107
+ warmed snapshot of the active signer's newest BUD-03 kind `10063` `server`
108
+ tags. `upload.info` and `upload.upload` never initiate that discovery. Pointer
109
+ loader Blossom hints are artifact sources, not upload policy. The current path
110
+ uses the first server only, returns its direct HTTP(S) URL, and does not mirror
111
+ or construct BUD-10 URLs.
112
+
113
+ Completion requires the server descriptor to confirm the exact local SHA-256
114
+ and byte size as a non-negative safe integer. Missing or mismatched proof is a
115
+ failed result even after an HTTP success. The configured identity, provider,
116
+ signer, discovery author, and signed authorization pubkeys must agree; a fixed
117
+ pubkey without `signEvent` is read-only. This implements the draft
118
+ [NAP-UPLOAD at `a7cc174`](https://github.com/napplet/naps/blob/a7cc17463cbf5d9cb87884b31071bc4fc826034c/naps/NAP-UPLOAD.md).
119
+
71
120
  Full package docs: [`docs/packages/paja.md`](../../docs/packages/paja.md).
72
121
  Getting started: [`docs/how-tos/paja-getting-started.md`](../../docs/how-tos/paja-getting-started.md).
73
122
  Local authoring how-to: [`docs/how-tos/paja-local-authoring.md`](../../docs/how-tos/paja-local-authoring.md).