@aotter/mantle 0.1.3-alpha.6 → 0.1.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.
Files changed (70) hide show
  1. package/README.md +5 -5
  2. package/dist/cli/main.d.ts +1 -1
  3. package/dist/cli/main.d.ts.map +1 -1
  4. package/dist/cli/main.js +4 -2
  5. package/dist/cli/main.js.map +1 -1
  6. package/dist/cli/skills.js +2 -2
  7. package/dist/cli/skills.js.map +1 -1
  8. package/docs/adr/0001-four-atom-manifest-model.md +3 -2
  9. package/docs/adr/0013-agent-provisioned-consumer-projects.md +4 -4
  10. package/docs/adr/0016-site-semantic-layer.md +5 -4
  11. package/docs/adr/0018-core-starters-repository-boundary.md +1 -1
  12. package/docs/adr/README.md +2 -2
  13. package/docs/agent-prompts.md +10 -8
  14. package/docs/assets/mantle-admin-developer.png +0 -0
  15. package/docs/consumer-onboarding-audit.md +65 -0
  16. package/docs/examples/README.md +1 -1
  17. package/docs/examples/host-chatgpt-sites/README.md +29 -12
  18. package/docs/examples/host-chatgpt-sites/drizzle/0003_store_instance_id.sql +1 -0
  19. package/docs/examples/host-chatgpt-sites/drizzle/meta/_journal.json +1 -1
  20. package/docs/examples/host-chatgpt-sites/public/site.css +1 -1
  21. package/docs/examples/host-chatgpt-sites/scripts/build.mjs +2 -1
  22. package/docs/examples/host-chatgpt-sites/scripts/check.mjs +2 -0
  23. package/docs/examples/host-chatgpt-sites/src/index.ts +1 -1
  24. package/docs/examples/host-chatgpt-sites/src/web.ts +1 -1
  25. package/docs/examples/host-minimal-worker/README.md +5 -5
  26. package/docs/handbook/{sites → chatgpt-sites}/equipment-checkout.md +1 -1
  27. package/docs/handbook/{sites → chatgpt-sites}/index.md +15 -3
  28. package/docs/handbook/cloudflare/authentication.md +16 -0
  29. package/docs/handbook/cloudflare/chatgpt-sites.md +6 -6
  30. package/docs/handbook/cloudflare/deploy-and-operate.md +3 -2
  31. package/docs/handbook/cloudflare/media-r2.md +2 -2
  32. package/docs/handbook/concepts/four-atoms.md +1 -1
  33. package/docs/handbook/concepts/lifecycle-and-locales.md +1 -1
  34. package/docs/handbook/concepts/mcp-and-agents.md +25 -5
  35. package/docs/handbook/concepts/procedures-and-triggers.md +1 -1
  36. package/docs/handbook/concepts/runtime-and-adapters.md +2 -2
  37. package/docs/handbook/concepts/views.md +9 -8
  38. package/docs/handbook/guides/admin-ui.md +135 -0
  39. package/docs/handbook/guides/agent-setup.md +97 -0
  40. package/docs/handbook/guides/typed-queries.md +161 -0
  41. package/docs/handbook/navigation.json +28 -18
  42. package/docs/handbook/reference/features.md +55 -0
  43. package/docs/handbook/reference/manifest.md +3 -1
  44. package/docs/handbook/reference/schema.md +1 -1
  45. package/docs/handbook/reference/surface.md +1 -1
  46. package/docs/handbook/reference/view.md +4 -2
  47. package/docs/handbook/releases/index.md +71 -2
  48. package/docs/handbook/start/overview.md +52 -0
  49. package/docs/handbook/start/project-and-cli.md +7 -7
  50. package/docs/handbook/start/quickstart-worker.md +8 -6
  51. package/docs/release-process.md +3 -2
  52. package/docs/sealed-pipeline-ownership.md +1 -1
  53. package/docs/skills/develop/SKILL.md +250 -0
  54. package/docs/skills/media-gc/SKILL.md +85 -0
  55. package/docs/skills/plugin/SKILL.md +132 -0
  56. package/docs/skills/provision/SKILL.md +194 -0
  57. package/docs/skills/theme/SKILL.md +77 -0
  58. package/docs/skills/update/SKILL.md +51 -0
  59. package/docs/spec-only-host-adoption.md +1 -1
  60. package/package.json +18 -18
  61. package/skills/README.md +30 -21
  62. package/skills/develop/SKILL.md +21 -4
  63. package/skills/install/SKILL.md +40 -8
  64. package/skills/media-gc/SKILL.md +2 -2
  65. package/skills/plugin/SKILL.md +19 -7
  66. package/skills/provision/SKILL.md +3 -3
  67. package/skills/theme/SKILL.md +10 -3
  68. package/skills/update/SKILL.md +9 -4
  69. package/skills/.keep +0 -0
  70. /package/docs/handbook/{sites → chatgpt-sites}/host-reference.md +0 -0
package/README.md CHANGED
@@ -12,11 +12,11 @@ where agents write config and the runtime carries the complexity.
12
12
  Cold start for a new application is the install skill, not a bare npm add:
13
13
 
14
14
  ```sh
15
- npx skills add aotter/mantle --skill install
15
+ npx skills add aotter/mantle
16
16
  ```
17
17
 
18
18
  To depend on this package in an existing project, pin the exact version
19
- from `package.json` (currently `0.1.3-alpha.6`):
19
+ from `package.json` (currently `0.1.4`):
20
20
 
21
21
  ```bash
22
22
  npm install @aotter/mantle
@@ -205,7 +205,7 @@ internals or rebuilding Mantle's adapters.
205
205
  Cold start from GitHub or a marketplace host:
206
206
 
207
207
  ```sh
208
- npx skills add aotter/mantle --skill install
208
+ npx skills add aotter/mantle
209
209
  ```
210
210
 
211
211
  That skill interviews, pins this package, then uses the CLI and the
@@ -223,7 +223,7 @@ Install the Mantle Core skill bundle before authoring or maintaining a
223
223
  consumer application. The canonical command is:
224
224
 
225
225
  ```sh
226
- npx skills add aotter/mantle --skill install
226
+ npx skills add aotter/mantle
227
227
  ```
228
228
 
229
229
  Claude Code and Codex can install the plugin, then run that skill:
@@ -242,7 +242,7 @@ Cursor and VS Code Copilot can auto-discover the GitHub repo through
242
242
  `.cursor-plugin/plugin.json` and `.copilot-plugin/plugin.json` after the repo
243
243
  is cloned or opened. Still start from the `npx skills add` sentence (or open
244
244
  `skills/install/SKILL.md`). Untagged `aotter/mantle` resolves to `main`, which
245
- only advances at a release, so it is always the latest published version. Add
245
+ can contain a source-only hotfix ahead of the latest npm release. Add
246
246
  `@vX.Y.Z` only to reproduce an older project; never point a consumer at
247
247
  `develop` or another moving branch.
248
248
 
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export declare const MANTLE_OVERVIEW = "mantle \u2014 compile manifests into a RuntimePlan and typed binding\n\nOverview\n Optional surfaces \u2014 take only what you need. Admin is opt-in. You can ship a\n complete service with no Dev UI, no visitor frontend, and no extra packages.\n\n Minimal \u2014 Spec + generate\n validate + generate compile manifests into a sealed plan and typed binding.\n Embed that binding in an existing host. No Admin, no visitor UI.\n\n Runtime / adapter\n Bind Runtime through an adapter (Cloudflare Worker, Bun, Vercel, or yours).\n HTTP Views, MCP, and Auth work without Admin.\n See docs/examples/host-minimal-worker or\n node_modules/@aotter/mantle/docs/examples/host-minimal-worker.\n\n Opt-in \u2014 Admin / Dev UI\n Add @aotter/mantle-admin and @aotter/mantle-admin-ui only when humans need\n a console. Then re-run generate, bind wrangler ASSETS, and open\n /admin/sign-in (local email OTP via ConsoleEmailSender).\n See docs/examples/host-local-admin-otp or\n node_modules/@aotter/mantle/docs/examples/host-local-admin-otp.\n\n Further (ask the subcommand for details)\n skills project version-matched agent instructions\n emit-openapi OpenAPI 3.1 from HTTP Triggers and Views\n mantle-harness measure indexes and live HTTP (separate binary)\n\nUsage: mantle <subcommand> [options]\n\nSubcommands:\n generate Compile manifests into a typed runtime binding\n validate Static manifest and handler-source validation\n skills Project version-matched Core skills\n emit-openapi Emit OpenAPI 3.1 from Triggers and Views\n\nDocumentation:\n Handbook: node_modules/@aotter/mantle/docs/handbook/ (or docs/handbook/)\n Online: https://mantle.tools/\n Install skill: npx skills add aotter/mantle --skill install\n";
2
+ export declare const MANTLE_OVERVIEW = "mantle \u2014 compile manifests into a RuntimePlan and typed binding\n\nOverview\n Optional surfaces \u2014 take only what you need. Admin is opt-in. You can ship a\n complete service with no Dev UI, no visitor frontend, and no extra packages.\n\n Minimal \u2014 Spec + generate\n validate + generate compile manifests into a sealed plan and typed binding.\n Embed that binding in an existing host. No Admin, no visitor UI.\n\n Runtime / adapter\n Bind Runtime through an adapter (Cloudflare Worker, Bun, Vercel, or yours).\n HTTP Views, MCP, and Auth work without Admin.\n See docs/examples/host-minimal-worker or\n node_modules/@aotter/mantle/docs/examples/host-minimal-worker.\n\n Opt-in \u2014 Admin / Dev UI\n Add @aotter/mantle-admin and @aotter/mantle-admin-ui only when humans need\n a console. Then re-run generate, bind wrangler ASSETS, and open\n /admin/sign-in (local email OTP via ConsoleEmailSender).\n See docs/examples/host-local-admin-otp or\n node_modules/@aotter/mantle/docs/examples/host-local-admin-otp.\n\n Further (ask the subcommand for details)\n skills project version-matched agent instructions\n emit-openapi OpenAPI 3.1 from HTTP Triggers and Views\n mantle-harness measure indexes and live HTTP (separate binary)\n\nUsage: mantle <subcommand> [options]\n\nSubcommands:\n generate Compile manifests into a typed runtime binding\n validate Static manifest and handler-source validation\n skills Project version-matched Core skills\n emit-openapi Emit OpenAPI 3.1 from Triggers and Views\n\nDocumentation:\n Start: node_modules/@aotter/mantle/docs/handbook/start/overview.md\n Features: node_modules/@aotter/mantle/docs/handbook/reference/features.md\n Admin UI: node_modules/@aotter/mantle/docs/handbook/guides/admin-ui.md\n Online: https://mantle.tools/\n Install skill: npx skills add aotter/mantle\n";
3
3
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAgCA,eAAO,MAAM,eAAe,kxDAwC3B,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAgCA,eAAO,MAAM,eAAe,g6DA0C3B,CAAC"}
package/dist/cli/main.js CHANGED
@@ -62,9 +62,11 @@ Subcommands:
62
62
  emit-openapi Emit OpenAPI 3.1 from Triggers and Views
63
63
 
64
64
  Documentation:
65
- Handbook: node_modules/@aotter/mantle/docs/handbook/ (or docs/handbook/)
65
+ Start: node_modules/@aotter/mantle/docs/handbook/start/overview.md
66
+ Features: node_modules/@aotter/mantle/docs/handbook/reference/features.md
67
+ Admin UI: node_modules/@aotter/mantle/docs/handbook/guides/admin-ui.md
66
68
  Online: https://mantle.tools/
67
- Install skill: npx skills add aotter/mantle --skill install
69
+ Install skill: npx skills add aotter/mantle
68
70
  `;
69
71
  main().then((code) => {
70
72
  process.exitCode = code;
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IA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jD,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C9B,CAAC;AAEF,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE;IACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,CAAC,KAAK,CAAC,mBAAmB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3G,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
@@ -59,7 +59,7 @@ export async function runSkills(rawArgs) {
59
59
  return 1;
60
60
  }
61
61
  if (!check)
62
- stdout.write(`Mantle skills projected: ${skills.join(", ")}.\n`);
62
+ stdout.write(`Mantle skills projected: ${skills.join(", ")}.\nRead .agents/skills/mantle-develop/SKILL.md and node_modules/@aotter/mantle/docs/handbook/start/overview.md.\n`);
63
63
  return 0;
64
64
  }
65
65
  catch (error) {
@@ -116,7 +116,7 @@ export function projectionScopes(skillMarkdown) {
116
116
  }
117
117
  async function skillSourceRoot() {
118
118
  const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
119
- for (const candidate of [join(packageRoot, "skills"), resolve(packageRoot, "../../skills")]) {
119
+ for (const candidate of [join(packageRoot, "skills"), resolve(packageRoot, "../../docs/skills")]) {
120
120
  if ((await stat(candidate).catch(() => null))?.isDirectory())
121
121
  return candidate;
122
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,S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,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -214,8 +214,9 @@ See § Authoring shape below for the full retirement rationale.
214
214
  Names + PG-1:1 framing are documented in this ADR and the manifest grammar
215
215
  reference. Manifest TS types live in `packages/mantle-spec/`. The external
216
216
  [`aotter/mantle-starters`](https://github.com/aotter/mantle-starters)
217
- repository declares consumer instances of each atom. Runtime dispatcher, View
218
- executor, and Procedure dispatcher live in this repository.
217
+ repository declared alpha-era consumer instances of each atom; new applications
218
+ are authored directly under [ADR-0021](0021-retire-starter-scaffolding.md).
219
+ Runtime dispatcher, View executor, and Procedure dispatcher live in this repository.
219
220
 
220
221
  ---
221
222
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  ## Status
4
4
 
5
- Superseded for first launch by provisioning v2 (2026-06-27). Historical
6
- record only.
5
+ Superseded by [ADR-0021](0021-retire-starter-scaffolding.md) for 0.1.2 and
6
+ later. Historical pre-stable install flow only.
7
7
 
8
8
  ## Date
9
9
 
@@ -11,7 +11,7 @@ record only.
11
11
 
12
12
  ## Context
13
13
 
14
- > **Current direction:** Mantle landing creates the GitHub repo from
14
+ > **Historical 2026-06-27 direction, no longer current:** Mantle landing creates the GitHub repo from
15
15
  > `mantle-starters` `provision-bundles/<type>.json`, commits the blank
16
16
  > or type bundle, and connects Cloudflare Workers CI when possible.
17
17
  > Do not extend the old `create-mantle launch --session` or
@@ -144,7 +144,7 @@ they are debugging a failed provision.
144
144
 
145
145
  ## Implementation status
146
146
 
147
- - `skills/install/SKILL.md` and `skills/provision/SKILL.md` encode the
147
+ - `skills/install/SKILL.md` and `docs/skills/provision/SKILL.md` encode the
148
148
  current agent workflow, including the launch-session fast path.
149
149
  - `aotter/mantle-starters` hosts `packages/create-mantle`, whose
150
150
  `launch --session` mode validates the session before writing files.
@@ -2,9 +2,10 @@
2
2
 
3
3
  ## Status
4
4
 
5
- Accepted (slimmed 2026-05-12 per Epic #116; `mantle/site.md` letter
6
- surface suspended 2026-06-19 and removed from first-run scaffolds;
7
- amended 2026-06-27 for landing provision bundles).
5
+ Superseded by [ADR-0021](0021-retire-starter-scaffolding.md) for 0.1.2 and
6
+ later. The launch-state and provision-bundle rules below describe the legacy
7
+ Starter/Landing flow; new applications are authored directly from the installed
8
+ SDK's skill and handbook.
8
9
 
9
10
  ## Decision
10
11
 
@@ -65,5 +66,5 @@ and to the landing substitution pass.
65
66
  generated `.mantle/*.template` bundle files.
66
67
  - Substitution: Mantle landing provision-bundle substitution.
67
68
  - Install handoff: `skills/install/SKILL.md` describes how agents continue from the landing-provisioned repo.
68
- - Provision update: `skills/provision/SKILL.md` describes the `AGENTS.md` public-site rewrite after deploy.
69
+ - Provision update: `docs/skills/provision/SKILL.md` describes the `AGENTS.md` public-site rewrite after deploy.
69
70
  - Type overlays are applied while building `provision-bundles/<type>.json`; generated repos should not need a second overlay step.
@@ -3,7 +3,7 @@
3
3
  > Superseded for 0.1.2 by [ADR-0021](0021-retire-starter-scaffolding.md).
4
4
  > The contract below is retained as alpha.17 history, not current launch/release guidance.
5
5
 
6
- **Status:** Accepted for now; revisit only under the triggers below
6
+ **Status:** Superseded by ADR-0021 for 0.1.2 and later. Historical alpha.17 decision only.
7
7
 
8
8
  **Date:** 2026-08-02
9
9
 
@@ -14,9 +14,9 @@ Records of *why* mantle ended up shaped this way. The numbering preserves POC AD
14
14
  | [0010](0010-locale-and-translates.md) | Locale 3-layer (manifest / D1 site_config / data field) + translates pattern. Boot decoupled from `site_config` (issue #60 fix). | Accepted (refreshed) |
15
15
  | [0011](0011-adapter-port-spec.md) | Adapter port spec. Required runtime ports plus optional feature ports. | Accepted (new) |
16
16
  | [0012](0012-views-as-public-rest.md) | Views auto-expose matching REST and `query_view_*` MCP reads on their declared `public` or `staff` surface. Schemas never get a public REST endpoint. | Accepted + amended |
17
- | [0013](0013-agent-provisioned-consumer-projects.md) | Historical agent-provisioned consumer projects path. Superseded for first launch by landing provision bundles. | Superseded |
17
+ | [0013](0013-agent-provisioned-consumer-projects.md) | Historical agent-provisioned consumer projects path. | Superseded by 0021 |
18
18
  | [0014](0014-auth-better-auth-and-multi-tenant-mcp.md) | The Cloudflare adapter owns one Better Auth 1.7 identity/OAuth/MCP authority with native method options and CIMD discovery. Verified callers are normalized into runtime context; mutable staff role and target authorization are re-evaluated per call. | Accepted + amended |
19
- | [0016](0016-site-semantic-layer.md) | Site semantic layer: `AGENTS.md` (cross-tool entry) + `.mantle/launch-state.json` (deterministic install context). The older `mantle/site.md` letter surface is suspended from first-run scaffolds. | Accepted (slimmed) |
19
+ | [0016](0016-site-semantic-layer.md) | Historical Starter/Landing `AGENTS.md` and launch-state contract. | Superseded by 0021 |
20
20
  | [0017](0017-media-multi-variant-agent-side-optimization.md) | Multi-variant media assets with agent-side optimization and asset-id entry references. | Accepted |
21
21
  | [0018](0018-core-starters-repository-boundary.md) | Core produces published SDK artifacts; the separate starters repository validates them as an external consumer. Revisit after release-contract simplification. | Superseded by 0021 |
22
22
  | [0019](0019-sealed-manifest-runtime-pipeline.md) | One sealed source-to-runtime pipeline, semantic storage seam, and optional Web/Admin/platform dependency direction. | Accepted |
@@ -3,16 +3,16 @@
3
3
  Cold start from GitHub or a marketplace host is the install skill:
4
4
 
5
5
  ```sh
6
- npx skills add aotter/mantle --skill install
6
+ npx skills add aotter/mantle
7
7
  ```
8
8
 
9
9
  Copy one block into a coding agent after that skill is present. Paths below
10
10
  are relative to the Mantle docs root: `node_modules/@aotter/mantle/docs/`
11
- after `@aotter/mantle` is installed, or `docs/` in the installed agent plugin.
11
+ after `@aotter/mantle` is installed. A standalone `skills add` installation
12
+ contains only the selected skill, not these docs.
12
13
  `npx --no-install mantle --help` is the layered CLI overview; it mirrors the
13
14
  authoring docs. A live `/mcp` catalog mirrors the Manifest → RuntimePlan, not
14
- the CLI. Interview first. Worker is the default host unless the user names
15
- ChatGPT Sites. There is no `mantle create`. Empty `generate` fails until
15
+ the CLI. Resolve only missing requirements first; do not assume a host. There is no `mantle create`. Empty `generate` fails until
16
16
  manifests exist. Admin is opt-in.
17
17
 
18
18
  ### Interview then build
@@ -20,9 +20,11 @@ manifests exist. Admin is opt-in.
20
20
  ```text
21
21
  Interview me about the service: host, who uses it, whether humans need a
22
22
  Dev UI, and whether we only embed Spec/Runtime. If the install skill is
23
- missing, run npx skills add aotter/mantle --skill install. Read the
24
- install skill and npx --no-install mantle --help, then
25
- handbook/start/project-and-cli.md.
23
+ missing, run npx skills add aotter/mantle. Read the
24
+ installer-reported skill, choose and install an exact SDK version, then read
25
+ its embedded skills/install/SKILL.md,
26
+ run npx --no-install mantle --help, and
27
+ read handbook/start/overview.md.
26
28
  Use examples/README.md as the examples index; copy builtin-* Manifests only
27
29
  (not cf-primitives-*). Implement locally first. Take only the surfaces we
28
30
  chose. For Spec-only use, skip Runtime and code generation. For a Worker
@@ -82,7 +84,7 @@ Use only when the user names ChatGPT Sites as the host.
82
84
 
83
85
  ```text
84
86
  Build with ChatGPT Sites; use Mantle for content management and publishing.
85
- Read handbook/sites/index.md and examples/host-chatgpt-sites/README.md.
87
+ Read handbook/chatgpt-sites/index.md and examples/host-chatgpt-sites/README.md.
86
88
  Use that runnable host as a reference and install its pinned
87
89
  dependencies from the registry. Derive Schema, View,
88
90
  Procedure and Trigger from my requirements and check the Admin editor/picker and public
@@ -0,0 +1,65 @@
1
+ # Consumer onboarding audit for 0.1.3
2
+
3
+ Scope: source skill install → pinned npm package → CLI → generated skills and
4
+ handbook → application manifest and Admin customization. This is maintainer
5
+ evidence, not a release announcement. Baseline: develop `b90cebbd`, package
6
+ version `0.1.3-alpha.5`; the package version alone does not identify unreleased
7
+ commits on develop. Tracking: [#1042](https://github.com/aotter/mantle/issues/1042).
8
+
9
+ ## Clean source install
10
+
11
+ Executed in an empty temporary directory:
12
+
13
+ ```sh
14
+ npx --yes skills add aotter/mantle --skill install --agent codex --yes
15
+ ```
16
+
17
+ Observed output: repository cloned, **7 skills found**, **1 selected**, copied
18
+ to `./.agents/skills/install`. `skills-lock.json` records source `aotter/mantle`,
19
+ source type `github`, and source path `skills/install/SKILL.md`. The installed
20
+ file's hash in that lock was
21
+ `8a6fd26aea97ae8bdf3e05fef22196c247b3f95aa049204a6ac51259d87e4e29`.
22
+ No SDK, handbook or application is installed by that command. The explicit
23
+ Codex and noninteractive flags make the audited destination reproducible;
24
+ other selected agents/global scope can use another destination.
25
+
26
+ This source install follows the repository's default ref. It does not test the
27
+ unreleased edits in this PR or establish an npm version. The packed-consumer
28
+ check below tests this branch's shipped instructions separately.
29
+
30
+ ## White-box path and fixes
31
+
32
+ | Stage / owner | Finding before this change | Correction |
33
+ |---|---|---|
34
+ | README → external skills installer | Prompt told the agent to read `skills/install/SKILL.md` and `docs/agent-prompts.md`, neither installed there. | Read the installer-reported destination, then the installed SDK's embedded docs. |
35
+ | `skills/install/SKILL.md` | Bootstrap Git instructions did not explicitly hand off to the installed package's own install skill; `docs/...` root was implicit. Host interview was repeated. | Explicit package-root resolution and version authority; ask only for missing requirements. |
36
+ | Install → CLI | It was possible to try the local CLI before installing Core; `generate` in an empty directory fails rather than creating a project. | Spell out package installation before CLI and manifest authoring before generation. |
37
+ | Quickstart versions | Floating `latest` dependency examples contradicted exact-pin advice. | Resolve the requested channel once and save exact Mantle versions before the first build. |
38
+ | `mantle skills` | Correctly projected four project skills, but success output did not tell the agent what to read next. | Print the projected develop skill and installed handbook entry. Document overwrite, drift and opt-in behavior. |
39
+ | `sync-package-docs.mjs` → npm `files` | Docs and all seven skills already shipped; presence checks did not protect the new entry paths or exercise projection from the tarball. | Assert handbook/skill files and byte-identical `.agents`/`.claude` projection in the existing packed-consumer check. |
40
+ | View concepts → grammar/runtime | Concepts denied internal Views and recommended SQL for every new View; reference `surface` table omitted `internal`. SQL admission text was stale. | Match implemented surfaces, typed declarative reads, SQLite admission sandbox and native-dialect limits. |
41
+ | Manifest reference | View's allowed spec keys omitted `cache`; Schema list-column prose omitted native columns. | Reconcile with parser and Admin UI checker. |
42
+ | Plugin/update skills | Assumed conventional source paths, missed regeneration after plugin manifest edits, and treated every View as publicly callable. | Use actual project paths, regenerate the plan, verify the declared surface and distinguish stable index from target prerelease docs. |
43
+ | Feature discovery | No task-to-manifest capability map or usable human entry; reference was buried after host-specific sections. | Add overview, capability table and task guides; move reference before host guides without breaking existing URLs. |
44
+ | Typed query discovery | APIs existed but lacked a complete internal-View calling example or clear reader authorization distinction. | Explain generated params/results, runtime `result` versus REST `data`, SQL `unknown`, indexed reader limits and plan-based emission. |
45
+ | Admin requests → theme/develop skills | Theme skill targeted visitor source; no routing from an Admin request to manifest-controlled presentation. | Route to Admin guide, with Schema/View/Procedure rendering table and supported customization ceiling. |
46
+ | Auth operations | Store-bound session cache behavior existed in code/ADR but was missing from the handbook. | Explain store identity, preparation order and KV propagation limits. |
47
+
48
+ ## Verification and regression coverage
49
+
50
+ - `packages/mantle-spec/test/handbook-contract.test.ts`: complete handbook YAML
51
+ examples parse and validate; navigation covers pages; relative links resolve.
52
+ - `packages/mantle/test/cli/generate.test.ts`: extracts the new internal-View
53
+ YAML and TypeScript directly from the handbook, generates bindings and runs
54
+ strict TypeScript checking on the real example.
55
+ - CLI surface/projection tests assert the concrete next-read destinations;
56
+ existing drift checks verify `--check` is read-only.
57
+ - `scripts/check-optional-packages.mjs`: packs and installs the actual Core
58
+ tarball, checks embedded entry pages/skills, runs `skills` and `skills --check`,
59
+ and compares each project projection byte-for-byte with the installed package.
60
+ - Repository gate: `pnpm check`. Exact execution results and any environment
61
+ limitations are recorded in the PR, rather than frozen as a future guarantee.
62
+
63
+ No npm publish, tag, deployment or grammar change is part of this audit. Source
64
+ skill consumers receive the corrections only once they reach the installed Git
65
+ ref; npm consumers receive them only in a package built from the corrected tree.
@@ -19,4 +19,4 @@ Drop a `builtin-*` YAML block into `host-local-admin-otp/manifests/` (or `host-m
19
19
  | [`cf-primitives-guarded-api.md`](./cf-primitives-guarded-api.md) | API keys, scopes, live entitlement `ref` guards over REST and MCP | cf-primitives | no | none | `host-minimal-worker` plus credential resolver |
20
20
  | [`host-minimal-worker/`](./host-minimal-worker/README.md) | Executable Spec + adapter without Admin | host | no | none | itself |
21
21
  | [`host-local-admin-otp/`](./host-local-admin-otp/README.md) | Executable opt-in Admin / Dev UI with email OTP | host | no | required | itself |
22
- | [Mantle on ChatGPT Sites](../handbook/sites/index.md) · [runnable reference](./host-chatgpt-sites/README.md) | Runnable Sites D1/R2, ChatGPT identity, Admin media, published web and public read-only MCP | host | no | required | itself |
22
+ | [Mantle on ChatGPT Sites](../handbook/chatgpt-sites/index.md) · [runnable reference](./host-chatgpt-sites/README.md) | Runnable Sites D1/R2, ChatGPT identity, Admin media, published web and public read-only MCP | host | no | required | itself |
@@ -1,8 +1,8 @@
1
1
  # Mantle on ChatGPT Sites: runnable reference
2
2
 
3
- The runnable application for [Mantle on ChatGPT Sites](../../handbook/sites/index.md) connects Sites D1 + R2 bindings, Sign in with ChatGPT identity, Mantle Admin and staff roles, same-origin media upload, a published-only article frontend, anonymous read-only `/api/mcp`, and Sites-session staff tools at `/api/mcp/staff`. Remote OAuth MCP remains a separate integration; see [MCP support](../../handbook/sites/host-reference.md#remote-mcp-is-a-separate-gate).
3
+ The runnable application for [Mantle on ChatGPT Sites](../../handbook/chatgpt-sites/index.md) connects Sites D1 + R2 bindings, Sign in with ChatGPT identity, Mantle Admin and staff roles, same-origin media upload, a published-only article frontend, anonymous read-only `/api/mcp`, and Sites-session staff tools at `/api/mcp/staff`. Remote OAuth MCP remains a separate integration; see [MCP support](../../handbook/chatgpt-sites/host-reference.md#remote-mcp-is-a-separate-gate).
4
4
 
5
- After setup, follow [Publish your first article](../../handbook/sites/index.md#publish-your-first-article) to verify the editorial workflow in Admin.
5
+ After setup, follow [Publish your first article](../../handbook/chatgpt-sites/index.md#publish-your-first-article) to verify the editorial workflow in Admin, then [maintain content with an agent](../../handbook/chatgpt-sites/index.md#maintain-content-with-an-agent). Article pages advertise their Markdown mirror through an HTML `rel="alternate"` link; the example does not add a visible Markdown button to the reader UI.
6
6
 
7
7
  ## Before writing code
8
8
 
@@ -10,7 +10,7 @@ Read the user's business request and author the manifest for **their** records a
10
10
 
11
11
  ## Install and run
12
12
 
13
- Requires Mantle 0.1.2 or newer. Copy this directory outside the SDK checkout, then:
13
+ Requires Mantle 0.1.2 or newer. Copy this directory from the selected installed SDK version into a new application directory. Replace every `@aotter/mantle*` `latest` dependency in `package.json` with that same exact version, then:
14
14
 
15
15
  ```bash
16
16
  npm install # or: bun install
@@ -21,24 +21,41 @@ npm run dev -- --port 4174 # leave running
21
21
  npm test # smoke, in a second terminal
22
22
  ```
23
23
 
24
- `npm install` resolves `@aotter/mantle*` from the `latest` dist-tag; this
25
- example does not commit a lockfile, so every fresh install picks up the
26
- current stable release. `bun install` works too, resolving from
27
- `package.json` the same way.
24
+ This example does not commit a lockfile. Commit the lockfile created by your
25
+ first install and use `npm ci` for subsequent installs. `bun install` also
26
+ works when you use Bun's lockfile consistently.
27
+
28
+ ## Add a manifest HTTP Trigger
29
+
30
+ Mounting Admin does not register a manifest HTTP Trigger on the Site's Hono
31
+ router. For an anonymous JSON form whose Trigger declares `POST /api/rsvp`, add
32
+ the corresponding route inside `assemble` in `src/index.ts`:
33
+
34
+ ```ts
35
+ import { createMantleRequestHandler } from '@aotter/mantle/runtime';
36
+
37
+ const handleHttp = createMantleRequestHandler({ plan, getRuntime: get });
38
+ app.post('/api/rsvp', async c =>
39
+ (await handleHttp(c.req.raw, { user: null, staff: null, env: c.env }))
40
+ ?? new Response('Not found', { status: 404 }));
41
+ ```
42
+
43
+ Return the handler's `Response` directly: it validates the JSON body and maps
44
+ Mantle diagnostics to HTTP status codes. If the Trigger requires a signed-in
45
+ user or staff role, derive that context from the verified Sites session instead
46
+ of copying the anonymous context above. See [Procedures and Triggers](../../handbook/concepts/procedures-and-triggers.md#the-http-envelope).
28
47
 
29
48
  Keep `.openai/hosting.json`; do not copy an existing Site's `project_id`. To use another port, also set the Worker's `PUBLIC_ORIGIN` and the test's `MANTLE_TEST_ORIGIN` to that same localhost origin. Local test headers simulate Sites' trusted dispatcher; they do **not** prove deployed ChatGPT login.
30
49
 
31
50
  Review the entire [smoke script](./scripts/check.mjs) before adapting it. It covers D1 CRUD/version conflict, owner/member/role revocation, R2 read/write/delete, media create → PUT → commit → public read, both advertised MCP URLs, public MCP `initialize`/`tools/list`/View call, staff MCP authentication/catalog, draft isolation, published article HTML/Markdown/SEO, and negative auth/Origin/size checks. It creates and deletes only its own test records and objects.
32
51
 
33
- To run this example against an unreleased Mantle checkout instead of the registry, use `node scripts/check-packed-consumer.mjs --project docs/examples/host-chatgpt-sites --output <new dir> -- pnpm build` from a clean SDK checkout and work in its `consumer/`. That path is for SDK development only.
34
-
35
- The checked-in `drizzle/` migrations and `src/storage-fingerprint.json` match the example manifest. `scripts/migration.mjs` shows the one-time generation mechanism; do **not** run it against a deployed database or overwrite an applied migration. For a new business manifest, generate/review an initial migration before the first deployment; for a later change, generate an additive migration from the previous schema state.
52
+ The checked-in `drizzle/` migrations and `src/storage-fingerprint.json` match the example manifest and runtime. Apply all pending D1 migrations before deploying updated code; managed storage does not apply runtime infrastructure migrations at boot, and a missing column can make every route return 500. `scripts/migration.mjs` shows the one-time generation mechanism; do **not** run it against a deployed database or overwrite an applied migration. For a new business manifest, generate/review an initial migration before the first deployment; for a later change, generate an additive migration from the previous schema state.
36
53
 
37
54
  ## Publish with Sites
38
55
 
39
56
  1. Create a new Site through Sites and request **both D1 and R2**. Confirm its saved hosting manifest has `d1: "DB"` and `r2: "MEDIA_BUCKET"`; the local example intentionally omits `project_id` until Sites provisions one. A missing R2 binding cannot be repaired by adding an R2 type to TypeScript. Sites controls provisioning and publishing, not `wrangler deploy`.
40
57
  2. In Sites settings, set `PUBLIC_ORIGIN` to the exact production origin and `OWNER_EMAIL` to the intended first owner. Do not commit hosted secrets or identity headers. Keep the Site audience narrow until verification. A Site Viewer is not automatically a Mantle staff member.
41
- 3. Review the D1 migration, save a Sites version, then deploy that version. Every deployment URL is production. Confirm the deployed artifact includes `dist/server/index.js`, `dist/client/`, `dist/.openai/hosting.json` and `dist/.openai/drizzle/`; `npm run build` prepares those artifacts.
58
+ 3. Review the D1 migration, save a Sites version, then deploy that version. Every deployment URL is production. Confirm the deployed artifact includes `dist/server/index.js`, `dist/client/`, `dist/.openai/hosting.json` and `dist/.openai/drizzle/`; `npm run build` replaces `dist` before preparing those artifacts, so removed migrations cannot remain in a later build.
42
59
  4. On the deployed Site, check `/health`, `/admin/sign-in`, one `/_mantle/admin/assets/*` file, owner login and staff revocation, Admin media upload and committed public image URL, then publish an article with that asset as its cover. Anonymous draft and uncommitted image URLs must return 404. Check public HTML, Markdown, canonical/JSON-LD, sitemap and `llms.txt`; POST `/api/mcp` should discover only the public View tool, while `/api/mcp/staff` must reject anonymous/member requests and expose staff tools to a current staff session. The root `/mcp` path was intercepted in the lab and is not used by this reference.
43
60
 
44
61
  The media path uses only the R2 binding: `ports.mediaStorage` + `media.purposes` + authenticated same-origin PUT + committed-only public GET. It does not need an R2 S3 endpoint or API keys. The upload route is browser-session authenticated, so it is **not** an MCP agent upload route. Do not expose the Worker outside Sites' identity-stripping ingress: `src/chatgpt-auth.ts` trusts the `oai-*` headers only under that condition.
@@ -50,4 +67,4 @@ The media path uses only the R2 binding: `ports.mediaStorage` + `media.purposes`
50
67
  - `/api/mcp/staff` uses the Sites-injected browser identity and re-reads the Mantle staff role. It is mounted and advertised in Admin, but it is not an OAuth resource server. Do not register it as a remote ChatGPT connector until OAuth discovery, a standards-compliant bearer challenge and token verification are implemented and tested.
51
68
  - OAuth discovery returns sign-in HTML: Sites' page session is not an OAuth bearer challenge. Do not bypass Sites auth or trust browser cookies as remote MCP credentials.
52
69
 
53
- See the [Sites host reference](../../handbook/sites/host-reference.md) and [OpenAI Sites documentation](https://learn.chatgpt.com/docs/sites).
70
+ See the [Sites host reference](../../handbook/chatgpt-sites/host-reference.md) and [OpenAI Sites documentation](https://learn.chatgpt.com/docs/sites).
@@ -0,0 +1 @@
1
+ ALTER TABLE _mantle_boot_state ADD COLUMN store_instance_id TEXT;
@@ -1 +1 @@
1
- {"version":"7","dialect":"sqlite","entries":[{"idx":0,"version":"6","when":1790000000000,"tag":"0000_sites_users","breakpoints":true},{"idx":1,"version":"6","when":1790000000001,"tag":"0001_mantle","breakpoints":true},{"idx":2,"version":"6","when":1790000000002,"tag":"0002_article_cover","breakpoints":true}]}
1
+ {"version":"7","dialect":"sqlite","entries":[{"idx":0,"version":"6","when":1790000000000,"tag":"0000_sites_users","breakpoints":true},{"idx":1,"version":"6","when":1790000000001,"tag":"0001_mantle","breakpoints":true},{"idx":2,"version":"6","when":1790000000002,"tag":"0002_article_cover","breakpoints":true},{"idx":3,"version":"6","when":1790000000003,"tag":"0003_store_instance_id","breakpoints":true}]}
@@ -1 +1 @@
1
- :root{font-family:Inter,"Noto Sans TC",ui-sans-serif,system-ui,sans-serif;color:#172320;background:#f7f8f4;font-synthesis:none}*{box-sizing:border-box}body{margin:0}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}.topbar{height:78px;max-width:1440px;margin:auto;padding:0 clamp(24px,5vw,80px);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d9dfd8}.brand{display:flex;align-items:center;gap:12px;font-size:18px;font-weight:760;letter-spacing:-.04em}.brand em{color:#95aa8c;font-style:normal}.mark{width:37px;height:37px;border-radius:11px;background:#183c30;color:#d9eadb;display:grid;place-items:center;font-size:19px;font-family:Georgia,serif}.topbar nav{display:flex;gap:28px;font-size:14px;color:#43564e}.hero{max-width:1440px;margin:auto;padding:100px clamp(24px,8vw,128px) 116px}.hero.small{padding-bottom:75px}.eyebrow,.feature-index{font-size:11px;letter-spacing:.19em;font-weight:750;color:#68806f}.hero h1,.article-page h1{font-family:Georgia,"Noto Serif TC",serif;font-weight:500;letter-spacing:-.055em;line-height:1.09;margin:26px 0 28px;font-size:clamp(48px,6.1vw,94px)}.dot{color:#a2b888}.hero-copy{max-width:620px;color:#52665a;font-size:18px;line-height:1.8}.actions{display:flex;align-items:center;gap:30px;margin-top:38px}.button{display:inline-flex;justify-content:space-between;gap:44px;min-width:184px;padding:17px 19px;border-radius:7px;color:#fff;background:#214f3c;font-size:14px;font-weight:650}.button:hover{background:#173c2d;text-decoration:none}.text-link{font-size:14px;color:#315640}.feature-grid{max-width:1440px;margin:auto;padding:0 clamp(24px,8vw,128px) 110px;display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.feature-grid>div{border-top:1px solid #bfcac0;padding-top:24px}.feature-grid h2{font-family:Georgia,"Noto Serif TC",serif;font-size:29px;font-weight:500;margin:29px 0 10px}.feature-grid p{font-size:14px;line-height:1.75;color:#597064;max-width:270px}.content-wrap{max-width:1184px;margin:0 auto;padding:0 24px 100px}.article-row{padding:25px 0;border-top:1px solid #cbd5ca;display:grid;grid-template-columns:160px 1fr 36px;gap:24px;align-items:start}.article-row:last-child{border-bottom:1px solid #cbd5ca}.article-number{font-size:12px;color:#708477;margin-top:11px}.article-row h2{font-family:Georgia,"Noto Serif TC",serif;font-size:clamp(24px,3vw,35px);font-weight:500;letter-spacing:-.035em;margin:0 0 8px}.article-row p{font-size:14px;color:#617468;line-height:1.65;margin:0}.article-row>span{color:#739279;font-size:25px}.empty{min-height:220px;padding:52px 0}.empty h2{font-size:27px;font-family:Georgia,"Noto Serif TC",serif;font-weight:500}.empty p{color:#66796c}.pagination{margin:26px 0}.article-page{max-width:900px;padding:75px 30px 140px;margin:auto}.back{font-size:13px;color:#5c7768}.article-page article{margin-top:75px}.article-page h1{font-size:clamp(44px,5vw,75px)}.lede{font-size:21px;line-height:1.75;color:#52685a}.prose{border-top:1px solid #cbd5ca;margin-top:45px;padding-top:28px;line-height:1.95;font-size:17px;color:#33473c}.prose p{margin:0 0 1.2em}.markdown-link{display:inline-block;margin-top:40px;font-size:13px;color:#4f765b}footer{border-top:1px solid #d5ddd3;max-width:1440px;margin:auto;padding:28px clamp(24px,5vw,80px);display:flex;justify-content:space-between;font-size:12px;color:#788b7d}@media(max-width:700px){.topbar{height:68px}.topbar nav{gap:16px;font-size:12px}.hero{padding-top:74px;padding-bottom:70px}.hero-copy{font-size:16px}.feature-grid{grid-template-columns:1fr;gap:26px}.article-row{grid-template-columns:1fr 26px;gap:10px}.article-number{grid-column:1/-1;margin:0}.article-page{padding-top:55px}.article-page article{margin-top:50px}footer{gap:20px}}
1
+ :root{font-family:Inter,"Noto Sans TC",ui-sans-serif,system-ui,sans-serif;color:#172320;background:#f7f8f4;font-synthesis:none}*{box-sizing:border-box}body{margin:0}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}.topbar{height:78px;max-width:1440px;margin:auto;padding:0 clamp(24px,5vw,80px);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d9dfd8}.brand{display:flex;align-items:center;gap:12px;font-size:18px;font-weight:760;letter-spacing:-.04em}.brand em{color:#95aa8c;font-style:normal}.mark{width:37px;height:37px;border-radius:11px;background:#183c30;color:#d9eadb;display:grid;place-items:center;font-size:19px;font-family:Georgia,serif}.topbar nav{display:flex;gap:28px;font-size:14px;color:#43564e}.hero{max-width:1440px;margin:auto;padding:100px clamp(24px,8vw,128px) 116px}.hero.small{padding-bottom:75px}.eyebrow,.feature-index{font-size:11px;letter-spacing:.19em;font-weight:750;color:#68806f}.hero h1,.article-page h1{font-family:Georgia,"Noto Serif TC",serif;font-weight:500;letter-spacing:-.055em;line-height:1.09;margin:26px 0 28px;font-size:clamp(48px,6.1vw,94px)}.dot{color:#a2b888}.hero-copy{max-width:620px;color:#52665a;font-size:18px;line-height:1.8}.actions{display:flex;align-items:center;gap:30px;margin-top:38px}.button{display:inline-flex;justify-content:space-between;gap:44px;min-width:184px;padding:17px 19px;border-radius:7px;color:#fff;background:#214f3c;font-size:14px;font-weight:650}.button:hover{background:#173c2d;text-decoration:none}.text-link{font-size:14px;color:#315640}.feature-grid{max-width:1440px;margin:auto;padding:0 clamp(24px,8vw,128px) 110px;display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.feature-grid>div{border-top:1px solid #bfcac0;padding-top:24px}.feature-grid h2{font-family:Georgia,"Noto Serif TC",serif;font-size:29px;font-weight:500;margin:29px 0 10px}.feature-grid p{font-size:14px;line-height:1.75;color:#597064;max-width:270px}.content-wrap{max-width:1184px;margin:0 auto;padding:0 24px 100px}.article-row{padding:25px 0;border-top:1px solid #cbd5ca;display:grid;grid-template-columns:160px 1fr 36px;gap:24px;align-items:start}.article-row:last-child{border-bottom:1px solid #cbd5ca}.article-number{font-size:12px;color:#708477;margin-top:11px}.article-row h2{font-family:Georgia,"Noto Serif TC",serif;font-size:clamp(24px,3vw,35px);font-weight:500;letter-spacing:-.035em;margin:0 0 8px}.article-row p{font-size:14px;color:#617468;line-height:1.65;margin:0}.article-row>span{color:#739279;font-size:25px}.empty{min-height:220px;padding:52px 0}.empty h2{font-size:27px;font-family:Georgia,"Noto Serif TC",serif;font-weight:500}.empty p{color:#66796c}.pagination{margin:26px 0}.article-page{max-width:900px;padding:75px 30px 140px;margin:auto}.back{font-size:13px;color:#5c7768}.article-page article{margin-top:75px}.article-page h1{font-size:clamp(44px,5vw,75px)}.lede{font-size:21px;line-height:1.75;color:#52685a}.prose{border-top:1px solid #cbd5ca;margin-top:45px;padding-top:28px;line-height:1.95;font-size:17px;color:#33473c}.prose p{margin:0 0 1.2em}footer{border-top:1px solid #d5ddd3;max-width:1440px;margin:auto;padding:28px clamp(24px,5vw,80px);display:flex;justify-content:space-between;font-size:12px;color:#788b7d}@media(max-width:700px){.topbar{height:68px}.topbar nav{gap:16px;font-size:12px}.hero{padding-top:74px;padding-bottom:70px}.hero-copy{font-size:16px}.feature-grid{grid-template-columns:1fr;gap:26px}.article-row{grid-template-columns:1fr 26px;gap:10px}.article-number{grid-column:1/-1;margin:0}.article-page{padding-top:55px}.article-page article{margin-top:50px}footer{gap:20px}}
@@ -1,6 +1,7 @@
1
1
  import { build } from 'esbuild';
2
- import { cp, mkdir } from 'node:fs/promises';
2
+ import { cp, mkdir, rm } from 'node:fs/promises';
3
3
  import { execFileSync } from 'node:child_process';
4
+ await rm('dist',{recursive:true,force:true});
4
5
  execFileSync('node',['node_modules/@aotter/mantle/dist/cli/main.js','generate'],{stdio:'inherit'});
5
6
  // Reject older published SDKs that cannot advertise the mounted MCP endpoints.
6
7
  execFileSync('node',['node_modules/typescript/bin/tsc','--noEmit'],{stdio:'inherit'});
@@ -76,6 +76,8 @@ assert.match(publicPage,new RegExp(mediaUrl));
76
76
  assert.doesNotMatch(publicPage,/href="javascript:/);
77
77
  assert.match(publicPage,/<meta property="og:image"/);
78
78
  assert.match(publicPage,/<link rel="canonical"/);
79
+ assert.match(publicPage,/<link rel="alternate" type="text\/markdown"/);
80
+ assert.doesNotMatch(publicPage,/<a\b[^>]*href="[^"]+\.md(?:[?#][^"]*)?"/);
79
81
  assert.match(publicPage,/application\/ld\+json/);
80
82
  assert.match(await (await call(`/articles/${entry.id}.md`)).text(),/Published body from Mantle/);
81
83
  assert.match(await (await call('/articles')).text(),new RegExp(entry.id));
@@ -23,7 +23,7 @@ function assemble(env:Env) {
23
23
  mountWeb(app,get);
24
24
  mountMcp(app,get,auth);
25
25
  mountMedia(app,auth,env);
26
- app.get('/health',async()=>{await get();return Response.json({ok:true,storage:'D1',auth:'ChatGPT Sites',mantle:'0.1.2'});});
26
+ app.get('/health',async()=>{await get();return Response.json({ok:true,storage:'D1',auth:'ChatGPT Sites'});});
27
27
  app.get('/admin/sign-in',async c=>{
28
28
  if(c.req.header('cookie')?.split(';').some(v=>v.trim()==='mantle-sites-signout=1')) {
29
29
  c.header('Set-Cookie','mantle-sites-signout=; Path=/admin/sign-in; HttpOnly; SameSite=Strict; Max-Age=0'+(env.PUBLIC_ORIGIN.startsWith('https:')?'; Secure':''));
@@ -26,7 +26,7 @@ export function mountWeb(app:Hono<{Bindings:Env}>,get:()=>Promise<MantleAdminRun
26
26
  const title=String(entry.data.title??site.title);
27
27
  const image=coverUrl?`<figure class="article-cover"><img src="${escape(coverUrl)}" alt="${escape(cover?.alt||title)}" loading="eager"></figure>`:'';
28
28
  const body=micromark(String(entry.data.body??''),{allowDangerousHtml:false,allowDangerousProtocol:false});
29
- return c.html(shell(`${title}|${site.title}`,renderSeoTagsHtml(seo),`<main class="article-page"><a class="back" href="/articles">← 返回文章</a><article><p class="eyebrow">ARTICLE · ${new Date(entry.updatedAt).toLocaleDateString('zh-TW',{timeZone:'UTC'})}</p><h1>${escape(title)}</h1>${entry.data.summary?`<p class="lede">${escape(entry.data.summary)}</p>`:''}${image}<div class="prose">${body}</div>${seo.alternateMarkdown?`<a class="markdown-link" href="${articlePath(entry.id)}.md">閱讀 Markdown 版本 ↗</a>`:''}</article></main>`));});
29
+ return c.html(shell(`${title}|${site.title}`,renderSeoTagsHtml(seo),`<main class="article-page"><a class="back" href="/articles">← 返回文章</a><article><p class="eyebrow">ARTICLE · ${new Date(entry.updatedAt).toLocaleDateString('zh-TW',{timeZone:'UTC'})}</p><h1>${escape(title)}</h1>${entry.data.summary?`<p class="lede">${escape(entry.data.summary)}</p>`:''}${image}<div class="prose">${body}</div></article></main>`));});
30
30
  // ponytail: one discovery page is enough for this lab; expose cursor pages when published articles exceed the SDK page limit.
31
31
  app.get('/llms.txt',async c=>{const {site,web}=await load();const page=await web.composeLlmsTxt.execute({collections:['articles'],locale:null,site,pathFor:e=>articlePath(e.id)});const body=page?.body??`# ${site.title}\n\n文章索引:${site.origin}/articles\n`;return c.text(body,200,{'Content-Type':'text/plain; charset=utf-8'});});
32
32
  // ponytail: first 1000 published URLs; add sitemap index parts only when the catalogue reaches that ceiling.
@@ -9,15 +9,15 @@ Schema/View is example business data; `mantle generate` never invents it.
9
9
 
10
10
  For your own project, author package.json, manifests, Worker/provider config
11
11
  and TypeScript settings for your requirements. Pin all selected `@aotter/mantle*`
12
- dependencies to the same intended release. This reference depends on them via
13
- the `latest` dist-tag instead, so a fresh install always resolves the current
14
- stable release; Core's test runner substitutes its exact candidate in a
15
- disposable copy.
12
+ dependencies to the same intended release. The checked-in `latest` values are
13
+ placeholders for Core's disposable release test; resolve and pin one exact
14
+ version before installing a copied application.
16
15
 
17
16
  Outside the SDK workspace, with Node 22+ and pnpm 9+:
18
17
 
19
18
  ```sh
20
- pnpm install
19
+ MANTLE_VERSION=$(pnpm view @aotter/mantle@latest version)
20
+ pnpm add --save-exact "@aotter/mantle@$MANTLE_VERSION" "@aotter/mantle-cloudflare@$MANTLE_VERSION"
21
21
  pnpm check
22
22
  pnpm dev
23
23
  ```
@@ -208,7 +208,7 @@ because the underlying host composition or a different provider succeeded.
208
208
 
209
209
  ```text
210
210
  Extend my existing ChatGPT Site with Mantle equipment checkout. Read the matching
211
- SDK's docs/handbook/sites/index.md, equipment-checkout.md and host-reference.md.
211
+ SDK's docs/handbook/chatgpt-sites/index.md, equipment-checkout.md and host-reference.md.
212
212
  Preserve current content, audience and R2 media. This guide is a design, not an
213
213
  installed app: implement and test the missing manifests, handlers and routes.
214
214
  Start with one identified kit and one fixed half-day slot per request. Include
@@ -56,7 +56,8 @@ a working example; adapt its fields and lifecycle to your team's content.
56
56
  Markdown body. Upload an image in the media library and select it as the
57
57
  article's cover. The draft's public article URL should return 404.
58
58
  5. **Publish and read.** Publish the article and open `/articles`. Follow its
59
- link to check the body and cover, then open its `.md` version. For a public
59
+ link to check the body and cover, then confirm the page head advertises
60
+ its `.md` version with `rel="alternate"` and `type="text/markdown"`. For a public
60
61
  Site, repeat this while signed out. A restricted Site still enforces its
61
62
  audience settings before visitors reach these pages.
62
63
  6. **Verify control.** Unpublish the article and confirm its detail page returns
@@ -67,6 +68,17 @@ For later content edits, return to Mantle Admin. Changes to the application's
67
68
  schema, code, or deployment settings follow the reference's migration and Sites
68
69
  deployment workflow.
69
70
 
71
+ ## Maintain content with an agent
72
+
73
+ The owner can use Admin WebMCP in a browser that supports it to let an agent
74
+ discover staff tools for drafts, publishing, and other permitted operations.
75
+ Open `/admin/dev/docs/webmcp` to see that browser surface and
76
+ `/admin/dev/docs/mcp` to see the Site's `/api/mcp` public read-only endpoint and `/api/mcp/staff`
77
+ staff endpoint. The latter uses the current Sites browser session and checks
78
+ the Mantle staff role on each request. It is useful to same-origin browser
79
+ code, but is not a remote OAuth MCP connector for a desktop agent. A remote
80
+ staff connector needs its own verified OAuth flow; see the [host reference](./host-reference.md#remote-mcp-is-a-separate-gate).
81
+
70
82
  ## Ask your agent to set it up
71
83
 
72
84
  Install the Mantle agent plugin, or `@aotter/mantle` itself, then describe your
@@ -74,7 +86,7 @@ audience and content requirements:
74
86
 
75
87
  ```text
76
88
  Build a content site with ChatGPT Sites and Mantle. Read
77
- handbook/sites/index.md and examples/host-chatgpt-sites/README.md from the
89
+ handbook/chatgpt-sites/index.md and examples/host-chatgpt-sites/README.md from the
78
90
  installed Mantle docs, and follow that reference's install and run steps.
79
91
  Adapt the article example to my content requirements. Include ChatGPT
80
92
  sign-in, Mantle staff roles, cover uploads, and published article pages.
@@ -83,7 +95,7 @@ deploying through Sites. Keep remote staff OAuth MCP outside this scope.
83
95
  ```
84
96
 
85
97
  For business rules beyond content, add: "use custom `ref` handlers and
86
- application-owned tables as described in handbook/sites/equipment-checkout.md."
98
+ application-owned tables as described in handbook/chatgpt-sites/equipment-checkout.md."
87
99
 
88
100
  ## Beyond content: operational workflows
89
101
 
@@ -84,6 +84,22 @@ The staff role is re-read from D1 on every protected REST and MCP call; a revoke
84
84
 
85
85
  MCP tokens are session-bound: signing out of Admin ends MCP access. See [MCP and agents](../concepts/mcp-and-agents.md).
86
86
 
87
+ ## Session cache and database replacement
88
+
89
+ When optional session caching is enabled, the cache is derived from the
90
+ canonical store, not a second identity authority. Auth prefixes keys with
91
+ `better-auth:<store-instance-id>:`. Preparing a new store gives it a distinct
92
+ identity, so reusing the same KV namespace after replacing D1 cannot resurrect
93
+ the previous store's cached sessions. Ordinary preparation of the same store
94
+ preserves its identity.
95
+
96
+ Custom low-level Auth composition must prepare the Mantle store before cached
97
+ Auth operations; do not construct cache keys or seed the identity yourself.
98
+ OTP verification remains in the primary database and rate limiting remains
99
+ isolate-local. Revocation/user-update cache invalidation still follows KV
100
+ propagation; the namespace change is isolation across stores, not a promise of
101
+ instant global invalidation. See the [Auth decision](../../adr/0014-auth-better-auth-and-multi-tenant-mcp.md).
102
+
87
103
  ## Better Auth configuration
88
104
 
89
105
  `createAuth()` owns the Worker lifecycle, Admin metadata, sender integration,