@boost33/shell-data 0.1.1 → 0.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,69 @@
2
2
 
3
3
  Changes to the published surface of `@boost33/shell-data`. Consumers upgrade by hand, as with `@boost33/ui`, so this file is the only notice they get.
4
4
 
5
+ ## 0.2.1 — 2026-11-18
6
+
7
+ **Brokers shows on Backdrop.** Brokers' own Backdrop is ready (its switch is
8
+ on; English and French screens merged and deployed), and Jamal asked on 18 Nov
9
+ 2026 for it to show. `BACKDROP_NOT_READY` drops `brokers` and keeps
10
+ `boostvoice`. So Brokers now appears in `products.all`, as a pin, and on the
11
+ rail in every app that draws the shared chrome, the same day the Hub stops
12
+ hiding it.
13
+
14
+ ### Changed
15
+
16
+ - `BACKDROP_NOT_READY` is `['boostvoice']`.
17
+ - `RAIL_CONTRACT`'s hidden app is now `boostvoice`, not `brokers`. The
18
+ person's pins and `railKeys` are unchanged, so an app's contract test passes
19
+ as before.
20
+
21
+ ## 0.2.0 — 2026-11-18
22
+
23
+ **One rail in every app, and two fixes.** Jamal, 18 Nov 2026: the rail is
24
+ "remembered for the account and always present the same regardless of which
25
+ app the user is in". Ship it with `@boost33/ui` 0.16.0, which draws Inbox and
26
+ reads `locale`.
27
+
28
+ ### Changed
29
+
30
+ - **`products.pinned` is the person's saved pins.** Identity sends them with
31
+ the product list (`pinnedApps`). Never chosen gives the first four, as
32
+ before. Chosen none gives none. A list gives that list, in the person's
33
+ order, kept to apps the list has, each once, at most four. This is the Hub's
34
+ `splitByPin`, moved here: `pinnedFrom`. An Identity that does not send pins
35
+ yet reads as never chosen, so today's rail is unchanged until it does.
36
+ - **Apps whose own Backdrop is not ready are hidden** from `products.all`, and
37
+ so from every app's rail and All apps panel: `BACKDROP_NOT_READY`, the Hub's
38
+ list (`boostvoice`, `brokers`), and `hiddenOnBackdrop(slug)`. One rule
39
+ instead of the Hub's alone. The app still answers on its own origin.
40
+
41
+ ### Added
42
+
43
+ - **`links.inbox`**, the Hub's `/inbox`: every app's rail draws it after Wallet.
44
+ - **`locale`** in the chrome data, from a new optional `locale` claim. It
45
+ picks the chrome's words.
46
+ - **`appMenuFolded`** in the chrome data: the person's saved app-menu fold,
47
+ read in the same Identity call as the product list (true folded, false
48
+ open, null never chose or the read failed), never cached. The chrome
49
+ draws the menu that way from the start. **`saveAppMenuFolded({ cookies,
50
+ config, folded })`** saves a toggle to Identity as the viewer, for the
51
+ app's server action behind the chrome's `onAppMenuFoldedChange`. It never
52
+ throws.
53
+ - **`@boost33/shell-data/contract`**: `RAIL_CONTRACT`, a fixed person, product
54
+ list and set of pins, and the rail every app must draw from them. Each app's
55
+ test imports it with `backdropStandardRailKeys` from `@boost33/ui/backdrop`.
56
+
57
+ ### Fixed
58
+
59
+ - **A client could see a staff-only app on a fallback.** The last good list
60
+ was cached per Identity origin, and Identity filters the list by audience,
61
+ so after a team member's read a client falling back could be served Boost
62
+ Pipe. The cache is now kept per audience (team: the `staff` claim or a
63
+ Boost33 address). Found by score-jmini and hub-jmini, 16 Nov 2026.
64
+ - **The cache never holds pins.** It outlives the request and is shared by
65
+ everyone the server serves, so a fallback draws the default rail, never
66
+ somebody else's.
67
+
5
68
  ## 0.1.1 — 2026-11-13
6
69
 
7
70
  ### Added — `gate()` and `isNavigation()`, for an app whose proxy does more than refresh
@@ -0,0 +1,64 @@
1
+ export declare const RAIL_CONTRACT: {
2
+ /** The verified claims an app would pass: a client (not the Boost33 team), acting on an account with two products, in French. */
3
+ readonly claims: {
4
+ readonly email: "camille@atelier-nord.example";
5
+ readonly name: "Camille Martin";
6
+ readonly orgName: "Atelier Nord";
7
+ readonly locale: "fr-FR";
8
+ readonly act: "acc_contract";
9
+ readonly accounts: readonly [{
10
+ readonly id: "acc_contract";
11
+ readonly role: "admin";
12
+ readonly products: readonly ["boostscore", "boostoutbound"];
13
+ readonly walletId: "wal_contract";
14
+ }];
15
+ };
16
+ /** The configuration an app would pass, minus its keys. */
17
+ readonly config: {
18
+ readonly identityUrl: "https://id.boost33.example";
19
+ readonly hubUrl: "https://app.boost33.example";
20
+ };
21
+ /**
22
+ * Identity's answer: the Wallet, three apps, one app not ready on Backdrop
23
+ * (hidden), and the person's pins in their order, one of them for the hidden
24
+ * app, which is dropped.
25
+ */
26
+ readonly response: {
27
+ readonly products: readonly [{
28
+ readonly slug: "boostoutbound";
29
+ readonly name: "Boost Outbound";
30
+ readonly url: "https://outbound.boost33.example";
31
+ readonly live: true;
32
+ readonly entitled: true;
33
+ }, {
34
+ readonly slug: "wallet";
35
+ readonly name: "Wallet";
36
+ readonly url: "https://wallet.boost33.example";
37
+ readonly live: true;
38
+ readonly entitled: true;
39
+ }, {
40
+ readonly slug: "boostscore";
41
+ readonly name: "Boost Score";
42
+ readonly url: "https://score.boost33.example";
43
+ readonly live: true;
44
+ readonly entitled: true;
45
+ }, {
46
+ readonly slug: "boostresults";
47
+ readonly name: "Boost Results";
48
+ readonly url: "https://results.boost33.example";
49
+ readonly live: true;
50
+ readonly entitled: false;
51
+ }, {
52
+ readonly slug: "boostvoice";
53
+ readonly name: "Boost Voice";
54
+ readonly url: "https://voice.boost33.example";
55
+ readonly live: true;
56
+ readonly entitled: true;
57
+ }];
58
+ readonly pinnedApps: readonly ["boostscore", "boostvoice", "boostoutbound"];
59
+ };
60
+ /** The rail, in order: what `backdropStandardRailKeys` must return for every app. */
61
+ readonly railKeys: readonly ["home", "wallet", "inbox", "boostscore", "boostoutbound", "allApps", "docs", "settings"];
62
+ /** The words: the person's language, as the chrome data serves it. */
63
+ readonly locale: "fr-FR";
64
+ };
@@ -0,0 +1,49 @@
1
+ /*
2
+ * The one-rail contract (0.2.0; Jamal, 18 Nov 2026: the rail is "always
3
+ * present the same regardless of which app the user is in").
4
+ *
5
+ * A fixed person, a fixed answer from Identity's `GET /api/v1/products` (the
6
+ * product list and the person's saved pins, as Identity sends them), and the
7
+ * rail every app must draw from them. Each app's contract test feeds
8
+ * `RAIL_CONTRACT.response` to `getBackdropChromeData` through a fake fetch,
9
+ * hands the result to `backdropStandardRailKeys` from @boost33/ui/backdrop, and
10
+ * expects `RAIL_CONTRACT.railKeys`. Imported, never copied, so a change here
11
+ * reaches every app's test at the next bump.
12
+ *
13
+ * Its own entry point, `@boost33/shell-data/contract`, with no `server-only`
14
+ * import, so a test runner imports it as plain data. It reads nothing and holds
15
+ * no secret.
16
+ */
17
+ export const RAIL_CONTRACT = {
18
+ /** The verified claims an app would pass: a client (not the Boost33 team), acting on an account with two products, in French. */
19
+ claims: {
20
+ email: 'camille@atelier-nord.example',
21
+ name: 'Camille Martin',
22
+ orgName: 'Atelier Nord',
23
+ locale: 'fr-FR',
24
+ act: 'acc_contract',
25
+ accounts: [{ id: 'acc_contract', role: 'admin', products: ['boostscore', 'boostoutbound'], walletId: 'wal_contract' }],
26
+ },
27
+ /** The configuration an app would pass, minus its keys. */
28
+ config: { identityUrl: 'https://id.boost33.example', hubUrl: 'https://app.boost33.example' },
29
+ /**
30
+ * Identity's answer: the Wallet, three apps, one app not ready on Backdrop
31
+ * (hidden), and the person's pins in their order, one of them for the hidden
32
+ * app, which is dropped.
33
+ */
34
+ response: {
35
+ products: [
36
+ { slug: 'boostoutbound', name: 'Boost Outbound', url: 'https://outbound.boost33.example', live: true, entitled: true },
37
+ { slug: 'wallet', name: 'Wallet', url: 'https://wallet.boost33.example', live: true, entitled: true },
38
+ { slug: 'boostscore', name: 'Boost Score', url: 'https://score.boost33.example', live: true, entitled: true },
39
+ { slug: 'boostresults', name: 'Boost Results', url: 'https://results.boost33.example', live: true, entitled: false },
40
+ { slug: 'boostvoice', name: 'Boost Voice', url: 'https://voice.boost33.example', live: true, entitled: true },
41
+ ],
42
+ pinnedApps: ['boostscore', 'boostvoice', 'boostoutbound'],
43
+ },
44
+ /** The rail, in order: what `backdropStandardRailKeys` must return for every app. */
45
+ railKeys: ['home', 'wallet', 'inbox', 'boostscore', 'boostoutbound', 'allApps', 'docs', 'settings'],
46
+ /** The words: the person's language, as the chrome data serves it. */
47
+ locale: 'fr-FR',
48
+ };
49
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,iIAAiI;IACjI,MAAM,EAAE;QACN,KAAK,EAAE,8BAA8B;QACrC,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,cAAc;QACnB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,OAAgB,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;KAChI;IACD,2DAA2D;IAC3D,MAAM,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,EAAE,6BAA6B,EAAE;IAC5F;;;;OAIG;IACH,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,kCAAkC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;YACtH,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,gCAAgC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;YACrG,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,+BAA+B,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC7G,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,iCAAiC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;YACpH,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,+BAA+B,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC9G;QACD,UAAU,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC;KAC1D;IACD,qFAAqF;IACrF,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC;IACnG,sEAAsE;IACtE,MAAM,EAAE,OAAO;CACP,CAAA"}
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export type GetBackdropChromeDataDeps = {
18
18
  tokenSplit?: TokenSplitReader;
19
19
  };
20
20
  export type { TokenSplitReader } from './tokens.js';
21
+ export { BACKDROP_NOT_READY, hiddenOnBackdrop, pinnedFrom, saveAppMenuFolded } from './products.js';
21
22
  /**
22
23
  * Everything the Backdrop chrome draws, from one call (B33-1726).
23
24
  *
package/dist/index.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import 'server-only';
2
2
  import { linksFrom } from './links.js';
3
3
  import { personFrom } from './person.js';
4
- import { readProducts } from './products.js';
4
+ import { readProductsAndSettings } from './products.js';
5
5
  import { readProfileName } from './profile.js';
6
6
  import { ledgerReader, readTokens } from './tokens.js';
7
+ // 0.2.0: the one rail. The pin rule and the hidden-app rule, shared with the
8
+ // Hub so it and every app draw the same rail.
9
+ export { BACKDROP_NOT_READY, hiddenOnBackdrop, pinnedFrom, saveAppMenuFolded } from './products.js';
7
10
  /**
8
11
  * Everything the Backdrop chrome draws, from one call (B33-1726).
9
12
  *
@@ -31,12 +34,16 @@ import { ledgerReader, readTokens } from './tokens.js';
31
34
  */
32
35
  export function getBackdropChromeData(input, deps = {}) {
33
36
  const fetchImpl = deps.fetch ?? fetch;
37
+ // One read of Identity: the product list and the person's rail settings.
38
+ const read = readProductsAndSettings(input, fetchImpl);
34
39
  return {
35
40
  person: personFrom(input.claims),
36
41
  profileName: readProfileName({ sid: input.cookies.sid, config: input.config }, fetchImpl),
37
- products: readProducts(input, fetchImpl),
42
+ products: read.then((result) => result.products),
43
+ appMenuFolded: read.then((result) => result.appMenuFolded),
38
44
  tokens: readTokens(input.claims, input.cookies.ctx, deps.tokenSplit ?? ledgerReader(input.config)),
39
45
  links: linksFrom(input.config),
46
+ locale: input.claims.locale ?? null,
40
47
  };
41
48
  }
42
49
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAyB,MAAM,aAAa,CAAA;AA8B7E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAiC,EACjC,OAAkC,EAAE;IAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAA;IACrC,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;QAChC,WAAW,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC;QACzF,QAAQ,EAAE,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC;QACxC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE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C,MAAM,CAAC,aAAa,CAAC;QAC1D,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClG,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;QAC9B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI;KACpC,CAAA;AACH,CAAC"}
package/dist/links.js CHANGED
@@ -24,6 +24,7 @@ export function linksFrom(config) {
24
24
  signOut: `${identity}/signout`,
25
25
  docs: config.docsUrl ?? DEFAULT_DOCS_URL,
26
26
  support: `mailto:${config.supportEmail ?? DEFAULT_SUPPORT_EMAIL}`,
27
+ inbox: `${hub}/inbox`,
27
28
  };
28
29
  }
29
30
  //# sourceMappingURL=links.js.map
package/dist/links.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"links.js","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAA;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAA;AAE1D,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,MAAoB;IAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;IAC3C,OAAO;QACL,IAAI,EAAE,GAAG,GAAG,GAAG;QACf,QAAQ,EAAE,GAAG,GAAG,WAAW;QAC3B,OAAO,EAAE,GAAG,GAAG,mBAAmB;QAClC,OAAO,EAAE,GAAG,GAAG,uBAAuB;QACtC,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AU;QAC9B,IAAI,EAAE,MAAM,CAAC,OAAO,IAAI,gBAAgB;QACxC,OAAO,EAAE,UAAU,MAAM,CAAC,YAAY,IAAI,qBAAqB,EAAE;QACjE,KAAK,EAAE,GAAG,GAAG,QAAQ;KACtB,CAAA;AACH,CAAC"}
@@ -1,5 +1,35 @@
1
1
  import type { ChromeClaims, ChromeConfig, ChromeProducts } from './types.js';
2
2
  export declare const READ_TIMEOUT_MS = 5000;
3
+ /**
4
+ * ── Apps whose own Backdrop is not ready, hidden from Backdrop viewers ──────
5
+ *
6
+ * Jamal, 16 Nov 2026, when Backdrop went customer-wide: a person on Backdrop
7
+ * should not be able to open an app that has not moved yet ("users can't even
8
+ * go into them"). It was the Hub's own list (boost33-hub
9
+ * src/app/backdrop/app-cards.ts, `BACKDROP_NOT_READY`) and moved here in 0.2.0,
10
+ * so every app hides the same apps (Jamal, 18 Nov 2026: one rule, the same in
11
+ * every app).
12
+ *
13
+ * A record of work in flight, not a feature: each slug comes off the day that
14
+ * app's `*_BACKDROP_READY` flips, and the list then goes, with this filter.
15
+ * It removes the door from the chrome, nothing more: the app still answers on
16
+ * its own origin, so a bookmark or a payment return still reaches it. Identity
17
+ * serving each product's readiness would make this list unnecessary.
18
+ */
19
+ export declare const BACKDROP_NOT_READY: readonly string[];
20
+ /** The one hidden-app rule: drawn nowhere in the Backdrop chrome. */
21
+ export declare function hiddenOnBackdrop(slug: string): boolean;
22
+ /**
23
+ * The rail's apps from the person's saved pins, the Hub's `splitByPin` rule
24
+ * moved here so every app draws the same rail (0.2.0):
25
+ *
26
+ * - `null` (never chosen, or no pins could be read): the first four of `slugs`;
27
+ * - `[]` (chose none): none;
28
+ * - a list: that list, in its order, kept to slugs in `slugs` (a pin survives a
29
+ * lapsed grant in Identity, so it may name an app this list no longer has),
30
+ * each once, at most four.
31
+ */
32
+ export declare function pinnedFrom(slugs: readonly string[], saved: readonly string[] | null): string[];
3
33
  /** For tests: forget every cached list. */
4
34
  export declare function forgetProducts(): void;
5
35
  /**
@@ -15,3 +45,34 @@ export declare function readProducts(input: {
15
45
  };
16
46
  config: ChromeConfig;
17
47
  }, fetchImpl: typeof fetch): Promise<ChromeProducts | null>;
48
+ /**
49
+ * The product list and the person's two rail settings, from one read of
50
+ * Identity's `GET /api/v1/products` (0.2.0). The settings are the person's
51
+ * own, so they are read live and never cached: on a fallback both are their
52
+ * defaults (pins null, the fold null), never anyone's last read.
53
+ */
54
+ export declare function readProductsAndSettings(input: {
55
+ claims: ChromeClaims;
56
+ cookies: {
57
+ sid: string;
58
+ ctx: string | null;
59
+ };
60
+ config: ChromeConfig;
61
+ }, fetchImpl: typeof fetch): Promise<{
62
+ products: ChromeProducts | null;
63
+ appMenuFolded: boolean | null;
64
+ }>;
65
+ /**
66
+ * Saves the person's app-menu fold to Identity (`POST /api/v1/profile/app-menu`,
67
+ * idempotent), as the viewer: their own `b33_sid`, no key. For the app's server
68
+ * action behind the chrome's `onAppMenuFoldedChange`. True when Identity took
69
+ * it. Never throws: a failed save leaves the menu as the person left it.
70
+ */
71
+ export declare function saveAppMenuFolded(input: {
72
+ cookies: {
73
+ sid: string;
74
+ ctx: string | null;
75
+ };
76
+ config: Pick<ChromeConfig, 'identityUrl'>;
77
+ folded: boolean | null;
78
+ }, fetchImpl?: typeof fetch): Promise<boolean>;
package/dist/products.js CHANGED
@@ -4,8 +4,65 @@ const WALLET_SLUG = 'wallet';
4
4
  const PINNED = 4;
5
5
  export const READ_TIMEOUT_MS = 5_000;
6
6
  /**
7
- * The last list that read cleanly, per Identity origin, without `entitled`:
8
- * that half is per person and is rebuilt from the claims on a fallback.
7
+ * ── Apps whose own Backdrop is not ready, hidden from Backdrop viewers ──────
8
+ *
9
+ * Jamal, 16 Nov 2026, when Backdrop went customer-wide: a person on Backdrop
10
+ * should not be able to open an app that has not moved yet ("users can't even
11
+ * go into them"). It was the Hub's own list (boost33-hub
12
+ * src/app/backdrop/app-cards.ts, `BACKDROP_NOT_READY`) and moved here in 0.2.0,
13
+ * so every app hides the same apps (Jamal, 18 Nov 2026: one rule, the same in
14
+ * every app).
15
+ *
16
+ * A record of work in flight, not a feature: each slug comes off the day that
17
+ * app's `*_BACKDROP_READY` flips, and the list then goes, with this filter.
18
+ * It removes the door from the chrome, nothing more: the app still answers on
19
+ * its own origin, so a bookmark or a payment return still reaches it. Identity
20
+ * serving each product's readiness would make this list unnecessary.
21
+ */
22
+ export const BACKDROP_NOT_READY = ['boostvoice'];
23
+ /** The one hidden-app rule: drawn nowhere in the Backdrop chrome. */
24
+ export function hiddenOnBackdrop(slug) {
25
+ return BACKDROP_NOT_READY.includes(slug);
26
+ }
27
+ /**
28
+ * The rail's apps from the person's saved pins, the Hub's `splitByPin` rule
29
+ * moved here so every app draws the same rail (0.2.0):
30
+ *
31
+ * - `null` (never chosen, or no pins could be read): the first four of `slugs`;
32
+ * - `[]` (chose none): none;
33
+ * - a list: that list, in its order, kept to slugs in `slugs` (a pin survives a
34
+ * lapsed grant in Identity, so it may name an app this list no longer has),
35
+ * each once, at most four.
36
+ */
37
+ export function pinnedFrom(slugs, saved) {
38
+ if (saved === null)
39
+ return slugs.slice(0, PINNED);
40
+ const known = new Set(slugs);
41
+ const out = [];
42
+ for (const slug of saved) {
43
+ if (out.length === PINNED)
44
+ break;
45
+ if (known.has(slug) && !out.includes(slug))
46
+ out.push(slug);
47
+ }
48
+ return out;
49
+ }
50
+ /**
51
+ * Whose list a cached copy is. Identity filters the registry by audience: a
52
+ * Boost33 team member's list carries staff-only products (Boost Pipe) that a
53
+ * client's must not, not even as "soon". So a fallback may serve only a list
54
+ * read for the same audience (found by score-jmini and hub-jmini, 16 Nov 2026).
55
+ * Team, as Identity decides it: the staff flag, or a Boost33 address.
56
+ */
57
+ function audienceOf(claims) {
58
+ return claims.staff === true || /@boost33\.(com|network)$/i.test(claims.email) ? 'team' : 'clients';
59
+ }
60
+ /**
61
+ * The last list that read cleanly, per Identity origin and audience, without
62
+ * `entitled`: that half is per person and is rebuilt from the claims on a
63
+ * fallback. **Never the person's pins**: this map outlives the request and is
64
+ * shared by everyone this server process serves, so a fallback draws the
65
+ * default rail rather than somebody else's (identity-jmini, 18 Nov 2026).
9
66
  * Module scope, so it lives as long as the server process, as the Hub's does.
10
67
  */
11
68
  const lastGood = new Map();
@@ -13,6 +70,23 @@ const lastGood = new Map();
13
70
  export function forgetProducts() {
14
71
  lastGood.clear();
15
72
  }
73
+ /**
74
+ * The person's saved pins from the same response (Identity, 18 Nov 2026):
75
+ * `null` never chose, `[]` chose none, a list in rail order. Anything else,
76
+ * including an Identity that does not send the key yet, reads as null, the
77
+ * default rail.
78
+ */
79
+ function parsePins(body) {
80
+ const pins = body && typeof body === 'object' ? body.pinnedApps : undefined;
81
+ if (!Array.isArray(pins) || !pins.every((slug) => typeof slug === 'string'))
82
+ return null;
83
+ return pins;
84
+ }
85
+ /** The person's saved app-menu fold, from the same response: true folded, false open, null never chose. Anything else is null. */
86
+ function parseFold(body) {
87
+ const folded = body && typeof body === 'object' ? body.appMenuFolded : undefined;
88
+ return typeof folded === 'boolean' ? folded : null;
89
+ }
16
90
  function parseRegistry(body) {
17
91
  if (!body || typeof body !== 'object')
18
92
  return null;
@@ -41,15 +115,15 @@ function stateOf(entry, hasAccount, supportEmail) {
41
115
  return { state: 'open', href: entry.url };
42
116
  }
43
117
  const shortNameOf = (name) => name.replace(/^Boost\s+/i, '') || name;
44
- function shape(entries, hasAccount, supportEmail, stale) {
118
+ function shape(entries, pins, hasAccount, supportEmail, stale) {
45
119
  const wallet = entries.find((entry) => entry.slug === WALLET_SLUG);
46
120
  const walletHref = wallet?.live ? wallet.url : null;
47
121
  const all = entries
48
- .filter((entry) => entry.slug !== WALLET_SLUG)
122
+ .filter((entry) => entry.slug !== WALLET_SLUG && !hiddenOnBackdrop(entry.slug))
49
123
  .map((entry) => ({ slug: entry.slug, name: entry.name, shortName: shortNameOf(entry.name), ...stateOf(entry, hasAccount, supportEmail) }));
50
124
  return {
51
125
  all,
52
- pinned: all.slice(0, PINNED).map((product) => product.slug),
126
+ pinned: pinnedFrom(all.map((product) => product.slug), pins),
53
127
  walletHref,
54
128
  buyTokensHref: walletHref ? `${walletHref.replace(/\/+$/, '')}/subscribe` : null,
55
129
  stale,
@@ -61,16 +135,30 @@ function shape(entries, hasAccount, supportEmail, stale) {
61
135
  * the viewer, B33-1725). Five seconds, then the last good list, then null.
62
136
  */
63
137
  export async function readProducts(input, fetchImpl) {
138
+ return (await readProductsAndSettings(input, fetchImpl)).products;
139
+ }
140
+ /**
141
+ * The product list and the person's two rail settings, from one read of
142
+ * Identity's `GET /api/v1/products` (0.2.0). The settings are the person's
143
+ * own, so they are read live and never cached: on a fallback both are their
144
+ * defaults (pins null, the fold null), never anyone's last read.
145
+ */
146
+ export async function readProductsAndSettings(input, fetchImpl) {
64
147
  const identity = input.config.identityUrl.replace(/\/+$/, '');
65
148
  const supportEmail = input.config.supportEmail ?? DEFAULT_SUPPORT_EMAIL;
66
149
  const account = actingAccount(input.claims);
67
150
  const hasAccount = account !== undefined;
151
+ const cacheKey = `${identity}|${audienceOf(input.claims)}`;
152
+ // The pins and the fold are never taken from a cache: a fallback draws the defaults.
68
153
  const fallback = () => {
69
- const cached = lastGood.get(identity);
154
+ const cached = lastGood.get(cacheKey);
70
155
  if (!cached)
71
- return null;
156
+ return { products: null, appMenuFolded: null };
72
157
  const entitled = (slug) => slug === WALLET_SLUG ? hasAccount : hasAccount && (account?.products ?? []).includes(slug);
73
- return shape(cached.map((entry) => ({ ...entry, entitled: entitled(entry.slug) })), hasAccount, supportEmail, true);
158
+ return {
159
+ products: shape(cached.map((entry) => ({ ...entry, entitled: entitled(entry.slug) })), null, hasAccount, supportEmail, true),
160
+ appMenuFolded: null,
161
+ };
74
162
  };
75
163
  try {
76
164
  const cookie = [`b33_sid=${input.cookies.sid}`, input.cookies.ctx ? `b33_ctx=${input.cookies.ctx}` : null]
@@ -83,14 +171,36 @@ export async function readProducts(input, fetchImpl) {
83
171
  });
84
172
  if (!res.ok)
85
173
  return fallback();
86
- const entries = parseRegistry(await res.json().catch(() => null));
174
+ const body = await res.json().catch(() => null);
175
+ const entries = parseRegistry(body);
87
176
  if (!entries)
88
177
  return fallback();
89
- lastGood.set(identity, entries.map(({ slug, name, url, live }) => ({ slug, name, url, live })));
90
- return shape(entries, hasAccount, supportEmail, false);
178
+ lastGood.set(cacheKey, entries.map(({ slug, name, url, live }) => ({ slug, name, url, live })));
179
+ return { products: shape(entries, parsePins(body), hasAccount, supportEmail, false), appMenuFolded: parseFold(body) };
91
180
  }
92
181
  catch {
93
182
  return fallback();
94
183
  }
95
184
  }
185
+ /**
186
+ * Saves the person's app-menu fold to Identity (`POST /api/v1/profile/app-menu`,
187
+ * idempotent), as the viewer: their own `b33_sid`, no key. For the app's server
188
+ * action behind the chrome's `onAppMenuFoldedChange`. True when Identity took
189
+ * it. Never throws: a failed save leaves the menu as the person left it.
190
+ */
191
+ export async function saveAppMenuFolded(input, fetchImpl = fetch) {
192
+ try {
193
+ const res = await fetchImpl(`${input.config.identityUrl.replace(/\/+$/, '')}/api/v1/profile/app-menu`, {
194
+ method: 'POST',
195
+ headers: { cookie: `b33_sid=${input.cookies.sid}`, 'content-type': 'application/json' },
196
+ body: JSON.stringify({ appMenuFolded: input.folded }),
197
+ cache: 'no-store',
198
+ signal: AbortSignal.timeout(READ_TIMEOUT_MS),
199
+ });
200
+ return res.ok;
201
+ }
202
+ catch {
203
+ return false;
204
+ }
205
+ }
96
206
  //# sourceMappingURL=products.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"products.js","sourceRoot":"","sources":["../src/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAGlD,MAAM,WAAW,GAAG,QAAQ,CAAA;AAC5B,MAAM,MAAM,GAAG,CAAC,CAAA;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAA;AAIpC;;;;GAIG;AAC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AAE,kBAAkB,EAAE;YACvF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;YACrD,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC;SAC7C,CAAC,CAAA;QACF,OAAO,GAAG,CAAC,EAAE,CAAA;IACf,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
package/dist/types.d.ts CHANGED
@@ -10,6 +10,13 @@
10
10
  export type ChromeClaims = {
11
11
  email: string;
12
12
  name: string | null;
13
+ /**
14
+ * The person's language, a BCP-47 tag ("fr", "en-GB"), when the claims carry
15
+ * one. Served back as `locale`, which the chrome reads to pick its words.
16
+ */
17
+ locale?: string | null;
18
+ /** Identity's staff flag, when the claims carry it. With the email's domain, it decides whose product list a cache may serve. */
19
+ staff?: boolean;
13
20
  orgName?: string | null;
14
21
  act: string | null;
15
22
  accounts: ReadonlyArray<{
@@ -89,9 +96,12 @@ export type ChromeProducts = {
89
96
  /** Every product except the Wallet, in the order Identity returned them. */
90
97
  all: ChromeProduct[];
91
98
  /**
92
- * Slugs pinned on the rail: the first four of `all`. Identity's order, never a
93
- * list baked in here (CLAUDE.md in @boost33/ui: "the product list is served,
94
- * never hardcoded"); Identity serving an explicit order is a ticket of its own.
99
+ * Slugs on the rail, in the person's order (0.2.0; Jamal, 18 Nov 2026: the
100
+ * rail is remembered per person and the same in every app). From the
101
+ * person's saved pins, which Identity serves with the product list:
102
+ * never chosen, or a read that failed, gives the first four of `all`; chosen
103
+ * none gives none; a list gives that list, kept to slugs `all` has, without
104
+ * repeats, at most four. One rule for every app (`pinnedFrom`).
95
105
  */
96
106
  pinned: string[];
97
107
  /** The Wallet, when it is live. Null hides it from the rail. */
@@ -138,6 +148,8 @@ export type ChromeLinks = {
138
148
  signOut: string;
139
149
  docs: string;
140
150
  support: string;
151
+ /** 0.2.0: the Hub's Inbox. The rail draws it after Wallet in every app. */
152
+ inbox: string;
141
153
  };
142
154
  export type BackdropChromeData = {
143
155
  /** Drawn at once, from the claims. */
@@ -149,4 +161,17 @@ export type BackdropChromeData = {
149
161
  /** Never rejects; failure is `{ kind: 'unknown' }`. */
150
162
  tokens: Promise<ChromeTokens>;
151
163
  links: ChromeLinks;
164
+ /**
165
+ * 0.2.0: the person's language from the claims, or null. Spread onto the
166
+ * chrome with the rest, it picks the chrome's words: French for an `fr` tag,
167
+ * English otherwise.
168
+ */
169
+ locale: string | null;
170
+ /**
171
+ * 0.2.0: whether the person keeps an app's page menu folded, read with the
172
+ * product list (true folded, false open, null never chose or the read
173
+ * failed). Never cached. Never rejects. The chrome draws the menu in this
174
+ * state from the start.
175
+ */
176
+ appMenuFolded: Promise<boolean | null>;
152
177
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boost33/shell-data",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Server-only reads that hand the Backdrop chrome in @boost33/ui exactly the data it draws.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -20,6 +20,10 @@
20
20
  "types": "./dist/index.d.ts",
21
21
  "import": "./dist/index.js"
22
22
  },
23
+ "./contract": {
24
+ "types": "./dist/contract.d.ts",
25
+ "import": "./dist/contract.js"
26
+ },
23
27
  "./session": {
24
28
  "types": "./dist/session.d.ts",
25
29
  "import": "./dist/session.js"
@@ -48,7 +52,7 @@
48
52
  }
49
53
  },
50
54
  "devDependencies": {
51
- "@boost33/ui": "0.11.0",
55
+ "@boost33/ui": "0.16.0",
52
56
  "@types/node": "^24.0.0",
53
57
  "@types/react": "19.3.0",
54
58
  "jose": "^6.2.17",