@mapled/mcp 0.9.3 → 0.11.0
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 +4 -2
- package/dist/tools.js +30 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ For the first integration, propose one plan and let the owner approve it on a tr
|
|
|
46
46
|
3. Ask the user to open the returned `reviewUrl` and approve. Poll `get_setup_run` until its status is `approved` (or `rejected` — then propose a better plan).
|
|
47
47
|
4. `apply_setup_plan` — Mapled creates everything in one go and tells you the keys it assigned.
|
|
48
48
|
5. Wire the site: `get_connection`, `configure_revalidation`, deploy, then close with `report_setup` (files changed, `buildPassed`, `secretsCommitted: false`). Mapled runs its own checks — the site reads content, the webhook delivered, the preview route responds, fields have help texts — and the run is completed only when they pass. Fix what failed and call `verify_setup`.
|
|
49
|
+
6. Leave a guide: `get_mapled_md` renders `MAPLED.md` from the project — what the site reads and where, the content model, the working rules, the commands that verify the integration. Write it to the repository root and commit it; the next agent (or person) starts from it. When the file exists, replace everything above its `<!-- mapled:notes -->` line and keep the notes below.
|
|
49
50
|
|
|
50
51
|
## Destructive changes
|
|
51
52
|
|
|
@@ -63,8 +64,9 @@ For the first integration, propose one plan and let the owner approve it on a tr
|
|
|
63
64
|
| `list_records` | Read a collection's draft records, newest edit first — `query` searches their content, `limit` (1–200) and `cursor` (the previous answer's `nextCursor`) page through them; `total` counts every match |
|
|
64
65
|
| `create_form` / `list_forms` | Set up public forms with spam protection |
|
|
65
66
|
| `get_connection` (image values → `assetUrl(id, { width })` from @mapled/next) | Delivery key + API URL for wiring the site (`@mapled/next`) |
|
|
66
|
-
| `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 |
|
|
67
|
+
| `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) |
|
|
67
68
|
| `configure_revalidation` | Point the publish webhook at the site, get the signing secret |
|
|
68
|
-
| `check_integration` | The site's integration as Mapled sees it — delivery reads, the webhook and its last delivery, the bindings summary, current package versions; `npx @mapled/cli doctor` shows the same from inside the repository |
|
|
69
|
+
| `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 |
|
|
70
|
+
| `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 |
|
|
69
71
|
|
|
70
72
|
Agents write drafts only — publishing stays with humans in the Mapled app, and nothing changes on the live site until someone presses Publish.
|
package/dist/tools.js
CHANGED
|
@@ -149,7 +149,7 @@ export function createTools(api) {
|
|
|
149
149
|
name: "apply_setup_plan",
|
|
150
150
|
description: "Apply an approved setup plan. Mapled creates the collections, fields and records in one go and returns " +
|
|
151
151
|
"what was created (keys, counts) plus warnings for records it had to skip. Then wire the site " +
|
|
152
|
-
"(get_connection, configure_revalidation) and finish with report_setup.",
|
|
152
|
+
"(get_connection, configure_revalidation), write MAPLED.md (get_mapled_md) and finish with report_setup.",
|
|
153
153
|
schema: { runId: z.string().uuid() },
|
|
154
154
|
handler: async (args) => api.request("POST", `/v1/agent/runs/${encodeURIComponent(args.runId)}/apply`, {}),
|
|
155
155
|
},
|
|
@@ -229,7 +229,9 @@ export function createTools(api) {
|
|
|
229
229
|
"image_alt, link, number, date, boolean, collection for a repeated list, route_param, form_field). " +
|
|
230
230
|
"Push the full list every time; bindings you leave out are marked missing on the site. Mapled grades " +
|
|
231
231
|
"each binding against the schema (healthy, type mismatch, outdated) and returns warnings for unknown " +
|
|
232
|
-
"collections or fields.
|
|
232
|
+
"collections or fields. The answer's manifest.integrationHash is the hash of the schema and these " +
|
|
233
|
+
"bindings — what the site is synced with from now on; check_integration reports inSync against it. " +
|
|
234
|
+
"Needs the builder plan.",
|
|
233
235
|
schema: {
|
|
234
236
|
framework: z.string().max(40).optional(),
|
|
235
237
|
pages: z.array(z.object({ route: z.string().max(200), file: z.string().max(300).optional() })).max(200).optional(),
|
|
@@ -266,7 +268,11 @@ export function createTools(api) {
|
|
|
266
268
|
name: "list_bindings",
|
|
267
269
|
description: "Read the bindings with their health: healthy, missing_on_site, type_mismatch, outdated (the field or " +
|
|
268
270
|
"collection changed since the manifest), not_checked, disabled. Fix the site or the schema, then push " +
|
|
269
|
-
"the manifest again."
|
|
271
|
+
"the manifest again. `integration` says whether the last push still matches Mapled: inSync false with " +
|
|
272
|
+
"schemaChanged means the schema moved after the site was wired — run `npx @mapled/cli schema diff`, " +
|
|
273
|
+
"update the site, then `scan --write` and push the manifest again; bindingsChanged means someone " +
|
|
274
|
+
"replaced or deleted bindings in Mapled — `npx @mapled/cli bindings pull` brings them into the " +
|
|
275
|
+
"repository, then update the site to match.",
|
|
270
276
|
schema: {},
|
|
271
277
|
handler: async () => api.request("GET", "/v1/agent/bindings"),
|
|
272
278
|
},
|
|
@@ -443,13 +449,31 @@ export function createTools(api) {
|
|
|
443
449
|
},
|
|
444
450
|
handler: async (args) => api.request("PATCH", "/v1/agent/webhook", { url: args.url }),
|
|
445
451
|
},
|
|
452
|
+
{
|
|
453
|
+
name: "get_mapled_md",
|
|
454
|
+
description: "Get MAPLED.md — the guide Mapled writes for the next agent and for people: the project and how the site " +
|
|
455
|
+
"reads it, the content model, where the site renders each field, the last setup run, the working rules and " +
|
|
456
|
+
"the verification commands, rendered from the project as it is now. Write `markdown` to MAPLED.md at the " +
|
|
457
|
+
"repository root and commit it. If the file exists, replace everything above its `<!-- mapled:notes -->` " +
|
|
458
|
+
"line and keep what is below — that part belongs to the repository. Its first line is a stamp with the " +
|
|
459
|
+
"schema hash, the manifest version and the integration hash. Refresh it after every schema or " +
|
|
460
|
+
"manifest change and at the end of a setup; `npx @mapled/cli md pull` does the same from the repository " +
|
|
461
|
+
"and `mapled doctor` says when it is out of date. It never contains a secret — don't add one.",
|
|
462
|
+
schema: {},
|
|
463
|
+
handler: async () => api.request("GET", "/v1/agent/mapled-md"),
|
|
464
|
+
},
|
|
446
465
|
{
|
|
447
466
|
name: "check_integration",
|
|
448
467
|
description: "See the site's integration as Mapled sees it: whether the site has read content with the delivery key " +
|
|
449
468
|
"and when, the publish webhook's URL and its last delivery, the bindings summary of the last manifest, " +
|
|
450
|
-
"the connection you hold
|
|
451
|
-
"the mapled CLI)
|
|
452
|
-
"
|
|
469
|
+
"the connection you hold, the package versions Mapled considers current (@mapled/next, @mapled/mcp, " +
|
|
470
|
+
"the mapled CLI) and `integration` — the integration hash: `hash` is the schema and the bindings as " +
|
|
471
|
+
"Mapled holds them now, `synced` what the last manifest push recorded; inSync false means the site was " +
|
|
472
|
+
"wired against an older schema (schemaChanged) or bindings were edited in Mapled (bindingsChanged) — " +
|
|
473
|
+
"re-sync it (schema diff, update the site, push the manifest again). The repository computes the same " +
|
|
474
|
+
"hash from mapled/schema.json and mapled/manifest.json, and `npx @mapled/cli doctor` compares the two in " +
|
|
475
|
+
"its Integration line. Use it to find what is left to wire up; doctor shows the same picture from inside " +
|
|
476
|
+
"the repository, plus the local checks (env, routes, generated types, secrets in git).",
|
|
453
477
|
schema: {},
|
|
454
478
|
handler: async () => api.request("GET", "/v1/agent/integration"),
|
|
455
479
|
},
|