@typeroll/mcp-server 0.42.1 → 0.43.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/AGENTS.md CHANGED
@@ -73,7 +73,9 @@ maps to one HTTP endpoint; the actual logic runs in the customer's portal
73
73
  products, restaurants for a directory site, etc.). Each has a schema
74
74
  (`fields[]`) and optional **per-item routing** via `route_template`
75
75
  (e.g. `/restaurants/{slug}`). When set, every published item gets its
76
- own static URL rendered through `item_template_html`. Set
76
+ own static URL rendered through `item_template_blocks` (preferred) or
77
+ `item_template_html`. Native `article` and `checklist` presets are available
78
+ through `template_kind`. Set
77
79
  `route_template=""` to opt out and keep the collection listing-only.
78
80
 
79
81
  - **Settings.** Site name, tagline, logo, favicon, colors, fonts,
@@ -367,6 +369,9 @@ maps to one HTTP endpoint; the actual logic runs in the customer's portal
367
369
  Discard; `read_working_copy` shows the raw unsaved diff when you need to
368
370
  know whose edits are in it. Working copies are per-doc scratch; for
369
371
  multi-page efforts branch instead (`create_branch`).
372
+ `content_mode` is not a writable `update_page` or batch patch field. Save
373
+ the target HTML/block tree first, then call `set_page_mode`; the API rejects
374
+ direct PATCH attempts and points at the mode endpoint.
370
375
  **Before `trigger_deploy`: commit.** Deploys build saved content only —
371
376
  an uncommitted draft silently stays behind.
372
377
  - **Deploys / `{branch}.{project}.pages.dev` are the STATIC BUILD**, refreshed
@@ -582,7 +587,7 @@ create_collection
582
587
  label_singular="Restaurant" label_plural="Restaurants"
583
588
  fields=[ ...title, slug, address, phone, cuisine, body... ]
584
589
  route_template="/restaurants/{slug}"
585
- item_template_html="<article><h1>{{title}}</h1>… {{{body}}}</article>"
590
+ template_kind="article"
586
591
 
587
592
  # For each row in your source data:
588
593
  create_collection_item collection="restaurants" fields={…} status="published"
@@ -596,6 +601,15 @@ list_collection_items collection="restaurants" limit=200
596
601
  update_page page_id=restaurants patch={ html_content: "<hand-written listing>" }
597
602
  ```
598
603
 
604
+ For articles and checklists, prefer the native `article` / `checklist`
605
+ `template_kind` presets or an explicit `item_template_blocks` tree. Exact
606
+ bindings such as `core/button.href = "{{item.pdf_url}}"` are supported on
607
+ typed text/URL/image fields. `template/item_body.field`,
608
+ `template/page_date.field`, and `core/table_of_contents.source_field` select
609
+ the named item field. Breadcrumbs and outlines exist in initial HTML. Use
610
+ explicit neighbor fields on `template/item_navigation` only when imported
611
+ navigation must differ from collection sort order.
612
+
599
613
  ### "Migrate a content type (e.g. WP custom post type)"
600
614
 
601
615
  ```
@@ -733,6 +747,13 @@ something is quietly wrong:
733
747
  redone. The in-portal migration workflow enforces the same gate as its first
734
748
  step (`skip_preflight: true` overrides it, and logs that it did).
735
749
 
750
+ Before converting a content family, pass its proposed `compositions` too.
751
+ The read-only review lists required fields/block types/capabilities and marks
752
+ generic custom blocks, raw HTML, or corrective instance CSS as
753
+ `waiting_for_native_support`. Do not build around that result. Continue
754
+ independent content/SEO work and wait for the required Core release, then
755
+ verify the fixture in both preview and a fresh hosted static build.
756
+
736
757
  ### "Don't lose URLs in a migration"
737
758
 
738
759
  Two different questions, and you need both answers:
@@ -744,7 +765,9 @@ verify_migration_urls # what the SERVER actually answers
744
765
 
745
766
  `list_migration_urls` classifies every inventory URL against the site's
746
767
  current pages + redirects. It's recomputed on read, so creating a redirect
747
- flips the entry on your next call — no bookkeeping of your own.
768
+ flips the entry on your next call — no bookkeeping of your own. Slash-equivalent
769
+ source URLs share one inventory row, but `observed_paths` preserves the exact
770
+ spellings that were discovered.
748
771
 
749
772
  `verify_migration_urls` requests each URL against the deployed site (its
750
773
  fallback subdomain by default, because the real domain still points at the
@@ -752,8 +775,20 @@ old host pre-cutover) and reports `ok` / `ok_redirect` / `missing` /
752
775
  `broken_redirect` / `error`. This is the one that catches a redirect
753
776
  pointing at an unpublished page, a typo'd `path`, and redirect loops — all
754
777
  of which read as "handled" in the coverage report and as a 404 to Googlebot.
778
+ Every distinct `observed_paths` value is requested, so a slash variant can fail
779
+ even when its normalized inventory row is green; `summary.checked` counts those
780
+ requests rather than normalized rows.
755
781
  **Deploy first**: it tests saved, deployed content, not your drafts.
756
782
 
783
+ Imports created before plain-text normalization may still contain WordPress
784
+ entities or markup in titles and SEO text. Use
785
+ `repair_migration_plain_text` for those records. It accepts only `title`,
786
+ `seo_title`, `seo_description`, and `excerpt`; it cannot touch rich content,
787
+ slugs, paths, or URLs. The tool defaults to a dry run with exact field diffs.
788
+ Show the full diff/conflict result to the user and obtain approval before
789
+ calling it with `dry_run=false`. Existing working copies are conflicts and are
790
+ never overwritten or committed by the repair.
791
+
757
792
  Every unhandled URL gets exactly one of three outcomes — there is no fourth:
758
793
 
759
794
  - it moved → `create_redirect`
@@ -798,7 +833,10 @@ Constraints, all enforced at write time rather than discovered in production:
798
833
  Rules are emitted most-specific-first, so `/blogg/recept/*` and `/blogg/*`
799
834
  can coexist — the narrower one fires. `list_migration_urls` counts
800
835
  pattern-covered URLs as `redirected`, so the coverage report reflects what
801
- production will do.
836
+ production will do. A build emits both slash spellings for redirect sources
837
+ (except root and file/resource paths) and normalizes internal destinations to
838
+ the site's trailing-slash policy. Changing this behavior requires a new build,
839
+ not a migration of stored redirect records.
802
840
 
803
841
  ### "Link language versions together (hreflang)"
804
842
 
@@ -986,14 +1024,14 @@ preview.
986
1024
  | **Pages — writes** | `create_page`, `update_page`, `replace_page`, `batch_update_pages`, `delete_page`, `clone_page` |
987
1025
  | **Pages — blocks** | `get_page_blocks`, `add_block`, `update_block`, `move_block`, `remove_block`, `set_page_mode`, `convert_page_to_blocks` |
988
1026
  | **Pages — meta** | `get_page_preview` |
989
- | **Global blocks (partials)** | `list_partials` (summary by default), `read_partial`, `create_free_block`, `update_partial`, `replace_partial`, `delete_partial`, `find_pages_using_block`, `list_blocks_with_usage` |
1027
+ | **Global blocks (partials)** | `list_partials` (summary by default), `read_partial`, `create_free_block`, `update_partial`, `replace_partial`, `set_partial_mode`, `delete_partial`, `find_pages_using_block`, `list_blocks_with_usage` |
990
1028
  | **Block types** | `list_block_types`, `read_block_type`, `find_pages_using_block_type`, `export_block_types`, `import_block_types` |
991
1029
  | **Collections** | `create_collection`, `update_collection_schema`, `delete_collection`, `list_collections`, `read_collection`, `list_collection_items` (richtext hidden by default), `read_collection_item`, `batch_read_collection_items`, `create_collection_item`, `update_collection_item`, `delete_collection_item`, `regenerate_collection_listing` |
992
1030
  | **Media** | `list_media`, `read_media`, `create_upload_url`, `upload_media_from_url`, `upload_media_inline`, `update_media`, `delete_media`, `finalize_media`, `finalize_all_media`, `generate_image_variants`, `suggest_alt_text_context` |
993
1031
  | **Redirects** | `list_redirects`, `create_redirect`, `delete_redirect`. `from_path` may be a PATTERN: a trailing `*` (with `:splat` in the target) or `:name` for one segment — one rule retires a whole family of dead URLs (`/category/*` → `/blogg/:splat`). Mid-path splats and query strings are refused, as is any rule that would hide a live page. |
994
- | **Migration inventory** | `get_migration_readiness` (preflight — CALL FIRST), `list_migration_urls`, `add_migration_urls`, `update_migration_url`, `update_migration_urls`, `delete_migration_url`, `import_sitemap`, `import_gsc_performance`, `verify_migration_urls`. Sitemap indexes are recursive. GSC supports direct Search Console access or CSV and aggregates fragment variants. Verification is compact by default. |
1032
+ | **Migration inventory** | `get_migration_readiness` (preflight — CALL FIRST), `list_migration_urls`, `add_migration_urls`, `update_migration_url`, `update_migration_urls`, `delete_migration_url`, `import_sitemap`, `import_gsc_performance`, `repair_migration_plain_text`, `verify_migration_urls`. Sitemap indexes are recursive. GSC supports direct Search Console access or CSV and aggregates fragment variants. Plain-text repair is allowlisted and dry-run-first. Verification is compact by default. |
995
1033
  | **Forms** | `list_forms`, `read_form`, `create_form`, `update_form`, `delete_form`, `list_form_submissions`, `delete_form_submission` (removes one submission — e.g. cleaning up a test entry; `delete_form` with `delete_submissions` is the bulk path). **Steps (form/* block trees) are the ONLY stored model**: pass `steps` for funnels, or `fields` for simple forms — the server converts a flat field list to a single static step. Place with a `core/form` block on block-mode pages or `<x-form id="…" />` in HTML mode. Both expand server-side to the same complete signed shell and initial state. Email/webhook actions are admin-only in the portal and excluded from agent reads/writes. |
996
- | **Settings** | `update_site_settings` (whitelist) |
1034
+ | **Settings** | `update_site_settings` (whitelist, including shallow-merged native `cookie_consent`) |
997
1035
  | **Core modules** | `list_apps`, `read_app`, `update_app` (legacy API name; admin; schema-driven config, masked secrets, redeploy when `affects_build` is true) |
998
1036
  | **Extension installations** | `list_extension_installations`, `read_extension_installation`, `update_extension_installation_config` (admin; schema-driven config, masked secrets preserved, production deploy queued by default) |
999
1037
  | **Analytics attribution** | `read_funnel_attribution`, `update_funnel_attribution` (specialized Analytics module tools; admin; redeploy after changes) |
package/README.md CHANGED
@@ -145,18 +145,23 @@ the full reference + concrete operation recipes.
145
145
  template, or collection item-template), so one tool family edits
146
146
  every block container.
147
147
  - **Global blocks (partials)** — list (summary mode by default), read,
148
- create free block, update, replace, delete, find-pages-using-block.
148
+ create free block, update, replace, delete, `set_partial_mode`,
149
+ find-pages-using-block. New header/footer work should use the native
150
+ `template/site_logo` + `core/navigation` recipe in `tr-header-footer`.
149
151
  - **Block types** — list, read, create, update, delete,
150
152
  find-pages-using-block-type, plus `.tcblocks` export/import. Custom
151
153
  client-side JS (`script`) is honoured only when the site has enabled
152
154
  "Allow AI to write block scripts" (a human-set portal setting) —
153
155
  otherwise it's stripped with a warning.
154
156
  - **Collections + items** — create/update/delete the collection schema
155
- itself (incl. `route_template` for per-item URLs); list/read/batch-
157
+ itself (incl. `route_template` for per-item URLs and native `article` /
158
+ `checklist` template presets); list/read/batch-
156
159
  read/create/update/delete items. Existing-collection tools consistently
157
160
  use `collection` (the old `name` argument remains accepted as an alias).
158
161
  Collection repeaters support `group_by`, and item templates can place
159
- `template/item_navigation` for deterministic previous/next links.
162
+ `template/item_navigation` for deterministic or explicitly field-bound
163
+ previous/next links. Typed context bindings, breadcrumbs, selected body
164
+ fields, and table-of-contents links render server-side.
160
165
  - **Media** — list, read, signed upload URLs, `upload_media_from_url`,
161
166
  `upload_media_batch_from_urls` (1–50 sources, max 25 MiB each, with
162
167
  partial-success results),
@@ -168,10 +173,12 @@ the full reference + concrete operation recipes.
168
173
  variant half of finalize, kept for surgical reruns),
169
174
  `suggest_alt_text_context` (returns a tuned prompt for your own
170
175
  vision model).
171
- - **Rendering controls** — `core/table_of_contents`, per-site
176
+ - **Rendering controls** — semantic `core/navigation`, mapped
177
+ `core/post_card`, `core/table_of_contents`, per-site
172
178
  `trailing_slash`, exact `iframe_allowed_hosts`, `icon_192`, and per-page
173
179
  `append_seo_suffix=false`. The block editor supports labelled enums,
174
- line-based lists, nested repeating arrays and an internal-page URL picker.
180
+ line-based lists, nested repeating arrays, responsive values in block
181
+ `data`, and an internal-page URL picker.
175
182
  - **Redirects** — list, create, delete. Plus automatic 301 on slug change.
176
183
  - **Forms** — list, read, create, update, delete, list submissions.
177
184
  Place forms with `core/form` blocks or an HTML-mode `<x-form id="…" />`
@@ -184,8 +191,8 @@ the full reference + concrete operation recipes.
184
191
  preserved. Use this for frontend config such as consent copy and policy
185
192
  links. It queues a production deploy by default; pass `deploy: false` only
186
193
  when batching changes and deploy once afterwards.
187
- - **Settings** — read + patch, including `scripts_head` /
188
- `scripts_body_end` / `custom_css` (trusted because the caller holds an
194
+ - **Settings** — read + patch, including shallow-merged `cookie_consent`,
195
+ `scripts_head` / `scripts_body_end` / `custom_css` (trusted because the caller holds an
189
196
  API key; the in-portal chat AI does NOT get these).
190
197
  - **Core modules** — list the legacy `apps` registry, read schema + masked
191
198
  state, and enable, configure, or disable any module with the same admin API key used for content
@@ -199,7 +206,9 @@ the full reference + concrete operation recipes.
199
206
  block data and schema-defined collection-item fields.
200
207
  - **Migration inventory** — bulk add/update decisions, recursive
201
208
  `import_sitemap`, direct or CSV-fallback `import_gsc_performance`, and compact
202
- `verify_migration_urls` (successful rows omitted unless requested).
209
+ `verify_migration_urls` (successful rows omitted unless requested), plus
210
+ `repair_migration_plain_text` for dry-run-first cleanup of legacy WordPress
211
+ entities and markup in allowlisted plain-text fields.
203
212
  - **Branches** — create, read, delete, merge. Branch deploys get their
204
213
  own URL at `{branch}.{project}.pages.dev`.
205
214
  - **Deploy** — trigger (with `dry_run` to build without publishing), list, get