@kehto/paja 0.19.0 → 0.20.1
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 -35
- package/dist/browser-host.js +2272 -1059
- package/dist/browser-host.js.map +1 -1
- package/dist/{chunk-GY5ET3PC.js → chunk-FUBJAN4W.js} +255 -25
- package/dist/chunk-FUBJAN4W.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +88 -14
- package/dist/index.js +9 -1
- package/package.json +5 -5
- package/dist/chunk-GY5ET3PC.js.map +0 -1
package/README.md
CHANGED
|
@@ -232,39 +232,27 @@ The file opens in a new runtime tab named after the file.
|
|
|
232
232
|
|
|
233
233
|
## Installed intent handlers and delivery
|
|
234
234
|
|
|
235
|
-
Paja
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
identity. A superseded target/source, failed open/readiness, or terminal send is
|
|
257
|
-
handled by the controller's replacement/retry/terminal policy and produces a
|
|
258
|
-
canonical failed `IntentResult`.
|
|
259
|
-
|
|
260
|
-
Reusing a handler tab activates it and remembers the new active tab. Paja's stage
|
|
261
|
-
shows exactly one tab, so a delivered intent always selects the handler tab:
|
|
262
|
-
`behavior.focus` is a hint, and honoring `false` as "deliver into the hidden
|
|
263
|
-
tab" would report a handled intent whose surface the user never sees. Reuse
|
|
264
|
-
still leaves the caller's tab open, so nothing is replaced. Newly created
|
|
265
|
-
handler tabs behave the same way. Pointer installation logs declared
|
|
266
|
-
archetypes and required domains; Paja warns when archetypes lack `inc`, which
|
|
267
|
-
its current convention delivery policy requires.
|
|
235
|
+
Paja stores immutable resolver-verified manifest facts separately from live tabs.
|
|
236
|
+
Closing a frame leaves its catalog record available for cold starts; explicit
|
|
237
|
+
artifact removal deletes it. Restored pointers are reverified before entering the
|
|
238
|
+
catalog. Entries preserve exact conventions and ordered parameter names under
|
|
239
|
+
publisher/kind-safe opaque IDs, including nameless root and snapshot artifacts.
|
|
240
|
+
The target's resolved `intent` domain must be available; INC is not required.
|
|
241
|
+
|
|
242
|
+
Selection uses exact contracts and user-owned default, chooser, recommendation,
|
|
243
|
+
and explicit-authorization policy. Explicit handler IDs require sender-aware
|
|
244
|
+
authorization and cannot address an arbitrary running frame.
|
|
245
|
+
|
|
246
|
+
The controller retains work before returning acceptance. It then opens or reuses
|
|
247
|
+
a verified target, waits for its registered source and real `shell.ready`, checks
|
|
248
|
+
that the generation is current, and sends one target-only `intent.deliver`.
|
|
249
|
+
Replacement, readiness failure, and terminal send failure remain host-observable
|
|
250
|
+
controller outcomes; they do not produce a second source result. Accepted work
|
|
251
|
+
survives source teardown and is never replayed by tab restoration.
|
|
252
|
+
|
|
253
|
+
Paja activates delivered handler tabs because its stage shows one tab at a time.
|
|
254
|
+
`behavior.focus` is advisory; `reuse: false` creates a new surface. Existing caller
|
|
255
|
+
tabs remain open. Installed contracts and domains appear in pointer diagnostics.
|
|
268
256
|
|
|
269
257
|
`@napplet/shim@0.30.0` supplies no generic shell API. Kehto deliberately keeps
|
|
270
258
|
its host-owned mandatory `window.napplet.shell` prelude: it installs the live
|
|
@@ -476,10 +464,60 @@ Generated API module: `docs/api/modules/_kehto_paja.html` (run `pnpm docs:api`).
|
|
|
476
464
|
|
|
477
465
|
## NIP-5D event compatibility
|
|
478
466
|
|
|
479
|
-
Current manifests use a direct artifact `x` hash, plain-text `content`,
|
|
480
|
-
`z`/`i`
|
|
467
|
+
Current manifests use a direct artifact `x` hash, plain-text `content`, role-matched
|
|
468
|
+
`z`/`i` intent declarations, and required `R` / optional `O` domains. Kehto also
|
|
481
469
|
accepts legacy aggregate events through an isolated compatibility adapter.
|
|
482
470
|
Existing `aggregateHash` host/cache/ACL fields carry the verified artifact hash
|
|
483
471
|
for current events; legacy identities keep their original aggregate. Both paths
|
|
484
472
|
verify signatures and bytes before runtime injection and `srcdoc` execution.
|
|
485
473
|
For the schema and removal boundary, see [event migration](https://kehto.github.io/web/docs/migrations/NIP-5D-EVENT-SCHEMA.html).
|
|
474
|
+
|
|
475
|
+
## NAP-INTENT links and lifecycle
|
|
476
|
+
|
|
477
|
+
This follows [NAP-INTENT PR #106](https://github.com/napplet/naps/blob/fc121fc264615482143eda86125863d2e1f741a2/naps/NAP-INTENT.md) at `fc121fc264615482143eda86125863d2e1f741a2` and NIP-5D PR #2303 at `020cb8b33a9e4c6b8ca4b2f9d0ed0a67843b68f7`.
|
|
478
|
+
|
|
479
|
+
For a verified app with advertised intents, choose **Share → Create intent link**.
|
|
480
|
+
Select its convention, include the text parameters you want, or switch to JSON.
|
|
481
|
+
Parameters start omitted; selecting Include with an empty field sends an explicit
|
|
482
|
+
empty string. Names stay in advertised order and extra named fields are allowed.
|
|
483
|
+
No parameter type or requiredness is inferred. An empty advertised list still
|
|
484
|
+
permits a payload. Opening or editing the builder never invokes an intent.
|
|
485
|
+
Use **Copy link** to share it, or **Test intent** to open the shared content.
|
|
486
|
+
|
|
487
|
+
The outer URL carries a complete percent-encoded convention URI in `intent`.
|
|
488
|
+
For example, `?intent=napplet%3Aprofile%2Fopen%3Fpubkey%3Dabc%252B123`
|
|
489
|
+
contains `napplet:profile/open?pubkey=abc%2B123` and delivers text `abc+123`.
|
|
490
|
+
Outer and inner layers decode once each; literal `+` stays plus. Optional outer
|
|
491
|
+
`payload` contains JSON, including null, primitives, arrays, or objects, and
|
|
492
|
+
cannot accompany an inner query. URLs are limited to 16 KiB UTF-8. Duplicate
|
|
493
|
+
keys, malformed encoding, and conflicting target instructions are rejected.
|
|
494
|
+
Ordinary pointer-only app links retain their existing behavior.
|
|
495
|
+
|
|
496
|
+
New links recommend the app using a named-35129 `#naddr` when available;
|
|
497
|
+
snapshot or unnamed apps use an exact outer `pointer`. The builder also offers
|
|
498
|
+
recipient-default routing. Explicit pointers must verify and advertise the exact
|
|
499
|
+
contract; failure never silently falls back. Recommendation relay hints remain
|
|
500
|
+
untrusted discovery inputs. Invalid, incompatible, or disallowed recommendations
|
|
501
|
+
do not override an applicable saved default.
|
|
502
|
+
|
|
503
|
+
Opening a shared link opens its verified app and delivers the content directly,
|
|
504
|
+
following Paja's ordinary pointer navigation and capability policy. No URI or
|
|
505
|
+
payload review is shown. If an applicable saved default conflicts with the
|
|
506
|
+
link's app, Paja names both apps and asks which to use. A one-time choice leaves
|
|
507
|
+
the default unchanged; **Always use this app** explicitly saves the chosen app.
|
|
508
|
+
Without a usable hint or default, ordinary installed-handler selection applies.
|
|
509
|
+
Installed app pointers are saved separately from open tabs and reverified when
|
|
510
|
+
loaded; cached pointers never authorize execution or supply trusted metadata.
|
|
511
|
+
|
|
512
|
+
Progress and failures use a small notice. Successful delivery dismisses it.
|
|
513
|
+
Closing the notice or cancelling an app choice before dispatch sends nothing.
|
|
514
|
+
After acceptance, the incoming intent is removed from the current URL so reload
|
|
515
|
+
restores the app without delivering the shared content again. Accepted work is
|
|
516
|
+
retained until the verified target is ready.
|
|
517
|
+
|
|
518
|
+
Paja invokes through a separate signed launcher napplet with a verified artifact
|
|
519
|
+
and authenticated iframe endpoint. Its source supplies the opaque sender; the
|
|
520
|
+
URL cannot supply one. The hidden launcher is removed after acceptance and is
|
|
521
|
+
never persisted or restored. Verification precedes `srcdoc`, and host bootstrap
|
|
522
|
+
injection stays outside signed bytes. Native external-origin sender semantics
|
|
523
|
+
remain a documented upstream spec gap; no host sender identity is invented.
|