@tokenoftrust/storefront-runner 2.4.88 → 2.4.90

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.
Files changed (239) hide show
  1. package/apps/storefront/astro.config.mjs +2 -2
  2. package/apps/storefront/drizzle.config.apps.ts +1 -1
  3. package/apps/storefront/env.d.ts +1 -1
  4. package/apps/storefront/migrations/README.md +5 -5
  5. package/apps/storefront/perf/README.md +6 -6
  6. package/apps/storefront/perf/assert-budgets.ts +2 -2
  7. package/apps/storefront/src/components/catalog/storefront/CollectionCard.astro +1 -1
  8. package/apps/storefront/src/components/catalog/storefront/ProductCard.astro +1 -1
  9. package/apps/storefront/src/components/catalog/storefront/commerce/BrandGrid.astro +1 -1
  10. package/apps/storefront/src/components/catalog/storefront/commerce/TagFilterCloud.astro +1 -1
  11. package/apps/storefront/src/components/catalog/storefront/islands/QuickView.tsx +1 -1
  12. package/apps/storefront/src/components/catalog/storefront/islands/RecentlyViewed.tsx +1 -1
  13. package/apps/storefront/src/components/catalog/storefront/islands/SearchTypeahead.tsx +1 -1
  14. package/apps/storefront/src/components/catalog/storefront/plp/ActiveFilters.astro +2 -2
  15. package/apps/storefront/src/components/catalog/storefront/plp/FacetSidebar.astro +2 -2
  16. package/apps/storefront/src/components/catalog/storefront/plp/Pagination.astro +1 -1
  17. package/apps/storefront/src/components/content/storefront/Breadcrumbs.astro +1 -1
  18. package/apps/storefront/src/components/content/storefront/EmptyState.astro +1 -1
  19. package/apps/storefront/src/components/content/storefront/blog/BlogPaywall.astro +1 -1
  20. package/apps/storefront/src/components/content/storefront/blog/ReactionBar.astro +2 -2
  21. package/apps/storefront/src/components/content/storefront/chrome/NavDropdown.astro +1 -1
  22. package/apps/storefront/src/components/content/storefront/chrome/SiteFooter.astro +1 -1
  23. package/apps/storefront/src/components/content/storefront/chrome/SiteHeader.astro +1 -1
  24. package/apps/storefront/src/components/content/storefront/chrome/UtilityNav.astro +1 -1
  25. package/apps/storefront/src/components/content/storefront/commerce/ArticleCard.astro +1 -1
  26. package/apps/storefront/src/components/content/storefront/home/Hero.astro +1 -1
  27. package/apps/storefront/src/components/content/storefront/marketing/CardGrid.astro +1 -1
  28. package/apps/storefront/src/components/content/storefront/marketing/Integrations.astro +1 -1
  29. package/apps/storefront/src/components/content/storefront/marketing/MarketingCtas.astro +1 -1
  30. package/apps/storefront/src/components/customers/storefront/islands/SavedList.tsx +1 -1
  31. package/apps/storefront/src/config/adminTargetTenant.ts +1 -1
  32. package/apps/storefront/src/config/devTenants.ts +1 -1
  33. package/apps/storefront/src/config/resolver.ts +2 -2
  34. package/apps/storefront/src/layouts/Layout.astro +5 -5
  35. package/apps/storefront/src/lib/{admin → access/admin}/README.md +3 -3
  36. package/apps/storefront/src/lib/{admin → access/admin}/adminShell.ts +1 -1
  37. package/apps/storefront/src/lib/{admin → access/admin}/envelope.ts +2 -2
  38. package/apps/storefront/src/lib/{admin → access/admin}/viewmodels/settings.ts +2 -2
  39. package/apps/storefront/src/lib/{auth → access/auth}/adminApiGuard.ts +2 -2
  40. package/apps/storefront/src/lib/{auth → access/auth}/adminEntry.ts +3 -3
  41. package/apps/storefront/src/lib/{auth → access/auth}/adminLanding.ts +1 -1
  42. package/apps/storefront/src/lib/{auth → access/auth}/brokerAssertion.ts +1 -1
  43. package/apps/storefront/src/lib/{auth → access/auth}/devAuth.ts +1 -1
  44. package/apps/storefront/src/lib/{auth → access/auth}/identityToken.ts +2 -2
  45. package/apps/storefront/src/lib/{auth → access/auth}/loginGate.ts +2 -2
  46. package/apps/storefront/src/lib/{auth → access/auth}/mcpClientAssertion.ts +1 -1
  47. package/apps/storefront/src/lib/{auth → access/auth}/route.ts +1 -1
  48. package/apps/storefront/src/lib/{auth → access/auth}/totAccessClient.ts +5 -5
  49. package/apps/storefront/src/lib/{dashboard → access/dashboard}/delegateGate.ts +3 -3
  50. package/apps/storefront/src/lib/{dashboard → access/dashboard}/staffAdmission.ts +1 -1
  51. package/apps/storefront/src/lib/{dashboard → access/dashboard}/staffVendorAccess.ts +1 -1
  52. package/apps/storefront/src/lib/{dashboard → access/dashboard}/tenantSelection.ts +1 -1
  53. package/apps/storefront/src/lib/{admin/services/mock → access/fixtures}/settings.ts +4 -4
  54. package/apps/storefront/src/lib/{shared → access/shared}/accessExplain.ts +1 -1
  55. package/apps/storefront/src/lib/{adminTenantEnvelope.ts → access/shared/adminTenantEnvelope.ts} +3 -3
  56. package/apps/storefront/src/lib/{shared → access/shared}/developerInvites.ts +5 -5
  57. package/apps/storefront/src/lib/{shared → access/shared}/invitePreflight.ts +1 -1
  58. package/apps/storefront/src/lib/{shared → access/shared}/principalGrants.ts +3 -3
  59. package/apps/storefront/src/lib/{tenantRouting.ts → access/shared/tenantRouting.ts} +1 -1
  60. package/apps/storefront/src/lib/{shared → access/shared}/viewerGrant.ts +1 -1
  61. package/apps/storefront/src/lib/activity/fixtures/evidence.ts +2 -2
  62. package/apps/storefront/src/lib/activity/killSwitch.ts +1 -1
  63. package/apps/storefront/src/lib/activity/uiActor.ts +5 -5
  64. package/apps/storefront/src/lib/activity/workerCommit.ts +1 -1
  65. package/apps/storefront/src/lib/admin/services/mock/index.ts +4 -4
  66. package/apps/storefront/src/lib/assets/durableR2Bindings.ts +1 -1
  67. package/apps/storefront/src/lib/{admin → automation/admin}/viewmodels/aiWorkflows.ts +3 -3
  68. package/apps/storefront/src/lib/{admin → automation}/ai/askEnvelope.ts +1 -1
  69. package/apps/storefront/src/lib/{admin → automation}/ai/operationalRuns.ts +4 -4
  70. package/apps/storefront/src/lib/{admin/services/mock → automation/fixtures}/aiWorkflows.ts +4 -4
  71. package/apps/storefront/src/lib/catalog/fixtures/products.ts +4 -4
  72. package/apps/storefront/src/lib/checkout/admin/checkoutStyleTarget.ts +2 -2
  73. package/apps/storefront/src/lib/checkout/commerce/checkoutHandoffCorrelation.ts +1 -1
  74. package/apps/storefront/src/lib/checkout/fixtures/checkoutSettings.ts +1 -1
  75. package/apps/storefront/src/lib/checkout/shared/checkoutCommerce.ts +1 -1
  76. package/apps/storefront/src/lib/compliance/browser/checkoutVerificationFlow.ts +1 -1
  77. package/apps/storefront/src/lib/compliance/enforcement.ts +1 -1
  78. package/apps/storefront/src/lib/compliance/tamper-sentinel-boot.ts +1 -1
  79. package/apps/storefront/src/lib/compliance/verification/totVerificationClient.ts +2 -2
  80. package/apps/storefront/src/lib/content/blog/access.ts +1 -1
  81. package/apps/storefront/src/lib/content/blog/collection.ts +1 -1
  82. package/apps/storefront/src/lib/content/blog/postView.ts +2 -2
  83. package/apps/storefront/src/lib/content/blog/provider.ts +1 -1
  84. package/apps/storefront/src/lib/content/shared/heroSlideshow.ts +1 -1
  85. package/apps/storefront/src/lib/content/shared/homeVisualParity.ts +1 -1
  86. package/apps/storefront/src/lib/content/shared/rawMarketingHtml.ts +1 -1
  87. package/apps/storefront/src/lib/content/storyblok/provider.ts +1 -1
  88. package/apps/storefront/src/lib/customers/fixtures/customers.ts +3 -3
  89. package/apps/storefront/src/lib/{admin → developer-experience/admin}/memoizeByEnvelope.ts +1 -1
  90. package/apps/storefront/src/lib/{dev → developer-experience/dev}/activityIngestToken.ts +2 -2
  91. package/apps/storefront/src/lib/{dev → developer-experience/dev}/cliSignInCode.ts +4 -4
  92. package/apps/storefront/src/lib/{dev → developer-experience/dev}/livePreview.ts +1 -1
  93. package/apps/storefront/src/lib/{dev → developer-experience/dev}/previewStatus.ts +2 -2
  94. package/apps/storefront/src/lib/{dev → developer-experience/dev}/rendezvousBroker.ts +3 -3
  95. package/apps/storefront/src/lib/{dev → developer-experience/dev}/subjectReissue.ts +2 -2
  96. package/apps/storefront/src/lib/{http → developer-experience/http}/mcpServiceCall.ts +1 -1
  97. package/apps/storefront/src/lib/{cloudflare-workers.d.ts → developer-experience/types/cloudflare-workers.d.ts} +1 -1
  98. package/apps/storefront/src/lib/engagement/messaging/messagesClient.ts +2 -2
  99. package/apps/storefront/src/lib/engagement/newsletter/resendClient.ts +1 -1
  100. package/apps/storefront/src/lib/engagement/social/tokenStore.ts +1 -1
  101. package/apps/storefront/src/lib/fulfillment/fulfillmentService.ts +4 -4
  102. package/apps/storefront/src/lib/integrations/apps/gatewayKeys.ts +1 -1
  103. package/apps/storefront/src/lib/integrations/apps/registryAccess.ts +1 -1
  104. package/apps/storefront/src/lib/integrations/integration/browserEnvironment.ts +1 -1
  105. package/apps/storefront/src/lib/integrations/webhooks/emit.ts +1 -1
  106. package/apps/storefront/src/lib/integrations/webhooks/getDispatcher.ts +1 -1
  107. package/apps/storefront/src/lib/measurement/attribution/orderConversionD1.ts +1 -1
  108. package/apps/storefront/src/lib/measurement/tracking/d1Control.ts +1 -1
  109. package/apps/storefront/src/lib/measurement/tracking/interactionCollector.ts +1 -1
  110. package/apps/storefront/src/lib/measurement/tracking/tenantD1Registry.ts +1 -1
  111. package/apps/storefront/src/lib/{monitoring → observability/monitoring}/manifest.ts +2 -2
  112. package/apps/storefront/src/lib/{analytics → observability/performance}/budgets.json +1 -1
  113. package/apps/storefront/src/lib/{analytics → observability/performance}/webVitals.ts +1 -1
  114. package/apps/storefront/src/lib/orders/fixtures/orders.ts +4 -4
  115. package/apps/storefront/src/lib/orders/providers/foxyOrderClient.ts +1 -1
  116. package/apps/storefront/src/lib/{basePath.ts → publication/shared/basePath.ts} +1 -1
  117. package/apps/storefront/src/lib/{env.ts → publication/shared/env.ts} +1 -1
  118. package/apps/storefront/src/lib/{previewReload.ts → publication/shared/previewReload.ts} +1 -1
  119. package/apps/storefront/src/lib/{runtimeEnv.ts → publication/shared/runtimeEnv.ts} +1 -1
  120. package/apps/storefront/src/lib/{url.ts → publication/shared/url.ts} +1 -1
  121. package/apps/storefront/src/lib/reporting/fixtures/reporting.ts +3 -3
  122. package/apps/storefront/src/lib/subscriptions/fixtures/subscriptions.ts +3 -3
  123. package/apps/storefront/src/middleware/candidatePin.ts +1 -1
  124. package/apps/storefront/src/middleware/controlPlane.ts +8 -8
  125. package/apps/storefront/src/middleware/index.ts +13 -13
  126. package/apps/storefront/src/middleware/publicRender.ts +2 -2
  127. package/apps/storefront/src/middleware/renderChain.ts +9 -9
  128. package/apps/storefront/src/middleware/staticBundle.ts +2 -2
  129. package/apps/storefront/src/pages/404.astro +1 -1
  130. package/apps/storefront/src/pages/api/activity.ts +1 -1
  131. package/apps/storefront/src/pages/api/admin/activity-alerts.ts +2 -2
  132. package/apps/storefront/src/pages/api/admin/commerce-readiness.ts +1 -1
  133. package/apps/storefront/src/pages/api/admin/fulfillment/batches.ts +1 -1
  134. package/apps/storefront/src/pages/api/admin/fulfillment/orders/[id]/address.ts +1 -1
  135. package/apps/storefront/src/pages/api/admin/fulfillment/orders/[id].ts +1 -1
  136. package/apps/storefront/src/pages/api/admin/interaction-insights.ts +2 -2
  137. package/apps/storefront/src/pages/api/admin/orders/[id].ts +2 -2
  138. package/apps/storefront/src/pages/api/admin/orders.ts +2 -2
  139. package/apps/storefront/src/pages/api/auth/logout.ts +2 -2
  140. package/apps/storefront/src/pages/api/auth/magic-exchange.ts +6 -6
  141. package/apps/storefront/src/pages/api/auth/send.ts +3 -3
  142. package/apps/storefront/src/pages/api/auth/step-up-send.ts +1 -1
  143. package/apps/storefront/src/pages/api/auth/step-up-verify.ts +3 -3
  144. package/apps/storefront/src/pages/api/auth/verify.ts +5 -5
  145. package/apps/storefront/src/pages/api/blog/[collection]/[slug]/react.ts +2 -2
  146. package/apps/storefront/src/pages/api/checkout-style.css.ts +1 -1
  147. package/apps/storefront/src/pages/api/cli/policy.ts +1 -1
  148. package/apps/storefront/src/pages/api/commerce/final-cart-authorization.ts +1 -1
  149. package/apps/storefront/src/pages/api/newsletter/[collection]/subscribe.ts +2 -2
  150. package/apps/storefront/src/pages/api/newsletter/confirm.ts +1 -1
  151. package/apps/storefront/src/pages/api/newsletter/unsubscribe.ts +2 -2
  152. package/apps/storefront/src/pages/api/newsletter.ts +2 -2
  153. package/apps/storefront/src/pages/api/request-access.ts +1 -1
  154. package/apps/storefront/src/pages/api/rum/vitals.ts +2 -2
  155. package/apps/storefront/src/pages/api/tracking/interaction.ts +1 -1
  156. package/apps/storefront/src/pages/auth/login.astro +3 -3
  157. package/apps/storefront/src/pages/auth/magic.astro +1 -1
  158. package/apps/storefront/src/pages/capabilities.astro +1 -1
  159. package/apps/storefront/src/pages/collections/[handle].astro +2 -2
  160. package/apps/storefront/src/pages/feed.json.ts +1 -1
  161. package/apps/storefront/src/pages/index.astro +1 -1
  162. package/apps/storefront/src/pages/llms.txt.ts +1 -1
  163. package/apps/storefront/src/pages/products/[handle].astro +1 -1
  164. package/apps/storefront/src/pages/search-index.json.ts +1 -1
  165. package/apps/storefront/src/pages/search.astro +1 -1
  166. package/apps/storefront/src/pages/sitemap.xml.ts +1 -1
  167. package/apps/storefront/src/pages/tenants/[id]/[...path].ts +1 -1
  168. package/apps/storefront/test/pipeline/fake-preview-services.ts +2 -2
  169. package/apps/storefront/test/pipeline/harness.ts +1 -1
  170. package/apps/storefront/test/pipeline/matrix-faults.ts +4 -4
  171. package/apps/storefront/test/pipeline/pipeline-host.ts +9 -9
  172. package/apps/storefront/test/pipeline/publish-kinds.ts +4 -4
  173. package/apps/storefront/test/pipeline/synthetic-job.ts +3 -3
  174. package/apps/storefront/test/pipeline-faults/matrix-lib.ts +2 -2
  175. package/package.json +1 -1
  176. package/packages/public-runtime/src/hosted-image-media-types.ts +1 -1
  177. package/packages/public-runtime/src/retention-holds.ts +1 -1
  178. package/scripts/dev/locate.mjs +1 -1
  179. package/apps/storefront/src/lib/admin/ai/index.ts +0 -6
  180. /package/apps/storefront/src/components/{auth → access/storefront/auth}/AuthBadge.astro +0 -0
  181. /package/apps/storefront/src/lib/{auth → access/auth}/gatePage.ts +0 -0
  182. /package/apps/storefront/src/lib/{auth → access/auth}/internalContentAuthority.ts +0 -0
  183. /package/apps/storefront/src/lib/{auth → access/auth}/operatorSession.ts +0 -0
  184. /package/apps/storefront/src/lib/{auth → access/auth}/session.ts +0 -0
  185. /package/apps/storefront/src/lib/{auth → access/auth}/stepUpChallenge.ts +0 -0
  186. /package/apps/storefront/src/lib/{dashboard → access/dashboard}/vendorQuery.ts +0 -0
  187. /package/apps/storefront/src/lib/{admin/services/mock → access/fixtures}/tenants.ts +0 -0
  188. /package/apps/storefront/src/lib/{email → access/notifications}/magicLinkInviteEmail.ts +0 -0
  189. /package/apps/storefront/src/lib/{privacy → access/privacy}/emailHint.ts +0 -0
  190. /package/apps/storefront/src/lib/{rate → access/rate}/kvWindow.ts +0 -0
  191. /package/apps/storefront/src/lib/{shared → access/shared}/capability.ts +0 -0
  192. /package/apps/storefront/src/lib/{cspStaticHashes.ts → access/shared/cspStaticHashes.ts} +0 -0
  193. /package/apps/storefront/src/lib/{demoGate.ts → access/shared/demoGate.ts} +0 -0
  194. /package/apps/storefront/src/lib/{maintenance.ts → access/shared/maintenance.ts} +0 -0
  195. /package/apps/storefront/src/lib/{securityHeaders.ts → access/shared/securityHeaders.ts} +0 -0
  196. /package/apps/storefront/src/lib/{tenantOrigins.ts → access/shared/tenantOrigins.ts} +0 -0
  197. /package/apps/storefront/src/lib/{admin → automation}/ai/approvalMode.ts +0 -0
  198. /package/apps/storefront/src/lib/{admin → automation}/ai/audit.ts +0 -0
  199. /package/apps/storefront/src/lib/{admin → automation}/ai/recommendation.ts +0 -0
  200. /package/apps/storefront/src/lib/{admin → developer-experience/admin}/seed.ts +0 -0
  201. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/activityStore.ts +0 -0
  202. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/ai-widget-client.js +0 -0
  203. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/apiBase.ts +0 -0
  204. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/ask.ts +0 -0
  205. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/clickToSource.ts +0 -0
  206. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/copyCommand.ts +0 -0
  207. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/files.ts +0 -0
  208. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/hostedActivity.ts +0 -0
  209. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/infoPopover.ts +0 -0
  210. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/mcpCopy.ts +0 -0
  211. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/monitor.ts +0 -0
  212. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/stepper.ts +0 -0
  213. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/themeToggle.ts +0 -0
  214. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/devDraft.ts +0 -0
  215. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/obstacleStore.ts +0 -0
  216. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/runtimeStore.ts +0 -0
  217. /package/apps/storefront/src/lib/{dev → developer-experience/dev}/storeStatus.ts +0 -0
  218. /package/apps/storefront/src/lib/{fixtures → developer-experience/fixtures}/regulated-commerce-truth/index.ts +0 -0
  219. /package/apps/storefront/src/lib/{fixtures → developer-experience/fixtures}/ws3-readonly-clone-preflight/index.ts +0 -0
  220. /package/apps/storefront/src/lib/{http → developer-experience/http}/fetchTransport.ts +0 -0
  221. /package/apps/storefront/src/lib/{memoryKv.ts → developer-experience/shared/memoryKv.ts} +0 -0
  222. /package/apps/storefront/src/lib/{diag → observability/diag}/capture.ts +0 -0
  223. /package/apps/storefront/src/lib/{diag → observability/diag}/consoleLine.ts +0 -0
  224. /package/apps/storefront/src/lib/{diag → observability/diag}/debugConsole.ts +0 -0
  225. /package/apps/storefront/src/lib/{diag → observability/diag}/debugMode.ts +0 -0
  226. /package/apps/storefront/src/lib/{diag → observability/diag}/debugWindow.ts +0 -0
  227. /package/apps/storefront/src/lib/{diag → observability/diag}/redact.ts +0 -0
  228. /package/apps/storefront/src/lib/{diag → observability/diag}/reference.ts +0 -0
  229. /package/apps/storefront/src/lib/{diag → observability/diag}/referenceStore.ts +0 -0
  230. /package/apps/storefront/src/lib/{diag → observability/diag}/report.ts +0 -0
  231. /package/apps/storefront/src/lib/{diag → observability/diag}/session.ts +0 -0
  232. /package/apps/storefront/src/lib/{analytics → observability/performance}/lighthouseReport.ts +0 -0
  233. /package/apps/storefront/src/lib/{analytics → observability/performance}/perfBudgets.ts +0 -0
  234. /package/apps/storefront/src/lib/{analytics → observability/performance}/rumAlert.ts +0 -0
  235. /package/apps/storefront/src/lib/{health.ts → observability/shared/health.ts} +0 -0
  236. /package/apps/storefront/src/lib/{d1 → publication/d1}/schema-apps.ts +0 -0
  237. /package/apps/storefront/src/lib/{email → publication/notifications}/candidateConflictEmail.ts +0 -0
  238. /package/apps/storefront/src/lib/{cdnForward.ts → publication/shared/cdnForward.ts} +0 -0
  239. /package/apps/storefront/src/lib/{edgeCache.ts → publication/shared/edgeCache.ts} +0 -0
@@ -13,8 +13,8 @@
13
13
  * drifting apart. The auth surface itself (/auth/*, /api/auth/*) is always exempt
14
14
  * so a visitor can actually sign in.
15
15
  */
16
- import { hostInGateList } from "@/lib/demoGate";
17
- import { normalizeMemberships, staffAdmits } from "@/lib/dashboard/tenantSelection";
16
+ import { hostInGateList } from "@/lib/access/shared/demoGate";
17
+ import { normalizeMemberships, staffAdmits } from "@/lib/access/dashboard/tenantSelection";
18
18
  import type { SessionRecord } from "./session.js";
19
19
 
20
20
  export type GateMode = "password" | "login";
@@ -34,7 +34,7 @@
34
34
  * `devbook/app-binding.md` Recipe A ("multiple execution environments").
35
35
  */
36
36
  import { importPKCS8, exportJWK, SignJWT, type CryptoKey, type JWK, type JSONWebKeySet } from "jose";
37
- import { readEnv } from "@/lib/env";
37
+ import { readEnv } from "@/lib/publication/shared/env";
38
38
 
39
39
  /** The only algorithm this assertion is signed with (the MCP verifier rejects anything else). */
40
40
  export const MCP_CLIENT_ASSERTION_ALG = "RS256";
@@ -14,7 +14,7 @@
14
14
  * tenant — never from request input.
15
15
  */
16
16
  import type { APIContext } from "astro";
17
- import { readKv } from "@/lib/env";
17
+ import { readKv } from "@/lib/publication/shared/env";
18
18
  import { createTotAccessClient, type TotAccessClient } from "./totAccessClient.js";
19
19
  import {
20
20
  KvSessionStore,
@@ -26,9 +26,9 @@
26
26
  * to `credentialFields()` below — the ONLY spot to touch. Everything else (paths,
27
27
  * bodies, response shapes) is contract-fixed.
28
28
  */
29
- import { readEnv } from "@/lib/env";
30
- import { diagEmail } from "@/lib/diag/redact";
31
- import { FetchHttpTransport, type HttpResponseLike, type HttpTransport } from "@/lib/http/fetchTransport";
29
+ import { readEnv } from "@/lib/publication/shared/env";
30
+ import { diagEmail } from "@/lib/observability/diag/redact";
31
+ import { FetchHttpTransport, type HttpResponseLike, type HttpTransport } from "@/lib/developer-experience/http/fetchTransport";
32
32
  import { classifyStepUp, type StepUpChallenge, type StepUpObligation } from "./stepUpChallenge.js";
33
33
 
34
34
  /** `send` is deliberately opaque — it never reveals whether the email was eligible. */
@@ -49,7 +49,7 @@ export type AccessCodeVerifyResult =
49
49
  * Present-usually, NOT guaranteed: tot returns the flat result without it
50
50
  * if signing hiccups (contract §6 graceful degradation). Phase 3 verifies
51
51
  * this OFFLINE and derives the session from its claims rather than trusting
52
- * the flat `roles`/`capability`. See `@/lib/auth/identityToken`.
52
+ * the flat `roles`/`capability`. See `@/lib/access/auth/identityToken`.
53
53
  */
54
54
  id_token?: string;
55
55
  }
@@ -128,7 +128,7 @@ export interface TotAccessClient {
128
128
  * (signer degradation, contract §6); the consumer fails closed when it's absent.
129
129
  *
130
130
  * The `step-up-required`/`success-pending` variants carry tot20's RFC 9470
131
- * obligations (see `@/lib/auth/stepUpChallenge`) instead of a plain failure
131
+ * obligations (see `@/lib/access/auth/stepUpChallenge`) instead of a plain failure
132
132
  * reason, so the caller can drive the SMS completion loop rather than just
133
133
  * showing a generic "invalid code" error.
134
134
  */
@@ -22,8 +22,8 @@
22
22
  * the page, matching `@/lib/dashboard/tenantSelection` and `@/lib/auth/loginGate`.
23
23
  */
24
24
  import { storefrontModeAllowsGoLive } from "@tot/public-runtime";
25
- import { membershipFor, staffAdmits } from "@/lib/dashboard/tenantSelection";
26
- import type { StaffAdmission, TenantMembership } from "@/lib/dashboard/tenantSelection";
25
+ import { membershipFor, staffAdmits } from "@/lib/access/dashboard/tenantSelection";
26
+ import type { StaffAdmission, TenantMembership } from "@/lib/access/dashboard/tenantSelection";
27
27
 
28
28
  /** What every viewer of an unpaid store is told in place of the delegate section. */
29
29
  export const UNPAID_DELEGATION_NOTE =
@@ -37,7 +37,7 @@ export type DelegateSection = { mode: "unpaid"; role: null; explanation: string
37
37
  /**
38
38
  * Resolve the whole delegate section. Before a store is paid, an invited developer can
39
39
  * already add changes AND publish them (both `merge-to-preview` and `publish-live` admit the
40
- * "unpaid-store-developer" basis, lib/pipeline/admission.ts), so delegation has nothing to
40
+ * "unpaid-store-developer" basis, lib/publication/pipeline/admission.ts), so delegation has nothing to
41
41
  * grant: every viewer, the owner included, gets {@link UNPAID_DELEGATION_NOTE}. A paid store
42
42
  * resolves {@link resolveDelegateGate} unchanged.
43
43
  */
@@ -12,7 +12,7 @@
12
12
  * scoped to the returned staffRoles capability. It is stamped on the session as a
13
13
  * DISTINCT marker from `tenants[]` — never a synthesized membership.
14
14
  */
15
- import type { SessionRecord, StaffSelection } from "@/lib/auth/session";
15
+ import type { SessionRecord, StaffSelection } from "@/lib/access/auth/session";
16
16
 
17
17
  /**
18
18
  * Staff selection lifetime. Deliberately short: staff cross-vendor access is a
@@ -30,7 +30,7 @@
30
30
  * factory) so the routes develop/test against `MockStaffVendorAccessClient` and
31
31
  * swap in the Http client with no call-site change.
32
32
  */
33
- import { readEnv } from "@/lib/env";
33
+ import { readEnv } from "@/lib/publication/shared/env";
34
34
  import { decodeJwt } from "jose";
35
35
 
36
36
  /**
@@ -17,7 +17,7 @@
17
17
  * tot20 populates all of the email's memberships. Flagged to the workstream lead.
18
18
  */
19
19
 
20
- import type { StaffSelection } from "@/lib/auth/session";
20
+ import type { StaffSelection } from "@/lib/access/auth/session";
21
21
 
22
22
  /** One tenant membership carried in the verified session. */
23
23
  export interface TenantMembership {
@@ -1,8 +1,8 @@
1
1
  import { DEFAULT_CHECKOUT_STYLE } from "@tot/public-runtime";
2
- import type { AdminTenantEnvelope } from "../../envelope";
3
- import { memoizeByEnvelope } from "../../memoizeByEnvelope";
4
- import { MOCK_ANCHOR_ISO, offsetIso, randomInt, seededRandom } from "../../seed";
5
- import type { SettingsAuditEvent, SettingsSection, SettingsViewModel } from "../../viewmodels/settings";
2
+ import type { AdminTenantEnvelope } from "../admin/envelope";
3
+ import { memoizeByEnvelope } from "../../developer-experience/admin/memoizeByEnvelope";
4
+ import { MOCK_ANCHOR_ISO, offsetIso, randomInt, seededRandom } from "../../developer-experience/admin/seed";
5
+ import type { SettingsAuditEvent, SettingsSection, SettingsViewModel } from "../admin/viewmodels/settings";
6
6
 
7
7
  const SECTION_DEFS: Omit<SettingsSection, "riskyChangeReview">[] = [
8
8
  { key: "store", label: "Store", summary: "Store profile, branding, and white-label copy." },
@@ -17,7 +17,7 @@
17
17
  * Nothing here is ever reported as verified unless tot-mcp said so: an unconfigured seam,
18
18
  * a non-200 or a timeout is `unavailable`, which the UI shows as unverified.
19
19
  */
20
- import { callMcpService } from "@/lib/http/mcpServiceCall";
20
+ import { callMcpService } from "@/lib/developer-experience/http/mcpServiceCall";
21
21
 
22
22
  const EXPLAIN_TIMEOUT_MS = 8000;
23
23
 
@@ -21,9 +21,9 @@
21
21
  * request asks for: the staff check gates evaluation of the request
22
22
  * entirely, not just the picker's visibility.
23
23
  */
24
- import type { SessionRecord } from "@/lib/auth/session";
25
- import { isStaffSession } from "@/lib/dashboard/staffAdmission";
26
- import { membershipFor, normalizeMemberships, type TenantMembership } from "@/lib/dashboard/tenantSelection";
24
+ import type { SessionRecord } from "@/lib/access/auth/session";
25
+ import { isStaffSession } from "@/lib/access/dashboard/staffAdmission";
26
+ import { membershipFor, normalizeMemberships, type TenantMembership } from "@/lib/access/dashboard/tenantSelection";
27
27
 
28
28
  export interface AdminTenantEnvelope {
29
29
  /** The tenant that actually served this request. */
@@ -52,11 +52,11 @@
52
52
  * seam is duplicated locally rather than imported from `@/lib/auth` so the grants
53
53
  * control-plane cluster stays self-contained (see `.dependency-cruiser.cjs`).
54
54
  */
55
- import { readEnv } from "@/lib/env";
56
- import { callMcpService } from "@/lib/http/mcpServiceCall";
57
- import { diagEmail } from "@/lib/diag/redact";
58
- import { checkStorePreviewReady, type PreflightDecision } from "@/lib/shared/invitePreflight";
59
- import { explainDeveloperAccess, type AccessVerification } from "@/lib/shared/accessExplain";
55
+ import { readEnv } from "@/lib/publication/shared/env";
56
+ import { callMcpService } from "@/lib/developer-experience/http/mcpServiceCall";
57
+ import { diagEmail } from "@/lib/observability/diag/redact";
58
+ import { checkStorePreviewReady, type PreflightDecision } from "@/lib/access/shared/invitePreflight";
59
+ import { explainDeveloperAccess, type AccessVerification } from "@/lib/access/shared/accessExplain";
60
60
 
61
61
  /**
62
62
  * The header carrying the storefront-signed staff BROKER ASSERTION to tot20
@@ -22,7 +22,7 @@
22
22
  * mirroring recordDeveloperAppBinding's "skipped when not-configured" stance — we
23
23
  * never break invites just because the MCP is briefly unreachable.
24
24
  */
25
- import { callMcpService } from "@/lib/http/mcpServiceCall";
25
+ import { callMcpService } from "@/lib/developer-experience/http/mcpServiceCall";
26
26
 
27
27
  /** How long we'll wait on the preview-status read before failing open. */
28
28
  const PREFLIGHT_TIMEOUT_MS = 4000;
@@ -75,9 +75,9 @@
75
75
  * factory) so the route develops/tests against `MockPrincipalGrantClient` and
76
76
  * swaps in the Http client with no call-site change.
77
77
  */
78
- import { readEnv } from "@/lib/env";
79
- import { diagEmail } from "@/lib/diag/redact";
80
- import { BROKER_ASSERTION_HEADER, BROKER_PRIVATE_KEY_ENV } from "@/lib/auth/brokerAssertion";
78
+ import { readEnv } from "@/lib/publication/shared/env";
79
+ import { diagEmail } from "@/lib/observability/diag/redact";
80
+ import { BROKER_ASSERTION_HEADER, BROKER_PRIVATE_KEY_ENV } from "@/lib/access/auth/brokerAssertion";
81
81
 
82
82
  /** A human grantee — the only principal type this HTTP surface accepts. */
83
83
  export interface UserPrincipal {
@@ -55,7 +55,7 @@ function normalizePath(path: string): string {
55
55
  }
56
56
 
57
57
  /**
58
- * Routing for an authenticated CDN forward (lib/cdnForward.ts). The forward names
58
+ * Routing for an authenticated CDN forward (lib/publication/shared/cdnForward.ts). The forward names
59
59
  * its tenant outright and renders at the apex, as the tenant's own host would.
60
60
  * Only a tenant served from CloudFront static storage (`serving.provider:
61
61
  * "s3-overwrite"`) has a distribution that forwards here; any other resolves to
@@ -30,7 +30,7 @@
30
30
  * app-binding WRITE (`recordDeveloperAppBinding`) targets, so this READ and that
31
31
  * WRITE always agree on which subject-capability store they speak to.
32
32
  */
33
- import { callMcpService } from "@/lib/http/mcpServiceCall";
33
+ import { callMcpService } from "@/lib/developer-experience/http/mcpServiceCall";
34
34
  import type { Capability } from "./capability.js";
35
35
 
36
36
  /** Minimal GET transport (mirrors `dev/previewStatus.ts` — decoupled by design). */
@@ -1,5 +1,5 @@
1
- import type { AdminTenantEnvelope } from "../../admin/envelope";
2
- import { memoizeByEnvelope } from "../../admin/memoizeByEnvelope";
1
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
2
+ import { memoizeByEnvelope } from "../../developer-experience/admin/memoizeByEnvelope";
3
3
  import type { EvidenceReference } from "../evidence/evidenceReference";
4
4
  import { getCustomersViewModel } from "../../customers/fixtures/customers";
5
5
  import { getOrdersViewModel } from "../../orders/fixtures/orders";
@@ -24,7 +24,7 @@
24
24
  * dev/tests immediately, and a Worker secret takes effect from the first primed
25
25
  * request of each isolate.
26
26
  */
27
- import { readEnv } from "../runtimeEnv.js";
27
+ import { readEnv } from "../publication/shared/runtimeEnv.js";
28
28
 
29
29
  /** The one canonical flag name — shared verbatim by the server and the CLI mirror. */
30
30
  export const ACTIVITY_KILL_SWITCH_FLAG = "ACTIVITY_TELEMETRY_DISABLED";
@@ -48,11 +48,11 @@ import type {
48
48
  ActivityPayload,
49
49
  } from "@tot/public-runtime";
50
50
  import type { ActionKey } from "@tot/public-runtime";
51
- import { readViewerSession } from "@/lib/auth/route";
52
- import { sessionHostCapability } from "@/lib/auth/loginGate";
53
- import { isStaffSession } from "@/lib/dashboard/staffAdmission";
54
- import { readEnv } from "@/lib/env";
55
- import { isOwnerCapability } from "@/lib/shared/capability";
51
+ import { readViewerSession } from "@/lib/access/auth/route";
52
+ import { sessionHostCapability } from "@/lib/access/auth/loginGate";
53
+ import { isStaffSession } from "@/lib/access/dashboard/staffAdmission";
54
+ import { readEnv } from "@/lib/publication/shared/env";
55
+ import { isOwnerCapability } from "@/lib/access/shared/capability";
56
56
  import { hashActorId, recordActivity } from "./recordActivity";
57
57
 
58
58
  /** The minimal viewer chrome the middleware stamps on `locals.viewer`. */
@@ -11,7 +11,7 @@
11
11
  * baked in at BUILD time: astro.config.mjs's Vite `define` replaces the
12
12
  * `__GIT_SHA__` token with a string literal of the build's commit (CI-provided
13
13
  * `GIT_SHA`/`WORKERS_CI_COMMIT_SHA`/`GITHUB_SHA`, else local `git rev-parse`,
14
- * else "unknown"). This is the SAME source /health already reports (lib/health.ts)
14
+ * else "unknown"). This is the SAME source /health already reports (lib/observability/shared/health.ts)
15
15
  * — we read it through the identical `typeof` guard so both agree by construction,
16
16
  * and so the value is safe under vitest (where the define isn't applied → "unknown").
17
17
  *
@@ -2,11 +2,11 @@ export { getOrdersViewModel } from "../../../orders/fixtures/orders";
2
2
  export { getProductsViewModel } from "../../../catalog/fixtures/products";
3
3
  export { getCustomersViewModel } from "../../../customers/fixtures/customers";
4
4
  export { getReportingViewModel } from "../../../reporting/fixtures/reporting";
5
- export { getSettingsViewModel } from "./settings";
5
+ export { getSettingsViewModel } from "../../../access/fixtures/settings";
6
6
  export { getCheckoutSettingsViewModel } from "../../../checkout/fixtures/checkoutSettings";
7
7
  export type { CheckoutSettingsViewModel } from "../../../checkout/fixtures/checkoutSettings";
8
8
  export { getSubscriptionsViewModel } from "../../../subscriptions/fixtures/subscriptions";
9
- export { getAiWorkflowsViewModel } from "./aiWorkflows";
9
+ export { getAiWorkflowsViewModel } from "../../../automation/fixtures/aiWorkflows";
10
10
  export { getEvidenceViewModel } from "../../../activity/fixtures/evidence";
11
- export { SEEDED_TENANTS, tenantProfile } from "./tenants";
12
- export type { SeededTenantProfile, MockVertical } from "./tenants";
11
+ export { SEEDED_TENANTS, tenantProfile } from "../../../access/fixtures/tenants";
12
+ export type { SeededTenantProfile, MockVertical } from "../../../access/fixtures/tenants";
@@ -4,7 +4,7 @@
4
4
  * with) and TENANT_CACHE for the durable-image status record. Unbound ⇒ every pre-flip stage
5
5
  * refuses, so a pointer-served version can never go live missing its captured images.
6
6
  */
7
- import { readKv, readR2 } from "@/lib/env";
7
+ import { readKv, readR2 } from "@/lib/publication/shared/env";
8
8
  import { makeWorkerR2PinnedOriginalStager, R2StagingError, type R2BucketLike, type StatusKvLike } from "./durableR2.js";
9
9
 
10
10
  export async function workerR2PinnedOriginalStagerFromEnv(): Promise<
@@ -5,9 +5,9 @@
5
5
  * come from `lib/admin/ai`, which formalizes the approval/evidence models.
6
6
  */
7
7
 
8
- import type { ApprovalMode } from "../ai/approvalMode";
9
- import type { AiRecommendation } from "../ai/recommendation";
10
- import type { AuditEvent } from "../ai/audit";
8
+ import type { ApprovalMode } from "../../ai/approvalMode";
9
+ import type { AiRecommendation } from "../../ai/recommendation";
10
+ import type { AuditEvent } from "../../ai/audit";
11
11
 
12
12
  export type { ApprovalMode };
13
13
 
@@ -6,7 +6,7 @@
6
6
  * this is emitted for dev inspection only (see adminShell.ts's `data-admin-ask`
7
7
  * click handler), never sent over the network.
8
8
  */
9
- import type { AdminTenantEnvelope } from "../envelope";
9
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
10
10
 
11
11
  export type AdminRole = "internal_staff" | "merchant_operator";
12
12
 
@@ -7,10 +7,10 @@
7
7
  * The other 5 workflows remain scaffold-only until their own units connect
8
8
  * real source data.
9
9
  */
10
- import type { AdminTenantEnvelope } from "../envelope";
11
- import { getOrdersViewModel, getProductsViewModel, getEvidenceViewModel } from "../services/mock";
12
- import { MOCK_ANCHOR_ISO, offsetIso, randomInt, seededRandom } from "../seed";
13
- import { OPERATIONAL_WORKFLOW_KEYS, type OperationalWorkflowKey } from "../viewmodels/aiWorkflows";
10
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
11
+ import { getOrdersViewModel, getProductsViewModel, getEvidenceViewModel } from "../../admin/services/mock/index";
12
+ import { MOCK_ANCHOR_ISO, offsetIso, randomInt, seededRandom } from "../../developer-experience/admin/seed";
13
+ import { OPERATIONAL_WORKFLOW_KEYS, type OperationalWorkflowKey } from "../admin/viewmodels/aiWorkflows";
14
14
  import type { ApprovalMode } from "./approvalMode";
15
15
  import type { AuditEvent } from "./audit";
16
16
  import type { AiRecommendation } from "./recommendation";
@@ -1,7 +1,7 @@
1
- import type { AdminTenantEnvelope } from "../../envelope";
2
- import { memoizeByEnvelope } from "../../memoizeByEnvelope";
3
- import { MOCK_ANCHOR_ISO, offsetIso, pick, randomInt, seededRandom } from "../../seed";
4
- import { AI_WORKFLOW_NAMES, OPERATIONAL_WORKFLOW_KEYS, type AiWorkflowsViewModel, type ApprovalMode, type WorkflowRecord, type WorkflowStatus } from "../../viewmodels/aiWorkflows";
1
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
2
+ import { memoizeByEnvelope } from "../../developer-experience/admin/memoizeByEnvelope";
3
+ import { MOCK_ANCHOR_ISO, offsetIso, pick, randomInt, seededRandom } from "../../developer-experience/admin/seed";
4
+ import { AI_WORKFLOW_NAMES, OPERATIONAL_WORKFLOW_KEYS, type AiWorkflowsViewModel, type ApprovalMode, type WorkflowRecord, type WorkflowStatus } from "../admin/viewmodels/aiWorkflows";
5
5
 
6
6
  const OWNERS = ["Ops", "Trust & Safety", "Growth", "Fulfillment"];
7
7
  const APPROVAL_MODES: ApprovalMode[] = ["draft_only", "approval_required", "guarded_automation"];
@@ -1,5 +1,5 @@
1
- import type { AdminTenantEnvelope } from "../../admin/envelope";
2
- import { MOCK_ANCHOR_ISO, offsetIso, pick, randomBool, randomInt, seededRandom } from "../../admin/seed";
1
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
2
+ import { MOCK_ANCHOR_ISO, offsetIso, pick, randomBool, randomInt, seededRandom } from "../../developer-experience/admin/seed";
3
3
  import type {
4
4
  ExciseCheckKey,
5
5
  ExciseReadinessCheck,
@@ -8,8 +8,8 @@ import type {
8
8
  ProductsViewModel,
9
9
  ProductVariant,
10
10
  } from "../admin/viewmodels/products";
11
- import { tenantProfile } from "../../admin/services/mock/tenants";
12
- import { memoizeByEnvelope } from "../../admin/memoizeByEnvelope";
11
+ import { tenantProfile } from "../../access/fixtures/tenants";
12
+ import { memoizeByEnvelope } from "../../developer-experience/admin/memoizeByEnvelope";
13
13
 
14
14
  // Must stay index-aligned with orders.ts's ITEM_POOLS: a product's id is
15
15
  // `prod-<tenant>-<position here>`, and orders.ts derives each order's productId
@@ -20,8 +20,8 @@
20
20
  * Pure (no I/O, no Astro) — the caller supplies the already-read viewer session —
21
21
  * so it is unit-testable in isolation.
22
22
  */
23
- import { resolveAdminTenantMode } from "@/lib/adminTenantEnvelope";
24
- import type { SessionRecord } from "@/lib/auth/session";
23
+ import { resolveAdminTenantMode } from "@/lib/access/shared/adminTenantEnvelope";
24
+ import type { SessionRecord } from "@/lib/access/auth/session";
25
25
 
26
26
  export type WriteTargetResult =
27
27
  | { ok: true; targetTenant: string }
@@ -33,7 +33,7 @@ import {
33
33
  type HandoffCorrelation,
34
34
  type IntegrationEnvironment,
35
35
  } from "@tot/public-runtime";
36
- import { readEnv } from "@/lib/env";
36
+ import { readEnv } from "@/lib/publication/shared/env";
37
37
 
38
38
  /** The server-only correlation-signing key binding — distinct from the cart secret
39
39
  * (key separation), and the SAME binding the order join verifies against. */
@@ -18,7 +18,7 @@ import { resolveManagedCheckout } from "@tot/public-runtime";
18
18
  import type { TenantConfig } from "@tot/public-runtime";
19
19
  import { referenceTheme } from "@/themes/reference";
20
20
  import { mergeTheme } from "@/themes/schema";
21
- import type { AdminTenantEnvelope } from "../../admin/envelope";
21
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
22
22
  import {
23
23
  buildCheckoutSettingsFields,
24
24
  deriveCheckoutSettings,
@@ -29,7 +29,7 @@ import {
29
29
  resolveManagedCheckout,
30
30
  SHARED_DEMO_CHECKOUT,
31
31
  } from "@tot/public-runtime";
32
- import { readEnv } from "@/lib/runtimeEnv";
32
+ import { readEnv } from "@/lib/publication/shared/runtimeEnv";
33
33
 
34
34
  /**
35
35
  * Resolve the effective checkout facts for a tenant, or null when the tenant has
@@ -175,7 +175,7 @@ export interface PollDeps {
175
175
 
176
176
  /**
177
177
  * True when the login gate, not the preflight route, answered: the store is not
178
- * public and this viewer holds no session (see `lib/auth/gatePage.ts`). Still fail
178
+ * public and this viewer holds no session (see `lib/access/auth/gatePage.ts`). Still fail
179
179
  * closed — the caller only names the reason instead of reporting an outage.
180
180
  */
181
181
  export function isStoreNotPublicRefusal(res: Pick<Response, "status" | "headers">): boolean {
@@ -18,7 +18,7 @@ import type {
18
18
  EnforcementEvidenceSignals,
19
19
  } from "@tot/public-runtime";
20
20
  import { enforcementSignals } from "@tot/public-runtime";
21
- import { readEnv } from "@/lib/env";
21
+ import { readEnv } from "@/lib/publication/shared/env";
22
22
  import { COMPLIANCE_RULE_PROFILES } from "@/config/compliance/rulesets";
23
23
 
24
24
  /** True when the tenant sells age/nicotine-restricted goods (drives fail-closed). */
@@ -24,7 +24,7 @@ import type {
24
24
  IntegrationSiteSurface,
25
25
  } from "@tot/public-runtime";
26
26
  import { INTEGRATION_PLAN_GLOBAL } from "@tot/public-runtime";
27
- import { withClientApiBase } from "@/lib/basePath";
27
+ import { withClientApiBase } from "@/lib/publication/shared/basePath";
28
28
 
29
29
  /** Where the browser posts a tamper beacon; the server receiver records + suspends. */
30
30
  export const TAMPER_BEACON_ENDPOINT = "/api/compliance/tamper";
@@ -34,13 +34,13 @@
34
34
  * Structure mirrors `@/lib/auth/totAccessClient`: interface + Http impl + Mock +
35
35
  * env factory, with the wire-credential shape isolated to `credentialFields()`.
36
36
  */
37
- import { readEnv } from "@/lib/env";
37
+ import { readEnv } from "@/lib/publication/shared/env";
38
38
  import {
39
39
  FetchHttpTransport,
40
40
  type HttpGetTransport,
41
41
  type HttpResponseLike,
42
42
  type HttpTransport,
43
- } from "@/lib/http/fetchTransport";
43
+ } from "@/lib/developer-experience/http/fetchTransport";
44
44
 
45
45
  // --- Gate normalization -----------------------------------------------------
46
46
 
@@ -1,4 +1,4 @@
1
- import type { SessionRecord } from "@/lib/auth/session.js";
1
+ import type { SessionRecord } from "@/lib/access/auth/session.js";
2
2
  import type { BlogAccess } from "./types.js";
3
3
 
4
4
  /**
@@ -6,7 +6,7 @@ import {
6
6
  } from "@tot/public-runtime";
7
7
  import type { AuthorBio, BlogPost, BlogPostSummary, BlogSettings, PostStatus } from "./types.js";
8
8
  import type { ContentProvider } from "../storyblok/provider.js";
9
- import { readEnv } from "../../env.js";
9
+ import { readEnv } from "../../publication/shared/env.js";
10
10
 
11
11
  type ArtifactSource = Pick<ContentProvider, "readArtifact" | "listArtifactPaths">;
12
12
  function canReadArtifacts(value: ArtifactSource | undefined): value is ArtifactSource {
@@ -18,12 +18,12 @@ import {
18
18
  import { homeCrumbLabel, siteTrail, type Crumb } from "@/lib/content/shared/breadcrumbs.js";
19
19
  import { viewerHasBlogAccess } from "./access.js";
20
20
  import { articleBodyHtml } from "./teaser.js";
21
- import { readViewerSession, safeNext } from "@/lib/auth/route.js";
21
+ import { readViewerSession, safeNext } from "@/lib/access/auth/route.js";
22
22
  import { buildAlternates, type Alternate } from "@/lib/content/seo/alternates.js";
23
23
  import { breadcrumbLd, blogPostingLd } from "@/lib/content/shared/jsonld.js";
24
24
  import { collectionPathsV1, blogPathOptsV1 } from "./collectionPaths.js";
25
25
  import type { BlogPost } from "./types.js";
26
- import type { SessionRecord } from "@/lib/auth/session.js";
26
+ import type { SessionRecord } from "@/lib/access/auth/session.js";
27
27
 
28
28
  export interface BlogPostViewPropsV1 {
29
29
  post: BlogPost;
@@ -13,7 +13,7 @@ import {
13
13
  import { getIndexSettings, listPosts } from "./collection.js";
14
14
  import type { BlogPost, BlogPostSummary, BlogSettings } from "./types.js";
15
15
  import type { ContentProvider } from "../storyblok/provider.js";
16
- import { readEnv } from "../../env.js";
16
+ import { readEnv } from "../../publication/shared/env.js";
17
17
 
18
18
  /** The collection id `/blog` reads — the derived fallback's second argument. */
19
19
  const BLOG_COLLECTION = "blog";
@@ -1,5 +1,5 @@
1
1
  import type { HeroBlock } from "@/lib/content/storyblok/content-model";
2
- import { withBase } from "@/lib/basePath";
2
+ import { withBase } from "@/lib/publication/shared/basePath";
3
3
 
4
4
  export function heroAutoplayAllowed(input: {
5
5
  enabled: boolean;
@@ -2,7 +2,7 @@ import {
2
2
  isSafeRehostedAssetPathForTenant,
3
3
  isSafeStorefrontHref,
4
4
  } from "@tot/public-runtime";
5
- import { withBase } from "@/lib/basePath";
5
+ import { withBase } from "@/lib/publication/shared/basePath";
6
6
  import type {
7
7
  CommerceTrustStripBlock,
8
8
  EditorialBlock,
@@ -24,7 +24,7 @@ import {
24
24
  } from "@tot/public-runtime";
25
25
  import { reportTrackingChainHealth } from "../../measurement/tracking/interactionHealth.js";
26
26
  import { ASYNC_CSS_SWAP_JS } from "./asyncCss.js";
27
- import { ROOT_SERVED_HREF_NAMESPACES } from "../../basePath.js";
27
+ import { ROOT_SERVED_HREF_NAMESPACES } from "../../publication/shared/basePath.js";
28
28
 
29
29
  export { rawHtmlPolicy } from "@tot/public-runtime";
30
30
 
@@ -867,7 +867,7 @@ export class DevDraftContentProvider implements ContentProvider {
867
867
 
868
868
  /** Draft artifact for a tenant-repo-relative path, or null to fall back. */
869
869
  private draftRaw(path: string): Promise<string | null> {
870
- // Key shape mirrors lib/dev/devDraft.ts devDraftKey — duplicated as a plain
870
+ // Key shape mirrors lib/developer-experience/dev/devDraft.ts devDraftKey — duplicated as a plain
871
871
  // template to keep this module's imports renderer-safe (public-runtime only).
872
872
  return this.get(`dev-draft:${this.tenantId}:${this.draftId}:${path}`);
873
873
  }
@@ -1,6 +1,6 @@
1
- import type { AdminTenantEnvelope } from "../../admin/envelope";
2
- import { memoizeByEnvelope } from "../../admin/memoizeByEnvelope";
3
- import { MOCK_ANCHOR_ISO, offsetIso, pick, randomBool, randomInt, seededRandom } from "../../admin/seed";
1
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
2
+ import { memoizeByEnvelope } from "../../developer-experience/admin/memoizeByEnvelope";
3
+ import { MOCK_ANCHOR_ISO, offsetIso, pick, randomBool, randomInt, seededRandom } from "../../developer-experience/admin/seed";
4
4
  import type {
5
5
  BlockedReason,
6
6
  CustomerBlockedQueueRow,
@@ -1,4 +1,4 @@
1
- import type { AdminTenantEnvelope } from "./envelope";
1
+ import type { AdminTenantEnvelope } from "../../access/admin/envelope";
2
2
 
3
3
  /**
4
4
  * Per-request memoization for the pure mock view-model builders. Each builder is
@@ -4,12 +4,12 @@
4
4
  * local→hosted activity bridge.
5
5
  *
6
6
  * Minted alongside the existing cli-signin-code paste
7
- * (apps/storefront/src/lib/dev/cliSignInCode.ts) and cached by the CLI in
7
+ * (apps/storefront/src/lib/developer-experience/dev/cliSignInCode.ts) and cached by the CLI in
8
8
  * ~/.tot/credentials.json. Deliberately NOT a signed token: this reuses the
9
9
  * SESSION KV binding that already exists in every environment (dev/qa/prod),
10
10
  * so it needs no new secret to provision. Revoking is just deleting the KV
11
11
  * entry — the same posture as the browser's own tot_session cookie (see
12
- * lib/auth/session.ts).
12
+ * lib/access/auth/session.ts).
13
13
  */
14
14
 
15
15
  const KEY_PREFIX = "dev-activity-token:";
@@ -18,13 +18,13 @@
18
18
  * on prod the shortest form is emitted.
19
19
  *
20
20
  * `activityBridge` (optional) piggybacks the local→hosted activity-bridge credential
21
- * (see lib/dev/activityIngestToken.ts) onto the SAME pasted line as two extra `tot login`
21
+ * (see lib/developer-experience/dev/activityIngestToken.ts) onto the SAME pasted line as two extra `tot login`
22
22
  * flags — no second browser round-trip. Omitted entirely when the caller has no SESSION KV
23
23
  * to mint against — the local loop then simply runs with no hosted signal.
24
24
  */
25
- import { readEnv } from "@/lib/env";
26
- import { redactEmailForHint } from "@/lib/privacy/emailHint";
27
- import { createRendezvous, type RendezvousDeps } from "@/lib/dev/rendezvousBroker";
25
+ import { readEnv } from "@/lib/publication/shared/env";
26
+ import { redactEmailForHint } from "@/lib/access/privacy/emailHint";
27
+ import { createRendezvous, type RendezvousDeps } from "@/lib/developer-experience/dev/rendezvousBroker";
28
28
 
29
29
  // The CLI's built-in default MCP (packages/cli login.mjs DEFAULT_MCP_URL). When the derived
30
30
  // MCP origin equals this, --mcp is redundant noise, so we omit it.