@kehto/paja 0.19.0 → 0.20.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
@@ -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 keeps resolver-verified pointer and manifest facts in an installed catalog,
236
- separate from the live tab/controller map. A verified install inserts or replaces
237
- the catalog record; an explicit artifact removal removes it. Closing, reloading,
238
- or replacing a frame never makes an installed handler unavailable, so a cold
239
- target can still be selected and started later.
240
-
241
- Intent selection considers only exact compatible contracts from that catalog. Required or optional INC declarations are eligible only when
242
- INC is available in the target's host-resolved environment. Missing optional INC
243
- still permits frame loading. Nameless root/snapshot artifacts may also run, but
244
- are excluded from the dTag-keyed intent catalog.
245
- Paja can use a compatible user default, ask its host chooser when more than one
246
- candidate is available, or reject an ambiguity. An explicit handler d-tag is
247
- accepted only when it is an installed compatible handler and the invoking sender
248
- has been explicitly authorized for it. It is not a request to deliver to an
249
- arbitrary running frame.
250
-
251
- When Paja receives an invocation, it selects and opens or reuses a verified
252
- target. The controller waits for the target generation's
253
- registered `MessageEvent.source` to establish its real `shell.ready` session;
254
- it checks that generation is still current, sends one target-only `intent.deliver`
255
- with the selected queryless convention, and returns the final handled target
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,50 @@ 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`, independent
480
- `z`/`i` routing declarations, and required `R` / optional `O` domains. Kehto also
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** or explicitly **Test intent** to open the review view.
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
+ Choose recipient default routing, a named-35129 `#naddr` recommendation, or an
497
+ exact outer `pointer`. Explicit pointers must verify and advertise the exact
498
+ contract; failure never silently falls back. Otherwise an applicable user default
499
+ wins before a recommendation, then ordinary compatible selection applies.
500
+ Recommendation relay hints remain untrusted discovery inputs. Installing a
501
+ recommendation requires confirmation after signed metadata and bytes verify.
502
+
503
+ Incoming links show **Review intent** before execution. Edit, choose another
504
+ handler, explicitly save or clear a default, launch, retry, or cancel. Defaults
505
+ never change implicitly. Cancellation before Launch sends nothing; accepted
506
+ work is retained while completion or failure remains visible in the host.
507
+
508
+ Paja invokes through a separate signed launcher napplet with a verified artifact
509
+ and authenticated iframe endpoint. Its source supplies the opaque sender; the
510
+ URL cannot supply one. The hidden launcher is removed after acceptance and is
511
+ never persisted or restored. Verification precedes `srcdoc`, and host bootstrap
512
+ injection stays outside signed bytes. Native external-origin sender semantics
513
+ remain a documented upstream spec gap; no host sender identity is invented.