@aotter/mantle 0.1.2 → 0.1.3-alpha.2
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 +36 -13
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +2 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +3 -0
- 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 +5 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +3 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/codegen/emitMantleModule.d.ts.map +1 -1
- package/dist/codegen/emitMantleModule.js +38 -2
- package/dist/codegen/emitMantleModule.js.map +1 -1
- package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +109 -2
- package/docs/agent-prompts.md +38 -29
- package/docs/auth-hosting-model.md +1 -1
- package/docs/examples/host-local-admin-otp/README.md +10 -0
- package/docs/handbook/cloudflare/authentication.md +44 -3
- package/docs/handbook/concepts/mcp-and-agents.md +10 -5
- package/docs/handbook/navigation.json +8 -2
- package/docs/handbook/reference/diagnostics.md +5 -1
- package/docs/handbook/reference/manifest.md +1 -1
- package/docs/handbook/reference/procedure.md +1 -0
- package/docs/handbook/reference/surface.md +6 -4
- package/docs/handbook/reference/trigger.md +1 -1
- package/docs/handbook/releases/index.md +75 -0
- package/docs/handbook/start/project-and-cli.md +15 -4
- package/docs/handbook/start/quickstart-admin.md +20 -209
- package/docs/labels.md +3 -3
- package/docs/migration-0.1.2.md +10 -126
- package/docs/release-process.md +80 -39
- package/docs/spec-only-host-adoption.md +1 -1
- package/package.json +25 -16
- package/skills/README.md +21 -15
- package/skills/install/SKILL.md +5 -5
- package/skills/plugin/SKILL.md +6 -6
- package/skills/provision/SKILL.md +27 -17
- package/skills/update/SKILL.md +4 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aotter/mantle",
|
|
3
|
-
"version": "0.1.2",
|
|
4
|
-
"description": "Embeddable Mantle Core umbrella with Spec and Runtime; Web, Admin, Bun, Vercel, Cloudflare, and Admin UI are optional peer packages.",
|
|
3
|
+
"version": "0.1.3-alpha.2",
|
|
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/",
|
|
7
7
|
"repository": {
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
"types": "./dist/admin.d.ts",
|
|
52
52
|
"import": "./dist/admin.js"
|
|
53
53
|
},
|
|
54
|
+
"./auth": {
|
|
55
|
+
"types": "./dist/auth.d.ts",
|
|
56
|
+
"import": "./dist/auth.js"
|
|
57
|
+
},
|
|
54
58
|
"./bun": {
|
|
55
59
|
"types": "./dist/bun.d.ts",
|
|
56
60
|
"import": "./dist/bun.js"
|
|
@@ -79,8 +83,8 @@
|
|
|
79
83
|
"README.md"
|
|
80
84
|
],
|
|
81
85
|
"dependencies": {
|
|
82
|
-
"@aotter/mantle-runtime": "0.1.2",
|
|
83
|
-
"@aotter/mantle-spec": "0.1.2"
|
|
86
|
+
"@aotter/mantle-runtime": "0.1.3-alpha.2",
|
|
87
|
+
"@aotter/mantle-spec": "0.1.3-alpha.2"
|
|
84
88
|
},
|
|
85
89
|
"peerDependencies": {
|
|
86
90
|
"aws4fetch": "^1.0.20",
|
|
@@ -88,12 +92,13 @@
|
|
|
88
92
|
"hono": "^4.12.0",
|
|
89
93
|
"@libsql/client": "^0.17.4",
|
|
90
94
|
"zod": "^4.5.0",
|
|
91
|
-
"@aotter/mantle-
|
|
92
|
-
"@aotter/mantle-admin": "0.1.2",
|
|
93
|
-
"@aotter/mantle-
|
|
94
|
-
"@aotter/mantle-
|
|
95
|
-
"@aotter/mantle-
|
|
96
|
-
"@aotter/mantle-web": "0.1.2"
|
|
95
|
+
"@aotter/mantle-auth": "0.1.3-alpha.2",
|
|
96
|
+
"@aotter/mantle-admin": "0.1.3-alpha.2",
|
|
97
|
+
"@aotter/mantle-cloudflare": "0.1.3-alpha.2",
|
|
98
|
+
"@aotter/mantle-admin-ui": "0.1.3-alpha.2",
|
|
99
|
+
"@aotter/mantle-bun": "0.1.3-alpha.2",
|
|
100
|
+
"@aotter/mantle-web": "0.1.3-alpha.2",
|
|
101
|
+
"@aotter/mantle-vercel": "0.1.3-alpha.2"
|
|
97
102
|
},
|
|
98
103
|
"peerDependenciesMeta": {
|
|
99
104
|
"@aotter/mantle-admin": {
|
|
@@ -102,6 +107,9 @@
|
|
|
102
107
|
"@aotter/mantle-admin-ui": {
|
|
103
108
|
"optional": true
|
|
104
109
|
},
|
|
110
|
+
"@aotter/mantle-auth": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
105
113
|
"@aotter/mantle-bun": {
|
|
106
114
|
"optional": true
|
|
107
115
|
},
|
|
@@ -136,12 +144,13 @@
|
|
|
136
144
|
"typescript": "^6.0.3",
|
|
137
145
|
"vitest": "^4.1.11",
|
|
138
146
|
"zod": "^4.5.4",
|
|
139
|
-
"@aotter/mantle-admin": "0.1.2",
|
|
140
|
-
"@aotter/mantle-
|
|
141
|
-
"@aotter/mantle-
|
|
142
|
-
"@aotter/mantle-
|
|
143
|
-
"@aotter/mantle-
|
|
144
|
-
"@aotter/mantle-
|
|
147
|
+
"@aotter/mantle-admin": "0.1.3-alpha.2",
|
|
148
|
+
"@aotter/mantle-auth": "0.1.3-alpha.2",
|
|
149
|
+
"@aotter/mantle-bun": "0.1.3-alpha.2",
|
|
150
|
+
"@aotter/mantle-admin-ui": "0.1.3-alpha.2",
|
|
151
|
+
"@aotter/mantle-web": "0.1.3-alpha.2",
|
|
152
|
+
"@aotter/mantle-cloudflare": "0.1.3-alpha.2",
|
|
153
|
+
"@aotter/mantle-vercel": "0.1.3-alpha.2"
|
|
145
154
|
},
|
|
146
155
|
"engines": {
|
|
147
156
|
"node": ">=22"
|
package/skills/README.md
CHANGED
|
@@ -6,11 +6,11 @@ Agent-readable skill briefs for consumers of `@aotter/mantle-*`. Discoverable by
|
|
|
6
6
|
|---|---|
|
|
7
7
|
| [`develop`](develop/SKILL.md) | `mantle:develop`: Core-owned workflow for manifest, runtime, handler, adapter, validation, and MCP work in any Mantle project. |
|
|
8
8
|
| [`media-gc`](media-gc/SKILL.md) | `mantle:media-gc`: audit or remove stale uncommitted public media objects with the connected Cloudflare API. |
|
|
9
|
-
| [`plugin`](plugin/SKILL.md) | `mantle:plugin`: Core-owned marketplace workflow for plan-first capability installs across
|
|
10
|
-
| [`theme`](theme/SKILL.md) | `mantle:theme`: Core-owned visual workflow. Reads project
|
|
9
|
+
| [`plugin`](plugin/SKILL.md) | `mantle:plugin`: Core-owned marketplace workflow for plan-first capability installs across applications and adapters. |
|
|
10
|
+
| [`theme`](theme/SKILL.md) | `mantle:theme`: Core-owned visual workflow. Reads project-owned theme and UI contracts. |
|
|
11
11
|
| [`update`](update/SKILL.md) | `mantle:update`: Core-owned drift check workflow for SDK dependencies, local skills, and plugin lockfiles. |
|
|
12
|
-
| [`install`](install/SKILL.md) | User wants to
|
|
13
|
-
| [`provision`](provision/SKILL.md) | User wants a local
|
|
12
|
+
| [`install`](install/SKILL.md) | User wants to author a local Mantle application or continue an existing project. |
|
|
13
|
+
| [`provision`](provision/SKILL.md) | User wants a local project shipped to Cloudflare with production auth and operator handoff. |
|
|
14
14
|
|
|
15
15
|
The skills target Mantle's v0.1 grammar. The installed package version, not
|
|
16
16
|
duplicated skill prose, selects the exact runtime and embedded docs.
|
|
@@ -27,9 +27,9 @@ enforces the columns below.
|
|
|
27
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, plugin | — |
|
|
29
29
|
| `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, plugin | — |
|
|
30
|
-
| `theme` | brand or visual direction in a
|
|
30
|
+
| `theme` | brand or visual direction in a project | repo-owned theme and UI contracts | — | project, plugin | — |
|
|
31
31
|
| `update` | SDK upgrade or plugin lock review | never blindly overwrite user-owned code | — | project, plugin | — |
|
|
32
|
-
| `install` | new
|
|
32
|
+
| `install` | 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. |
|
|
33
33
|
| `provision` | ship to Cloudflare and finish production auth | secrets never enter source or logs; explicit auth mode | hosted auth; self-managed auth | plugin | Platform-specific deploy that handles production secrets; opt-in only. |
|
|
34
34
|
| `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 | plugin | Destructive remote object deletion and Cloudflare-specific; opt-in only. |
|
|
35
35
|
|
|
@@ -46,33 +46,39 @@ Deliberately monolithic:
|
|
|
46
46
|
|
|
47
47
|
The `mantle:*` namespace is owned by `@aotter/mantle`. Every skill declares its
|
|
48
48
|
own distribution scope in front matter: `metadata.projection: project` marks a
|
|
49
|
-
skill `mantle skills` should place in a
|
|
49
|
+
skill `mantle skills` should place in a consumer project, and a skill that
|
|
50
50
|
withholds `project` must say why. `scripts/check-skills.mjs` holds that
|
|
51
51
|
declaration and the audit table below to each other.
|
|
52
52
|
|
|
53
53
|
Run `mantle skills` to project the installed package's skills into a project;
|
|
54
54
|
use `mantle skills --check` to fail closed on drift. The installed package and
|
|
55
55
|
`node_modules/@aotter/mantle/docs/` are the single version-matched authority.
|
|
56
|
-
|
|
56
|
+
Application files and plugin recipes are project context, not competing
|
|
57
57
|
contracts.
|
|
58
58
|
|
|
59
59
|
## Source-repository marketplace install
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Cold start is the pinned install skill. Other marketplace hosts are pointers
|
|
62
|
+
to the same pin:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npx skills add aotter/mantle@v0.1.3-alpha.2 --skill install
|
|
66
|
+
```
|
|
62
67
|
|
|
63
68
|
```bash
|
|
64
69
|
# Claude Code — two separate prompts
|
|
65
|
-
/plugin marketplace add aotter/mantle
|
|
70
|
+
/plugin marketplace add aotter/mantle@v0.1.3-alpha.2
|
|
66
71
|
/plugin install mantle@mantle
|
|
67
72
|
|
|
68
73
|
# Codex
|
|
69
|
-
codex plugin marketplace add aotter/mantle
|
|
74
|
+
codex plugin marketplace add aotter/mantle --ref v0.1.3-alpha.2
|
|
70
75
|
codex plugin add mantle@mantle
|
|
71
76
|
```
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
Then follow the install skill to the CLI and handbook. Do not use an untagged
|
|
79
|
+
`aotter/mantle` marketplace add as the official entry. After packages are
|
|
80
|
+
pinned, `mantle skills` projects the installed package's own skills into the
|
|
81
|
+
project, and `mantle skills --check` fails on drift.
|
|
76
82
|
|
|
77
83
|
Cursor and GitHub Copilot read their manifests from the repository directly.
|
|
78
84
|
These manifests are not duplicated into the npm package:
|
|
@@ -91,7 +97,7 @@ package. Two audiences, two artifacts.
|
|
|
91
97
|
|
|
92
98
|
## Discoverability
|
|
93
99
|
|
|
94
|
-
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").
|
|
100
|
+
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@v0.1.3-alpha.2 --skill install`. Point the agent at tag `v0.1.3-alpha.2` or pass the version-matched markdown content directly.
|
|
95
101
|
|
|
96
102
|
## Conventions
|
|
97
103
|
|
package/skills/install/SKILL.md
CHANGED
|
@@ -101,15 +101,15 @@ Install the frozen dependency graph, project installed Core skills, then read
|
|
|
101
101
|
those skills and embedded docs. Never apply develop docs to an older package.
|
|
102
102
|
Use the installed `mantle --help` and the project's scripts as authority.
|
|
103
103
|
|
|
104
|
-
For legacy
|
|
105
|
-
upgrade is requested
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
For a legacy pre-stable project, retain its pinned behavior until an explicit
|
|
105
|
+
upgrade is requested. Do not rewrite provider identities, delete metadata or
|
|
106
|
+
fetch a nonexistent new Starter tag. SDK upgrades follow the update skill, not
|
|
107
|
+
a bundle comparison command.
|
|
108
108
|
|
|
109
109
|
## Ship and report
|
|
110
110
|
|
|
111
111
|
When deployment is requested, follow the installed provision skill and the
|
|
112
|
-
observed host configuration. Legacy Landing remains
|
|
112
|
+
observed host configuration. Legacy Landing remains a pre-stable product; it
|
|
113
113
|
is not a launch dependency for new Core projects.
|
|
114
114
|
|
|
115
115
|
Report the project path, exact SDK version, local URL/HTTP result and checks,
|
package/skills/plugin/SKILL.md
CHANGED
|
@@ -10,8 +10,8 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
# Mantle Plugin
|
|
12
12
|
|
|
13
|
-
Mantle plugins are Core SDK capability packages. They are not
|
|
14
|
-
and they are not provider provisioning scripts.
|
|
13
|
+
Mantle plugins are Core SDK capability packages. They are not application
|
|
14
|
+
scaffolds (retired in ADR-0021) and they are not provider provisioning scripts.
|
|
15
15
|
|
|
16
16
|
A plugin may contribute:
|
|
17
17
|
|
|
@@ -82,8 +82,8 @@ Suggested ledger paths:
|
|
|
82
82
|
.mantle/plugins.lock.json
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
Keep
|
|
86
|
-
|
|
85
|
+
Keep optional legacy launch files such as `.mantle/features.json` separate from
|
|
86
|
+
plugin state. They are not the Core plugin ledger.
|
|
87
87
|
|
|
88
88
|
## Update
|
|
89
89
|
|
|
@@ -114,7 +114,7 @@ Then verify the plugin's declared surfaces:
|
|
|
114
114
|
|
|
115
115
|
## Don't
|
|
116
116
|
|
|
117
|
-
- Don't treat
|
|
117
|
+
- Don't treat an application template as a plugin.
|
|
118
118
|
- Don't assume Cloudflare; inspect the active adapter and capability ports.
|
|
119
|
-
- Don't create a second skill namespace for
|
|
119
|
+
- Don't create a second skill namespace for host-specific plugins.
|
|
120
120
|
- Don't commit secrets. Provider secrets stay in the platform secret store.
|
|
@@ -13,18 +13,22 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
Local cold start deliberately stops before this skill. Provision only after the
|
|
15
15
|
user asks to create remote resources or ship production. This flow is for
|
|
16
|
-
consumer-owned Cloudflare Workers.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Site,
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
consumer-owned Cloudflare Workers. New direct-authored apps do not need Landing
|
|
17
|
+
artifacts (`.mantle/launch-state.json`, `.mantle/handoff.md`, or a hosted-auth
|
|
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
|
|
20
|
+
the "Publish with Sites" steps in `docs/examples/host-chatgpt-sites/README.md`:
|
|
21
|
+
request D1 and R2 on the Site, set `PUBLIC_ORIGIN` and `OWNER_EMAIL` in Sites
|
|
22
|
+
settings, review the migration, then save and deploy a Sites version. Do not
|
|
23
|
+
run `wrangler deploy` or require R2 S3 credentials merely because Sites exposes
|
|
24
|
+
an R2 binding.
|
|
22
25
|
|
|
23
26
|
## Source of Truth
|
|
24
27
|
|
|
25
28
|
1. Read the actual provider config (`wrangler.jsonc` or `wrangler.toml`),
|
|
26
29
|
application entry and git remotes. Read legacy `.mantle/launch-state.json`
|
|
27
|
-
and `.mantle/handoff.md` only when present;
|
|
30
|
+
and `.mantle/handoff.md` only when present; they are optional leftovers from
|
|
31
|
+
Landing and must not be created as prerequisites for a new app.
|
|
28
32
|
2. Read installed `@aotter/mantle*` versions from `package.json`.
|
|
29
33
|
3. Use matching embedded docs under `node_modules/@aotter/mantle/docs/`.
|
|
30
34
|
4. Never infer provider authority from launch state. Confirm the active GitHub
|
|
@@ -56,8 +60,9 @@ account, prefer an available connector, or use `pnpm exec wrangler login` with
|
|
|
56
60
|
the user's agreement, then run `pnpm deploy`.
|
|
57
61
|
|
|
58
62
|
Capture the live URL in `PUBLIC_ORIGIN` and `Public site:` in `AGENTS.md`, then
|
|
59
|
-
commit and push non-secret changes. Reuse any repo or Worker already created
|
|
60
|
-
|
|
63
|
+
commit and push non-secret changes. Reuse any repo or Worker already created.
|
|
64
|
+
Do not recreate Landing artifacts for a new direct-authored app. Workers Builds
|
|
65
|
+
is optional after a direct deploy.
|
|
61
66
|
|
|
62
67
|
When the owner later adopts a custom domain, update `PUBLIC_ORIGIN` and the
|
|
63
68
|
provider's OAuth callback together, then redeploy. Do not patch `site_config`
|
|
@@ -67,15 +72,17 @@ directly; boot syncs its canonical origin from `PUBLIC_ORIGIN`.
|
|
|
67
72
|
|
|
68
73
|
- **Self-hosted email OTP:** use the application's production transactional-email sender. Replace `ConsoleEmailSender`; never deploy it.
|
|
69
74
|
- **Self-hosted GitHub OAuth — free fallback:** use when the application has no email provider. Configure the owner's per-site GitHub OAuth App and Worker secrets using the steps below.
|
|
70
|
-
- **Mantle hosted auth — paid:** use only when
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
- **Mantle hosted auth — paid, legacy/optional:** use only when a **legacy
|
|
76
|
+
Landing handoff** already records a hosted allocation and client
|
|
77
|
+
configuration. New direct-authored apps do not get this from Core. Mantle
|
|
78
|
+
Platform operates the identity provider; do not ask the user for a per-site
|
|
79
|
+
GitHub OAuth App.
|
|
73
80
|
|
|
74
81
|
Configure only the selected mode. Core deliberately rejects partial or mixed
|
|
75
82
|
hosted/self-managed bindings with `503 setup_incomplete`.
|
|
76
83
|
|
|
77
|
-
Do not claim that hosted auth can attach to an arbitrary local repo unless
|
|
78
|
-
|
|
84
|
+
Do not claim that hosted auth can attach to an arbitrary local repo unless a
|
|
85
|
+
legacy Landing handoff already supplies that configuration.
|
|
79
86
|
|
|
80
87
|
For the exact boundary, read
|
|
81
88
|
`node_modules/@aotter/mantle/docs/auth-hosting-model.md`.
|
|
@@ -131,10 +138,13 @@ git push
|
|
|
131
138
|
pnpm deploy
|
|
132
139
|
```
|
|
133
140
|
|
|
134
|
-
## Hosted Auth
|
|
141
|
+
## Hosted Auth (legacy Landing)
|
|
135
142
|
|
|
136
|
-
|
|
137
|
-
|
|
143
|
+
Skip this section unless a legacy Landing handoff is already present. New
|
|
144
|
+
direct-authored apps use self-hosted email OTP or GitHub OAuth above.
|
|
145
|
+
|
|
146
|
+
Follow that handoff and its client configuration. Hosted configuration remains
|
|
147
|
+
in landing-managed Cloudflare Worker bindings. Verify:
|
|
138
148
|
|
|
139
149
|
- `MANTLE_AUTH_MODE = "hosted"`;
|
|
140
150
|
- `MANTLE_HOSTED_AUTH_ISSUER` is the HTTPS root issuer;
|
package/skills/update/SKILL.md
CHANGED
|
@@ -17,9 +17,10 @@ skill remains the version-matched upgrade workflow, not a replacement CLI.
|
|
|
17
17
|
1. Inspect git status, package.json, lockfile, actual project scripts and
|
|
18
18
|
installed versions. Preserve unrelated local changes. Read plugin locks
|
|
19
19
|
and legacy `.mantle` metadata if present; they are context, not required.
|
|
20
|
-
2. Select an explicit target release and read its
|
|
21
|
-
`docs/
|
|
22
|
-
refs or compare the project to a baseline
|
|
20
|
+
2. Select an explicit target release and read its entry in
|
|
21
|
+
`docs/handbook/releases/index.md` plus that version's GitHub release notes.
|
|
22
|
+
Do not resolve new Starter refs or compare the project to a baseline
|
|
23
|
+
template.
|
|
23
24
|
3. Update only selected `@aotter/mantle*` dependencies to the same exact target
|
|
24
25
|
version, preserving dependency sections. Use the package manager to update
|
|
25
26
|
the lockfile; inspect the dependency diff and required peer changes.
|