@justai/cuts 0.139.0 → 0.141.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justai/cuts",
3
- "version": "0.139.0",
3
+ "version": "0.141.0",
4
4
  "description": "A persona's named parts \u2014 the page shell that holds them, and the cuts themselves.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@justai/core": "^0.36.0",
44
+ "@justai/core": "^0.37.0",
45
45
  "@justai/ui": "^0.26.0",
46
46
  "@justai/atrium": "^0.1.9"
47
47
  },
@@ -43,12 +43,41 @@
43
43
  // geometry here is a second copy of the one in that file, which is authored by hand and generated by
44
44
  // nothing — a redraw has to be carried across to this component as well.
45
45
  interface Props {
46
- /** Which storefront "home" means here. Defaults to app.zone — the fleet as it stood. */
47
- apex?: "app.zone" | "pin.games";
46
+ /**
47
+ * Which storefront "home" means here. Defaults to app.zone — the fleet as it stood.
48
+ *
49
+ * A STRING, NOT A UNION OF THE TWO APEXES WE HAPPENED TO HAVE. The union was a fourth copy of the
50
+ * apex table (the others: edge-router's `apexes`, core's `STREAMS`, the generator's `APEXES`), and
51
+ * it is the copy that fails LOUDEST — a third household could not type-check, which is how it was
52
+ * found. Loud is the good outcome; the quiet one is below.
53
+ */
54
+ apex?: string;
48
55
  }
49
56
  const { apex = "app.zone" } = Astro.props;
50
57
  const href = `https://${apex}`;
51
58
 
59
+ /**
60
+ * queries: the home mark is app.zone's on another apex · no home button on a new apex · a household
61
+ * with no mark · why does my persona have no home affordance · BackToZone renders nothing
62
+ *
63
+ * AN APEX WE CANNOT DRAW GETS NO CONTROL AT ALL — and that is the honest outcome, not a gap.
64
+ *
65
+ * This was `apex === "pin.games" ? pinMark : appzoneMark`, a ternary whose ELSE branch quietly meant
66
+ * "app.zone". Point a third household at it and the control renders app.zone's four-arm mark, labelled
67
+ * with the other domain, linking to a front door that may not even be served yet: a wrong brand, on
68
+ * somebody else's name, as a dead link. Nothing errors. Nothing looks broken.
69
+ *
70
+ * So the marks are a TABLE and the fallback is nothing. Law 1 says a component brings its own ground;
71
+ * a component that cannot represent a household must decline rather than borrow another's face. The
72
+ * toolbar already survives this — `BackToZone` sizes and pulls itself, and the row is written for its
73
+ * absence — so the whole degradation is one missing control.
74
+ *
75
+ * It self-corrects: the day a household has a mark here, every persona under it grows the affordance
76
+ * on its next build, with no persona-level change anywhere.
77
+ */
78
+ const MARKS = ["app.zone", "pin.games"];
79
+ const drawable = MARKS.includes(apex);
80
+
52
81
  // queries: the home mark is missing arms · the mark is the wrong size · 36px · scoped styles do
53
82
  // not apply · set:html · data-astro-cid
54
83
  //
@@ -67,6 +96,7 @@ const href = `https://${apex}`;
67
96
  // Elements again. The ternary was never the problem.
68
97
  ---
69
98
 
99
+ {drawable && (
70
100
  <a class="home" href={href} data-home aria-label={apex} title={apex}>
71
101
  {apex === "pin.games" ? (
72
102
  <svg class="pgmark" viewBox="287 266 482 491" aria-hidden="true">
@@ -90,6 +120,7 @@ const href = `https://${apex}`;
90
120
  </svg>
91
121
  )}
92
122
  </a>
123
+ )}
93
124
 
94
125
  <style>
95
126
  /* icon-only, flat — flush to the left edge of the (full-bleed) toolbar */
@@ -116,7 +116,11 @@ const appName = (a: App): string => entries[a.id]?.name ?? a.name;
116
116
  // API is unreachable at build — the design never depends on the network.
117
117
  let catalogByHome: Record<string, string> = {};
118
118
  try {
119
- const res = await fetch(`https://api.justai.pro/api/catalog?locale=${lang}&kind=${encodeURIComponent(kind)}`);
119
+ // Asked by HOUSEHOLD, matching the runtime append — see behaviour/catalogue.ts for why a third
120
+ // apex made `kind` the wrong question here. This lookup is keyed by home, so a wider answer would
121
+ // still have worked; it asks the same question as the runtime path so the two cannot drift into
122
+ // disagreeing about who lives here.
123
+ const res = await fetch(`https://api.justai.pro/api/catalog?locale=${lang}&apex=${encodeURIComponent(apexHost)}`);
120
124
  if (res.ok) {
121
125
  const data = await res.json();
122
126
  for (const p of data.personas ?? []) if (p.home && p.bio) catalogByHome[p.home] = p.bio;
package/src/Toolbar.astro CHANGED
@@ -61,8 +61,13 @@ interface Props {
61
61
  // destination, and justai.pro is above it (sending the parent "home" to a child platform is
62
62
  // the wrong direction). Every other persona keeps it.
63
63
  home?: boolean;
64
- /** Which storefront the home affordance points at. Defaults to app.zone — see BackToZone. */
65
- apex?: "app.zone" | "pin.games";
64
+ /**
65
+ * Which storefront the home affordance points at. Defaults to app.zone — see BackToZone, which owns
66
+ * the marks and DECLINES to draw a household it has no mark for rather than borrowing app.zone's.
67
+ * A string, not a union: the ecosystem grows households, and a type that lists two of them is a
68
+ * fourth copy of the apex table.
69
+ */
70
+ apex?: string;
66
71
 
67
72
  // Posts is required only where there IS a stream (doctrine 02 — an empty cut shipped to look
68
73
  // complete is the buffet). A child persona has none, so `parent` turns this off by default.
@@ -27,13 +27,18 @@
27
27
  const locale = document.documentElement.lang || "en";
28
28
  const NEW_MS = 7 * 864e5; // a persona wears NEW only for its first week (honest — from its createdAt)
29
29
  const newLabel = grid.dataset.newLabel || "New";
30
- // queries: which personas appear on this apex · runtime append kind · why is my game not listed
30
+ // queries: which personas appear on this apex · runtime append kind · why is my game not listed ·
31
+ // a CiM persona is missing from its storefront · apex query parameter · mixed-kind apex
31
32
  //
32
33
  // WHICH CITIZENS THIS APEX LISTS — where the hostname test used to be. A bundled script cannot
33
- // reach this component's props, so the two facts it needs ride the same data-attribute channel as
34
- // newLabel and catMap. And `kind` is asked of the registry rather than inferred from a suffix: a
35
- // persona's apex is a property of the persona, not a shape of its address.
36
- const apexKind = grid.dataset.kind || "app";
34
+ // reach this component's props, so the fact it needs rides the same data-attribute channel as
35
+ // newLabel and catMap.
36
+ //
37
+ // IT ASKS THE REGISTRY BY HOUSEHOLD, NOT BY SPECIES, and the difference only became visible with a
38
+ // third apex. `kind` selects a SORT of persona; on app.zone and pin.games that happens to select
39
+ // the residents too, because every citizen of those two is the same sort. cityinmotion.nl is the
40
+ // household where they part — its citizens are sometimes games and sometimes apps — and asking it
41
+ // for one kind returns half a family and calls that the storefront.
37
42
  const apexHost = grid.dataset.apex || "app.zone";
38
43
  // The category label must be localized like the SSR path (catLabel), but the API returns the
39
44
  // category in English regardless of ?locale=. So carry this page's cat dictionary through a data
@@ -93,13 +98,16 @@
93
98
  return `<a class="card" href="${esc(url)}" data-name="${esc(name.toLowerCase())}" data-category="${esc(cat)}" data-id="${esc((a.handle || "").toLowerCase())}" data-added="${esc(a.createdAt || "")}">${icon}<div class="meta"><div class="top"><h2>${esc(name)}</h2>${badge}</div><p>${esc(tagMap[a.home] ?? a.bio ?? "")}</p></div><svg class="chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg></a>`;
94
99
  };
95
100
 
96
- fetch(`https://api.justai.pro/api/catalog?locale=${encodeURIComponent(locale)}&kind=${encodeURIComponent(apexKind)}`)
101
+ fetch(`https://api.justai.pro/api/catalog?locale=${encodeURIComponent(locale)}&apex=${encodeURIComponent(apexHost)}`)
97
102
  .then((r) => (r.ok ? r.json() : null))
98
103
  .then((data) => {
99
104
  if (!data || !data.personas) return;
100
105
  const newcomers = (data.personas as Entry[]).filter(
101
- // The registry already returned only this apex's kind, so all that is left to exclude is the
102
- // apex itself — a household head does not stand on its own shelf.
106
+ // THE RESIDENCY TEST STAYS, AND IS NOW A REDUNDANCY ON PURPOSE. Asking by apex means the
107
+ // registry has already excluded the other households AND the platform furniture that stands
108
+ // on no shelf, so this filter should never remove anything. It is kept because a browser can
109
+ // be holding a cached response from before the question changed, and because a storefront
110
+ // listing somebody else's citizen is the one failure here that looks fine.
103
111
  //
104
112
  // queries: auth appeared on app.zone · a persona from another apex is listed · why both
105
113
  // kind and home · residency