@aotter/mantle 0.1.3-alpha.6 → 0.1.3

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 (34) hide show
  1. package/README.md +1 -1
  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 +3 -1
  5. package/dist/cli/main.js.map +1 -1
  6. package/dist/cli/skills.js +1 -1
  7. package/dist/cli/skills.js.map +1 -1
  8. package/docs/agent-prompts.md +6 -5
  9. package/docs/consumer-onboarding-audit.md +65 -0
  10. package/docs/handbook/cloudflare/authentication.md +16 -0
  11. package/docs/handbook/concepts/mcp-and-agents.md +1 -1
  12. package/docs/handbook/concepts/runtime-and-adapters.md +1 -1
  13. package/docs/handbook/concepts/views.md +8 -7
  14. package/docs/handbook/guides/admin-ui.md +135 -0
  15. package/docs/handbook/guides/agent-setup.md +96 -0
  16. package/docs/handbook/guides/typed-queries.md +161 -0
  17. package/docs/handbook/navigation.json +24 -14
  18. package/docs/handbook/reference/features.md +55 -0
  19. package/docs/handbook/reference/manifest.md +3 -1
  20. package/docs/handbook/reference/schema.md +1 -1
  21. package/docs/handbook/reference/surface.md +1 -1
  22. package/docs/handbook/reference/view.md +4 -2
  23. package/docs/handbook/releases/index.md +45 -1
  24. package/docs/handbook/start/overview.md +52 -0
  25. package/docs/handbook/start/project-and-cli.md +2 -2
  26. package/docs/handbook/start/quickstart-worker.md +8 -3
  27. package/docs/spec-only-host-adoption.md +1 -1
  28. package/package.json +17 -17
  29. package/skills/README.md +5 -1
  30. package/skills/develop/SKILL.md +19 -2
  31. package/skills/install/SKILL.md +23 -3
  32. package/skills/plugin/SKILL.md +17 -5
  33. package/skills/theme/SKILL.md +8 -1
  34. package/skills/update/SKILL.md +7 -2
package/README.md CHANGED
@@ -16,7 +16,7 @@ npx skills add aotter/mantle --skill install
16
16
  ```
17
17
 
18
18
  To depend on this package in an existing project, pin the exact version
19
- from `package.json` (currently `0.1.3-alpha.6`):
19
+ from `package.json` (currently `0.1.3`):
20
20
 
21
21
  ```bash
22
22
  npm install @aotter/mantle
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export declare const MANTLE_OVERVIEW = "mantle \u2014 compile manifests into a RuntimePlan and typed binding\n\nOverview\n Optional surfaces \u2014 take only what you need. Admin is opt-in. You can ship a\n complete service with no Dev UI, no visitor frontend, and no extra packages.\n\n Minimal \u2014 Spec + generate\n validate + generate compile manifests into a sealed plan and typed binding.\n Embed that binding in an existing host. No Admin, no visitor UI.\n\n Runtime / adapter\n Bind Runtime through an adapter (Cloudflare Worker, Bun, Vercel, or yours).\n HTTP Views, MCP, and Auth work without Admin.\n See docs/examples/host-minimal-worker or\n node_modules/@aotter/mantle/docs/examples/host-minimal-worker.\n\n Opt-in \u2014 Admin / Dev UI\n Add @aotter/mantle-admin and @aotter/mantle-admin-ui only when humans need\n a console. Then re-run generate, bind wrangler ASSETS, and open\n /admin/sign-in (local email OTP via ConsoleEmailSender).\n See docs/examples/host-local-admin-otp or\n node_modules/@aotter/mantle/docs/examples/host-local-admin-otp.\n\n Further (ask the subcommand for details)\n skills project version-matched agent instructions\n emit-openapi OpenAPI 3.1 from HTTP Triggers and Views\n mantle-harness measure indexes and live HTTP (separate binary)\n\nUsage: mantle <subcommand> [options]\n\nSubcommands:\n generate Compile manifests into a typed runtime binding\n validate Static manifest and handler-source validation\n skills Project version-matched Core skills\n emit-openapi Emit OpenAPI 3.1 from Triggers and Views\n\nDocumentation:\n Handbook: node_modules/@aotter/mantle/docs/handbook/ (or docs/handbook/)\n Online: https://mantle.tools/\n Install skill: npx skills add aotter/mantle --skill install\n";
2
+ export declare const MANTLE_OVERVIEW = "mantle \u2014 compile manifests into a RuntimePlan and typed binding\n\nOverview\n Optional surfaces \u2014 take only what you need. Admin is opt-in. You can ship a\n complete service with no Dev UI, no visitor frontend, and no extra packages.\n\n Minimal \u2014 Spec + generate\n validate + generate compile manifests into a sealed plan and typed binding.\n Embed that binding in an existing host. No Admin, no visitor UI.\n\n Runtime / adapter\n Bind Runtime through an adapter (Cloudflare Worker, Bun, Vercel, or yours).\n HTTP Views, MCP, and Auth work without Admin.\n See docs/examples/host-minimal-worker or\n node_modules/@aotter/mantle/docs/examples/host-minimal-worker.\n\n Opt-in \u2014 Admin / Dev UI\n Add @aotter/mantle-admin and @aotter/mantle-admin-ui only when humans need\n a console. Then re-run generate, bind wrangler ASSETS, and open\n /admin/sign-in (local email OTP via ConsoleEmailSender).\n See docs/examples/host-local-admin-otp or\n node_modules/@aotter/mantle/docs/examples/host-local-admin-otp.\n\n Further (ask the subcommand for details)\n skills project version-matched agent instructions\n emit-openapi OpenAPI 3.1 from HTTP Triggers and Views\n mantle-harness measure indexes and live HTTP (separate binary)\n\nUsage: mantle <subcommand> [options]\n\nSubcommands:\n generate Compile manifests into a typed runtime binding\n validate Static manifest and handler-source validation\n skills Project version-matched Core skills\n emit-openapi Emit OpenAPI 3.1 from Triggers and Views\n\nDocumentation:\n Start: node_modules/@aotter/mantle/docs/handbook/start/overview.md\n Features: node_modules/@aotter/mantle/docs/handbook/reference/features.md\n Admin UI: node_modules/@aotter/mantle/docs/handbook/guides/admin-ui.md\n Online: https://mantle.tools/\n Install skill: npx skills add aotter/mantle --skill install\n";
3
3
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAgCA,eAAO,MAAM,eAAe,kxDAwC3B,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAgCA,eAAO,MAAM,eAAe,g7DA0C3B,CAAC"}
package/dist/cli/main.js CHANGED
@@ -62,7 +62,9 @@ Subcommands:
62
62
  emit-openapi Emit OpenAPI 3.1 from Triggers and Views
63
63
 
64
64
  Documentation:
65
- Handbook: node_modules/@aotter/mantle/docs/handbook/ (or docs/handbook/)
65
+ Start: node_modules/@aotter/mantle/docs/handbook/start/overview.md
66
+ Features: node_modules/@aotter/mantle/docs/handbook/reference/features.md
67
+ Admin UI: node_modules/@aotter/mantle/docs/handbook/guides/admin-ui.md
66
68
  Online: https://mantle.tools/
67
69
  Install skill: npx skills add aotter/mantle --skill install
68
70
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACzD,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe;CAClC,CAAC,CAAC;QACC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,cAAc;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B;YACE,MAAM,CAAC,KAAK,CAAC,uBAAuB,OAAO,IAAI,CAAC,CAAC;YACjD,OAAO,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AU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,cAAc;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B;YACE,MAAM,CAAC,KAAK,CAAC,uBAAuB,OAAO,IAAI,CAAC,CAAC;YACjD,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C9B,CAAC;AAEF,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE;IACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,CAAC,KAAK,CAAC,mBAAmB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3G,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
@@ -59,7 +59,7 @@ export async function runSkills(rawArgs) {
59
59
  return 1;
60
60
  }
61
61
  if (!check)
62
- stdout.write(`Mantle skills projected: ${skills.join(", ")}.\n`);
62
+ stdout.write(`Mantle skills projected: ${skills.join(", ")}.\nRead .agents/skills/mantle-develop/SKILL.md and node_modules/@aotter/mantle/docs/handbook/start/overview.md.\n`);
63
63
  return 0;
64
64
  }
65
65
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EA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AAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -8,11 +8,11 @@ npx skills add aotter/mantle --skill install
8
8
 
9
9
  Copy one block into a coding agent after that skill is present. Paths below
10
10
  are relative to the Mantle docs root: `node_modules/@aotter/mantle/docs/`
11
- after `@aotter/mantle` is installed, or `docs/` in the installed agent plugin.
11
+ after `@aotter/mantle` is installed. A standalone `skills add` installation
12
+ contains only the selected skill, not these docs.
12
13
  `npx --no-install mantle --help` is the layered CLI overview; it mirrors the
13
14
  authoring docs. A live `/mcp` catalog mirrors the Manifest → RuntimePlan, not
14
- the CLI. Interview first. Worker is the default host unless the user names
15
- ChatGPT Sites. There is no `mantle create`. Empty `generate` fails until
15
+ the CLI. Resolve only missing requirements first; do not assume a host. There is no `mantle create`. Empty `generate` fails until
16
16
  manifests exist. Admin is opt-in.
17
17
 
18
18
  ### Interview then build
@@ -21,8 +21,9 @@ manifests exist. Admin is opt-in.
21
21
  Interview me about the service: host, who uses it, whether humans need a
22
22
  Dev UI, and whether we only embed Spec/Runtime. If the install skill is
23
23
  missing, run npx skills add aotter/mantle --skill install. Read the
24
- install skill and npx --no-install mantle --help, then
25
- handbook/start/project-and-cli.md.
24
+ installer-reported skill, choose and install an exact SDK version, then read
25
+ its embedded skills/install/SKILL.md, run npx --no-install mantle --help, and
26
+ read handbook/start/overview.md.
26
27
  Use examples/README.md as the examples index; copy builtin-* Manifests only
27
28
  (not cf-primitives-*). Implement locally first. Take only the surfaces we
28
29
  chose. For Spec-only use, skip Runtime and code generation. For a Worker
@@ -0,0 +1,65 @@
1
+ # Consumer onboarding audit for 0.1.3
2
+
3
+ Scope: source skill install → pinned npm package → CLI → generated skills and
4
+ handbook → application manifest and Admin customization. This is maintainer
5
+ evidence, not a release announcement. Baseline: develop `b90cebbd`, package
6
+ version `0.1.3-alpha.5`; the package version alone does not identify unreleased
7
+ commits on develop. Tracking: [#1042](https://github.com/aotter/mantle/issues/1042).
8
+
9
+ ## Clean source install
10
+
11
+ Executed in an empty temporary directory:
12
+
13
+ ```sh
14
+ npx --yes skills add aotter/mantle --skill install --agent codex --yes
15
+ ```
16
+
17
+ Observed output: repository cloned, **7 skills found**, **1 selected**, copied
18
+ to `./.agents/skills/install`. `skills-lock.json` records source `aotter/mantle`,
19
+ source type `github`, and source path `skills/install/SKILL.md`. The installed
20
+ file's hash in that lock was
21
+ `8a6fd26aea97ae8bdf3e05fef22196c247b3f95aa049204a6ac51259d87e4e29`.
22
+ No SDK, handbook or application is installed by that command. The explicit
23
+ Codex and noninteractive flags make the audited destination reproducible;
24
+ other selected agents/global scope can use another destination.
25
+
26
+ This source install follows the repository's default ref. It does not test the
27
+ unreleased edits in this PR or establish an npm version. The packed-consumer
28
+ check below tests this branch's shipped instructions separately.
29
+
30
+ ## White-box path and fixes
31
+
32
+ | Stage / owner | Finding before this change | Correction |
33
+ |---|---|---|
34
+ | README → external skills installer | Prompt told the agent to read `skills/install/SKILL.md` and `docs/agent-prompts.md`, neither installed there. | Read the installer-reported destination, then the installed SDK's embedded docs. |
35
+ | `skills/install/SKILL.md` | Bootstrap Git instructions did not explicitly hand off to the installed package's own install skill; `docs/...` root was implicit. Host interview was repeated. | Explicit package-root resolution and version authority; ask only for missing requirements. |
36
+ | Install → CLI | It was possible to try the local CLI before installing Core; `generate` in an empty directory fails rather than creating a project. | Spell out package installation before CLI and manifest authoring before generation. |
37
+ | Quickstart versions | Floating `latest` dependency examples contradicted exact-pin advice. | Resolve the requested channel once and save exact Mantle versions before the first build. |
38
+ | `mantle skills` | Correctly projected four project skills, but success output did not tell the agent what to read next. | Print the projected develop skill and installed handbook entry. Document overwrite, drift and opt-in behavior. |
39
+ | `sync-package-docs.mjs` → npm `files` | Docs and all seven skills already shipped; presence checks did not protect the new entry paths or exercise projection from the tarball. | Assert handbook/skill files and byte-identical `.agents`/`.claude` projection in the existing packed-consumer check. |
40
+ | View concepts → grammar/runtime | Concepts denied internal Views and recommended SQL for every new View; reference `surface` table omitted `internal`. SQL admission text was stale. | Match implemented surfaces, typed declarative reads, SQLite admission sandbox and native-dialect limits. |
41
+ | Manifest reference | View's allowed spec keys omitted `cache`; Schema list-column prose omitted native columns. | Reconcile with parser and Admin UI checker. |
42
+ | Plugin/update skills | Assumed conventional source paths, missed regeneration after plugin manifest edits, and treated every View as publicly callable. | Use actual project paths, regenerate the plan, verify the declared surface and distinguish stable index from target prerelease docs. |
43
+ | Feature discovery | No task-to-manifest capability map or usable human entry; reference was buried after host-specific sections. | Add overview, capability table and task guides; move reference before host guides without breaking existing URLs. |
44
+ | Typed query discovery | APIs existed but lacked a complete internal-View calling example or clear reader authorization distinction. | Explain generated params/results, runtime `result` versus REST `data`, SQL `unknown`, indexed reader limits and plan-based emission. |
45
+ | Admin requests → theme/develop skills | Theme skill targeted visitor source; no routing from an Admin request to manifest-controlled presentation. | Route to Admin guide, with Schema/View/Procedure rendering table and supported customization ceiling. |
46
+ | Auth operations | Store-bound session cache behavior existed in code/ADR but was missing from the handbook. | Explain store identity, preparation order and KV propagation limits. |
47
+
48
+ ## Verification and regression coverage
49
+
50
+ - `packages/mantle-spec/test/handbook-contract.test.ts`: complete handbook YAML
51
+ examples parse and validate; navigation covers pages; relative links resolve.
52
+ - `packages/mantle/test/cli/generate.test.ts`: extracts the new internal-View
53
+ YAML and TypeScript directly from the handbook, generates bindings and runs
54
+ strict TypeScript checking on the real example.
55
+ - CLI surface/projection tests assert the concrete next-read destinations;
56
+ existing drift checks verify `--check` is read-only.
57
+ - `scripts/check-optional-packages.mjs`: packs and installs the actual Core
58
+ tarball, checks embedded entry pages/skills, runs `skills` and `skills --check`,
59
+ and compares each project projection byte-for-byte with the installed package.
60
+ - Repository gate: `pnpm check`. Exact execution results and any environment
61
+ limitations are recorded in the PR, rather than frozen as a future guarantee.
62
+
63
+ No npm publish, tag, deployment or grammar change is part of this audit. Source
64
+ skill consumers receive the corrections only once they reach the installed Git
65
+ ref; npm consumers receive them only in a package built from the corrected tree.
@@ -84,6 +84,22 @@ The staff role is re-read from D1 on every protected REST and MCP call; a revoke
84
84
 
85
85
  MCP tokens are session-bound: signing out of Admin ends MCP access. See [MCP and agents](../concepts/mcp-and-agents.md).
86
86
 
87
+ ## Session cache and database replacement
88
+
89
+ When optional session caching is enabled, the cache is derived from the
90
+ canonical store, not a second identity authority. Auth prefixes keys with
91
+ `better-auth:<store-instance-id>:`. Preparing a new store gives it a distinct
92
+ identity, so reusing the same KV namespace after replacing D1 cannot resurrect
93
+ the previous store's cached sessions. Ordinary preparation of the same store
94
+ preserves its identity.
95
+
96
+ Custom low-level Auth composition must prepare the Mantle store before cached
97
+ Auth operations; do not construct cache keys or seed the identity yourself.
98
+ OTP verification remains in the primary database and rate limiting remains
99
+ isolate-local. Revocation/user-update cache invalidation still follows KV
100
+ propagation; the namespace change is isolation across stores, not a promise of
101
+ instant global invalidation. See the [Auth decision](../../adr/0014-auth-better-auth-and-multi-tenant-mcp.md).
102
+
87
103
  ## Better Auth configuration
88
104
 
89
105
  `createAuth()` owns the Worker lifecycle, Admin metadata, sender integration,
@@ -20,7 +20,7 @@ A tool name is derived from a manifest name by `mcpToolNameSegment`: lowercased,
20
20
 
21
21
  | Tool | Produced by | Surface |
22
22
  |---|---|---|
23
- | `query_view_<segment>` | Any View | The View's own `surface` |
23
+ | `query_view_<segment>` | Public or staff View (never internal) | The View's own `surface` |
24
24
  | `create_draft_<schema>`, `update_draft_<schema>` | A Schema with `lifecycle: publishing` | Staff |
25
25
  | `create_record_<schema>`, `update_record_<schema>` | A Schema with `lifecycle: operational` | Staff |
26
26
  | `request_publish`, `unpublish_entry`, `archive_entry`, `delete_entry` | Present when an applicable Schema exists | Staff |
@@ -51,7 +51,7 @@ const bound = bindMantle(runtime);
51
51
  await bound.runtime.archive.execute({ id, ctx });
52
52
  ```
53
53
 
54
- Generated property names are deterministic lower-camel identifiers; calls keep the authored wire names internally, and a collision is an error (`CODEGEN_IDENTIFIER_COLLISION`). Code generation is a pure projection: it never caches, retries, mounts routes or owns host lifecycle, and the typed API keeps its raw `runtime` so it hides nothing. Skipping generation is valid — call `runtime.executeView({ view: "published-notes" })` by name.
54
+ Generated property names are deterministic lower-camel identifiers; calls keep the authored wire names internally, and a collision is an error (`CODEGEN_IDENTIFIER_COLLISION`). The emitter accepts either `emitMantleModule({ linked })` or `emitMantleModule({ plan })` for hosts that already compiled the plan; see [Typed queries](../guides/typed-queries.md). Code generation is a pure projection: it never caches, retries, mounts routes or owns host lifecycle, and the typed API keeps its raw `runtime` so it hides nothing. Skipping generation is valid — call `runtime.executeView({ view: "published-notes" })` by name.
55
55
 
56
56
  ## Core, optional products, adapters
57
57
 
@@ -3,24 +3,25 @@ description: Views are the only public read surface — surfaces, declarative ve
3
3
  ---
4
4
  # Reads: Views, REST and MCP
5
5
 
6
- Every read that leaves the runtime goes through a View. This page explains why, how a View is shaped, and what it costs at query time. Field-level rules are in the [View reference](../reference/view.md).
6
+ Views declare reusable queries and their transport visibility. This page explains why, how a View is shaped, and what it costs at query time. Field-level rules are in the [View reference](../reference/view.md).
7
7
 
8
8
  ## One read surface, not two
9
9
 
10
- A View is a named, read-only query over Schemas. Declaring one is enough: it mounts on its surface with no [Trigger](./procedures-and-triggers.md) involved. Schemas are never publicly readable on their own.
10
+ A View is a named, read-only query over Schemas. Public and staff Views mount on supported transports with no [Trigger](./procedures-and-triggers.md) involved. Schemas are never publicly readable on their own.
11
11
 
12
12
  Exposing collections directly — a `Schema.spec.expose.rest` flag, or a `GET /api/<collection>` shortcut — was considered and rejected. A Schema declares the storage shape. Its entries carry drafts, internal status, server-stamped fields and per-row data the author never intended to publish; `contact-messages` is the canonical example, where a direct collection route would be a privacy bug by default. A View already has the right semantics — a named query with explicit fields, filter, ordering and limit — so auto-exposing it only ratifies what the manifest already says.
13
13
 
14
- There is no internal-only View surface either. A query that should not be externally callable stays a TypeScript helper.
14
+ Use `surface: internal` for a named query callable only by host code. It remains in the plan and generated bindings, but is absent from REST, MCP, WebMCP and Admin reports. Its `requires` and guards still run. See [Typed queries](../guides/typed-queries.md).
15
15
 
16
16
  ## Surfaces
17
17
 
18
- `spec.surface` is required and closed to two values.
18
+ `spec.surface` is required and closed to three values.
19
19
 
20
20
  | `surface` | REST | MCP | Extra |
21
21
  |---|---|---|---|
22
22
  | `public` | `GET /api/views/<name>` | `query_view_<segment>` on `/mcp` | Listed by `GET /api/views` |
23
23
  | `staff` | `GET /admin/api/views/<name>` | `query_view_<segment>` on `/mcp/staff` | `GET /admin/api/views/<name>/export`, Admin report sidebar |
24
+ | `internal` | None | None | Host calls through `executeView` or generated `views` bindings |
24
25
 
25
26
  The adapter filters the View set before building each MCP dispatcher, so a guessed public tool call cannot reach a staff View. Surface decides transport visibility; `spec.requires` decides whether the verified caller may execute the View, on REST and MCP alike. See [Authorization](./authorization.md).
26
27
 
@@ -31,7 +32,7 @@ A View declares exactly one of `from` or `sql`; declaring both or neither is rej
31
32
  - **`from`** names a Schema and pairs with `fields`, `filter`, `orderBy` and `limit`. The filter is a closed AST: `eq`, `gt`, `gte`, `lt`, `lte`, combined with `and` and `or`. Field-to-field comparison and arithmetic are not expressible.
32
33
  - **`sql`** is a single `SELECT` with no semicolon. Every Schema is available as a logical table named after its `metadata.name`, with data properties projected as columns; quote names containing hyphens (`"post-translations"`). Combining `sql` with `fields`, `filter` or `orderBy` is rejected.
33
34
 
34
- **New Views should use one `SELECT`.** The declarative form remains accepted for existing manifests. SQL Views compile to native SQLite; a storage adapter that cannot run them fails at boot with `VIEW_DIALECT_UNSUPPORTED`, and static validation never executes the statement — run it against the selected adapter or through `mantle-harness indexes`.
35
+ Use `from` for portable single-Schema queries, typed result rows and eligible public caching. Use `sql` for joins, aggregation or JSON expansion that the declarative form cannot express. SQL Views require a SQLite-capable adapter (`VIEW_DIALECT_UNSUPPORTED` otherwise), and generated SQL row types are `unknown`. The CLI validates SQL against an empty database of declared Schema tables; programmatic validation needs the `sqlViewSandbox` port for the same check. Exercise data-dependent behavior on your adapter or with `mantle-harness indexes`.
35
36
 
36
37
  ## Params
37
38
 
@@ -88,7 +89,7 @@ These names are output field names — SQL aliases for a `sql` View, Schema prop
88
89
 
89
90
  ## The MCP mirror
90
91
 
91
- Every View is also a tool. The name is the View name lowercased with hyphens replaced by underscores, prefixed `query_view_`. Its input schema is `params.properties` plus `page` and `show`, and it is annotated `readOnlyHint: true`. One executor and one response shape serve REST and MCP, so an agent and a downstream service read exactly the same rows. See [MCP and agents](./mcp-and-agents.md).
92
+ Every public or staff View is also a tool on its matching MCP surface; internal Views are never tools. The name is the View name lowercased with hyphens replaced by underscores, prefixed `query_view_`. Its input schema is `params.properties` plus `page` and `show`, and it is annotated `readOnlyHint: true`. One executor and one response shape serve REST and MCP, so an agent and a downstream service read exactly the same rows. See [MCP and agents](./mcp-and-agents.md).
92
93
 
93
94
  ## Performance: declare the index the query needs
94
95
 
@@ -97,7 +98,7 @@ a native column. Declared `indexes` and `uniqueIndexes` become B-tree indexes
97
98
  over those columns; Core-compiled projections, filters and ordering reference
98
99
  the same columns directly.
99
100
 
100
- Declare the **smallest ordered index justified by the measured path**, and respect SQLite's leftmost-prefix rule. Equality columns go first, the ordered column last. A public View over a publishing Schema always carries `status = published`, so its index leads with `status`: `[status, locale, publishedAt]` serves `WHERE status = ? AND locale = ?`, `… AND publishedAt > ?`, and `… ORDER BY publishedAt`. It does not serve `WHERE publishedAt > ?` alone, and `[publishedAt]` alone does not serve the published list — without planner statistics SQLite prefers the status equality and sorts in a temporary B-tree. If a second hot path needs a different leading field, that is a second index — not a reason to enumerate every permutation, since each index costs storage and slows every write.
101
+ Declare the **smallest ordered index justified by the measured path**, and respect SQLite's leftmost-prefix rule. Equality columns go first, the ordered column last. A public declarative View over a publishing Schema always carries `status = published`, so its index leads with `status`: `[status, locale, publishedAt]` serves `WHERE status = ? AND locale = ?`, `… AND publishedAt > ?`, and `… ORDER BY publishedAt`. It does not serve `WHERE publishedAt > ?` alone, and `[publishedAt]` alone does not serve the published list — without planner statistics SQLite prefers the status equality and sorts in a temporary B-tree. If a second hot path needs a different leading field, that is a second index — not a reason to enumerate every permutation, since each index costs storage and slows every write.
101
102
 
102
103
  ```sh
103
104
  pnpm exec mantle-harness indexes --require-public --format text
@@ -0,0 +1,135 @@
1
+ ---
2
+ description: How Schema, View, Procedure, Trigger and uiSchema become Admin forms, lists, navigation and actions, with a complete customization example.
3
+ ---
4
+ # Customize the Admin console
5
+
6
+ Many Admin changes are manifest edits: labels, multiline inputs, operational
7
+ list columns and tabs, reports and action placement. Admin API derives
8
+ metadata from the compiled plan; the prebuilt SPA renders it. The host must
9
+ already mount Admin API, authentication and Admin assets — see the
10
+ [local Admin tutorial](../start/quickstart-admin.md).
11
+
12
+ ## Manifest to rendered UI
13
+
14
+ | User request | Author this | What Admin renders / constraints |
15
+ |---|---|---|
16
+ | Rename a collection or explain a field | Schema `title` / `description`, property `title` / `description` | Localized labels and help. Property names and stored values stay unchanged. |
17
+ | Make a field required or an option list | JSON Schema `required`, `enum`, `type` | Required marker and type-derived control; enums become selects. These are data contracts, not styling flags. |
18
+ | Make a string multiline | Schema or Procedure `uiSchema.fields.<name>.widget: textarea` | Textarea for a top-level string field. `textarea` is the only supported explicit widget. |
19
+ | Edit Markdown or HTML | Property `x-mcp-hint: markdown` or `html` | Rich editor; these hints take precedence over `widget: textarea`. `richtext` currently uses a textarea. |
20
+ | Edit a timestamp or show money | `format: date-time` on a string; `x-mcp-hint: timestamp-ms` or `money-minor` on a number | Date/time controls or number preview. Money uses minor units divided by 100 and a sibling `currency` when present. |
21
+ | Reorder an operational record list | Schema `uiSchema.list.primaryField`, `.columns` | Linked leading data field, then ordered columns. Native columns such as `status` and `createdAt` are allowed in `columns`; `primaryField` must be a scalar data property. |
22
+ | Add business-state tabs | Schema `uiSchema.list.filterField` | Operational-only enum tabs/sidebar links. Field needs a string enum and a left-prefix index. |
23
+ | Search record contents | Schema `searchableFields` | Searches declared string fields plus entry id. This is substring search, not an index declaration. |
24
+ | Show related records | Required property `x-mantle-ref` | Eligible child collections fold into the parent's workbench; translation children use language tabs. |
25
+ | Also show a folded child in navigation | Schema `uiSchema.nav.standalone: true`, optional `parentField` | Adds its own list with parent filter, retaining the folded view. Multiple eligible parent refs require `parentField`; not allowed on translation children. |
26
+ | Add a read-only report and CSV | View `surface: staff`, `title`, `uiSchema.list` | Report navigation; `columns`, `searchFields`, `filterFields` use output names. Server filters before pagination; CSV includes all matches. |
27
+ | Add a list-level action | Eligible Procedure `uiSchema.collectionAction: <schema>` | Collection action with a form generated from Procedure `input`. |
28
+ | Add a row action | Eligible Procedure input property `x-mantle-ref: <schema>` | Row operation with prefilled reference. Selection uses a same-name Schema property, then a sole single-field unique index, otherwise entry `id`. |
29
+ | Make generic content editing read-only | Schema root `schema.readOnly: true` | Generic authoring writes are blocked; declared Procedures remain available. A disabled field is not an authorization rule. |
30
+
31
+ The data editor also handles booleans, numbers, objects and arrays from JSON
32
+ Schema. Bound fields (`x-mantle-bind`) display read-only because Runtime owns
33
+ the value. Media controls depend on the supported media schema and host media
34
+ policy; `uiSchema` alone cannot enable uploads.
35
+
36
+ Schema list presentation (`primaryField`, `columns`, `filterField`) is for
37
+ `lifecycle: operational`. Publishing collections keep the built-in publishing
38
+ workflow. For an alternate publishing table, define a staff View report.
39
+
40
+ ## Example: an operational inbox
41
+
42
+ This complete source configures a collection and a separate staff report.
43
+ The collection filters by `ticketState`, not Mantle's native publishing status.
44
+
45
+ ```yaml
46
+ apiVersion: cms.mantle.aotter.net/v1
47
+ kind: Schema
48
+ metadata:
49
+ name: support-tickets
50
+ spec:
51
+ title: { en: Support tickets, zh-TW: 客服工單 }
52
+ lifecycle: operational
53
+ schema:
54
+ type: object
55
+ additionalProperties: false
56
+ required: [subject, ticketState]
57
+ properties:
58
+ subject: { type: string, title: Subject }
59
+ details: { type: string, description: Include the steps to reproduce. }
60
+ ticketState: { type: string, enum: [open, waiting, closed] }
61
+ indexes: [[ticketState]]
62
+ searchableFields: [subject, details]
63
+ uiSchema:
64
+ fields:
65
+ details: { widget: textarea }
66
+ list:
67
+ primaryField: subject
68
+ columns: [ticketState, createdAt]
69
+ filterField: ticketState
70
+ ---
71
+ apiVersion: cms.mantle.aotter.net/v1
72
+ kind: View
73
+ metadata:
74
+ name: support-report
75
+ spec:
76
+ title: Support report
77
+ surface: staff
78
+ from: support-tickets
79
+ fields: [id, subject, ticketState, createdAt]
80
+ uiSchema:
81
+ list:
82
+ columns: [subject, ticketState, createdAt]
83
+ searchFields: [subject]
84
+ filterFields: [ticketState]
85
+ ```
86
+
87
+ The collection shows Subject first, State and Created at next, state tabs,
88
+ and a multiline Details editor. The report is a separate navigation entry
89
+ with its own search/filter configuration and CSV export. Schema `.list` and
90
+ View `.list` are different contracts; do not copy their keys between atoms.
91
+
92
+ ## When a Procedure becomes a button
93
+
94
+ `uiSchema.collectionAction` alone does not expose a Procedure. Admin discovers
95
+ staff operations from either a staff MCP Trigger or an HTTP Trigger whose
96
+ Procedure requires `ctx.staff`. Runtime rechecks Procedure `requires` on
97
+ execution. Use the [Procedure reference](../reference/procedure.md#uischema)
98
+ for a complete action declaration.
99
+
100
+ An eligible operation with row bindings appears on those records. One with
101
+ `collectionAction` appears on that collection's list. Operations without either
102
+ appear in the standalone Operations screen. Row mutations use the observed
103
+ entry version for optimistic concurrency where the Procedure contract declares
104
+ `expectedVersion`; keep its input contract intact when adjusting presentation.
105
+
106
+ ## Verify a change
107
+
108
+ 1. Edit the application manifests, then run `mantle validate`, `mantle generate`
109
+ and `mantle generate --check` through the local package manager.
110
+ 2. Restart/reload the host so Admin receives the new compiled plan. Check
111
+ `/admin/api/collections`, `/admin/api/views-manifest` or
112
+ `/admin/api/operations` in an authenticated session if the UI seems stale.
113
+ 3. Open the affected list and editor: check labels, actual columns, filters,
114
+ form values and keyboard access. Verify a record after saving, and verify
115
+ report filters in CSV as well as the visible page.
116
+
117
+ `uiSchema` roots and supported nested keys are closed. Schema accepts `fields`,
118
+ `list`, `nav`; Procedure accepts `collectionAction`, `fields`; staff View accepts
119
+ `list`. They do not accept a custom layout, CSS, React component, arbitrary
120
+ widget name or permission policy. See [Schema](../reference/schema.md#uischema),
121
+ [View](../reference/view.md#uischemalist) and [Procedure](../reference/procedure.md#uischema).
122
+
123
+ For a new layout or unsupported widget, use application-owned UI against the
124
+ appropriate APIs or propose a change to the Admin UI package. Do not patch
125
+ `public/_mantle/admin/`: generation replaces those prebuilt assets. Visitor
126
+ frontend styles and the `theme` skill's site changes do not style Admin.
127
+
128
+ ## Source
129
+
130
+ - [Admin UI contract validation](../../../packages/mantle-spec/src/domain/service/SchemaAdminUiChecker.ts)
131
+ - [Admin metadata and operation discovery](../../../packages/mantle-admin/src/mountMantleAdmin.ts)
132
+ - [Entry form renderer](../../../packages/mantle-admin-ui/src/features/content/entry-edit-view.tsx)
133
+ - [Collection renderer](../../../packages/mantle-admin-ui/src/features/content/collection-view.tsx)
134
+ - [Action renderer](../../../packages/mantle-admin-ui/src/features/content/row-operations.tsx)
135
+ - [Navigation rules](../../../packages/mantle-admin-ui/src/lib/collection-nav.ts)
@@ -0,0 +1,96 @@
1
+ ---
2
+ description: Trace what npx skills add installs, hand off to the pinned SDK, project version-matched skills and diagnose missing or stale instructions.
3
+ ---
4
+ # Install and verify agent instructions
5
+
6
+ There are two separate installations: an agent's bootstrap skill and the
7
+ application's SDK. Installing one does not install the other.
8
+
9
+ ## 1. Install the bootstrap skill
10
+
11
+ ```sh
12
+ npx skills add aotter/mantle --skill install
13
+ ```
14
+
15
+ The installer selects the repository's `install` skill. Read its printed
16
+ installation path. In a project-local Codex installation that is
17
+ `.agents/skills/install/SKILL.md`, not `skills/install/SKILL.md` (the latter is
18
+ its source-repository path). Other agent selections and global installation
19
+ can use different locations.
20
+
21
+ The command installs the selected brief; it does not materialize a Mantle
22
+ application, install `@aotter/mantle`, or copy `docs/`. The unqualified GitHub
23
+ source follows its default branch, not necessarily `develop` or the npm
24
+ version you intend to use. The skills installer's lock identifies the source
25
+ skill; it is not the application's dependency lockfile.
26
+
27
+ ## 2. Select the SDK version, then read its own instructions
28
+
29
+ Use the version the project already pins, or resolve the requested npm channel
30
+ once and pin every selected `@aotter/mantle*` dependency to the same exact
31
+ version. `latest` and `alpha` can describe different capabilities. Resolve only
32
+ requirements the user has not provided: host, storage, public API/HTML, and
33
+ whether staff need Admin. Follow the bootstrap skill to install the selected
34
+ packages locally.
35
+
36
+ Then read:
37
+
38
+ ```text
39
+ node_modules/@aotter/mantle/skills/install/SKILL.md
40
+ node_modules/@aotter/mantle/docs/handbook/start/overview.md
41
+ node_modules/@aotter/mantle/docs/handbook/reference/features.md
42
+ ```
43
+
44
+ These files are in the npm tarball. They are the version-matched authority,
45
+ including when the bootstrap skill came from a different Git ref. Every
46
+ `docs/...` path in the skill resolves under the installed package, not under
47
+ `.agents/skills/install/`. Keep using that SDK's docs for host examples and CLI
48
+ behavior. No local `mantle` binary is available before package installation.
49
+
50
+ ## 3. Project the ongoing workflows
51
+
52
+ From the application root, after installing the SDK:
53
+
54
+ ```sh
55
+ pnpm exec mantle --help
56
+ pnpm exec mantle skills
57
+ pnpm exec mantle skills --check
58
+ ```
59
+
60
+ | Artifact | What you get |
61
+ |---|---|
62
+ | `.agents/skills/mantle-{develop,plugin,theme,update}/SKILL.md` | The installed package's four project-scoped workflows. |
63
+ | `.claude/skills/mantle-{develop,plugin,theme,update}/SKILL.md` | Identical bytes for Claude compatibility. |
64
+ | `node_modules/@aotter/mantle/skills/` | All seven shipped skills, including opt-in `install`, `provision` and `media-gc`. |
65
+ | `node_modules/@aotter/mantle/docs/` | Handbook and examples matched to the package. |
66
+
67
+ `mantle skills` overwrites these four generated projections. Keep project-specific
68
+ instructions elsewhere. `--check` does not write: exit 0 means they match,
69
+ 1 means missing/stale projections, and 2 means a command/package error.
70
+ `mantle generate` does not project skills. Projection does not remove an older
71
+ bootstrap `install` or legacy `.agent/skills` copy; use the version-matched
72
+ project skills for ongoing work.
73
+
74
+ ## 4. Complete and verify the application
75
+
76
+ Follow a [tutorial](../start/overview.md#start-with-your-integration), then run
77
+ its generation, validation, TypeScript checks and actual local route probes.
78
+ Successful skill installation proves only that the instructions were copied.
79
+ It does not prove a server, login, Admin assets or MCP connection works.
80
+
81
+ | Symptom | Cause and next step |
82
+ |---|---|
83
+ | `skills/install/SKILL.md` is missing | That is source provenance. Read the installer's destination instead. |
84
+ | `docs/...` is missing after `skills add` | The skill does not carry the handbook. Install the pinned SDK and read its embedded docs. |
85
+ | `mantle` is missing | Install local `@aotter/mantle`; run its binary through the project package manager. |
86
+ | `MANIFEST_ROOT_NOT_FOUND` | Author manifests in the configured directory; `generate` is not a scaffold command. |
87
+ | `mantle skills --check` exits 1 | Run `mantle skills`, then read the refreshed project skill. |
88
+ | No projected provision/media-gc skill | These are intentionally opt-in. Read their installed package files when the task calls for them. |
89
+ | A documented feature fails on an older release | Use that release's docs or explicitly upgrade; changing a skill does not change Runtime. |
90
+
91
+ ## Source
92
+
93
+ - [Bootstrap install skill](../../../skills/install/SKILL.md)
94
+ - [Projection implementation](../../../packages/mantle/src/cli/skills.ts)
95
+ - [Package file list](../../../packages/mantle/package.json)
96
+ - [Package docs and skills copying](../../../scripts/sync-package-docs.mjs)