@tokenoftrust/storefront-runner 7.6.8 → 7.6.9

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.
@@ -13,6 +13,7 @@ export type { AgentRoleId };
13
13
  export const PREVIEW_VIEW_ROLE = "preview:view" as const satisfies AgentRoleId;
14
14
  export const ADMIN_READ_ROLE = "admin:read" as const satisfies AgentRoleId;
15
15
  export const ORDERS_FULFIL_BY_ID_ROLE = "orders:fulfil-by-id" as const satisfies AgentRoleId;
16
+ export const ORDERS_READ_HOLDS_ROLE = "orders:read-holds" as const satisfies AgentRoleId;
16
17
 
17
18
  /** True when the catalog permits the role and the grant names it exactly. */
18
19
  export function agentHoldsRole(roles: readonly string[] | null | undefined, role: CatalogCapabilityId): boolean {
@@ -14,7 +14,8 @@
14
14
  * - the ROLE-GATED routes in {@link AGENT_ROLE_ROUTES}, each only while the agent's
15
15
  * grant roles name that route's role: the PII-blind order reads (`admin:read`) and
16
16
  * the fulfil-by-id operation (`orders:fulfil-by-id`, which tot20 still decides per
17
- * call), the stock levels and movement history reads, and the supplier and purchase
17
+ * call), the hold-reasons read (`orders:read-holds`, rechecked by tot20 on every page),
18
+ * the stock levels and movement history reads, and the supplier and purchase
18
19
  * order reads (`admin:read`). Those handlers project an agent's view; the gate only
19
20
  * admits. No purchasing write is reachable: an agent never creates, sends or receives
20
21
  * a purchase order through a route.
@@ -28,7 +29,13 @@
28
29
  */
29
30
  import type { SessionRecord } from "./session.js";
30
31
  import { isAgentSession } from "./session.js";
31
- import { ADMIN_READ_ROLE, agentHoldsRole, ORDERS_FULFIL_BY_ID_ROLE, type AgentRoleId } from "./agentRoles.js";
32
+ import {
33
+ ADMIN_READ_ROLE,
34
+ agentHoldsRole,
35
+ ORDERS_FULFIL_BY_ID_ROLE,
36
+ ORDERS_READ_HOLDS_ROLE,
37
+ type AgentRoleId,
38
+ } from "./agentRoles.js";
32
39
 
33
40
  /** Exact non-content routes an agent session may reach, by method. */
34
41
  export const AGENT_ALLOWED_ROUTES: ReadonlyArray<{ method: string; path: string }> = [
@@ -53,6 +60,7 @@ export const AGENT_ROLE_ROUTES: ReadonlyArray<{ method: string; path: string; ro
53
60
  { method: "GET", path: "/api/admin/purchasing/orders", role: ADMIN_READ_ROLE },
54
61
  { method: "GET", path: "/api/admin/purchasing/orders/:id", role: ADMIN_READ_ROLE },
55
62
  { method: "POST", path: "/api/admin/fulfillment/fulfil-by-id", role: ORDERS_FULFIL_BY_ID_ROLE },
63
+ { method: "GET", path: "/api/admin/hold-reasons", role: ORDERS_READ_HOLDS_ROLE },
56
64
  ];
57
65
 
58
66
  function routeMatches(pattern: string, path: string): boolean {
@@ -5,7 +5,7 @@
5
5
 
6
6
  /** The vendored artifact's schema and the digest tot20 stamped on it. */
7
7
  export const CAPABILITY_CATALOG_SCHEMA = "tot.capability-catalog/v1" as const;
8
- export const CAPABILITY_CATALOG_DIGEST = "sha256:575fa5e1da430973a51979967d3602314f987c6ca9cab3b2793adfa2c686e250" as const;
8
+ export const CAPABILITY_CATALOG_DIGEST = "sha256:ad601b987e2dc989aeaae1315d451cbce5d9b824393eebba409aa36fee1e2089" as const;
9
9
 
10
10
  /** Every capability row id the catalog names. */
11
11
  export const CATALOG_CAPABILITY_IDS = [
@@ -79,6 +79,7 @@ export const CATALOG_CAPABILITY_IDS = [
79
79
  "message:send-status",
80
80
  "orders:fulfil-by-id",
81
81
  "orders:read-customer",
82
+ "orders:read-holds",
82
83
  "orders:read-minimal",
83
84
  "orders:read-recipient",
84
85
  "orders:webhook",
@@ -127,6 +128,7 @@ export type CatalogBundleName = (typeof CATALOG_BUNDLE_NAMES)[number];
127
128
  export const AGENT_ROLE_IDS = [
128
129
  "admin:read",
129
130
  "orders:fulfil-by-id",
131
+ "orders:read-holds",
130
132
  "preview:view",
131
133
  ] as const satisfies readonly CatalogCapabilityId[];
132
134
  export type AgentRoleId = (typeof AGENT_ROLE_IDS)[number];
@@ -140,6 +142,7 @@ export const APP_AUDIENCE_CAPABILITY_IDS = [
140
142
  "inventory:read",
141
143
  "inventory:write",
142
144
  "message:send-status",
145
+ "orders:read-holds",
143
146
  "orders:read-minimal",
144
147
  "orders:read-recipient",
145
148
  "orders:webhook",
@@ -158,6 +161,7 @@ export const PRIVATE_APP_SCOPE_IDS = [
158
161
  "fulfillment:process",
159
162
  "inventory:read",
160
163
  "inventory:write",
164
+ "orders:read-holds",
161
165
  "orders:read-minimal",
162
166
  "orders:read-recipient",
163
167
  "orders:webhook",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/storefront-runner",
3
- "version": "7.6.8",
3
+ "version": "7.6.9",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
6
6
  "packageManager": "pnpm@11.9.0",