@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
@@ -4,10 +4,19 @@
4
4
  {
5
5
  "text": "Start here",
6
6
  "items": [
7
+ { "text": "Handbook overview", "link": "/start/overview" },
7
8
  { "text": "Project layout and the CLI loop", "link": "/start/project-and-cli" },
8
9
  { "text": "Quickstart: a minimal Worker", "link": "/start/quickstart-worker" },
9
10
  { "text": "Quickstart: local Admin (opt-in)", "link": "/start/quickstart-admin" },
10
- { "text": "When the host is ChatGPT Sites", "link": "/sites/index" }
11
+ { "text": "When the host is ChatGPT Sites", "link": "/chatgpt-sites/index" }
12
+ ]
13
+ },
14
+ {
15
+ "text": "Task guides",
16
+ "items": [
17
+ { "text": "Agent installation and handoff", "link": "/guides/agent-setup" },
18
+ { "text": "Typed queries and internal Views", "link": "/guides/typed-queries" },
19
+ { "text": "Customize Admin from manifests", "link": "/guides/admin-ui" }
11
20
  ]
12
21
  },
13
22
  {
@@ -22,12 +31,27 @@
22
31
  { "text": "Runtime pipeline and adapters", "link": "/concepts/runtime-and-adapters" }
23
32
  ]
24
33
  },
34
+ {
35
+ "text": "Reference",
36
+ "items": [
37
+ { "text": "Manifest feature table", "link": "/reference/features" },
38
+ { "text": "Manifest envelope", "link": "/reference/manifest" },
39
+ { "text": "Schema", "link": "/reference/schema" },
40
+ { "text": "View", "link": "/reference/view" },
41
+ { "text": "Procedure", "link": "/reference/procedure" },
42
+ { "text": "Trigger", "link": "/reference/trigger" },
43
+ { "text": "Authorization requirements", "link": "/reference/authorization" },
44
+ { "text": "Site defaults and site_config", "link": "/reference/site-config" },
45
+ { "text": "Diagnostic codes", "link": "/reference/diagnostics" },
46
+ { "text": "HTTP, MCP, CLI and packages", "link": "/reference/surface" }
47
+ ]
48
+ },
25
49
  {
26
50
  "text": "ChatGPT Sites",
27
51
  "items": [
28
- { "text": "Get started", "link": "/sites/index" },
29
- { "text": "Host reference", "link": "/sites/host-reference" },
30
- { "text": "Equipment checkout and external APIs", "link": "/sites/equipment-checkout" },
52
+ { "text": "Get started", "link": "/chatgpt-sites/index" },
53
+ { "text": "Host reference", "link": "/chatgpt-sites/host-reference" },
54
+ { "text": "Equipment checkout and external APIs", "link": "/chatgpt-sites/equipment-checkout" },
31
55
  { "text": "Earlier guide URL", "link": "/cloudflare/chatgpt-sites" }
32
56
  ]
33
57
  },
@@ -60,20 +84,6 @@
60
84
  { "text": "Guarded API access", "link": "/examples/guarded-api" }
61
85
  ]
62
86
  },
63
- {
64
- "text": "Reference",
65
- "items": [
66
- { "text": "Manifest envelope", "link": "/reference/manifest" },
67
- { "text": "Schema", "link": "/reference/schema" },
68
- { "text": "View", "link": "/reference/view" },
69
- { "text": "Procedure", "link": "/reference/procedure" },
70
- { "text": "Trigger", "link": "/reference/trigger" },
71
- { "text": "Authorization requirements", "link": "/reference/authorization" },
72
- { "text": "Site defaults and site_config", "link": "/reference/site-config" },
73
- { "text": "Diagnostic codes", "link": "/reference/diagnostics" },
74
- { "text": "HTTP, MCP, CLI and packages", "link": "/reference/surface" }
75
- ]
76
- },
77
87
  {
78
88
  "text": "Releases",
79
89
  "items": [
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Manifest capability table mapping authoring goals to Schema, View, Procedure and Trigger fields, generated APIs and Admin behavior.
3
+ ---
4
+ # Manifest feature reference
5
+
6
+ All paths below are relative to the atom's `spec`. The envelope is always
7
+ `apiVersion`, `kind`, `metadata.name`, `spec`. Features compose from these four
8
+ atoms; there is no separate Form, Workflow or UI manifest kind. See the
9
+ [envelope reference](./manifest.md) for naming and unknown-key rules.
10
+
11
+ ## Capability table
12
+
13
+ | Goal | Atom and fields | Runtime / surface effect | Contract |
14
+ |---|---|---|---|
15
+ | Define stored business data | Schema `schema` | Validated fields; storage adapter prepares the Schema. Generated entry types follow the JSON Schema subset. | [Schema](./schema.md) |
16
+ | Choose draft publishing or live records | Schema `lifecycle` | `publishing` has draft/publish transitions; `operational` creates live records. Admin workflow follows this choice. | [Lifecycle](../concepts/lifecycle-and-locales.md) |
17
+ | Label fields and collections | Schema `title`, `description`, property `title`, `description` | Localized Admin labels/help. Does not rename data keys. | [LocalizedText](./manifest.md#localizedtext) |
18
+ | Make Procedure-managed records | Schema `schema.readOnly` | Disables generic authoring writes; declared Procedures still work. | [Read-only collections](./schema.md#root-readonly-true) |
19
+ | Find and constrain records | Schema `indexes`, `uniqueIndexes`, `searchableFields` | Native access paths, uniqueness and declared substring-search fields. Search fields do not create indexes. | [Indexes](./schema.md#indexes) |
20
+ | Translate or relate records | Schema `localized`, `translates`; property `x-mantle-ref` | Locale rows, joined translations, relation controls and folded child collections. | [Schema](./schema.md), [Admin guide](../guides/admin-ui.md) |
21
+ | Stamp trusted values | Property `x-mantle-bind` | Runtime stamps identity/time; generic agent inputs exclude bound fields and Admin shows them read-only. | [Binding](./schema.md#x-mantle-bind) |
22
+ | Adjust collection inputs and list | Schema `uiSchema.fields`, `.list`, `.nav` | Textareas, operational columns/tabs, standalone child navigation. No CSS or component injection. | [Admin guide](../guides/admin-ui.md) |
23
+ | Query one Schema portably | View `from`, `fields`, `filter`, `orderBy`, `limit`, `params` | Named query with generated typed params and projected rows. | [View](./view.md), [typed queries](../guides/typed-queries.md) |
24
+ | Join or aggregate in SQLite | View `sql`, `params`, `limit` | One bound SELECT; requires a SQLite-capable adapter. Generated row type is `unknown`. | [SQL Views](./view.md#sql) |
25
+ | Choose read visibility | View `surface` | `public`: public REST/MCP; `staff`: Admin reports/staff MCP; `internal`: host binding only. Transports require host composition. | [Surfaces](./view.md#surfaces) |
26
+ | Authorize a query or action | View / Procedure `requires.auth`, `requires.guard` | Runtime checks verified caller context and optional guard. Visibility and UI metadata do not grant access. | [Authorization](./authorization.md) |
27
+ | Filter by caller identity | View `filter` with `$ctx.user: id` | Declarative equality filter; requires user auth and a left-prefix index. | [Identity filters](./view.md#value-forms) |
28
+ | Cache anonymous published reads | View `cache.sharedMaxAge` | Eligible public declarative publishing reads receive shared HTTP cache policy when the host configures cache scope. | [View cache](../concepts/views.md#shared-response-cache) |
29
+ | Configure a report | Staff View `title`, `uiSchema.list` | Ordered report/CSV columns, server-side search and exact filters. | [View list](./view.md#uischemalist) |
30
+ | Define an action | Procedure `input`, `output`, `handler` | Typed input/output; builtin mutation or registered host handler. A Procedure does not create an HTTP route by itself. | [Procedure](./procedure.md) |
31
+ | Put an action in Admin | Procedure `uiSchema.collectionAction`, `.fields`; input `x-mantle-ref`; qualifying Trigger | Collection/row actions and forms; eligible standalone operations appear under Operations. | [Admin guide](../guides/admin-ui.md) |
32
+ | Describe an agent action | Procedure `title`, `description`, `mcp` | Tool descriptions and behavior annotations; enforcement remains in runtime authorization/validation. | [Procedure](./procedure.md) |
33
+ | Expose an HTTP action | Trigger `source: { kind: http, method, path }`, `target.procedure` | Handler on the declared `/api/` path through supporting host adapters. | [HTTP Trigger](./trigger.md#http-source) |
34
+ | Expose an agent action | Trigger `source: { kind: mcp, surface }`, `target.procedure` | Public or staff MCP tool; Procedure authorization still applies. | [Trigger](./trigger.md) |
35
+ | React to content lifecycle | Trigger `source: { kind: lifecycle, schema, on, errorPolicy }`, `target.procedure` | Invokes the action on selected lifecycle events. Deferred execution needs host support. | [Hooks](../concepts/procedures-and-triggers.md) |
36
+
37
+ ## Where manifest control ends
38
+
39
+ Manifests describe data, callable behavior and supported presentation metadata.
40
+ They do not declare arbitrary React components, visitor routes, page layouts,
41
+ CSS, provider credentials or deployment resources. Those belong to application
42
+ source and optional host packages. For an Admin change, consult the
43
+ [rendering map](../guides/admin-ui.md) before deciding that custom UI is needed.
44
+
45
+ The pipeline is source → parse → link → compile → prepare storage → bind
46
+ runtime. `mantle generate` projects the plan and types; it does not start a
47
+ server. Programmatic `emitMantleModule({ plan })` also accepts an already
48
+ compiled plan; see [typed queries](../guides/typed-queries.md).
49
+
50
+ ## Source
51
+
52
+ - [Manifest grammar](../../../packages/mantle-spec/src/domain/model/ManifestGrammar.ts)
53
+ - [Admin UI validation](../../../packages/mantle-spec/src/domain/service/SchemaAdminUiChecker.ts)
54
+ - [Type generation](../../../packages/mantle-spec/src/usecase/EmitTypesUseCase.ts)
55
+ - [Runtime binding generation](../../../packages/mantle/src/codegen/emitMantleModule.ts)
@@ -5,6 +5,8 @@ description: Envelope fields, unknown-key policy, multi-document YAML, Localized
5
5
 
6
6
  This page covers the rules that apply to every Manifest document before kind-specific validation runs. Read it once; the four atom pages ([Schema](./schema.md), [View](./view.md), [Procedure](./procedure.md), [Trigger](./trigger.md)) assume it. Diagnostic codes named here are catalogued in [Diagnostics](./diagnostics.md).
7
7
 
8
+ For a task-to-field table covering all four atoms, see the [Manifest feature reference](./features.md). For the resulting console, see [Customize Admin](../guides/admin-ui.md).
9
+
8
10
  ## Envelope
9
11
 
10
12
  Every document is a YAML mapping with exactly four top-level keys.
@@ -37,7 +39,7 @@ The parser rejects keys outside the shipped grammar at every level it knows. The
37
39
  | `/` | `apiVersion`, `kind`, `metadata`, `spec` |
38
40
  | `/metadata` | `name` |
39
41
  | `/spec` (Schema) | `title`, `description`, `schema`, `uiSchema`, `uniqueIndexes`, `indexes`, `searchableFields`, `localized`, `translates`, `lifecycle` |
40
- | `/spec` (View) | `title`, `uiSchema`, `from`, `sql`, `surface`, `requires`, `filter`, `fields`, `orderBy`, `limit`, `params` |
42
+ | `/spec` (View) | `title`, `uiSchema`, `from`, `sql`, `surface`, `cache`, `requires`, `filter`, `fields`, `orderBy`, `limit`, `params` |
41
43
  | `/spec` (Procedure) | `title`, `description`, `requires`, `input`, `uiSchema`, `output`, `handler`, `mcp` |
42
44
  | `/spec` (Trigger) | `source`, `target` |
43
45
  | `/spec/translates` | `parent`, `on` |
@@ -164,7 +164,7 @@ Closed Admin-only roots: `fields`, `list`, `nav`. Nested keys are closed too. Un
164
164
  | `fields.<field>.widget` | Only `textarea`. The field must be a top-level property with a string type (`string` or `[string, null]`). |
165
165
  | `list.filterField` | Operational Schemas only. A declared property with a non-empty string `enum` that is the first field of some `indexes` or `uniqueIndexes` tuple. Admin renders the enum as sidebar links and list tabs. |
166
166
  | `list.primaryField` | Operational Schemas only. A non-empty top-level scalar property; rendered as the linked leading column. |
167
- | `list.columns` | Operational Schemas only. Top-level properties, no repeats and not repeating `primaryField`; structured values render as compact JSON. |
167
+ | `list.columns` | Operational Schemas only. Top-level properties or native entry columns, no repeats and not repeating `primaryField`; structured values render as compact JSON. |
168
168
  | `nav.standalone` | Boolean. `true` also emits a main Admin Nav list entry with a **parent autocomplete filter**. It does not unfold: required `x-mantle-ref` children still compose under the parent. Omit or `false` means fold-only (discover via the parent-entry workbench). Rejected on top-level Schemas, `translates` children, and Schemas with no eligible required-ref parent. |
169
169
  | `nav.parentField` | Allowed only with `standalone: true`. Names a required `x-mantle-ref` field used as the parent filter. One eligible required ref is inferred; more than one requires an explicit `parentField`. Do not rely on property-order heuristics when multiple refs exist. |
170
170
 
@@ -97,7 +97,7 @@ Tool names are the mangled `metadata.name`: lower-cased, with `-` replaced by `_
97
97
 
98
98
  | Tool | Surface | Registered when |
99
99
  |---|---|---|
100
- | `query_view_<segment>` | The View's own `surface` | One per declared View. `annotations.readOnlyHint` is `true`; the input schema is the View's `params.properties` plus `page` and `show`. |
100
+ | `query_view_<segment>` | The View's own `surface` | One per public or staff View; internal Views have no tool. `annotations.readOnlyHint` is `true`; the input schema is the View's `params.properties` plus `page` and `show`. |
101
101
  | `<procedure_segment>` | The MCP Trigger's `surface` | One per `mcp` Trigger. `annotations` carry what Core can prove (`readOnlyHint: false` for every builtin handler, `destructiveHint: true` for `op: delete`, `idempotentHint: true` when an input carries `x-mcp-hint: idempotency-key`) plus whatever the Procedure declares under `spec.mcp`; `ref` handlers get nothing inferred beyond the idempotency key. Generic authoring, lifecycle and media tools are `readOnlyHint: false`; `delete_entry` is also `destructiveHint: true`. |
102
102
  | `<procedure segment>` | The Trigger's `surface` | One per `Trigger.source.kind: mcp`. A Procedure with no MCP Trigger is not exposed. |
103
103
  | `request_publish` | staff | Always. Rejected at call time for an operational Schema. |
@@ -3,7 +3,7 @@ description: View field reference — declarative and SQL forms, filter AST, par
3
3
  ---
4
4
  # View
5
5
 
6
- A View is a named read-only query over Schemas. It is the only atom that needs no [Trigger](./trigger.md): declaring `surface` mounts it. This page is the field-level contract; the concepts are in [Views](../concepts/views.md) and [The four atoms](../concepts/four-atoms.md). Envelope rules are in [Manifest envelope and conventions](./manifest.md), and every diagnostic code named here is catalogued in [Diagnostics](./diagnostics.md).
6
+ A View is a named read-only query over Schemas. It is the only atom that needs no [Trigger](./trigger.md): `surface: public` or `staff` exposes it on supported transports; `internal` keeps it host-only. This page is the field-level contract; the concepts are in [Views](../concepts/views.md) and [The four atoms](../concepts/four-atoms.md). Envelope rules are in [Manifest envelope and conventions](./manifest.md), and every diagnostic code named here is catalogued in [Diagnostics](./diagnostics.md).
7
7
 
8
8
  ## Fields
9
9
 
@@ -13,7 +13,7 @@ A View is a named read-only query over Schemas. It is the only atom that needs n
13
13
  | `uiSchema` | object | no | — | Only on `surface: staff`; only the key `list`. Violations are `VIEW_UI_INVALID`. |
14
14
  | `from` | string | exactly one of `from` / `sql` | — | Name of a declared Schema (`VIEW_FROM_UNKNOWN_SCHEMA`). The declarative form. |
15
15
  | `sql` | string | exactly one of `from` / `sql` | — | One SQLite `SELECT`. See [`sql`](#sql). |
16
- | `surface` | `public` \| `staff` | yes | — | Decides where the View mounts. See [Surfaces](#surfaces). |
16
+ | `surface` | `public` \| `staff` \| `internal` | yes | — | Decides where the View mounts. See [Surfaces](#surfaces). |
17
17
  | `cache` | `{ sharedMaxAge }` | no | — | Anonymous REST shared-cache hint. `sharedMaxAge` is an integer from 1 to 86400. Only an unguarded, declarative public View over a publishing Schema may declare it. |
18
18
  | `requires` | AuthorizationRequirements | no | — | `auth.all` predicates plus one optional `guard.procedure`. See [Authorization](./authorization.md). |
19
19
  | `filter` | FilterAst | no | — | `from` form only. See [Filter AST](#filter-ast). |
@@ -207,6 +207,8 @@ Admin applies search and filters before pagination, rejecting a search term or f
207
207
  | `staff` | `GET /admin/api/views/<name>` and `/admin/api/views/<name>/export` — not mounted publicly | `query_view_<segment>` on `/mcp/staff` | Report sidebar |
208
208
  | `internal` | Not mounted | Not mounted | Not listed or mounted |
209
209
 
210
+ For a complete generated-binding example, see [Typed queries](../guides/typed-queries.md).
211
+
210
212
  An `internal` View remains in the compiled plan for host code to call through `MantleRuntime.executeView`. It is an exposure policy, not an authorization bypass: `requires` and guards still evaluate against the `ctx` supplied by the host. Shared HTTP caching is invalid because no adapter owns an HTTP response for the View.
211
213
 
212
214
  A `public` declarative View over a `publishing` Schema reads **published rows only**, on every transport. The runtime adds `status = published` to the compiled query whether or not the filter spells it out; writing it is allowed and redundant, and comparing `status` to any other value is rejected at validate time (`VIEW_PUBLIC_STATUS_INVALID`). Staff Views see every status. `operational` Schemas create rows as `published`, so nothing is added. SQL Views (`spec.sql`) are the author's own statement and receive no injected predicate. Decision record: ADR-0025.
@@ -17,10 +17,79 @@ stable candidate cut from `main`. Installing a prerelease means opting into an
17
17
  exact version, not a channel. [GitHub Releases](https://github.com/aotter/mantle/releases)
18
18
  is the canonical, immutable change history; this chapter is the narrative one.
19
19
 
20
- All ten packages share a single version and are published together, so mixed
20
+ All eleven packages share a single version and are published together, so mixed
21
21
  versions across `@aotter/mantle*` are never a supported combination. Pin the
22
22
  version you install and upgrade the whole set at once.
23
23
 
24
+ ## 0.1.4 — 2026-09-24
25
+
26
+ 0.1.4 repairs the published consumer path without changing the Manifest
27
+ grammar. Pin every selected `@aotter/mantle*` package to `0.1.4`, refresh the
28
+ lockfile, then rerun `mantle generate` and `mantle skills` with their `--check`
29
+ commands. Read the handbook and skills from that installed version.
30
+
31
+ **ChatGPT Sites reference.** The 0.1.3 reference omitted the
32
+ `_mantle_boot_state.store_instance_id` column required by the runtime, which
33
+ could make deployed runtime routes return 500. The reference now adds the
34
+ append-only `drizzle/0003_store_instance_id.sql` migration. If your project
35
+ was copied from that reference, carry the new migration forward and apply
36
+ pending D1 migrations **before** deploying updated code; do not edit a
37
+ migration already applied. Repeated builds now clear `dist` so removed SQL
38
+ files cannot remain in the deployment artifact. The Sites guide also shows
39
+ how to mount an HTTP Trigger, identifies the browser and MCP owner workflows,
40
+ and names its integration chapter `docs/handbook/chatgpt-sites/`.
41
+
42
+ **Agent installation.** `npx skills add aotter/mantle` installs the small
43
+ `mantle` bootstrap skill; the installed npm package supplies version-matched
44
+ instructions and docs. The skill now checks the application's installed
45
+ version before reading them. Superseded Starter decisions are marked as
46
+ history: no `mantle-starters/v0.1.4` tag or `mantle create` command is needed
47
+ to author a new application.
48
+
49
+ ## 0.1.3 — 2026-09-23
50
+
51
+ 0.1.3 tightens the contract between Manifests, generated TypeScript, agent
52
+ skills and the optional Admin surface. To upgrade from 0.1.2, pin every
53
+ selected `@aotter/mantle*` package to `0.1.3`, refresh the lockfile, then run
54
+ `mantle generate`, `mantle skills` and the matching `--check` commands.
55
+
56
+ **Private and typed reads.** Views may use `surface: internal` to stay out of
57
+ REST, MCP, WebMCP, OpenAPI and Admin while remaining callable from host code.
58
+ Generated bindings type declarative View params and rows, expose typed indexed
59
+ field reads for Schemas, and can be emitted from an already compiled plan. SQL
60
+ Views remain SQLite-native and deliberately return an `unknown` row type.
61
+
62
+ **Safer View storage and validation.** Public declarative Views over publishing
63
+ Schemas always enforce published status. Native entry columns (`id`, `status`,
64
+ `version`, `createdAt`, `updatedAt`, `authorId`) are reserved consistently and
65
+ may be used in the supported View/index positions. SQL validation is confined
66
+ to declared Schema tables, and the local index harness now uses production-
67
+ shaped planner and fixture state instead of reporting an artificial pass.
68
+
69
+ **MCP and authorization.** Tool schemas have agent-shaped inputs and standard
70
+ read-only, destructive, open-world and idempotency annotations. Calls carry
71
+ expected-version data through optimistic concurrency checks, enforce the
72
+ caller gate, and can emit audit records keyed by a declared idempotency input.
73
+ OAuth provider extensions, account linking and sign-in-link flows are owned by
74
+ the extracted optional `@aotter/mantle-auth` package. Session cache keys bind
75
+ to the prepared store identity so replacing D1 cannot revive stale sessions.
76
+
77
+ **Admin and authoring.** Manifest `uiSchema` can select operational collection
78
+ columns/tabs, staff report search/filter/CSV fields and collection or row
79
+ actions. Native columns render correctly in lists, and operation dialogs reset
80
+ their optimistic-concurrency state between actions. The handbook now starts
81
+ with a task-oriented overview, a complete Manifest feature table, typed-query
82
+ and Admin-rendering guides, and an explicit skill-install → pinned SDK →
83
+ project-skill handoff. The CLI points to those installed, version-matched docs.
84
+
85
+ **Upgrade note.** Regeneration is required because generated bindings and
86
+ projected skills gained APIs and instructions. Applications that declared one
87
+ of the newly reserved native column names as business data must rename that
88
+ field before upgrading. Backend-specific D1/IndexedDB cost inspectors and
89
+ server-side soak budgets remain deferred to
90
+ [#1040](https://github.com/aotter/mantle/issues/1040); the conservative local
91
+ harness is a preflight, not production cost evidence.
92
+
24
93
  ## 0.1.2 — 2026-09-21
25
94
 
26
95
  The first stable release, and Mantle's first public one. Everything before it
@@ -54,7 +123,7 @@ See [HTTP, MCP, CLI and packages](../reference/surface.md) for the full list.
54
123
  D1 and assets bindings, Better Auth 1.7 (social providers, email OTP, magic
55
124
  link, passkey), Admin, MCP, Web and R2 media uploads. The Bun and Vercel
56
125
  adapters are experimental, cover public Views and HTTP Triggers only, and leave
57
- authentication and CSRF to the host. [ChatGPT Sites](../sites/index.md) is a
126
+ authentication and CSRF to the host. [ChatGPT Sites](../chatgpt-sites/index.md) is a
58
127
  first-class integration with a runnable reference.
59
128
 
60
129
  **Agents.** `mantle skills` projects the installed package's skills into
@@ -0,0 +1,52 @@
1
+ ---
2
+ description: Choose a Mantle integration, discover manifest capabilities, and find tutorials, task guides, concepts and field-level reference.
3
+ ---
4
+ # Mantle handbook
5
+
6
+ Mantle turns YAML manifests into a validated runtime plan, typed TypeScript
7
+ bindings, and optional HTTP, MCP and Admin surfaces. Your application owns the
8
+ host, storage and frontend. Four atoms describe the contract: **Schema** stores
9
+ data, **View** reads it, **Procedure** acts on it, and **Trigger** binds an action
10
+ to HTTP, MCP or lifecycle events.
11
+
12
+ This handbook describes the SDK snapshot that carries it. For an installed
13
+ project, read `node_modules/@aotter/mantle/docs/handbook/`; a website or Git
14
+ branch can describe a different version. The [release index](../releases/index.md)
15
+ links published releases. A prerelease capability is not a promise that the
16
+ current npm `latest` contains it.
17
+
18
+ ## Start with your integration
19
+
20
+ | Goal | Start here | Result |
21
+ |---|---|---|
22
+ | Understand what manifests can express | [Manifest feature reference](../reference/features.md) | A capability-to-field map across the four atoms. |
23
+ | Validate manifests in an existing tool | [Spec-only adoption](../../spec-only-host-adoption.md) | Parse and link without Runtime, storage or a UI. |
24
+ | Embed Runtime in an existing host | [Runtime and adapters](../concepts/runtime-and-adapters.md), then [typed queries](../guides/typed-queries.md) | Bind your storage and call the generated API. |
25
+ | Build a local Cloudflare API | [Minimal Worker tutorial](./quickstart-worker.md) | A running public View and a verified HTTP response. |
26
+ | Add a staff console | [Local Admin tutorial](./quickstart-admin.md) | Email OTP, Admin assets and a local human workflow. |
27
+ | Build on ChatGPT Sites | [Sites integration](../chatgpt-sites/index.md) | Host-owned sign-in and deployment with Mantle content. |
28
+ | Work through a coding agent | [Skill installation and handoff](../guides/agent-setup.md) | Bootstrap skill, pinned package, then project-local instructions. |
29
+
30
+ Human authors can follow these pages directly; installing an agent skill is
31
+ optional. Do not start with `mantle generate` in an empty directory: author the
32
+ manifests and host first, then generate and validate.
33
+
34
+ ## Find the right kind of documentation
35
+
36
+ - **Tutorials** walk through a running minimal service or local Admin.
37
+ - **Task guides** explain typed queries, Admin customization and agent setup.
38
+ - **Concepts** explain the four atoms, runtime, lifecycle, authorization and transports.
39
+ - **Reference** lists accepted fields, defaults, restrictions and diagnostics.
40
+ - **Host guides** cover Cloudflare and Sites wiring and operations.
41
+ - **Examples** supply complete domain manifests and runnable host references.
42
+
43
+ The [project and CLI guide](./project-and-cli.md) describes file ownership and
44
+ the verification loop. The [examples hub](../examples/hub.md) helps select a
45
+ domain model. Use the [field reference](../reference/manifest.md) when checking
46
+ exact syntax; do not infer grammar from a UI screenshot.
47
+
48
+ ## Source
49
+
50
+ - [Core package](../../../packages/mantle/README.md)
51
+ - [Handbook navigation](../navigation.json)
52
+ - [Consumer skills](../../../skills/README.md)
@@ -5,10 +5,10 @@ description: The files you own in a Mantle project, every mantle and mantle-harn
5
5
 
6
6
  This page describes a directly authored Mantle project: which files are yours, what the installed CLI does to them, and the loop you run before every commit. Surfaces are optional — take only what you need. [The minimal Worker](./quickstart-worker.md) is Spec + adapter without Admin. [Local Admin](./quickstart-admin.md) is the opt-in Dev UI path when humans need a console.
7
7
 
8
- Cold start from GitHub or a marketplace host is the install skill, not this page:
8
+ Agents can bootstrap with the install skill; human authors can follow this guide directly. For installation paths and the pinned-package handoff, see [Agent setup](../guides/agent-setup.md):
9
9
 
10
10
  ```sh
11
- npx skills add aotter/mantle --skill install
11
+ npx skills add aotter/mantle
12
12
  ```
13
13
 
14
14
  ## You own the project
@@ -77,7 +77,7 @@ It does not project skills, update packages, change styling, provision providers
77
77
  | `createMantle({ storage, handlers, ports })` | Prepares storage eagerly once and returns the typed binding. No caching or retry. |
78
78
  | `bindMantle(runtime)` | The same typed binding over a runtime whose lifecycle the host already owns. |
79
79
 
80
- The binding exposes `mantle.views.<lowerCamelName>()`, `mantle.procedures.<name>(input, ctx)`, `mantle.entries.<collection>.createDraft({ data, authorId })`, typed indexed field reads such as `mantle.entries.<collection>.findManyByDataField({ field, value, limit })`, and the underlying `mantle.runtime`. Generated property names are deterministic lower-camel identifiers; calls keep the authored wire names internally. Details are in [HTTP, MCP, CLI and packages](../reference/surface.md).
80
+ The binding exposes `mantle.views.<lowerCamelName>()`, `mantle.procedures.<name>(input, ctx)`, `mantle.entries.<collection>.createDraft({ data, authorId })`, typed indexed field reads such as `mantle.entries.<collection>.findManyByDataField({ field, value, limit })`, and the underlying `mantle.runtime`. Generated property names are deterministic lower-camel identifiers; calls keep the authored wire names internally. See [Typed queries](../guides/typed-queries.md) for internal Views and entry-reader examples. Details are in [HTTP, MCP, CLI and packages](../reference/surface.md).
81
81
 
82
82
  ## The daily loop
83
83
 
@@ -96,14 +96,14 @@ Run the harness after any change to a Schema index, View filter or ordering, or
96
96
 
97
97
  ## Connecting an agent
98
98
 
99
- `mantle skills` projects the skills the installed package marks `projection: project`. At this version those are `develop`, `plugin`, `theme` and `update`; `install`, `media-gc` and `provision` stay opt-in because they create projects, delete remote objects or handle production secrets. Both tool layouts receive identical bytes. Generation never rewrites these files.
99
+ `mantle skills` projects the skills the installed package marks `projection: project`. At this version those are `develop`, `plugin`, `theme` and `update`; `mantle`, `media-gc` and `provision` stay opt-in because they create projects, delete remote objects or handle production secrets. Both tool layouts receive identical bytes. Generation never rewrites these files.
100
100
 
101
- Install the plugin bundle in the agent host. Cold start uses
101
+ Install the bootstrap skill in the agent host. Cold start uses
102
102
  the install skill; an already-installed project pins packages from `package.json`:
103
103
 
104
104
  ```sh
105
105
  # Canonical
106
- npx skills add aotter/mantle --skill install
106
+ npx skills add aotter/mantle
107
107
 
108
108
  # Claude Code — two separate prompts
109
109
  /plugin marketplace add aotter/mantle
@@ -137,4 +137,4 @@ The projected `develop` skill tells the agent to read `package.json` for the ins
137
137
  - [`packages/mantle-spec/src/infrastructure/cli/ValidateCommand.ts`](../../../packages/mantle-spec/src/infrastructure/cli/ValidateCommand.ts)
138
138
  - [`packages/mantle-spec/src/infrastructure/cli/EmitOpenapiCommand.ts`](../../../packages/mantle-spec/src/infrastructure/cli/EmitOpenapiCommand.ts)
139
139
  - [`packages/mantle-spec/src/infrastructure/cli/MantleCli.ts`](../../../packages/mantle-spec/src/infrastructure/cli/MantleCli.ts)
140
- - [`skills/develop/SKILL.md`](../../../skills/develop/SKILL.md)
140
+ - [`docs/skills/develop/SKILL.md`](../../skills/develop/SKILL.md)
@@ -3,7 +3,7 @@ description: "Author a minimal Cloudflare Worker from scratch: one Schema, one p
3
3
  ---
4
4
  # Quickstart: a minimal Worker
5
5
 
6
- This page reproduces Core's API-only Worker reference as a from-scratch walkthrough. It is the embed / adapter path: View REST without Admin, Auth or a visitor frontend. Admin is opt-in when humans need a console — [Quickstart: local Admin](./quickstart-admin.md). Install every `@aotter/mantle*` package from the `latest` dist-tag; see [Versions](../reference/surface.md#versions).
6
+ This page reproduces Core's API-only Worker reference as a from-scratch walkthrough. It is the embed / adapter path: View REST without Admin, Auth or a visitor frontend. Admin is opt-in when humans need a console — [Quickstart: local Admin](./quickstart-admin.md). Resolve the intended release once and pin every `@aotter/mantle*` package to it; see [Versions](../reference/surface.md#versions).
7
7
 
8
8
  ## Prerequisites
9
9
 
@@ -13,7 +13,10 @@ This page reproduces Core's API-only Worker reference as a from-scratch walkthro
13
13
 
14
14
  ## 1. `package.json`
15
15
 
16
- Install every `@aotter/mantle*` package from the `latest` dist-tag and add the peers the Cloudflare adapter needs.
16
+ The `latest` entries below are bootstrap placeholders. Step 5 replaces both
17
+ with one exact version before the first build. For a prerelease evaluation,
18
+ select its exact version explicitly rather than mixing channels. The other
19
+ entries are the peers and tools used by this reference.
17
20
 
18
21
  ```json
19
22
  {
@@ -130,7 +133,9 @@ Both compatibility flags are required by the adapter. `MANTLE_AUTH_MODE` must be
130
133
  ## 5. Install, generate, validate, run
131
134
 
132
135
  ```sh
133
- pnpm install
136
+ # Resolve once; for a requested prerelease, set its exact version instead.
137
+ MANTLE_VERSION=$(pnpm view @aotter/mantle@latest version)
138
+ pnpm add --save-exact "@aotter/mantle@$MANTLE_VERSION" "@aotter/mantle-cloudflare@$MANTLE_VERSION"
134
139
  pnpm exec mantle generate
135
140
  pnpm exec mantle validate
136
141
  pnpm exec wrangler dev --local --ip 127.0.0.1 --port 8787
@@ -169,9 +174,6 @@ curl -i http://127.0.0.1:8787/mcp/staff
169
174
 
170
175
  `generate` fails on missing or invalid manifests and never creates a project, a default Schema or a home route. `mantle generate --check` reports stale output without writing. The reference keeps `.mantle/`, `.agents/` and `.claude/` out of git and regenerates them in `check`; see [Project layout and the CLI loop](./project-and-cli.md).
171
176
 
172
- > **npm and optional peers**
173
- > A cold npm install can fail with `ERESOLVE` when an Auth peer selects a different optional `@libsql/client` than this snapshot declares. If that happens, pin `@libsql/client` in `overrides` to the range in this checkout's `package.json` and rerun `npm install`. Do not use `--force`. Commit the lockfile and use `npm ci` afterwards.
174
-
175
177
  ## Next steps
176
178
 
177
179
  - [Quickstart: local Admin](./quickstart-admin.md) — opt-in Dev UI: ASSETS, prebuilt Admin, email OTP.
@@ -110,10 +110,11 @@ dist-tag DELETE only added failure and re-run state, and Actions
110
110
  ```
111
111
 
112
112
  Leave the consumer cold-start entry **untagged**: `npx skills add
113
- aotter/mantle --skill install`, `/plugin marketplace add aotter/mantle`,
113
+ aotter/mantle`, `/plugin marketplace add aotter/mantle`,
114
114
  `codex plugin marketplace add aotter/mantle` and the plugin-manifest
115
115
  descriptions carry no `@v…` / `--ref`. Untagged resolves to `main`, which
116
- only moves at a release, so it is always the latest published version
116
+ normally moves at a release but may contain a source-only hotfix; the
117
+ installed npm package remains the version authority
117
118
  (#995, #998). Only "installed version" statements such as
118
119
  `(currently \`X.Y.Z\`)` are bumped.
119
120
 
@@ -65,7 +65,7 @@ release use `docs/examples/host-minimal-worker` from the same reviewed commit.
65
65
  Private consumers can still run the exact-tarball checker in their own repos;
66
66
  public Core PRs receive no cross-repository credentials:
67
67
 
68
- | Consumer | Revision | Gate authority | Manifest paths |
68
+ | Historical consumer | Revision | Gate at the time | Manifest paths |
69
69
  |---|---|---|---|
70
70
  | `aotter/mantle-starters` | `157e8f49e1e25ae1c52c0115f0dd9e8b6017ef0e` | Core CI + release | `blank/manifests/site.yaml`; `overlays/{community,intake,presence,publication,reservation,transaction}/manifests/site.yaml`; `recipes/typed-web/manifests/site.yaml` |
71
71
  | `aotter/mantle-landing` | `4381354dd25d5d94f4096cf3e55a4cb9eecbf3ad` | Landing CI + Core release | `manifests/site.yaml` |