@aotter/mantle 0.1.0-alpha.11 → 0.1.0-alpha.13

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.
@@ -3,7 +3,7 @@
3
3
  **Status:** Carried over from POC v0.0.x; amended for the shipped v0.1
4
4
  diagnostic emitters and measured harnesses.
5
5
 
6
- **Date:** 2026-04-30 (POC); last amended 2026-08-03.
6
+ **Date:** 2026-04-30 (POC); last amended 2026-08-31.
7
7
 
8
8
  **Deciders**: phsu
9
9
 
@@ -215,8 +215,13 @@ admin SPA and CF Workers could share a CSP-safe path with no
215
215
  `Function`-constructor codegen. The v0.1.0 rebuild inherits zod
216
216
  from day 1 — manifest authoring stays JSON Schema, but the
217
217
  runtime validator a manifest author's request body hits is a
218
- zod schema, produced by the JSON-Schema zod converter in
218
+ zod schema, produced by Zod's official `z.fromJSONSchema` importer behind the
219
+ compatibility boundary in
219
220
  `@aotter/mantle-spec` (see [`docs/design-atoms.md`](../design-atoms.md) § "Manifest validation — JSON Schema in, zod at runtime").
221
+ Mantle validates its supported keyword/ref policy before import and emits
222
+ `JSON_SCHEMA_UNSUPPORTED`, `JSON_SCHEMA_REF_INVALID`, or
223
+ `JSON_SCHEMA_LIMIT_EXCEEDED`; Zod owns the accepted keywords' validation
224
+ semantics.
220
225
 
221
226
  Concretely, runtime entry validation consumes `ZodError.issues`:
222
227
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Status:** Accepted
4
4
 
5
- **Date:** 2026-08-16
5
+ **Date:** 2026-08-16; last amended 2026-08-31
6
6
 
7
7
  **Related:** [#656](https://github.com/aotter/mantle/issues/656),
8
8
  [#662](https://github.com/aotter/mantle/issues/662),
@@ -111,6 +111,24 @@ those plans to native queries. The v0.1 `View.spec.sql` form remains explicitly
111
111
  SQLite-only and is rejected by unsupported storage during preparation; Mantle
112
112
  does not guess a translation and does not add a universal query driver.
113
113
 
114
+ ### Callable capability projection
115
+
116
+ Optional callable transports consume `projectCallableCapabilities(RuntimePlan)`.
117
+ Each Procedure capability retains the owning MCP Trigger name while its
118
+ input/output/title/description remain owned by the target Procedure; View
119
+ capabilities retain their read-only View contract. Discovery and invocation use
120
+ the same projected descriptor, and invocation routes through `invokeTrigger`
121
+ rather than bypassing Trigger identity with a direct Procedure call. Hosts may
122
+ select a surface and bind transport or browser lifecycle, but do not rescan raw
123
+ manifests or maintain a second registry.
124
+
125
+ `@aotter/mantle-web/webmcp` is an opt-in host binding over that projection. It
126
+ feature-detects `document.modelContext`, registers only public View
127
+ capabilities, invokes the existing same-origin View REST route, and uses the
128
+ registration `AbortSignal` for teardown. It does not add browser globals to
129
+ runtime Core, expose staff/mutating capabilities, or introduce a second
130
+ manifest/runtime path.
131
+
114
132
  ### Naming and code generation
115
133
 
116
134
  The Core execution unit is `MantleRuntime`, not a site. Optional TypeScript
@@ -584,17 +584,23 @@ That split is intentional and load-bearing.
584
584
  draft-2020-12 JSON Schema documents. This is what AI authors and
585
585
  human authors write, what the admin UI feeds JSON Forms, and what
586
586
  the OpenAPI emitter relays unchanged.
587
- - **Runtime engine** = zod 4. The `@aotter/mantle-spec`
588
- package ships a JSON-Schema → zod converter; the runtime calls the converted zod
587
+ - **Runtime engine** = zod 4.5+. The `@aotter/mantle-spec`
588
+ package delegates JSON-Schema → zod conversion to Zod's official
589
+ `z.fromJSONSchema`; the runtime calls the converted zod
589
590
  schema on every Procedure invocation, View parameter parse, and
590
591
  manifest boot check.
591
592
 
592
593
  **Why zod, not Ajv**: Cloudflare Workers' default Content-Security
593
594
  Policy posture and bundle-size budget make Ajv (which generates
594
595
  validators via `new Function(...)`) a poor fit. zod is interpreted,
595
- ships small, and has no eval-shaped code paths. The price is a
596
- narrower JSON Schema feature set; the converter documents which
597
- keywords it supports.
596
+ ships small, and has no eval-shaped code paths. Mantle accepts its existing
597
+ scalar/object/array constraints plus `oneOf`, `const`, root `$defs`, recursive
598
+ same-document `$ref` values beginning `#/$defs/`, and schema-valued
599
+ `additionalProperties`. Unsupported composition and remote refs fail during
600
+ manifest validation. Standard `additionalProperties` semantics apply: omitted
601
+ or `true` preserves extras, `false` rejects them, and a schema validates them.
602
+ The non-standard `nullable` and `format: url` spellings remain compatibility
603
+ normalizations at the boundary.
598
604
 
599
605
  The split also means: **manifests stay portable**. A consumer who
600
606
  later swaps to a non-Workers adapter inherits the same JSON Schema
@@ -99,15 +99,17 @@ rollback or unpublish behavior, or deploy Landing unless
99
99
  3. Set that exact version in every workspace package and in all four agent
100
100
  plugin manifests. Set `.agents/plugins/marketplace.json` to the immutable
101
101
  `v<version>` ref.
102
- 4. Pin both the controller and Core CI to the exact reviewed
103
- `mantle-starters/develop` commit intended for this release. Do not use a
104
- branch, latest tag, or inferred fallback.
102
+ 4. Pin the controller to the exact reviewed `mantle-starters/develop` and
103
+ `mantle-landing/develop` commits intended for this release, and Core CI to
104
+ the same Starter commit. Do not use a branch, latest tag, or inferred
105
+ fallback.
105
106
  5. If an SDK type changed, audit downstream literal constructors and exhaustive
106
107
  switches before publication. CI in Core cannot prove downstream source
107
108
  compatibility by itself.
108
109
  6. Run `pnpm check`, inspect the packed umbrella package, and run the exact
109
- packed-consumer gate. Review and merge a same-repository PR into `develop`;
110
- the controller rejects a direct-push release commit.
110
+ packed-consumer gates against both pinned Starter and Landing commits before
111
+ tagging. Review and merge a same-repository PR into `develop`; the
112
+ controller rejects a direct-push release commit.
111
113
 
112
114
  Preview the native notes before merging the release PR:
113
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.1.0-alpha.11",
3
+ "version": "0.1.0-alpha.13",
4
4
  "description": "Embeddable Mantle Core umbrella with Spec and Runtime; Web, Admin, Bun, Vercel, Cloudflare, and Admin UI are optional peer packages.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://mantle.tools/",
@@ -83,21 +83,21 @@
83
83
  "README.md"
84
84
  ],
85
85
  "dependencies": {
86
- "@aotter/mantle-runtime": "0.1.0-alpha.11",
87
- "@aotter/mantle-spec": "0.1.0-alpha.11"
86
+ "@aotter/mantle-runtime": "0.1.0-alpha.13",
87
+ "@aotter/mantle-spec": "0.1.0-alpha.13"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "aws4fetch": "^1.0.20",
91
91
  "better-auth": "^1.7.1",
92
92
  "hono": "^4.12.0",
93
93
  "@libsql/client": "^0.17.4",
94
- "zod": "^4.0.0",
95
- "@aotter/mantle-admin-ui": "0.1.0-alpha.11",
96
- "@aotter/mantle-bun": "0.1.0-alpha.11",
97
- "@aotter/mantle-vercel": "0.1.0-alpha.11",
98
- "@aotter/mantle-web": "0.1.0-alpha.11",
99
- "@aotter/mantle-admin": "0.1.0-alpha.11",
100
- "@aotter/mantle-cloudflare": "0.1.0-alpha.11"
94
+ "zod": "^4.5.0",
95
+ "@aotter/mantle-admin": "0.1.0-alpha.13",
96
+ "@aotter/mantle-admin-ui": "0.1.0-alpha.13",
97
+ "@aotter/mantle-bun": "0.1.0-alpha.13",
98
+ "@aotter/mantle-cloudflare": "0.1.0-alpha.13",
99
+ "@aotter/mantle-web": "0.1.0-alpha.13",
100
+ "@aotter/mantle-vercel": "0.1.0-alpha.13"
101
101
  },
102
102
  "peerDependenciesMeta": {
103
103
  "@aotter/mantle-admin": {
@@ -135,17 +135,17 @@
135
135
  "@types/node": "^26",
136
136
  "aws4fetch": "^1.0.20",
137
137
  "better-auth": "^1.7.1",
138
- "hono": "^4.12.34",
138
+ "hono": "^4.13.1",
139
139
  "@libsql/client": "^0.17.4",
140
140
  "typescript": "^6.0.3",
141
141
  "vitest": "^4.1.10",
142
- "zod": "^4.4.3",
143
- "@aotter/mantle-admin-ui": "0.1.0-alpha.11",
144
- "@aotter/mantle-bun": "0.1.0-alpha.11",
145
- "@aotter/mantle-cloudflare": "0.1.0-alpha.11",
146
- "@aotter/mantle-admin": "0.1.0-alpha.11",
147
- "@aotter/mantle-vercel": "0.1.0-alpha.11",
148
- "@aotter/mantle-web": "0.1.0-alpha.11"
142
+ "zod": "^4.5.4",
143
+ "@aotter/mantle-admin-ui": "0.1.0-alpha.13",
144
+ "@aotter/mantle-bun": "0.1.0-alpha.13",
145
+ "@aotter/mantle-cloudflare": "0.1.0-alpha.13",
146
+ "@aotter/mantle-admin": "0.1.0-alpha.13",
147
+ "@aotter/mantle-vercel": "0.1.0-alpha.13",
148
+ "@aotter/mantle-web": "0.1.0-alpha.13"
149
149
  },
150
150
  "engines": {
151
151
  "node": ">=22"