@aotter/mantle 0.0.11-alpha.57 → 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.
@@ -171,7 +171,8 @@ entry's state machine.
171
171
  with `CONFLICT`). The admin console renders these collections flat —
172
172
  no draft/published filter buckets, no publish controls. Declare it
173
173
  on any Schema whose rows a human should *inspect and correct*, never
174
- *stage and publish*.
174
+ *stage and publish*. Staff MCP emits `create_record_<schema>` and
175
+ `update_record_<schema>` for these Schemas instead of draft tools.
175
176
 
176
177
  The modes are **per-Schema and mix freely** within a site. There is no
177
178
  site-wide lifecycle setting; one Schema can be `simple` while another
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.0.11-alpha.57",
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-admin-ui": "0.0.11-alpha.57",
51
- "@aotter/mantle-cloudflare": "0.0.11-alpha.57",
52
- "@aotter/mantle-spec": "0.0.11-alpha.57",
53
- "@aotter/mantle-runtime": "0.0.11-alpha.57"
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",
@@ -82,6 +82,12 @@ the atoms cannot express the behavior.
82
82
  `Procedure.spec.input` before the seed/form. Keep public mutation inputs
83
83
  `additionalProperties: false`; otherwise JSON Schema's default may strip an
84
84
  undeclared field while returning success.
85
+ - Use `lifecycle: none` for submissions, inquiries, orders, and other
86
+ Procedure-created operational records that staff inspect or correct. Reserve
87
+ `simple` for content a person stages and publishes.
88
+ - When a form's fixed option values change, update the stored Schema and public
89
+ Procedure input `enum` together. Keep translated labels in the page seed;
90
+ Admin and Staff MCP derive their typed controls from the manifest values.
85
91
  - For a new section display property, update the content type and the `page`
86
92
  Schema's `sections[].properties`; an undeclared property has no
87
93
  runtime-backed Admin or Staff MCP path.
@@ -146,7 +146,10 @@ pnpm view-smoke # 10 cases against /api/views/*
146
146
  pnpm mcp-smoke # 12 cases against /mcp
147
147
  ```
148
148
 
149
- If you added a new MCP-relevant Schema, the per-collection authoring tools (`create_draft_<segment>`, `update_draft_<segment>`) auto-emit; verify with `tools/list`.
149
+ If you added a new MCP-relevant Schema, per-collection authoring tools auto-emit:
150
+ `create_draft_<segment>` / `update_draft_<segment>` for content lifecycles,
151
+ or `create_record_<segment>` / `update_record_<segment>` for
152
+ `lifecycle: none`. Verify the actual surface with `tools/list`.
150
153
 
151
154
  ## API and MCP authorization
152
155
 
@@ -33,8 +33,9 @@ tokens, or recipes, but the skill contract is Core-owned.
33
33
  ## Work
34
34
 
35
35
  - Use existing tokens, CSS, components, and installed dependencies first.
36
- - When the generated section type exposes `showImage`, set it to `false` for
37
- a text-only hero/content block. Put custom media in a project-owned section.
36
+ - For a standard hero image, set the section's `image: { src, alt }`; use
37
+ `showImage: false` for text-only hero/content blocks. Put non-image media in
38
+ a project-owned section.
38
39
  - Keep accessibility basics: semantic HTML, focus states, contrast, and
39
40
  keyboard reachability. Against a non-default background, check
40
41
  `--foreground-muted` and `--primary`, not only `--foreground`; keep normal