@kehto/paja 0.17.0 → 0.17.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 CHANGED
@@ -217,6 +217,15 @@ identity. A superseded target/source, failed open/readiness, or terminal send is
217
217
  handled by the controller's replacement/retry/terminal policy and produces a
218
218
  canonical failed `IntentResult`.
219
219
 
220
+ Reusing a handler tab activates it and remembers the new active tab. Paja's stage
221
+ shows exactly one tab, so a delivered intent always selects the handler tab:
222
+ `behavior.focus` is a hint, and honoring `false` as "deliver into the hidden
223
+ tab" would report a handled intent whose surface the user never sees. Reuse
224
+ still leaves the caller's tab open, so nothing is replaced. Newly created
225
+ handler tabs behave the same way. Pointer installation logs declared
226
+ archetypes and required domains; Paja warns when archetypes lack `inc`, which
227
+ its current convention delivery policy requires.
228
+
220
229
  `@napplet/shim@0.30.0` supplies no generic shell API. Kehto deliberately keeps
221
230
  its host-owned mandatory `window.napplet.shell` prelude: it installs the live
222
231
  receiver before the one bare `shell.ready`, caches the first `shell.init`, and
@@ -22728,6 +22728,8 @@ function createPajaIntentTargetOptions(getState, getContext, effects = {}) {
22728
22728
  (tab2) => matchesInstalledNappletRecord(record, tab2.resolvedTarget) && isCurrentRuntimeTabGeneration(state, context, tab2)
22729
22729
  );
22730
22730
  if (current && params.behavior?.newWindow !== true && params.behavior?.reuse !== false) {
22731
+ activateRuntimeTab(state, context, current.id);
22732
+ effects.persistTabs?.(state);
22731
22733
  return bindPajaIntentGeneration(current, record, context.runtime);
22732
22734
  }
22733
22735
  const resolved = await resolvePajaPointer(record.pointer.value, pajaPointerResolverOptions(context));
@@ -22790,6 +22792,25 @@ function createPajaIntentTargetOptions(getState, getContext, effects = {}) {
22790
22792
  }
22791
22793
  };
22792
22794
  }
22795
+ function recordInstalledIntentSurface(state, resolvedTarget) {
22796
+ const archetypes = resolvedTarget.manifest.archetypes;
22797
+ const requires = resolvedTarget.manifest.requires;
22798
+ const intentEligible = requires.includes("inc") && archetypes.length > 0;
22799
+ if (archetypes.length > 0 && !intentEligible) {
22800
+ console.warn(
22801
+ '[paja] napplet %s declares archetypes but is NOT intent-eligible: missing "inc" in requires. Add a ["requires","inc"] tag to its manifest to route intents to it.',
22802
+ resolvedTarget.dTag
22803
+ );
22804
+ }
22805
+ appendPajaMessageLog(state, "paja", {
22806
+ type: "paja.pointer.resolved",
22807
+ dTag: resolvedTarget.dTag,
22808
+ aggregateHash: resolvedTarget.aggregateHash,
22809
+ archetypes,
22810
+ requires,
22811
+ intentEligible
22812
+ });
22813
+ }
22793
22814
  function pajaPointerResolverOptions(context) {
22794
22815
  return {
22795
22816
  relays: [
@@ -23563,11 +23584,7 @@ async function loadRuntimePointer(state, context, value, options = {}) {
23563
23584
  runtime.catalog.install(resolvedTarget);
23564
23585
  const pointerStatus = `${resolvedTarget.dTag}:${resolvedTarget.aggregateHash.slice(0, 12)}`;
23565
23586
  setPointerStatus(state, pointerStatus);
23566
- appendPajaMessageLog(state, "paja", {
23567
- type: "paja.pointer.resolved",
23568
- dTag: resolvedTarget.dTag,
23569
- aggregateHash: resolvedTarget.aggregateHash
23570
- });
23587
+ recordInstalledIntentSurface(state, resolvedTarget);
23571
23588
  const duplicate = options.skipDuplicatePrompt ? void 0 : state.tabs.find((tab) => tab.key === resolvedTargetKey(resolvedTarget));
23572
23589
  if (duplicate) {
23573
23590
  const choice = await showDuplicatePointerDialog();