@mapled/mcp 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -69,8 +69,8 @@ A rename or a conversion Mapled wouldn't take is refused at once with the reason
69
69
  | `create_form` / `list_forms` | Set up public forms with spam protection |
70
70
  | `get_connection` | The delivery key and the API URL, plus — for the `framework` the agent names (`nextjs`, `react-spa`, `plain-html`, …) or the project's own — the package the site reads through (`@mapled/next`, `@mapled/react`, `@mapled/vanilla` — a script tag and `data-mapled-*` attributes for plain HTML — or `@mapled/client`), the env var of the key, whether the site renders on a server or in the browser, and the wire-up steps. Image values → `assetUrl(id, { width })` of the same package |
71
71
  | `set_site_url` | Where the site is deployed — for a site rendered in the browser (a React single-page app, plain HTML), which has no webhook to learn it from: Preview opens the site there, verification checks that it answers |
72
- | `push_site_manifest` / `list_bindings` | Tell Mapled where each field is rendered; read every binding's health (type mismatch, outdated, missing on site). Keep the repository's copy in `mapled/manifest.json` — `npx @mapled/cli scan --write` derives it from the code and `bindings push` / `bindings pull` exchange it with Mapled. A push records the integration hash — the schema and these bindings — and `list_bindings` says whether it still matches (`integration.inSync`, with `schemaChanged` / `bindingsChanged` naming what moved) |
73
- | `configure_revalidation` | Point the publish webhook at the site (one with a server that caches what it reads), get the signing secret; the description also tells the agent how to add live updates for tabs that are already open (`createReleaseHandler` and `<MapledLive />`, `@mapled/next` 0.8.0+) |
72
+ | `push_site_manifest` / `list_bindings` | Tell Mapled where each field is rendered; read every binding's health (type mismatch, outdated, missing on site). Keep the repository's copy in `mapled/manifest.json` — `npx @mapled/cli scan --write` derives it from the code and `bindings push` / `bindings pull` exchange it with Mapled. A push records the integration hash — the schema and these bindings — and `list_bindings` says whether it still matches (`integration.inSync`, with `schemaChanged` / `bindingsChanged` naming what moved). `capabilities` says whether open tabs follow Publish: `{ realtime: true, releaseRoute: "/api/mapled/release" }` for a Next.js site with `<MapledLive />` and `createReleaseHandler` (on the Pages Router, `createPagesReleaseHandler`), `{ realtime: true }` for a site rendered in the browser whose tabs ask Mapled directly (`live` on `MapledProvider`, `data-mapled-live` on the script tag), `{ realtime: false }` without live updates — only these two keys; MAPLED.md's Live updates line comes from it, so send it with every push |
73
+ | `configure_revalidation` | Point the publish webhook at the site (one with a server that caches what it reads), get the signing secret; the description also tells the agent how to add live updates for tabs that are already open (`createReleaseHandler` and `<MapledLive />`, `@mapled/next` 0.8.0+; on the Pages Router `createPagesReleaseHandler` as an API route's default export and `<MapledLive />` from `@mapled/next/live/pages`, 0.9.0+), declared then in the manifest's `capabilities` |
74
74
  | `check_integration` | The site's integration as Mapled sees it — delivery reads, the webhook and its last delivery, the bindings summary, the integration hash (is the last push still in step with the schema and the bindings?), current package versions; `npx @mapled/cli doctor` shows the same from inside the repository |
75
75
  | `delete_collection` / `remove_field` / `clear_records` / `rename_field` / `convert_field` / `get_confirmation` | Destructive and breaking changes — each files a request a person confirms on a trusted Mapled screen (see above); `get_confirmation` reads its status |
76
76
  | `get_mapled_md` | `MAPLED.md` rendered from the project — the guide for the next agent: project, how the site reads it, content model, bindings by page, last setup run, working rules, verification commands. Never a secret. `npx @mapled/cli md pull` writes the same file; `mapled doctor` says when it is out of date |
package/dist/tools.js CHANGED
@@ -296,6 +296,14 @@ export function createTools(api) {
296
296
  "sveltekit…; react-spa and plain-html tell Mapled the site renders in the browser, so verification " +
297
297
  "expects no webhook and no preview route. A plain HTML page that shows one record keeps the slug in its " +
298
298
  "query — name it \"/post.html?slug=[slug]\", with a route_param binding on the slug field. " +
299
+ "`capabilities` says whether pages that are already open follow a publish (live updates): a Next.js site " +
300
+ "that renders <MapledLive /> (or calls watchRelease) and serves createReleaseHandler as GET at a route — " +
301
+ "on the Pages Router createPagesReleaseHandler as an API route's default export — " +
302
+ "sends { realtime: true, releaseRoute: \"/api/mapled/release\" } — the path its tabs ask; a site " +
303
+ "rendered in the browser whose tabs ask Mapled directly (live on MapledProvider, data-mapled-live on the " +
304
+ "script tag) sends { realtime: true }; a site without live updates sends { realtime: false }. Only these two keys " +
305
+ "are accepted. Nothing is graded by them and they stay out of the integration hash, but MAPLED.md's " +
306
+ "Live updates line comes from them — send them with every push, as a push without them drops the line. " +
299
307
  "The answer's manifest.integrationHash is the hash of the schema and these " +
300
308
  "bindings — what the site is synced with from now on; check_integration reports inSync against it. " +
301
309
  "Needs the builder plan.",
@@ -328,6 +336,15 @@ export function createTools(api) {
328
336
  }))
329
337
  .max(500),
330
338
  notes: z.array(z.string().max(300)).max(20).optional(),
339
+ // the API's limits (lib/bindings.ts): strict, so an unknown capability is refused, never dropped
340
+ capabilities: z
341
+ .object({
342
+ realtime: z.boolean().optional(),
343
+ releaseRoute: z.string().min(1).max(200).startsWith("/").optional(),
344
+ })
345
+ .strict()
346
+ .optional()
347
+ .describe("Whether open tabs follow a publish: realtime, and releaseRoute — the path of the site's release route, e.g. /api/mapled/release."),
331
348
  },
332
349
  handler: async (args) => api.request("POST", "/v1/agent/manifest", args),
333
350
  },
@@ -542,7 +559,12 @@ export function createTools(api) {
542
559
  "Optional, when the owner wants pages that are already open to follow a publish without a reload " +
543
560
  "(@mapled/next 0.8.0+): also mount createReleaseHandler({ key: process.env.MAPLED_KEY! }) from " +
544
561
  "\"@mapled/next/server\" as GET at /api/mapled/release and render <MapledLive /> from " +
545
- "\"@mapled/next/live\" once in the root layout — tabs poll the site's own route, never Mapled.",
562
+ "\"@mapled/next/live\" once in the root layout. On the Pages Router (@mapled/next 0.9.0+) export " +
563
+ "createPagesReleaseHandler({ key: process.env.MAPLED_KEY! }) from \"@mapled/next/server\" as the default " +
564
+ "of pages/api/mapled/release.ts and render <MapledLive /> from \"@mapled/next/live/pages\" in pages/_app; " +
565
+ "there only pages that read in getServerSideProps follow a publish (the @mapled/next README, Live updates → " +
566
+ "Pages Router). Tabs poll the site's own route, never Mapled; then declare it in push_site_manifest's " +
567
+ "capabilities.",
546
568
  schema: {
547
569
  url: z.string().min(8).max(2048),
548
570
  },
@@ -551,7 +573,8 @@ export function createTools(api) {
551
573
  {
552
574
  name: "get_mapled_md",
553
575
  description: "Get MAPLED.md — the guide Mapled writes for the next agent and for people: the project and how the site " +
554
- "reads it, the content model, where the site renders each field, the last setup run, the working rules and " +
576
+ "reads it (and whether open tabs follow a publish, as the manifest's capabilities say), the content model, " +
577
+ "where the site renders each field, the last setup run, the working rules and " +
555
578
  "the verification commands, rendered from the project as it is now. Write `markdown` to MAPLED.md at the " +
556
579
  "repository root and commit it. If the file exists, replace everything above its `<!-- mapled:notes -->` " +
557
580
  "line and keep what is below — that part belongs to the repository. Its first line is a stamp with the " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapled/mcp",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "Mapled MCP server: lets AI agents build schema and content for one Mapled project.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://mapled.io",