@aotter/mantle 0.0.11-alpha.58 → 0.0.11-alpha.59

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.
@@ -93,6 +93,26 @@ passed through `CmsConfig.templates`, and a `publicPathResolver` passed through
93
93
  consumer; mounting every Schema automatically is not, because some collections
94
94
  are private even when they contain a slug.
95
95
 
96
+ ### HTTP cache contract
97
+
98
+ The Cloudflare adapter is private by default. Consumers must export
99
+ `createOAuthProvider(...)` as the Worker's top-level handler so its final
100
+ response policy covers admin, auth, API, OAuth, MCP, redirects, and errors.
101
+ Those responses receive `Cache-Control: private, no-store`; Cloudflare-specific
102
+ CDN cache overrides are removed.
103
+
104
+ `mountPublicRoutes(...)` opts only successful pre-rendered HTML, markdown,
105
+ `llms.txt`, and sitemap responses into the shared cache with
106
+ `Cache-Control: public, max-age=0, s-maxage=300`. The top-level policy preserves
107
+ that opt-in only for anonymous `GET`/`HEAD` responses with status 200, explicit
108
+ shared freshness, no request `Cookie` or `Authorization`, and no response
109
+ `Set-Cookie`. It also varies public responses by `Cookie` and `Authorization`.
110
+
111
+ A starter-level Workers Cache may therefore store only responses that still
112
+ meet that exact public contract. It must bypass credentialed/cookie requests
113
+ and must never infer cacheability from a URL prefix. Cache entries remain
114
+ version-local; cross-version caching is outside this contract.
115
+
96
116
  Minimum auth/MCP behavior:
97
117
 
98
118
  - Provide Better Auth-compatible sign-in/session routes for the platform.
@@ -124,6 +144,7 @@ Minimum auth/MCP behavior:
124
144
  - [ ] Normalize session/OAuth and any consumer credential seam into
125
145
  `HandlerContext.auth`; never put raw credentials in runtime context.
126
146
  - [ ] Mount `/mcp/staff` and `/mcp` via the platform's OAuth provider lib (Cloudflare adapter uses `@cloudflare/workers-oauth-provider` at top level). Enforce staff D1 role inside the apiHandler.
147
+ - [ ] Preserve the HTTP cache contract: private by default; explicit anonymous 200 `GET`/`HEAD` public opt-in only.
127
148
  - [ ] Prove one guarded target has identical REST/MCP outcomes, including
128
149
  mutable revocation on the next call.
129
150
  - [ ] Add optional `MediaStorage` or `DeferredHookDispatcher` only when the adapter supports those features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.0.11-alpha.58",
3
+ "version": "0.0.11-alpha.59",
4
4
  "description": "Umbrella entry for @aotter/mantle. Adopters install this one package and import from subpaths: /spec, /runtime, /cloudflare, /admin-ui. Sub-packages remain individually installable on npm for tooling / alt-adapter authors. The Netlify adapter ships as a private workspace stub in v0.1 — its subpath will be added when the impl lands in v0.2.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://mantle.tools/",
@@ -47,10 +47,10 @@
47
47
  "README.md"
48
48
  ],
49
49
  "dependencies": {
50
- "@aotter/mantle-cloudflare": "0.0.11-alpha.58",
51
- "@aotter/mantle-admin-ui": "0.0.11-alpha.58",
52
- "@aotter/mantle-spec": "0.0.11-alpha.58",
53
- "@aotter/mantle-runtime": "0.0.11-alpha.58"
50
+ "@aotter/mantle-admin-ui": "0.0.11-alpha.59",
51
+ "@aotter/mantle-runtime": "0.0.11-alpha.59",
52
+ "@aotter/mantle-cloudflare": "0.0.11-alpha.59",
53
+ "@aotter/mantle-spec": "0.0.11-alpha.59"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@cloudflare/workers-oauth-provider": "^0.8.0",