@typeroll/mcp-server 0.45.45 → 0.45.47

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
@@ -168,18 +168,53 @@ maps to one HTTP endpoint; the actual logic runs in the customer's portal
168
168
  - **Block types.** A site has three sources of block types:
169
169
  - **Core** (origin: 'core', ids like `core/section`) — shipped in
170
170
  the platform, always available.
171
- - **User** (origin: 'user') — created in the portal's block-types UI.
171
+ - **Site** (origin: 'user' from the portal, 'ai' from an agent) — the
172
+ site's own block types, per branch like other content.
172
173
  - **Third-party** (origin: 'third_party') — imported from .tcblocks
173
174
  packages via `import_block_types`.
174
175
 
175
176
  `list_block_types` returns ALL of them in one list as a lightweight
176
- summary: each entry's id, label, category, container/slot info, origin,
177
- and full field schema (names, types, defaults) — but NOT the render-time
178
- template/styles/script (omitted so the list stays within token budget as
179
- the library grows). Use `read_block_type` for one block's markup, or pass
180
- `full:true` to inline it for every block. Always call this FIRST before
181
- working with blocks — never hardcode block ids or field names, the
182
- available set is per-site.
177
+ summary: each entry's id, label, description, category, container/slot
178
+ info, origin, `composed: true` for composed types, and full field schema
179
+ (names, types, defaults) — but NOT the template/composition/styles/script
180
+ (omitted so the list stays within token budget as the library grows).
181
+ Use `read_block_type` for one block's definition, or pass `full:true` to
182
+ inline it for every block. Always call this FIRST before working with
183
+ blocks — never hardcode block ids or field names, the available set is
184
+ per-site.
185
+
186
+ **Building a block type** (needs **admin** permission on the site; editors
187
+ with write permission place block types on pages and edit their fields):
188
+ - Prefer a core block, then a block template (a section people copy and
189
+ adapt), then a global block (identical everywhere). Build a block type
190
+ only for a recurring shape whose structure should stay fixed while
191
+ editors change its content.
192
+ - **Composed** (preferred): `composition` is a tree of existing blocks;
193
+ `schema` declares the props editors fill in. Inner blocks bind props
194
+ as the whole value — `"{{props.title}}"` — and a `core/repeater` with
195
+ `items: "{{props.items}}"` (an array prop) renders its children once
196
+ per item, reading `"{{item.title}}"`, `"{{item.link.href}}"`.
197
+ - **Template** (advanced): own markup with `{{field}}`, `{{{richtext}}}`,
198
+ `{{#field}}…{{/field}}`, `{{^field}}…{{/field}}`, `{{#each items}}…{{/each}}`
199
+ and `{{#link field class="…"}}…{{/link}}`.
200
+ - Field types include `link` (`{ page_id | url, new_tab }`; prefer
201
+ `page_id` for a page on the site) and `array` groups with `item_label`,
202
+ `min_items`, `max_items`. `styles` is scoped to the block (`:scope` is
203
+ the block element; body/html/:root are refused); responses include
204
+ `styles_compiled`.
205
+ - Start from `list_block_type_starters`, check with `validate_block_type`
206
+ (every problem has a JSON-pointer path and, for markup and CSS, a line),
207
+ look at `preview_block_type` (the portal's renderer with the site's
208
+ theme, sample data by default), then `create_block_type`. Unknown
209
+ properties are errors.
210
+ - Changing a type in use: rename fields with `renames` on
211
+ `update_block_type` (the data moves in every page, draft, template,
212
+ global block, block template and other block type that uses it, after
213
+ a page revision); removing or retyping a field that holds data answers
214
+ 409 with the affected uses until you resend with `confirm_data_loss:
215
+ true` — ask the user first. `find_pages_using_block_type` lists every
216
+ use (including through other block types and repeater items), and
217
+ `delete_block_type` is refused while any remains.
183
218
 
184
219
  **The core library is larger than you'd guess (~30+ blocks): `core/image`,
185
220
  `core/media_card`, `core/gallery`, `core/hero`, `core/feature_grid`,
@@ -337,7 +372,7 @@ maps to one HTTP endpoint; the actual logic runs in the customer's portal
337
372
  - **`script` on custom block types** (create/update_block_type) is
338
373
  accepted under your API key's authority — the same trust level that
339
374
  already lets the key write `scripts_head`/`custom_css`, and the same
340
- thing a site editor can do in the portal. The write is stored as sent
375
+ thing a site admin can do in the portal. The write is stored as sent
341
376
  and audit-logged like any API write; there is no extra warning in the
342
377
  response. Tell the user when you change visitor-executed code, and
343
378
  never include script you copied from untrusted content (migrated
@@ -988,6 +1023,16 @@ browser you can connect Cloudflare with a customer API token
988
1023
  (`save_organization_media_access`), and disconnect
989
1024
  (`disconnect_organization_publishing_provider`, user's explicit go-ahead).
990
1025
 
1026
+ When GitHub is not connected or a person says "Connect GitHub didn't work",
1027
+ call `diagnose_organization_github_connection`. It returns the organization's
1028
+ outcome and each blocker's `who` (`you` = the person connecting,
1029
+ `github_owner`, `publisher`, `typeroll_admin`) with one action, plus the saved
1030
+ installation once connected. A person's unfinished attempt and their GitHub
1031
+ accounts are shown only in their own GitHub card. Relay the message and the
1032
+ action's link to the person; browser actions (`sign_in`, `install`, `retry`,
1033
+ `confirm_account_change`) happen at `connect_url`. Pass `recheck: true` only to
1034
+ re-check an already connected installation.
1035
+
991
1036
  ## Safety boundaries
992
1037
 
993
1038
  - **HTML is sanitized at save.** No `<script>`, no `onclick`, no
@@ -1138,7 +1183,7 @@ preview.
1138
1183
  | **Site lifecycle** | `archive_site`, `restore_site`, `purge_site_media` (archived sites only, irreversible). Owner-organization admin, as in the portal. |
1139
1184
  | **Workflows** | `list_workflows`, `start_workflow` (write; `rebuild_deploy` admin), `get_workflow`, `approve_workflow` (only `paused_for_review`, with the user's consent) |
1140
1185
  | **Access** | `list_api_keys`, `revoke_api_key` (site admin), `list_organization_api_keys`, `revoke_organization_api_key` (organization key; new keys are created only in the portal), `list_site_shares`, `share_site`, `update_site_share`, `revoke_site_share` (site admin), `create_organization_invite` (organization key) |
1141
- | **Organization publishing** | `read_organization_publishing_connections`, `disconnect_organization_publishing_provider`, `connect_organization_cloudflare`, `prepare_organization_media_storage`, `save_organization_media_access`, plus builds, Hosting Groups, domains and media migration tools (organization key) |
1186
+ | **Organization publishing** | `read_organization_publishing_connections`, `diagnose_organization_github_connection`, `disconnect_organization_publishing_provider`, `connect_organization_cloudflare`, `prepare_organization_media_storage`, `save_organization_media_access`, plus builds, Hosting Groups, domains and media migration tools (organization key) |
1142
1187
  | **Insights** | `get_site_insights` — traffic, AI-assistant referrals, and first-party conversion events over 7/30/90 days. Read-only. Traffic is powered by Cloudflare Web Analytics; conversion rows come from validated Analytics attribution `click_event` targets and can be present even when the traffic provider is unavailable. |
1143
1188
  | **Pages — reads** | `list_pages`, `read_page`, `batch_read_pages` |
1144
1189
  | **Pages — writes** | `create_page`, `update_page`, `replace_page`, `batch_update_pages`, `delete_page`, `clone_page` |
@@ -1147,7 +1192,7 @@ preview.
1147
1192
  | **Global blocks (partials)** | `list_partials` (summary by default), `read_partial`, `create_free_block` (`blocks` or `html_content`), `update_partial`, `replace_partial`, `set_partial_mode`, `delete_partial`, `find_pages_using_block`, `make_block_global`, `detach_global_block`. Block pages reference a global block with `core/global_block` (`global_block_id`); HTML pages use `<x-include>`. |
1148
1193
  | **Block templates** | `list_block_templates`, `read_block_template`, `save_block_template` (from `blocks` or `from: { page_id, block_id }`), `update_block_template`, `delete_block_template`, `insert_block_template` (copies with new ids). Per site, not per branch. |
1149
1194
  | **Styles** | `list_styles`, `create_style`, `update_style`, `delete_style`, `apply_standard_styles`. Blocks pick a style with `style_id` (heading parts: `eyebrow_style_id`, `subtitle_style_id`). Contrast below WCAG AA is refused. |
1150
- | **Block types** | `list_block_types`, `read_block_type`, `find_pages_using_block_type`, `export_block_types`, `import_block_types` |
1195
+ | **Block types** | `list_block_types`, `read_block_type`, `find_pages_using_block_type`, `list_block_type_starters`, `validate_block_type`, `preview_block_type`, `create_block_type`, `update_block_type` (`renames`, `confirm_data_loss`), `delete_block_type`, `export_block_types`, `import_block_types` (`on_conflict`: skip, rename, replace). Authoring and import need admin. |
1151
1196
  | **Content types** | `list_content_types`, `read_content_type`, `create_content_type`, `update_content_type`, `delete_content_type`, `change_page_content_type`, `page_completeness` |
1152
1197
  | **Page templates** | `list_page_templates`, `read_page_template`, `create_page_template`, `update_page_template`, `delete_page_template` |
1153
1198
  | **Media** | `get_media_upload_status`, `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` |
package/README.md CHANGED
@@ -180,6 +180,8 @@ the full reference + concrete operation recipes.
180
180
  - **Organization publishing connections** —
181
181
  `read_organization_publishing_connections` (status, revisions and
182
182
  `connect_urls` for the browser-only OAuth steps),
183
+ `diagnose_organization_github_connection` (why GitHub is not connected,
184
+ every account with the App, and who must act with one fix each),
183
185
  `disconnect_organization_publishing_provider`,
184
186
  `connect_organization_cloudflare` (customer API token),
185
187
  `prepare_organization_media_storage`, `save_organization_media_access`.