@aotter/mantle 0.0.11-alpha.53 → 0.0.11-alpha.55

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.
@@ -86,6 +86,13 @@ Minimum HTTP behavior for a full adapter:
86
86
  - Evaluate target auth and dynamic guards through the runtime use cases; do
87
87
  not duplicate guard logic in HTTP handlers.
88
88
 
89
+ For the Cloudflare adapter, public rendering requires three matching consumer
90
+ inputs: `mountPublicRoutes(...)` route declarations, a `TemplateRegistry`
91
+ passed through `CmsConfig.templates`, and a `publicPathResolver` passed through
92
+ `CmsConfig.publicPathResolver`. Omitting public routes is valid for a headless
93
+ consumer; mounting every Schema automatically is not, because some collections
94
+ are private even when they contain a slug.
95
+
89
96
  Minimum auth/MCP behavior:
90
97
 
91
98
  - Provide Better Auth-compatible sign-in/session routes for the platform.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.0.11-alpha.53",
3
+ "version": "0.0.11-alpha.55",
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.53",
51
- "@aotter/mantle-cloudflare": "0.0.11-alpha.53",
52
- "@aotter/mantle-runtime": "0.0.11-alpha.53",
53
- "@aotter/mantle-spec": "0.0.11-alpha.53"
50
+ "@aotter/mantle-admin-ui": "0.0.11-alpha.55",
51
+ "@aotter/mantle-cloudflare": "0.0.11-alpha.55",
52
+ "@aotter/mantle-spec": "0.0.11-alpha.55",
53
+ "@aotter/mantle-runtime": "0.0.11-alpha.55"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@cloudflare/workers-oauth-provider": "^0.8.0",
@@ -64,7 +64,7 @@
64
64
  "@types/node": "^26",
65
65
  "aws4fetch": "^1.0.20",
66
66
  "better-auth": "^1.6.23",
67
- "hono": "^4.12.27",
67
+ "hono": "^4.12.30",
68
68
  "typescript": "^6.0.3",
69
69
  "zod": "^4.4.2"
70
70
  },
package/skills/README.md CHANGED
@@ -19,10 +19,12 @@ or update the existing one.
19
19
 
20
20
  ## Skill authority
21
21
 
22
- The `mantle:*` namespace is owned by `@aotter/mantle`. Starter template
23
- repos may vendor exact copies for offline/repo-local use, but they must not
24
- fork the meaning of a `mantle:*` skill. Starter launch files and plugin recipes
25
- are context that Core skills read, not competing skill contracts.
22
+ The `mantle:*` namespace is owned by `@aotter/mantle`. Generated starters may
23
+ vendor Core workflow skills pinned to their starter ref for offline use. Use
24
+ those skills for workflow and compatibility recovery; use the installed
25
+ package version plus `node_modules/@aotter/mantle/docs/` for runtime/API
26
+ behavior. Starter launch files and plugin recipes are project context, not
27
+ competing contracts.
26
28
 
27
29
  ## Marketplace install
28
30
 
@@ -9,17 +9,19 @@ metadata:
9
9
 
10
10
  # Mantle Develop
11
11
 
12
- This is the Core SDK skill for working inside an existing Mantle project.
13
- Starter files, launch handoffs, and plugin recipes are context; this skill
14
- owns the workflow vocabulary.
12
+ This is the Core workflow skill for an existing Mantle project. A repo-local
13
+ copy may carry compatibility guidance pinned to the starter ref; the installed
14
+ package version and embedded docs govern runtime/API behavior.
15
15
 
16
16
  ## First Read
17
17
 
18
18
  1. `package.json` for the installed `@aotter/mantle*` versions.
19
19
  2. `manifests/` and `src/mantle/config.ts` for the active atoms and adapter wiring. If the project is older, check `src/mantleConfig.ts`.
20
- 3. Optional local context: `.mantle/launch-state.json`, `.mantle/handoff.md`,
20
+ 3. The active `.mantle/overlays/<type>/seed.json`, when present; generated
21
+ homepages commonly import visible copy and form structure from it.
22
+ 4. Optional local context: `.mantle/launch-state.json`, `.mantle/handoff.md`,
21
23
  `.mantle/plugins.json`, `.mantle/plugins.lock.json`, and `.mantle/recipes/`.
22
- 4. Installed Core docs in `node_modules/@aotter/mantle/docs/`.
24
+ 5. Installed Core docs in `node_modules/@aotter/mantle/docs/`.
23
25
 
24
26
  If `node_modules/` is missing, run `pnpm install --frozen-lockfile` before
25
27
  falling back to remote docs. Remote docs must use a tag matching the installed
@@ -32,8 +34,13 @@ Before inventing a Mantle pattern, inspect
32
34
  Use a tag matching the installed Mantle version when available; use `develop`
33
35
  only for unreleased work. `blank/` shows the base application shape and
34
36
  `overlays/<type>/` contains working examples of manifests, handlers, routes,
35
- pages, and feature wiring. Copy the smallest matching pattern. Do not edit or
36
- copy generated `provision-bundles/*.json` by hand.
37
+ page seeds, and feature wiring. Copy the smallest matching pattern. Do not edit
38
+ or copy generated `provision-bundles/*.json` by hand.
39
+
40
+ Public rendering is opt-in consumer wiring: `mountPublicRoutes`, a
41
+ `TemplateRegistry`, and a matching `publicPathResolver` must agree on the
42
+ exposed collections. Do not auto-publish every Schema. Generated projects list
43
+ their mounted URL surface in their own README.
37
44
 
38
45
  ## Authoring CLI
39
46
 
@@ -66,6 +73,33 @@ Do not invent manifest kinds such as `Form`, `Feature`, `Workflow`, or
66
73
  `Membership`. Compose those from the four atoms plus TypeScript only where
67
74
  the atoms cannot express the behavior.
68
75
 
76
+ ## Content Edits
77
+
78
+ - A generated homepage reads its repo seed before auth. Change that seed for
79
+ local/static page copy; after auth, use Admin or Staff MCP for runtime-backed
80
+ content.
81
+ - For a new submitted field, update the stored `Schema` and the public
82
+ `Procedure.spec.input` before the seed/form. Keep public mutation inputs
83
+ `additionalProperties: false`; otherwise JSON Schema's default may strip an
84
+ undeclared field while returning success.
85
+ - For a new section display property, update the content type and the `page`
86
+ Schema's `sections[].properties`; an undeclared property has no
87
+ runtime-backed Admin or Staff MCP path.
88
+ - Update notification handlers when they need the new field. Test the stored
89
+ entry, not only the HTTP `{ "ok": true }` response.
90
+
91
+ ## Locales
92
+
93
+ - `data.locale` is reserved for `localized: true` Schemas. A non-localized
94
+ Schema must use a domain field such as `replyLocale`.
95
+ - Parallel locale blocks must keep field names, option values, step IDs, and
96
+ result keys identical; translate display strings only.
97
+ - `siteDefaults.locales` is code-owned and boot-synced. Brand, title,
98
+ description, and origin are seeded once, then changed through site settings.
99
+ - When changing an existing collection from `[slug]` to `[slug, locale]`,
100
+ boot with a Mantle version that reconciles obsolete unique indexes and test
101
+ the same slug in two locales. Do not patch D1 manually.
102
+
69
103
  ## Adapter Boundary
70
104
 
71
105
  The runtime is adapter-neutral. Required runtime ports are `DatabaseDriver`,
@@ -117,6 +151,8 @@ cache.
117
151
  ## Rules
118
152
 
119
153
  - Prefer manifest YAML for content model changes.
154
+ - Use a generated overlay `seed.json` for the auth-free local first page when
155
+ it is already imported by `src/web/content/*`.
120
156
  - Add TypeScript only for handlers, rendering, adapter wiring, or real behavior.
121
157
  - Do not write directly to D1, KV, Postgres, or object storage for content
122
158
  authoring. Use runtime use cases, admin APIs, or Staff MCP.
@@ -38,11 +38,15 @@ hosted provider flow.
38
38
  2. Choose absolute paths for a temporary starters checkout and a target
39
39
  directory outside both Mantle repositories. Derive a short project slug,
40
40
  brand, one-sentence description, and locales from the user's prompt.
41
+ Require Node 22+ and pnpm 9+; check `node --version` and `pnpm --version`
42
+ before materializing.
41
43
 
42
44
  3. Clone [`aotter/mantle-starters`](https://github.com/aotter/mantle-starters)
43
45
  into a temporary directory and run its materializer. Use a starters ref
44
46
  supplied by the user for branch testing. Otherwise use a tag matching the
45
- requested Mantle version; use `develop` only for unreleased work.
47
+ requested Mantle version; use `develop` only for unreleased work. When the
48
+ user supplies a Mantle branch URL for a cold test, use the same branch name
49
+ in `mantle-starters` when that branch exists.
46
50
 
47
51
  ```bash
48
52
  git clone --depth 1 --branch <starters-ref> \
@@ -59,7 +63,13 @@ The materializer writes the same precomposed `provision-bundles/<type>.json`
59
63
  used by Mantle landing. Do not manually copy `blank/`, merge overlays, or edit
60
64
  the generated bundle JSON.
61
65
 
62
- 4. Initialize and verify the local project:
66
+ 4. For a typed launch, read `.mantle/handoff.md`, the selected overlay's
67
+ `layout.md`, `seed-prompt.md`, and `seed.json`. Shape the first local page by
68
+ editing that checked-in seed; generated content modules import it directly.
69
+ This is application source, not direct D1 authoring. Do not use Staff MCP
70
+ until an auth provider is configured.
71
+
72
+ 5. Initialize and verify the local project:
63
73
 
64
74
  ```bash
65
75
  cd <target-dir>
@@ -71,7 +81,10 @@ pnpm dev
71
81
  ```
72
82
 
73
83
  Open `http://localhost:8787`. Public preview works before auth is configured;
74
- auth-gated routes may return `503 setup_incomplete`.
84
+ auth-gated routes may return `503 setup_incomplete`. `blank` is intentionally
85
+ empty; typed launches must show the selected seed. Do not infer SDK public
86
+ render routes from the Core README—generated projects mount only the URL
87
+ surface documented in their own README.
75
88
 
76
89
  ## Continue an Existing Project
77
90
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: theme
3
- description: Apply brand and visual direction in a Mantle project without depending on starter-owned skill semantics.
3
+ description: Apply brand and visual direction in a generated Mantle project using its repo-owned theme and UI contracts.
4
4
  metadata:
5
5
  source: "@aotter/mantle"
6
6
  sourcePath: skills/theme/SKILL.md
@@ -17,14 +17,28 @@ tokens, or recipes, but the skill contract is Core-owned.
17
17
  1. `.mantle/handoff.md` and `.mantle/recipes/` if present.
18
18
  2. `styles/`, `components/`, `src/web/`, `src/theme*`, and `kiwa-ui.json`
19
19
  if present.
20
- 3. `manifests/` to understand which content shape drives the public UI.
20
+ 3. `kiwa/manifest.json` for the pinned source and per-file `mirrors`.
21
+ 4. `manifests/` to understand which content shape drives the public UI.
22
+
23
+ ## Ownership
24
+
25
+ - `styles/globals.css` is the token contract. Start a whole-site reskin with
26
+ its `:root` and `.dark` values; Kiwa components inherit those variables.
27
+ - `src/web/` is project-owned. Put new sections and page composition there.
28
+ - `kiwa/` is a vendored snapshot. In `components/`, treat paths whose manifest
29
+ entry's `mirrors` contains `blank` as sync-managed in the project root. For
30
+ a structural variant, fork or wrap the block under `src/web/sections/`
31
+ instead of editing a synced file.
21
32
 
22
33
  ## Work
23
34
 
24
- - Edit source the repo owns.
25
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.
26
38
  - Keep accessibility basics: semantic HTML, focus states, contrast, and
27
- keyboard reachability.
39
+ keyboard reachability. Against a non-default background, check
40
+ `--foreground-muted` and `--primary`, not only `--foreground`; keep normal
41
+ text at 4.5:1 or better.
28
42
  - Do not require registry access for a project that already vendors UI source.
29
43
  - Add UI dependencies only when existing source cannot cover the requested
30
44
  change.
@@ -37,4 +51,7 @@ pnpm typecheck
37
51
  pnpm dev
38
52
  ```
39
53
 
40
- Visually verify UI changes before calling them done.
54
+ If utility classes changed, rebuild `styles/generated.css` with the project's
55
+ `build:styles`, `check`, or `dev` script. Remove routes/imports for replaced
56
+ assets or styles, then visually verify light/dark contrast and responsive
57
+ behavior before calling the work done.
@@ -24,18 +24,45 @@ Use this for drift checks. Do not blindly overwrite user-owned code.
24
24
  ## Workflow
25
25
 
26
26
  1. Start from a clean git worktree.
27
- 2. Run the project's existing update or compare script if one exists.
27
+ 2. Resolve a mutable target branch to its current commit SHA, then run the
28
+ project's existing update or compare script with that immutable ref.
29
+ If it exits before writing a report (for example, an older
30
+ `mantle:update` rejects a new bundle placeholder), fetch the provision
31
+ bundle from that `aotter/mantle-starters` commit, extract
32
+ `scripts/update.mjs` and `scripts/materialize.mjs` together into a temporary
33
+ directory, and run the updater from the project root with the same commit
34
+ SHA. Do not replace the project's updater before reviewing the report.
28
35
  3. Read the generated report before editing.
29
- 4. Apply useful differences manually.
30
- 5. Re-run:
36
+ 4. Triage each path; do not treat the report as a patch or merge plan.
37
+ 5. Port confirmed upstream changes one hunk at a time.
38
+ 6. Re-run:
31
39
 
32
40
  ```bash
33
41
  pnpm validate
34
42
  pnpm typecheck
35
43
  ```
36
44
 
45
+ ## Report Triage
46
+
47
+ Current reports compare three states: the original starter ref, the target
48
+ ref, and the local project.
49
+
50
+ - Review `upstream` to find starter changes worth porting. Use `local` only to
51
+ understand project-owned drift from the original starter.
52
+ - Never copy generated comparison versions of `wrangler.toml`,
53
+ `.dev.vars.example`, `.mantle/launch-state.json`, or
54
+ `.mantle/features.json`. Preserve Worker/D1 names, bindings, origins,
55
+ provider values, and launch state. Port a reviewed upstream line manually
56
+ only when it does not replace project identity or state.
57
+ - The updater omits the two `.mantle/*.json` state files and reproduces project
58
+ identity. If `upstream` proposes `mantle-<type>` names for a real project,
59
+ stop: the comparator is stale or incompatible. Use the target updater
60
+ recovery in step 2, then regenerate the report.
61
+ - A large `local` section is normal after customization. Counts are not a
62
+ confidence score.
63
+
37
64
  ## Boundary
38
65
 
39
66
  Starter bundles and plugin packages can provide source snapshots, but Core owns
40
- the update vocabulary. A stale starter recipe or plugin note is context; it does
41
- not override the installed Core SDK contract.
67
+ the workflow vocabulary. Repo-local update guidance may recover an older
68
+ updater, but it does not override the installed Core runtime/API contract.