@aotter/mantle 0.1.3 → 0.1.5-alpha.1
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.
- package/README.md +20 -20
- package/dist/cli/generate-cloudflare.d.ts +7 -0
- package/dist/cli/generate-cloudflare.d.ts.map +1 -0
- package/dist/cli/generate-cloudflare.js +123 -0
- package/dist/cli/generate-cloudflare.js.map +1 -0
- package/dist/cli/generate-project.d.ts +25 -0
- package/dist/cli/generate-project.d.ts.map +1 -0
- package/dist/cli/generate-project.js +282 -0
- package/dist/cli/generate-project.js.map +1 -0
- package/dist/cli/generate-sites.d.ts +8 -0
- package/dist/cli/generate-sites.d.ts.map +1 -0
- package/dist/cli/generate-sites.js +273 -0
- package/dist/cli/generate-sites.js.map +1 -0
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +121 -10
- package/dist/cli/generate.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +11 -11
- package/dist/cli/skills.js +1 -1
- package/dist/cli/skills.js.map +1 -1
- package/docs/adr/0001-four-atom-manifest-model.md +3 -2
- package/docs/adr/0013-agent-provisioned-consumer-projects.md +4 -4
- package/docs/adr/0016-site-semantic-layer.md +5 -4
- package/docs/adr/0018-core-starters-repository-boundary.md +1 -1
- package/docs/adr/0021-retire-starter-scaffolding.md +1 -1
- package/docs/adr/0026-progressive-generate.md +36 -0
- package/docs/adr/0027-scheduled-procedure-triggers.md +31 -0
- package/docs/adr/0028-schema-ttl-expiry.md +33 -0
- package/docs/adr/README.md +7 -4
- package/docs/agent-prompts.md +41 -78
- package/docs/assets/mantle-admin-developer.png +0 -0
- package/docs/examples/README.md +1 -1
- package/docs/examples/host-chatgpt-sites/README.md +29 -12
- package/docs/examples/host-chatgpt-sites/drizzle/0003_store_instance_id.sql +1 -0
- package/docs/examples/host-chatgpt-sites/drizzle/0004_mantle.sql +10 -0
- package/docs/examples/host-chatgpt-sites/drizzle/0005_mantle.sql +24 -0
- package/docs/examples/host-chatgpt-sites/drizzle/meta/_journal.json +1 -1
- package/docs/examples/host-chatgpt-sites/drizzle/meta/mantle-state.json +60 -0
- package/docs/examples/host-chatgpt-sites/package.json +1 -1
- package/docs/examples/host-chatgpt-sites/public/site.css +1 -1
- package/docs/examples/host-chatgpt-sites/scripts/build.mjs +2 -1
- package/docs/examples/host-chatgpt-sites/scripts/check.mjs +2 -0
- package/docs/examples/host-chatgpt-sites/scripts/migration.mjs +42 -8
- package/docs/examples/host-chatgpt-sites/src/chatgpt-auth.ts +9 -6
- package/docs/examples/host-chatgpt-sites/src/index.ts +1 -1
- package/docs/examples/host-chatgpt-sites/src/web.ts +1 -1
- package/docs/examples/host-local-admin-otp/package.json +2 -2
- package/docs/examples/host-minimal-worker/README.md +5 -5
- package/docs/examples/host-minimal-worker/package.json +2 -2
- package/docs/handbook/{sites → chatgpt-sites}/equipment-checkout.md +1 -1
- package/docs/handbook/chatgpt-sites/generated-app.md +84 -0
- package/docs/handbook/{sites → chatgpt-sites}/index.md +35 -13
- package/docs/handbook/cloudflare/authentication.md +19 -2
- package/docs/handbook/cloudflare/bindings.md +4 -11
- package/docs/handbook/cloudflare/chatgpt-sites.md +6 -6
- package/docs/handbook/cloudflare/conventional-worker.md +7 -3
- package/docs/handbook/cloudflare/deploy-and-operate.md +4 -3
- package/docs/handbook/cloudflare/media-r2.md +2 -2
- package/docs/handbook/concepts/four-atoms.md +1 -1
- package/docs/handbook/concepts/lifecycle-and-locales.md +1 -1
- package/docs/handbook/concepts/mcp-and-agents.md +24 -4
- package/docs/handbook/concepts/procedures-and-triggers.md +1 -1
- package/docs/handbook/concepts/runtime-and-adapters.md +8 -1
- package/docs/handbook/concepts/views.md +1 -1
- package/docs/handbook/guides/agent-setup.md +8 -7
- package/docs/handbook/navigation.json +7 -6
- package/docs/handbook/reference/diagnostics.md +5 -0
- package/docs/handbook/reference/procedure.md +52 -1
- package/docs/handbook/reference/schema.md +27 -1
- package/docs/handbook/reference/surface.md +3 -3
- package/docs/handbook/reference/trigger.md +21 -1
- package/docs/handbook/releases/index.md +81 -1
- package/docs/handbook/start/overview.md +6 -3
- package/docs/handbook/start/project-and-cli.md +103 -119
- package/docs/handbook/start/quickstart-admin.md +6 -4
- package/docs/handbook/start/quickstart-worker.md +17 -11
- package/docs/release-process.md +3 -2
- package/docs/sealed-pipeline-ownership.md +1 -1
- package/docs/skills/develop/SKILL.md +258 -0
- package/docs/skills/integrate/SKILL.md +60 -0
- package/docs/skills/media-gc/SKILL.md +85 -0
- package/docs/skills/plugin/SKILL.md +132 -0
- package/docs/skills/provision/SKILL.md +194 -0
- package/docs/skills/theme/SKILL.md +77 -0
- package/docs/skills/update/SKILL.md +51 -0
- package/docs/spec-only-host-adoption.md +1 -1
- package/package.json +19 -18
- package/skills/README.md +28 -21
- package/skills/develop/SKILL.md +16 -8
- package/skills/install/SKILL.md +103 -128
- package/skills/integrate/SKILL.md +60 -0
- package/skills/media-gc/SKILL.md +2 -2
- package/skills/plugin/SKILL.md +2 -2
- package/skills/provision/SKILL.md +3 -3
- package/skills/theme/SKILL.md +2 -2
- package/skills/update/SKILL.md +2 -2
- package/templates/chatgpt-sites/auth.ts +66 -0
- package/templates/chatgpt-sites/build.mjs +14 -0
- package/templates/chatgpt-sites/env.ts +1 -0
- package/templates/chatgpt-sites/mcp.ts +48 -0
- package/templates/chatgpt-sites/public-mcp.ts +29 -0
- package/templates/chatgpt-sites/smoke-local.mjs +20 -0
- package/skills/.keep +0 -0
- /package/docs/handbook/{sites → chatgpt-sites}/host-reference.md +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aotter/mantle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5-alpha.1",
|
|
4
4
|
"description": "Embeddable Mantle Core umbrella with Spec and Runtime; Web, Admin, Auth, Bun, Vercel, Cloudflare, and Admin UI are optional peer packages.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://mantle.tools/",
|
|
@@ -80,11 +80,12 @@
|
|
|
80
80
|
"dist",
|
|
81
81
|
"docs",
|
|
82
82
|
"skills",
|
|
83
|
+
"templates",
|
|
83
84
|
"README.md"
|
|
84
85
|
],
|
|
85
86
|
"dependencies": {
|
|
86
|
-
"@aotter/mantle-runtime": "0.1.
|
|
87
|
-
"@aotter/mantle-spec": "0.1.
|
|
87
|
+
"@aotter/mantle-runtime": "0.1.5-alpha.1",
|
|
88
|
+
"@aotter/mantle-spec": "0.1.5-alpha.1"
|
|
88
89
|
},
|
|
89
90
|
"peerDependencies": {
|
|
90
91
|
"aws4fetch": "^1.0.20",
|
|
@@ -92,13 +93,13 @@
|
|
|
92
93
|
"hono": "^4.12.0",
|
|
93
94
|
"@libsql/client": "^0.17.4",
|
|
94
95
|
"zod": "^4.5.0",
|
|
95
|
-
"@aotter/mantle-admin": "0.1.
|
|
96
|
-
"@aotter/mantle-admin-ui": "0.1.
|
|
97
|
-
"@aotter/mantle-
|
|
98
|
-
"@aotter/mantle-
|
|
99
|
-
"@aotter/mantle-
|
|
100
|
-
"@aotter/mantle-
|
|
101
|
-
"@aotter/mantle-
|
|
96
|
+
"@aotter/mantle-admin": "0.1.5-alpha.1",
|
|
97
|
+
"@aotter/mantle-admin-ui": "0.1.5-alpha.1",
|
|
98
|
+
"@aotter/mantle-auth": "0.1.5-alpha.1",
|
|
99
|
+
"@aotter/mantle-bun": "0.1.5-alpha.1",
|
|
100
|
+
"@aotter/mantle-cloudflare": "0.1.5-alpha.1",
|
|
101
|
+
"@aotter/mantle-vercel": "0.1.5-alpha.1",
|
|
102
|
+
"@aotter/mantle-web": "0.1.5-alpha.1"
|
|
102
103
|
},
|
|
103
104
|
"peerDependenciesMeta": {
|
|
104
105
|
"@aotter/mantle-admin": {
|
|
@@ -139,18 +140,18 @@
|
|
|
139
140
|
"@types/node": "^26",
|
|
140
141
|
"aws4fetch": "^1.0.20",
|
|
141
142
|
"better-auth": "1.7.2",
|
|
142
|
-
"hono": "^4.13.
|
|
143
|
+
"hono": "^4.13.7",
|
|
143
144
|
"@libsql/client": "^0.17.4",
|
|
144
145
|
"typescript": "^6.0.3",
|
|
145
146
|
"vitest": "^4.1.11",
|
|
146
147
|
"zod": "^4.5.4",
|
|
147
|
-
"@aotter/mantle-admin
|
|
148
|
-
"@aotter/mantle-admin": "0.1.
|
|
149
|
-
"@aotter/mantle-auth": "0.1.
|
|
150
|
-
"@aotter/mantle-bun": "0.1.
|
|
151
|
-
"@aotter/mantle-cloudflare": "0.1.
|
|
152
|
-
"@aotter/mantle-vercel": "0.1.
|
|
153
|
-
"@aotter/mantle-web": "0.1.
|
|
148
|
+
"@aotter/mantle-admin": "0.1.5-alpha.1",
|
|
149
|
+
"@aotter/mantle-admin-ui": "0.1.5-alpha.1",
|
|
150
|
+
"@aotter/mantle-auth": "0.1.5-alpha.1",
|
|
151
|
+
"@aotter/mantle-bun": "0.1.5-alpha.1",
|
|
152
|
+
"@aotter/mantle-cloudflare": "0.1.5-alpha.1",
|
|
153
|
+
"@aotter/mantle-vercel": "0.1.5-alpha.1",
|
|
154
|
+
"@aotter/mantle-web": "0.1.5-alpha.1"
|
|
154
155
|
},
|
|
155
156
|
"engines": {
|
|
156
157
|
"node": ">=22"
|
package/skills/README.md
CHANGED
|
@@ -4,13 +4,14 @@ Agent-readable skill briefs for consumers of `@aotter/mantle-*`. Discoverable by
|
|
|
4
4
|
|
|
5
5
|
| Skill | When to invoke |
|
|
6
6
|
|---|---|
|
|
7
|
-
| [`develop`](develop/SKILL.md) | `mantle:develop`: Core-owned workflow for manifest, runtime, handler, adapter, validation, and MCP work in any Mantle project. |
|
|
8
|
-
| [`
|
|
9
|
-
| [`
|
|
10
|
-
| [`
|
|
11
|
-
| [`
|
|
12
|
-
| [`
|
|
13
|
-
| [`
|
|
7
|
+
| [`develop`](../docs/skills/develop/SKILL.md) | `mantle:develop`: Core-owned workflow for manifest, runtime, handler, adapter, validation, and MCP work in any Mantle project. |
|
|
8
|
+
| [`integrate`](../docs/skills/integrate/SKILL.md) | `mantle:integrate`: choose and carry out an existing application's Mantle integration or rebuild and data migration. |
|
|
9
|
+
| [`media-gc`](../docs/skills/media-gc/SKILL.md) | `mantle:media-gc`: audit or remove stale uncommitted public media objects with the connected Cloudflare API. |
|
|
10
|
+
| [`plugin`](../docs/skills/plugin/SKILL.md) | `mantle:plugin`: Core-owned marketplace workflow for plan-first capability installs across applications and adapters. |
|
|
11
|
+
| [`theme`](../docs/skills/theme/SKILL.md) | `mantle:theme`: Core-owned visual workflow. Reads project-owned theme and UI contracts. |
|
|
12
|
+
| [`update`](../docs/skills/update/SKILL.md) | `mantle:update`: Core-owned drift check workflow for SDK dependencies, local skills, and plugin lockfiles. |
|
|
13
|
+
| [`mantle`](install/SKILL.md) | User wants to author a local Mantle application or continue an existing project. |
|
|
14
|
+
| [`provision`](../docs/skills/provision/SKILL.md) | User wants a local project shipped to Cloudflare with production auth and operator handoff. |
|
|
14
15
|
|
|
15
16
|
The skills target Mantle's v0.1 grammar. The installed package version, not
|
|
16
17
|
duplicated skill prose, selects the exact runtime and embedded docs.
|
|
@@ -25,13 +26,14 @@ enforces the columns below.
|
|
|
25
26
|
|
|
26
27
|
| Skill | Routes on | Entry-path constraints (read before acting) | Path-gated sections | Projection | Restricted because |
|
|
27
28
|
|---|---|---|---|---|---|
|
|
28
|
-
| `develop` | existing project; manifest, runtime, handler, adapter, or MCP work | four-atom model; adapter neutrality; no direct D1/KV/Postgres writes; no committed secrets | performance harness; local MCP client; locale rules | project
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
29
|
+
| `develop` | existing project; manifest, runtime, handler, adapter, or MCP work | four-atom model; adapter neutrality; no direct D1/KV/Postgres writes; no committed secrets | performance harness; local MCP client; locale rules | project | — |
|
|
30
|
+
| `integrate` | independently authored application; add Mantle or rebuild with migration | inspect application before strategy; version-matched SDK; protect live data | embed; incrementally replace; rebuild and migrate | package | Existing-project migration is opt-in; a fresh generated app does not need this brief. |
|
|
31
|
+
| `plugin` | user wants an installable capability | plan before apply; lock entry is the removal manifest; delete only plugin-owned files and atoms | apply; remove | project | — |
|
|
32
|
+
| `theme` | brand or visual direction in a project | repo-owned theme and UI contracts | — | project | — |
|
|
33
|
+
| `update` | SDK upgrade or plugin lock review | never blindly overwrite user-owned code | — | project | — |
|
|
34
|
+
| `mantle` | new application, or opening an existing project | do not use the SDK checkout as the application; no push/deploy/provider config during cold start | author local project; continue existing project | plugin | Creates a new project; nothing to project into an existing one. |
|
|
35
|
+
| `provision` | ship to Cloudflare and finish production auth | secrets never enter source or logs; explicit auth mode | hosted auth; self-managed auth | package | Platform-specific deploy that handles production secrets; opt-in only. |
|
|
36
|
+
| `media-gc` | audit or remove stale uncommitted media objects | audit by default; confirm exact account, bucket, cutoff, and candidate digest; re-audit before applying; never prefix-delete; never print keys | apply | package | Destructive remote object deletion and Cloudflare-specific; opt-in only. |
|
|
35
37
|
|
|
36
38
|
Deliberately monolithic:
|
|
37
39
|
|
|
@@ -47,7 +49,8 @@ Deliberately monolithic:
|
|
|
47
49
|
The `mantle:*` namespace is owned by `@aotter/mantle`. Every skill declares its
|
|
48
50
|
own distribution scope in front matter: `metadata.projection: project` marks a
|
|
49
51
|
skill `mantle skills` should place in a consumer project, and a skill that
|
|
50
|
-
withholds `project` must say why. `
|
|
52
|
+
withholds `project` must say why. `plugin` is the bootstrap skill and `package`
|
|
53
|
+
is an opt-in brief in the installed SDK. `scripts/check-skills.mjs` holds that
|
|
51
54
|
declaration and the audit table below to each other.
|
|
52
55
|
|
|
53
56
|
Run `mantle skills` to project the installed package's skills into a project;
|
|
@@ -58,11 +61,15 @@ contracts.
|
|
|
58
61
|
|
|
59
62
|
## Source-repository marketplace install
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
`skills/install/SKILL.md` declares `name: mantle`. It is the only repository
|
|
65
|
+
skill discovered by the no-flag command and copied as a small directory.
|
|
66
|
+
The other seven skills live in `docs/skills/` and ship with the npm package.
|
|
67
|
+
`mantle skills` projects the four ongoing workflows after package installation.
|
|
68
|
+
|
|
69
|
+
Other marketplace hosts point to the same entry:
|
|
63
70
|
|
|
64
71
|
```sh
|
|
65
|
-
npx skills add aotter/mantle
|
|
72
|
+
npx skills add aotter/mantle
|
|
66
73
|
```
|
|
67
74
|
|
|
68
75
|
```bash
|
|
@@ -76,7 +83,7 @@ codex plugin add mantle@mantle
|
|
|
76
83
|
```
|
|
77
84
|
|
|
78
85
|
Read the path printed by the installer (for project-local Codex,
|
|
79
|
-
`.agents/skills/
|
|
86
|
+
`.agents/skills/mantle/SKILL.md`). Only the selected brief is installed, not
|
|
80
87
|
the SDK or handbook. After choosing and installing an exact SDK version, read
|
|
81
88
|
`node_modules/@aotter/mantle/skills/install/SKILL.md` and its embedded docs;
|
|
82
89
|
that package supersedes the bootstrap Git-ref instructions. After packages are
|
|
@@ -100,13 +107,13 @@ package. Two audiences, two artifacts.
|
|
|
100
107
|
|
|
101
108
|
## Discoverability
|
|
102
109
|
|
|
103
|
-
The skills target ADR-0007's "AI as primary author" thesis: agents reach these files by URL when the user invokes them by intent ("install mantle", "develop my Mantle site", "deploy"). Official cold start is `npx skills add aotter/mantle
|
|
110
|
+
The skills target ADR-0007's "AI as primary author" thesis: agents reach these files by URL when the user invokes them by intent ("install mantle", "develop my Mantle site", "deploy"). Official cold start is `npx skills add aotter/mantle`. Point the agent at the repository or pass the version-matched markdown content directly.
|
|
104
111
|
|
|
105
112
|
## Conventions
|
|
106
113
|
|
|
107
114
|
Each SKILL.md ships:
|
|
108
115
|
|
|
109
|
-
- **Front-matter** with a
|
|
116
|
+
- **Front-matter** with a stable `name`, trigger-complete
|
|
110
117
|
`description`, and optional source/version `metadata`. Plugin hosts add the
|
|
111
118
|
external `mantle:` namespace.
|
|
112
119
|
- **Preflight** section — environment + user-confirmation gates.
|
package/skills/develop/SKILL.md
CHANGED
|
@@ -3,9 +3,9 @@ name: develop
|
|
|
3
3
|
description: Work on any Mantle project using the Core SDK contract. Use for manifest, runtime, content model, handler, adapter, validation, and MCP work after a project already exists.
|
|
4
4
|
metadata:
|
|
5
5
|
source: "@aotter/mantle"
|
|
6
|
-
sourcePath: skills/develop/SKILL.md
|
|
6
|
+
sourcePath: docs/skills/develop/SKILL.md
|
|
7
7
|
applies_to: mantle grammar v0.1
|
|
8
|
-
projection: project
|
|
8
|
+
projection: project
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Mantle Develop
|
|
@@ -57,9 +57,11 @@ pnpm exec mantle --help
|
|
|
57
57
|
pnpm validate
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
On 0.1.5 and newer, `generate --host cf|chatgpt-sites` assembles a new blank
|
|
61
|
+
app; no `--features` selects Spec, Runtime, API, MCP, Admin and Web. Explicit
|
|
62
|
+
`--features` selects a smaller composition. It never invents a business
|
|
63
|
+
Schema. Existing authored apps keep compile mode, and older installed CLIs
|
|
64
|
+
may not support project generation. Check this project's CLI help first.
|
|
63
65
|
|
|
64
66
|
## Core Model
|
|
65
67
|
|
|
@@ -155,7 +157,10 @@ teaching the project Mantle internals.
|
|
|
155
157
|
|
|
156
158
|
## Auth Composition
|
|
157
159
|
|
|
158
|
-
Admin
|
|
160
|
+
Generated full apps select Admin by default; smaller selections can omit it.
|
|
161
|
+
A project without `@aotter/mantle-admin-ui` is complete when Admin was not
|
|
162
|
+
selected. If Admin was selected but its package is missing, install the
|
|
163
|
+
CLI-declared exact version and rerun generation.
|
|
159
164
|
When Admin is installed, `createMantleWorker({ auth })` with `email-otp`
|
|
160
165
|
and `ConsoleEmailSender` is the local human path (OTP in wrangler logs).
|
|
161
166
|
That override owns Auth construction; Core still owns `/admin` and
|
|
@@ -164,8 +169,11 @@ and an `ASSETS` binding. A white screen at `/admin` with HTML 200 and
|
|
|
164
169
|
`/_mantle/admin/assets/*` 404 is a missing assets binding, not a missing
|
|
165
170
|
frontend build.
|
|
166
171
|
|
|
167
|
-
|
|
168
|
-
`
|
|
172
|
+
Generated Cloudflare apps use `MANTLE_AUTH_MODE=local-otp` on loopback after
|
|
173
|
+
copying `.dev.vars.example` to `.dev.vars` and setting a real owner email and
|
|
174
|
+
random secret. Production uses `hosted` or `self-managed` with provider
|
|
175
|
+
credentials and `ADMIN_GITHUB_LOGIN`. Conventional Cloudflare projects that
|
|
176
|
+
do not replace Auth use those two production modes; Core owns that standard
|
|
169
177
|
composition and rejects partial or mixed bindings. Preserve the explicit
|
|
170
178
|
mode recorded in Worker config, keep provider secrets out of source, and
|
|
171
179
|
do not infer a mode from whichever credentials happen to be present.
|
package/skills/install/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description:
|
|
2
|
+
name: mantle
|
|
3
|
+
description: Set up a new Mantle application or continue an existing one using the installed SDK's matching instructions.
|
|
4
4
|
metadata:
|
|
5
5
|
source: "@aotter/mantle"
|
|
6
6
|
sourcePath: skills/install/SKILL.md
|
|
@@ -9,129 +9,104 @@ metadata:
|
|
|
9
9
|
projectionReason: Creates a new project; nothing to project into an existing one.
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
# Mantle
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
## Existing application
|
|
114
|
-
|
|
115
|
-
Read package.json, lockfile, actual entry, manifest files, provider config and
|
|
116
|
-
project instructions. `.mantle/launch-state.json`, features or handoff files
|
|
117
|
-
are optional legacy context, never prerequisites. Preserve them and user code.
|
|
118
|
-
Install the frozen dependency graph, project installed Core skills, then read
|
|
119
|
-
those skills and embedded docs. Never apply develop docs to an older package.
|
|
120
|
-
Use the installed `mantle --help` and the project's scripts as authority.
|
|
121
|
-
|
|
122
|
-
For a legacy pre-stable project, retain its pinned behavior until an explicit
|
|
123
|
-
upgrade is requested. Do not rewrite provider identities, delete metadata or
|
|
124
|
-
fetch a nonexistent new Starter tag. SDK upgrades follow the update skill, not
|
|
125
|
-
a bundle comparison command.
|
|
126
|
-
|
|
127
|
-
## Ship and report
|
|
128
|
-
|
|
129
|
-
When deployment is requested, read
|
|
130
|
-
`node_modules/@aotter/mantle/skills/provision/SKILL.md` (not projected by
|
|
131
|
-
`mantle skills`) and follow that version-matched skill and the
|
|
132
|
-
observed host configuration. Legacy Landing remains a pre-stable product; it
|
|
133
|
-
is not a launch dependency for new Core projects.
|
|
134
|
-
|
|
135
|
-
Report the project path, exact SDK version, local URL/HTTP result and checks,
|
|
136
|
-
plus any genuinely missing auth/provider setup. Do not claim a working homepage
|
|
137
|
-
or authenticated MCP based only on successful generation.
|
|
12
|
+
# Mantle
|
|
13
|
+
|
|
14
|
+
`npx skills add aotter/mantle` installs this small bootstrap skill. It does not
|
|
15
|
+
install the SDK or create a project. The skill name is `mantle`; the source
|
|
16
|
+
folder remains `skills/install/` so installation does not copy the repository.
|
|
17
|
+
|
|
18
|
+
## Find the application and its version
|
|
19
|
+
|
|
20
|
+
First locate the user's target project. If it already has `@aotter/mantle`,
|
|
21
|
+
read that project's `package.json`, lockfile, and
|
|
22
|
+
`node_modules/@aotter/mantle/package.json`. Follow the CLI and docs shipped in
|
|
23
|
+
that exact installed package. Never use another project's dependencies, the
|
|
24
|
+
SDK checkout, a floating GitHub handbook, or an old alpha/Starter fallback.
|
|
25
|
+
An older installed SDK may only support direct authoring; its own
|
|
26
|
+
`mantle generate --help` decides which flags exist. Upgrade only when requested.
|
|
27
|
+
|
|
28
|
+
For a new project, choose `cf` or `chatgpt-sites` from the request; ask only if
|
|
29
|
+
it remains ambiguous. A host-free Spec-only project needs no host. Resolve the
|
|
30
|
+
latest **published stable** `@aotter/mantle` version from npm once, confirm it
|
|
31
|
+
is not a prerelease, and install it with an exact version in the new project.
|
|
32
|
+
For example, run `npm view @aotter/mantle@latest version`, inspect the returned
|
|
33
|
+
plain `X.Y.Z`, then `npm install --save-exact @aotter/mantle@X.Y.Z` with that
|
|
34
|
+
actual version substituted. Set `type=module` in `package.json` first; npm's
|
|
35
|
+
default project type may be CommonJS.
|
|
36
|
+
When testing a release candidate, use the explicitly supplied exact version
|
|
37
|
+
or local tarball instead of npm latest. Pin every selected `@aotter/mantle*`
|
|
38
|
+
package to the running CLI's exact version; `generate` writes the required
|
|
39
|
+
package declarations. Do not let npm's default `^` range remain. If the
|
|
40
|
+
project registry overrides public npmjs, set `@aotter:registry=https://registry.npmjs.org/`
|
|
41
|
+
in a project-owned `.npmrc`.
|
|
42
|
+
|
|
43
|
+
## New project sequence
|
|
44
|
+
|
|
45
|
+
1. Create a separate application directory with Node 22+ and a project
|
|
46
|
+
`package.json` containing `"type":"module"`. Install the exact chosen
|
|
47
|
+
`@aotter/mantle` version locally. Read its
|
|
48
|
+
`node_modules/@aotter/mantle/skills/install/SKILL.md` and version-matched
|
|
49
|
+
`docs/handbook/start/overview.md` before continuing. These installed
|
|
50
|
+
instructions take precedence over this GitHub bootstrap copy. Check
|
|
51
|
+
`npx mantle generate --help`: if it does not list `--host`, follow the
|
|
52
|
+
installed version's direct-authoring path instead of the steps below.
|
|
53
|
+
2. On a CLI that supports it, run with an explicit host, for example
|
|
54
|
+
`npx mantle generate --host cf` or `npx mantle generate --host chatgpt-sites`.
|
|
55
|
+
No `--features` means Spec, Runtime, API, MCP, Admin and a blank editable
|
|
56
|
+
home. For a smaller app, positively list the modules with `--features`
|
|
57
|
+
(for example `spec,api`); use `--features spec` for a host-free compiler.
|
|
58
|
+
Do not remove Admin merely because its package is not installed yet.
|
|
59
|
+
3. The first run may declare selected dependencies and exit asking for an
|
|
60
|
+
install. Install them using the project's package manager, then rerun
|
|
61
|
+
`mantle generate` to finish. Read `docs/handbook/start/project-and-cli.md`
|
|
62
|
+
from the same installed package for saved selections, owned files,
|
|
63
|
+
`--check`.
|
|
64
|
+
4. Before adding a Schema on ChatGPT Sites, review and apply its initial local
|
|
65
|
+
D1 migration as the installed Sites guide says. Then add only the user's
|
|
66
|
+
Schema, View, Procedure and Trigger manifests. Keep the blank home editable;
|
|
67
|
+
do not invent business data or media bindings. Run `mantle generate` to
|
|
68
|
+
append any new migration, review and apply it, then run `generate --check`,
|
|
69
|
+
`validate`, `skills`, build/typecheck and local smoke.
|
|
70
|
+
5. For Cloudflare, follow installed `docs/handbook/start/project-and-cli.md`
|
|
71
|
+
and `docs/handbook/cloudflare/authentication.md`. Copy `.dev.vars.example`
|
|
72
|
+
to `.dev.vars`, set `ADMIN_EMAIL` and `BETTER_AUTH_SECRET`, and match
|
|
73
|
+
`PUBLIC_ORIGIN` to the loopback URL printed by `wrangler dev`. Open
|
|
74
|
+
`/admin/sign-in` with that email; read the OTP from wrangler logs. Check
|
|
75
|
+
Admin assets and an owner-only Admin API before claiming Admin works. For
|
|
76
|
+
ChatGPT Sites, follow installed
|
|
77
|
+
`docs/handbook/chatgpt-sites/generated-app.md`: review and apply local D1
|
|
78
|
+
migrations, set `OWNER_EMAIL` and `PUBLIC_ORIGIN`, then test the blank home,
|
|
79
|
+
unauthorized Admin, owner Admin, public MCP and staff MCP. Local owner
|
|
80
|
+
identity is simulated by the loopback-only smoke; it does not create a
|
|
81
|
+
browser ChatGPT session. Sites owns
|
|
82
|
+
production identity and deployment; do not deploy its Worker directly.
|
|
83
|
+
Browser Admin WebMCP and Sites-session `/api/mcp/staff` do not provide
|
|
84
|
+
remote staff OAuth MCP. The owner can maintain content through Admin and
|
|
85
|
+
the applicable authenticated MCP surface.
|
|
86
|
+
|
|
87
|
+
Use installed `docs/handbook/reference/features.md` for Manifest choices and
|
|
88
|
+
`docs/examples/` for optional examples. The generated project is the starting
|
|
89
|
+
point; a domain example is not a template to copy wholesale. Do not use a
|
|
90
|
+
`mantle-starters` tag or `mantle create`.
|
|
91
|
+
|
|
92
|
+
## Existing project and handoff
|
|
93
|
+
|
|
94
|
+
For an application that already uses Mantle, preserve selected features,
|
|
95
|
+
user-authored files, migrations, package versions, identity settings and
|
|
96
|
+
provider resources. Use its installed CLI's `--help` and package-local docs.
|
|
97
|
+
Run `generate --check` without writing, then the project's normal tests.
|
|
98
|
+
|
|
99
|
+
When the request is to add Mantle to an independently authored application,
|
|
100
|
+
inspect its host, code and data first. Use the exact installed package's
|
|
101
|
+
`docs/skills/integrate/SKILL.md` if available. If Mantle is not installed,
|
|
102
|
+
choose between selective embedding, incremental replacement and creating a
|
|
103
|
+
separate Mantle app followed by frontend/data migration before installing an
|
|
104
|
+
exact SDK version. The existing application does not need to adopt the
|
|
105
|
+
generated project's entry or directory layout. An older SDK's own docs and
|
|
106
|
+
CLI govern its behavior; upgrade deliberately if the selected strategy needs
|
|
107
|
+
newer capabilities.
|
|
108
|
+
|
|
109
|
+
When deployment is requested, read the installed version's
|
|
110
|
+
`skills/provision/SKILL.md`. Report the target path, exact SDK version, local
|
|
111
|
+
HTTP results, Admin/MCP identity evidence, and any missing provider setup.
|
|
112
|
+
Local simulated Sites headers do not prove deployed ChatGPT sign-in.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: integrate
|
|
3
|
+
description: Integrate Mantle into an existing application. Use when the application has its own code, routes, storage or deployment and the owner wants to add Mantle, replace part of it, or rebuild with Mantle while migrating frontend and data.
|
|
4
|
+
metadata:
|
|
5
|
+
source: "@aotter/mantle"
|
|
6
|
+
sourcePath: docs/skills/integrate/SKILL.md
|
|
7
|
+
applies_to: mantle grammar v0.1
|
|
8
|
+
projection: package
|
|
9
|
+
projectionReason: Existing-project migration is opt-in; a fresh generated app does not need this brief.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Integrate Mantle into an existing application
|
|
13
|
+
|
|
14
|
+
Work in the target application. Read its installed `@aotter/mantle` version,
|
|
15
|
+
CLI help and package-local docs before editing. If Mantle is absent, inspect
|
|
16
|
+
the application first, then install an exact SDK version only after choosing an
|
|
17
|
+
integration strategy. Use the installed version's contract; do not copy
|
|
18
|
+
`develop` branch examples into an older consumer.
|
|
19
|
+
|
|
20
|
+
## Inspect and decide
|
|
21
|
+
|
|
22
|
+
Map the actual entry points, router, frontend, auth, storage, data volume and
|
|
23
|
+
relationships, deployment pipeline, URLs, background jobs and existing tests.
|
|
24
|
+
Identify which behavior the owner wants Mantle to own and what must remain
|
|
25
|
+
stable. Compare three approaches using the application's evidence:
|
|
26
|
+
|
|
27
|
+
1. **Embed selectively:** keep the host and call Mantle's parser, Runtime or
|
|
28
|
+
selected surfaces through its documented package APIs. The host owns wiring.
|
|
29
|
+
2. **Replace incrementally:** move one bounded capability at a time. Define
|
|
30
|
+
where reads and writes go during coexistence and how each step is checked.
|
|
31
|
+
3. **Rebuild and migrate:** create a separate new Mantle application, port the
|
|
32
|
+
frontend and business behavior, and transform/import existing data. Prefer
|
|
33
|
+
this when adapting the old structure costs more than rebuilding. Preserve
|
|
34
|
+
relevant IDs, relations, URLs and identity semantics; rehearse the data
|
|
35
|
+
transfer before a production cutover.
|
|
36
|
+
|
|
37
|
+
Explain the chosen path and its concrete tradeoffs to the owner. A small
|
|
38
|
+
prototype or read-only inventory may resolve uncertainty. Do not run a generic
|
|
39
|
+
project converter or assume the current application's shape matches a
|
|
40
|
+
generated Cloudflare or ChatGPT Sites skeleton.
|
|
41
|
+
|
|
42
|
+
## Implement and verify
|
|
43
|
+
|
|
44
|
+
- For embedding, retain user-owned entry/config/build files. Use the installed
|
|
45
|
+
direct-authoring docs and CLI to validate manifests and emit bindings; wire
|
|
46
|
+
the selected Mantle capabilities into the existing host explicitly.
|
|
47
|
+
- For incremental replacement, establish a clear owner for each data write
|
|
48
|
+
and request route at every stage. Verify old and new behavior together.
|
|
49
|
+
- For rebuilding, generate in a **separate directory** with the installed
|
|
50
|
+
CLI, move frontend and handlers deliberately, and plan data mapping and
|
|
51
|
+
import separately. Review database migrations before application or cutover.
|
|
52
|
+
- Run the application's build and representative behavior checks for the
|
|
53
|
+
changed routes, auth and data. `mantle generate --check` checks generated
|
|
54
|
+
output against its declared selection; it cannot certify host integration.
|
|
55
|
+
For live data, record migration counts and a rollback or recovery path
|
|
56
|
+
appropriate to the project.
|
|
57
|
+
|
|
58
|
+
Leave existing data and deployment untouched until the requested migration
|
|
59
|
+
and release steps are ready. Report which capabilities Mantle now owns,
|
|
60
|
+
what was verified, and what remains for application deployment or cutover.
|
package/skills/media-gc/SKILL.md
CHANGED
|
@@ -3,9 +3,9 @@ name: media-gc
|
|
|
3
3
|
description: Audit and safely remove stale, uncommitted public media uploads from a Mantle Cloudflare R2 bucket. Use when a Mantle operator asks to inspect or clean orphan media objects left after create_media_upload without commit_media_upload.
|
|
4
4
|
metadata:
|
|
5
5
|
source: "@aotter/mantle"
|
|
6
|
-
sourcePath: skills/media-gc/SKILL.md
|
|
6
|
+
sourcePath: docs/skills/media-gc/SKILL.md
|
|
7
7
|
applies_to: mantle grammar v0.1
|
|
8
|
-
projection:
|
|
8
|
+
projection: package
|
|
9
9
|
projectionReason: Destructive remote object deletion and Cloudflare-specific; opt-in only.
|
|
10
10
|
---
|
|
11
11
|
|
package/skills/plugin/SKILL.md
CHANGED
|
@@ -3,9 +3,9 @@ name: plugin
|
|
|
3
3
|
description: Discover, plan, apply, and verify Mantle marketplace plugins through the Core SDK contract. Use when the user wants to add an installable capability without hand-planning provisioning steps.
|
|
4
4
|
metadata:
|
|
5
5
|
source: "@aotter/mantle"
|
|
6
|
-
sourcePath: skills/plugin/SKILL.md
|
|
6
|
+
sourcePath: docs/skills/plugin/SKILL.md
|
|
7
7
|
applies_to: mantle grammar v0.1
|
|
8
|
-
projection: project
|
|
8
|
+
projection: project
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Mantle Plugin
|
|
@@ -3,9 +3,9 @@ name: provision
|
|
|
3
3
|
description: Ship a Mantle project through its selected host, routing ChatGPT Sites to its integration guide and conventional Cloudflare Workers to production auth and provisioning.
|
|
4
4
|
metadata:
|
|
5
5
|
source: "@aotter/mantle"
|
|
6
|
-
sourcePath: skills/provision/SKILL.md
|
|
6
|
+
sourcePath: docs/skills/provision/SKILL.md
|
|
7
7
|
applies_to: mantle grammar v0.1
|
|
8
|
-
projection:
|
|
8
|
+
projection: package
|
|
9
9
|
projectionReason: Platform-specific deploy that handles production secrets; opt-in only.
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ user asks to create remote resources or ship production. This flow is for
|
|
|
16
16
|
consumer-owned Cloudflare Workers. New direct-authored apps do not need Landing
|
|
17
17
|
artifacts (`.mantle/launch-state.json`, `.mantle/handoff.md`, or a hosted-auth
|
|
18
18
|
allocation). Treat any Landing handoff as **legacy/optional**. For a ChatGPT
|
|
19
|
-
Site, use the installed `docs/handbook/sites/index.md` integration guide and
|
|
19
|
+
Site, use the installed `docs/handbook/chatgpt-sites/index.md` integration guide and
|
|
20
20
|
the "Publish with Sites" steps in `docs/examples/host-chatgpt-sites/README.md`:
|
|
21
21
|
request D1 and R2 on the Site, set `PUBLIC_ORIGIN` and `OWNER_EMAIL` in Sites
|
|
22
22
|
settings, review the migration, then save and deploy a Sites version. Do not
|
package/skills/theme/SKILL.md
CHANGED
|
@@ -3,9 +3,9 @@ name: theme
|
|
|
3
3
|
description: Apply brand and visual direction in a Mantle application using its repo-owned theme and UI contracts.
|
|
4
4
|
metadata:
|
|
5
5
|
source: "@aotter/mantle"
|
|
6
|
-
sourcePath: skills/theme/SKILL.md
|
|
6
|
+
sourcePath: docs/skills/theme/SKILL.md
|
|
7
7
|
applies_to: mantle grammar v0.1
|
|
8
|
-
projection: project
|
|
8
|
+
projection: project
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Mantle Theme
|