@typeroll/mcp-server 0.45.42 → 0.45.44
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 +17 -16
- package/README.md +12 -5
- package/dist/bundled-content.js +11 -10
- package/dist/server.js +15 -1
- package/dist/tools/content-types.js +2 -2
- package/dist/tools/forms.js +16 -3
- package/dist/tools/helpers.js +7 -0
- package/dist/tools/page-blocks.js +6 -20
- package/dist/tools/pages.js +11 -4
- package/dist/tools/partials.js +3 -2
- package/dist/tools/preview.js +6 -0
- package/dist/tools/reusable-blocks.js +98 -0
- package/dist/tools/settings.js +3 -2
- package/dist/tools/styles.js +108 -0
- package/dist/tools/working-copy.js +5 -3
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/README.md +1 -0
- package/skills/tr-brand.md +10 -0
- package/skills/tr-content-write.md +17 -0
- package/skills/tr-forms.md +20 -6
- package/skills/tr-import-url.md +10 -0
- package/skills/tr-migrate-wp.md +7 -2
- package/skills/tr-new-site.md +29 -7
- package/skills/tr-page-template.md +1 -1
- package/skills/tr-upgrade-rendering.md +71 -0
package/skills/tr-forms.md
CHANGED
|
@@ -6,8 +6,8 @@ description: Use when the user wants to add a contact form, newsletter signup, b
|
|
|
6
6
|
# Add a form to a Typeroll site
|
|
7
7
|
|
|
8
8
|
Typeroll forms are server-backed. The platform renders the form shell, accepts
|
|
9
|
-
signed submissions, validates declared fields, stores submissions, and
|
|
10
|
-
|
|
9
|
+
signed submissions, validates declared fields, stores submissions, and runs
|
|
10
|
+
email and webhook actions configured in the portal or through MCP/API.
|
|
11
11
|
|
|
12
12
|
## Choose the placement
|
|
13
13
|
|
|
@@ -97,9 +97,23 @@ actions in the form editor:
|
|
|
97
97
|
`X-Typeroll-Signature`, sends an idempotency key, retries transient failures,
|
|
98
98
|
and stores delivery status.
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
Agents manage the same actions with `read_form` (actions with secrets masked)
|
|
101
|
+
and `update_form patch={ actions: [...] }`, with admin permission as in the
|
|
102
|
+
portal. `actions` replaces the whole list: read the form, change what you need
|
|
103
|
+
and send the list back. Examples:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
update_form form_id=contact patch={ actions: [
|
|
107
|
+
{ type: "email", config: { to: "hello@example.com", subject: "New lead: {{name}}",
|
|
108
|
+
body: "<p>{{message}}</p>", include_all: true, reply_to: "{{email}}" } },
|
|
109
|
+
{ type: "email", config: { to: "{{email}}", subject: "Thanks, {{name}}",
|
|
110
|
+
body: "<p>We will get back to you within a day.</p>" } }
|
|
111
|
+
] }
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
A webhook needs `url` (https), an explicit `fields` allowlist and a signing
|
|
115
|
+
`secret`; send the masked value back to keep a stored secret. `list_form_submissions`
|
|
116
|
+
reads what visitors sent.
|
|
103
117
|
|
|
104
118
|
## Verify
|
|
105
119
|
|
|
@@ -143,7 +157,7 @@ Booking request:
|
|
|
143
157
|
|
|
144
158
|
- Do not hand-write a form, token, honeypot, or submit script.
|
|
145
159
|
- Do not put a raw `<script>` in page HTML; the sanitizer removes it.
|
|
146
|
-
- Do not
|
|
160
|
+
- Do not drop existing actions by accident: `actions` replaces the list.
|
|
147
161
|
- Do not send every submitted field to a webhook by default; choose the
|
|
148
162
|
smallest allowlist the external register needs.
|
|
149
163
|
- `submit_token` is stable until the platform rotates its form-signing secret;
|
package/skills/tr-import-url.md
CHANGED
|
@@ -54,6 +54,16 @@ Parse `<a href>` links to discover internal pages. Build a list:
|
|
|
54
54
|
Exclude private/session/admin URLs deliberately. Inventory public pagination and
|
|
55
55
|
query routes; decide preservation or retirement from their actual purpose.
|
|
56
56
|
|
|
57
|
+
**Map source styling to named styles.** A class the source uses for a
|
|
58
|
+
recurring treatment (`.eyebrow`, `.lead`, `.btn-outline`, `.section-dark`)
|
|
59
|
+
becomes a site style with `create_style` and is applied with `style_id`. A
|
|
60
|
+
small label directly above a heading is an eyebrow style, not a heading of its
|
|
61
|
+
own: put it in the heading block's `eyebrow` field (and a line under the
|
|
62
|
+
heading in `subtitle`). Never carry classed raw HTML into text blocks to keep a
|
|
63
|
+
look: the editor cannot edit it, and the next render version may not keep it.
|
|
64
|
+
Build such sections with heading, text, image and button blocks; Typeroll does
|
|
65
|
+
not convert HTML into blocks.
|
|
66
|
+
|
|
57
67
|
### 2. Measure the source and protect existing target work
|
|
58
68
|
|
|
59
69
|
```
|
package/skills/tr-migrate-wp.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tr-migrate-wp
|
|
3
|
-
description: Use when the user asks to migrate a WordPress site to Typeroll, mentions wp-json, or names a WP source URL. Walks the WP REST API, preserves cleaned HTML and shared references, transfers media, sets redirects, and leaves everything as drafts for human review.
|
|
3
|
+
description: Use when the user asks to migrate a WordPress site to Typeroll, mentions wp-json, or names a WP source URL. Walks the WP REST API, preserves cleaned HTML and shared references, transfers media, sets redirects, and leaves everything as drafts for human review. Typeroll does not convert HTML into blocks.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Migrate from WordPress to Typeroll
|
|
@@ -122,6 +122,11 @@ The managed importer preserves existing imported Pages on retry and refuses
|
|
|
122
122
|
URL/identity conflicts or dangling term references. An older flattened import
|
|
123
123
|
requires a separately reviewed mapping repair; do not re-import over edits.
|
|
124
124
|
|
|
125
|
+
**Styles.** Recurring source treatments (theme classes for eyebrows, leads,
|
|
126
|
+
button variants, highlighted sections) become named site styles
|
|
127
|
+
(`create_style`) applied with `style_id`, so editors can change them in one
|
|
128
|
+
place. Do not preserve them as classed raw HTML in text blocks.
|
|
129
|
+
|
|
125
130
|
### 4. Import one page at a time, draft status
|
|
126
131
|
|
|
127
132
|
For each source URL:
|
|
@@ -140,7 +145,7 @@ c. Migrate referenced images with `upload_media_from_url`. The customer's
|
|
|
140
145
|
media reference only after verification. Stop and report a failed required
|
|
141
146
|
transfer; do not silently hotlink the WordPress source.
|
|
142
147
|
|
|
143
|
-
The managed importer stores cleaned HTML
|
|
148
|
+
The managed importer stores cleaned HTML. Typeroll does not convert HTML into blocks, and `set_page_mode` never rewrites HTML. Pages move to blocks only when someone rebuilds them with blocks.
|
|
144
149
|
|
|
145
150
|
d. Preserve exact text, headings, anchors, links, media and semantic structure with native blocks first. Read the
|
|
146
151
|
available block types and map headings, prose, images, buttons and layout
|
package/skills/tr-new-site.md
CHANGED
|
@@ -129,6 +129,23 @@ the built-in YouTube/Vimeo/Google Maps/Calendly set. Values are exact domain
|
|
|
129
129
|
hostnames, never URLs or wildcards. Read the setting back before deciding that
|
|
130
130
|
an iframe cannot be represented.
|
|
131
131
|
|
|
132
|
+
### 2b. Styles before pages
|
|
133
|
+
|
|
134
|
+
Set the site's look as named styles before building any page:
|
|
135
|
+
|
|
136
|
+
1. `list_styles`. New sites already have the standard set (body, H1–H6, link,
|
|
137
|
+
lead, eyebrow, small, quote, buttons, section). If roles are missing,
|
|
138
|
+
`apply_standard_styles`.
|
|
139
|
+
2. Adjust them to the brand with `update_style`: the font, the type scale and
|
|
140
|
+
spacing for `base` (phones) and `at.tablet`/`at.desktop`, and colours from
|
|
141
|
+
palette tokens. Keep text at WCAG AA contrast; failing styles are refused.
|
|
142
|
+
3. Add a named style for every look the design repeats: a card title, a price
|
|
143
|
+
note, a highlighted section, a CTA button variant. Use the site's language
|
|
144
|
+
for names.
|
|
145
|
+
|
|
146
|
+
Pages then choose styles with each block's `style_id` field. A per-block
|
|
147
|
+
font size, colour or class is only for something clearly unique.
|
|
148
|
+
|
|
132
149
|
### 3. Header + footer partials
|
|
133
150
|
|
|
134
151
|
**Start from the native preset — don't hand-roll navigation.** Read
|
|
@@ -275,10 +292,10 @@ Known limitations (honest list — don't fight them):
|
|
|
275
292
|
client-side without the icon pipeline). Text labels only.
|
|
276
293
|
|
|
277
294
|
Theming: block primitives render neutral. Brand color/typography comes
|
|
278
|
-
from settings (step 2). For page-specific polish
|
|
279
|
-
|
|
280
|
-
`
|
|
281
|
-
|
|
295
|
+
from settings (step 2) and named styles (step 2b). For page-specific polish
|
|
296
|
+
(e.g. a colored card treatment) that no style covers, give the block a
|
|
297
|
+
`custom_class` and write the rule in the page's `custom_css`. Never put a
|
|
298
|
+
`<style>` in a `core/html` block or target `[data-bid]`/`[data-block]`.
|
|
282
299
|
|
|
283
300
|
### 5. Inner pages
|
|
284
301
|
|
|
@@ -286,6 +303,12 @@ Same pattern: `create_page` with `content_mode: "blocks"` and a section
|
|
|
286
303
|
tree. Standard set: Om oss, Tjänster, Kontakt — or what the brief says.
|
|
287
304
|
Default new pages to `status: "draft"`; publish after review.
|
|
288
305
|
|
|
306
|
+
Sections that repeat across pages: a call to action or contact strip that
|
|
307
|
+
must stay identical becomes a global block (`make_block_global`, then
|
|
308
|
+
`core/global_block` on the other pages). A section shape you will reuse with
|
|
309
|
+
different content (a pricing row, a feature trio) becomes a block template
|
|
310
|
+
(`save_block_template`, then `insert_block_template`).
|
|
311
|
+
|
|
289
312
|
### 5b. If the legacy site is still live, scrape canonical content
|
|
290
313
|
|
|
291
314
|
For pages with canonical text (privacy policy, terms, about), `WebFetch`
|
|
@@ -336,9 +359,8 @@ For migrated legacy pages or a hand-crafted one-off, `content_mode:
|
|
|
336
359
|
negative-margin escape (`margin-left: calc(50% - 50vw); width: 100vw`)
|
|
337
360
|
— never combine with `overflow-x: clip` on a wrapper.
|
|
338
361
|
- `set_page_mode` flips a page between modes and does not convert HTML.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
preview in the page editor.
|
|
362
|
+
Typeroll has no HTML-to-blocks conversion: to move a page to blocks,
|
|
363
|
+
build its content with blocks.
|
|
342
364
|
|
|
343
365
|
## Pitfalls
|
|
344
366
|
|
|
@@ -34,7 +34,7 @@ default template, and an individual Page can override it.
|
|
|
34
34
|
Prefer native image, table, list, heading and content blocks. A rare specialized
|
|
35
35
|
widget can use a reviewed HTML/embed block. Reusable custom behavior belongs in
|
|
36
36
|
one custom block type rather than repeated HTML bodies. Existing HTML-mode pages
|
|
37
|
-
may share fragments through partials and `<x-include>`, but use block templates
|
|
37
|
+
may share fragments through partials and `<x-include>`, but use block-based page templates
|
|
38
38
|
for new content families.
|
|
39
39
|
|
|
40
40
|
Header/footer partials are global and remain separate from content types. Keep
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tr-upgrade-rendering
|
|
3
|
+
description: Use when a site's platform render version is behind the latest (read_site_settings → render.version < render.latest), or the user asks to "upgrade rendering", "get the new block styles" or why a platform improvement doesn't show. Compares every page at the current and target version with screenshots, reports the differences and upgrades only with approval.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Upgrade a site's render version
|
|
7
|
+
|
|
8
|
+
Platform changes to block markup and shared CSS ship as numbered render
|
|
9
|
+
versions. A site keeps its version until someone upgrades it, so its look
|
|
10
|
+
never changes on its own. Upgrading is a single settings write, reversible by
|
|
11
|
+
writing the previous number. The comparison happens here, in the agent; the
|
|
12
|
+
server only renders previews.
|
|
13
|
+
|
|
14
|
+
The user can also do this in the portal: Settings → Rendering → "Preview with
|
|
15
|
+
version N", then "Upgrade". Offer this skill when they want a full-site visual
|
|
16
|
+
comparison first.
|
|
17
|
+
|
|
18
|
+
## Recipe
|
|
19
|
+
|
|
20
|
+
1. **Read the gap.** `read_site_settings` returns `render`:
|
|
21
|
+
`{ version, latest, upgrades: [{ version, title, changes[] }] }`. If
|
|
22
|
+
`version === latest`, stop. Tell the user what each pending version
|
|
23
|
+
changes, in their words, before measuring anything.
|
|
24
|
+
|
|
25
|
+
2. **List the pages to compare.** `list_pages` (published and unlisted), plus
|
|
26
|
+
the header/footer, which appear on every page. For a large site, compare
|
|
27
|
+
the home page, one page per content type and template, and every page
|
|
28
|
+
whose blocks use a component named in `upgrades[].changes`.
|
|
29
|
+
|
|
30
|
+
3. **Mint two links per page set.** One `get_preview_link` without
|
|
31
|
+
`render_version` (current) and one with `render_version: latest` (target).
|
|
32
|
+
Both show saved content. Mint each once and reuse it; internal links keep
|
|
33
|
+
the token.
|
|
34
|
+
|
|
35
|
+
4. **Screenshot both** at 390, 768 and 1440 px wide, full page, after fonts
|
|
36
|
+
and images have loaded (`document.fonts.ready`, scroll to the end to
|
|
37
|
+
trigger lazy images, then back to the top). Use a headless browser with a
|
|
38
|
+
fixed viewport and `reducedMotion: 'reduce'`.
|
|
39
|
+
|
|
40
|
+
5. **Compare.** Pixel-diff each pair (same size, small per-pixel tolerance)
|
|
41
|
+
and record the changed area and the bounding boxes of changed regions.
|
|
42
|
+
Crop each region from both versions. Ignore differences confined to
|
|
43
|
+
embedded third-party frames (maps, booking widgets, video).
|
|
44
|
+
|
|
45
|
+
6. **Report** per page and width: unchanged, or the cropped before/after
|
|
46
|
+
regions with a one-line description ("links in body text are underlined",
|
|
47
|
+
"section gap 8px larger"). Link each change to the version note that
|
|
48
|
+
explains it. Say plainly when a change looks like a regression.
|
|
49
|
+
|
|
50
|
+
Before screenshots, read the site and page custom CSS for selectors a
|
|
51
|
+
version note names. Version 2 moves a heading's or button's custom class
|
|
52
|
+
onto the `<h2>` or link, so `.my-class .block-heading-text` stops
|
|
53
|
+
matching; propose the rewrite (`.my-class`) or a named style.
|
|
54
|
+
|
|
55
|
+
7. **Ask before upgrading.** Never upgrade on your own. If the user wants to
|
|
56
|
+
keep a specific old look, solve it with a site style or page CSS first and
|
|
57
|
+
compare again.
|
|
58
|
+
|
|
59
|
+
8. **Upgrade** with `update_site_settings render_version: <latest>` (pass
|
|
60
|
+
`version` to do it on a branch first). The preview changes at once; the
|
|
61
|
+
live site changes at the next deploy. To undo, write the previous number.
|
|
62
|
+
|
|
63
|
+
## Pitfalls
|
|
64
|
+
|
|
65
|
+
- Comparing a draft against saved content shows content edits, not
|
|
66
|
+
rendering changes. Use the same content state for both links.
|
|
67
|
+
- Lazy images and web fonts cause false differences. Wait for them in both
|
|
68
|
+
screenshots.
|
|
69
|
+
- Comparing only the home page misses changes in components it doesn't use.
|
|
70
|
+
- Don't encode a workaround in custom CSS to resist an upgrade without
|
|
71
|
+
telling the user; it becomes a hidden fork of the platform styles.
|