@tokenoftrust/storefront-runner 7.6.3 → 7.6.4

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.
@@ -1,20 +1,20 @@
1
1
  /**
2
- * The four sponsored-agent role ids, bound by name from the generated catalog vocabulary
3
- * (`AGENT_ROLE_IDS`, ADR capabilities-management §11, D2.6). Storefront code names a
4
- * role through these constants, never as a string literal (`agentRoles.test.ts` scans
5
- * the tree for one).
2
+ * Capability names used by the sponsored-agent routes and store entry. A grant can
3
+ * satisfy a role check only when the generated catalog marks that role as holdable.
6
4
  *
7
5
  * The roles an agent session carries (`actor.roles`) only NARROW what it may reach; they
8
6
  * never unlock anything locally. Customer PII in particular stays projected away for an
9
7
  * agent whatever its roles say, and `orders:fulfil-by-id` still asks tot20 per operation.
10
8
  */
11
- import { AGENT_ROLE_IDS, type AgentRoleId } from "@/lib/access/shared/generated/capabilityCatalog.generated";
9
+ import { isAgentRoleId, type AgentRoleId, type CatalogCapabilityId } from "@/lib/access/shared/generated/capabilityCatalog.generated";
12
10
 
13
11
  export type { AgentRoleId };
14
12
 
15
- export const [PREVIEW_VIEW_ROLE, ADMIN_READ_ROLE, ORDERS_FULFIL_BY_ID_ROLE, ORDERS_READ_CUSTOMER_ROLE] = AGENT_ROLE_IDS;
13
+ export const PREVIEW_VIEW_ROLE = "preview:view" as const satisfies AgentRoleId;
14
+ export const ADMIN_READ_ROLE = "admin:read" as const satisfies AgentRoleId;
15
+ export const ORDERS_FULFIL_BY_ID_ROLE = "orders:fulfil-by-id" as const satisfies AgentRoleId;
16
16
 
17
- /** True when an agent's grant roles name `role` exactly. */
18
- export function agentHoldsRole(roles: readonly string[] | null | undefined, role: AgentRoleId): boolean {
19
- return Array.isArray(roles) && roles.includes(role);
17
+ /** True when the catalog permits the role and the grant names it exactly. */
18
+ export function agentHoldsRole(roles: readonly string[] | null | undefined, role: CatalogCapabilityId): boolean {
19
+ return isAgentRoleId(role) && Array.isArray(roles) && roles.includes(role);
20
20
  }
@@ -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:abd0918720e907e52a5e2b00feedac93938a2bc097b9eb49695383a8e2e661f4" as const;
8
+ export const CAPABILITY_CATALOG_DIGEST = "sha256:0683a9f2312c22c53fd995e5b8f90929b8887251d5fc47300f82776801203a39" as const;
9
9
 
10
10
  /** Every capability row id the catalog names. */
11
11
  export const CATALOG_CAPABILITY_IDS = [
@@ -110,12 +110,11 @@ export const CATALOG_BUNDLE_NAMES = [
110
110
  ] as const;
111
111
  export type CatalogBundleName = (typeof CATALOG_BUNDLE_NAMES)[number];
112
112
 
113
- /** The sponsored-agent role ids storefront enforces app-locally. */
113
+ /** Capability rows marked holdable by sponsored agents in the catalog. */
114
114
  export const AGENT_ROLE_IDS = [
115
- "preview:view",
116
115
  "admin:read",
117
116
  "orders:fulfil-by-id",
118
- "orders:read-customer",
117
+ "preview:view",
119
118
  ] as const satisfies readonly CatalogCapabilityId[];
120
119
  export type AgentRoleId = (typeof AGENT_ROLE_IDS)[number];
121
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/storefront-runner",
3
- "version": "7.6.3",
3
+ "version": "7.6.4",
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",