@aotter/mantle 0.1.2 → 0.1.3-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.
Files changed (43) hide show
  1. package/README.md +36 -13
  2. package/dist/auth.d.ts +2 -0
  3. package/dist/auth.d.ts.map +1 -0
  4. package/dist/auth.js +2 -0
  5. package/dist/auth.js.map +1 -0
  6. package/dist/cli/generate.d.ts.map +1 -1
  7. package/dist/cli/generate.js +3 -0
  8. package/dist/cli/generate.js.map +1 -1
  9. package/dist/cli/main.d.ts +1 -1
  10. package/dist/cli/main.d.ts.map +1 -1
  11. package/dist/cli/main.js +5 -0
  12. package/dist/cli/main.js.map +1 -1
  13. package/dist/cli/skills.d.ts.map +1 -1
  14. package/dist/cli/skills.js +3 -0
  15. package/dist/cli/skills.js.map +1 -1
  16. package/dist/codegen/emitMantleModule.d.ts.map +1 -1
  17. package/dist/codegen/emitMantleModule.js +38 -2
  18. package/dist/codegen/emitMantleModule.js.map +1 -1
  19. package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +109 -2
  20. package/docs/agent-prompts.md +38 -29
  21. package/docs/auth-hosting-model.md +1 -1
  22. package/docs/examples/host-local-admin-otp/README.md +10 -0
  23. package/docs/handbook/cloudflare/authentication.md +44 -3
  24. package/docs/handbook/concepts/mcp-and-agents.md +10 -5
  25. package/docs/handbook/navigation.json +8 -2
  26. package/docs/handbook/reference/diagnostics.md +5 -1
  27. package/docs/handbook/reference/manifest.md +1 -1
  28. package/docs/handbook/reference/procedure.md +1 -0
  29. package/docs/handbook/reference/surface.md +6 -4
  30. package/docs/handbook/reference/trigger.md +1 -1
  31. package/docs/handbook/releases/index.md +75 -0
  32. package/docs/handbook/start/project-and-cli.md +15 -4
  33. package/docs/handbook/start/quickstart-admin.md +20 -209
  34. package/docs/labels.md +3 -3
  35. package/docs/migration-0.1.2.md +10 -126
  36. package/docs/release-process.md +36 -32
  37. package/docs/spec-only-host-adoption.md +1 -1
  38. package/package.json +25 -16
  39. package/skills/README.md +21 -15
  40. package/skills/install/SKILL.md +5 -5
  41. package/skills/plugin/SKILL.md +6 -6
  42. package/skills/provision/SKILL.md +27 -17
  43. package/skills/update/SKILL.md +4 -3
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 starters and adapters. |
10
- | [`theme`](theme/SKILL.md) | `mantle:theme`: Core-owned visual workflow. Reads project context but does not depend on starter-owned skill semantics. |
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 create a local Mantle site by direct authoring or continue an existing local / landing-generated project. |
13
- | [`provision`](provision/SKILL.md) | User wants a local or landing-generated project shipped to Cloudflare with production auth and operator handoff. |
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 generated project | repo-owned theme and UI contracts | — | project, plugin | — |
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 site, or opening an existing generated one | 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. |
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 generated project, and a skill that
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
- Starter launch files and plugin recipes are project context, not competing
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
- The source repository is also an agent plugin bundle:
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.1 --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.1
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.1
70
75
  codex plugin add mantle@mantle
71
76
  ```
72
77
 
73
- These are authoring workflows and do not track a release. Version matching is
74
- the job of `mantle skills`, which projects the installed package's own skills
75
- into the project, and `mantle skills --check`, which fails on drift.
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"). No `/skill install` slash command is required — point the agent at a version tag or pass the version-matched markdown content directly.
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.1 --skill install`. Point the agent at tag `v0.1.3-alpha.1` or pass the version-matched markdown content directly.
95
101
 
96
102
  ## Conventions
97
103
 
@@ -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 alpha.17 projects, retain their pinned behavior until an explicit
105
- upgrade is requested; read `docs/migration-0.1.2.md` before upgrading. Do not
106
- rewrite provider identities, delete metadata or fetch a nonexistent new Starter
107
- tag. SDK upgrades follow the update skill, not a bundle comparison command.
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 an alpha.17 product; it
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,
@@ -10,8 +10,8 @@ metadata:
10
10
 
11
11
  # Mantle Plugin
12
12
 
13
- Mantle plugins are Core SDK capability packages. They are not starter overlays
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 starter launch state separate from plugin state. `.mantle/features.json`
86
- is launch/starter context, not the Core plugin ledger.
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 a starter archetype as a plugin.
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 starter-specific plugins.
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. For a ChatGPT Site, use the installed
17
- `docs/handbook/sites/index.md` integration guide and the "Publish with Sites"
18
- steps in `docs/examples/host-chatgpt-sites/README.md`: request D1 and R2 on the
19
- Site, set `PUBLIC_ORIGIN` and `OWNER_EMAIL` in Sites settings, review the
20
- migration, then save and deploy a Sites version. Do not run `wrangler deploy`
21
- or require R2 S3 credentials merely because Sites exposes an R2 binding.
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; do not create them as prerequisites.
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
- by landing. Workers Builds is optional after a direct deploy.
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 the landing handoff records a
71
- hosted allocation and client configuration. Mantle Platform operates the
72
- identity provider; do not ask the user for a per-site GitHub OAuth App.
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 the
78
- current Mantle landing flow explicitly supplies that handoff.
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
- Follow the landing handoff and generated client configuration. Hosted
137
- configuration remains in landing-managed Cloudflare Worker bindings. Verify:
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;
@@ -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 migration notes, including
21
- `docs/migration-0.1.2.md` when leaving alpha.17. Do not resolve new Starter
22
- refs or compare the project to a baseline template.
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.