@typeroll/mcp-server 0.45.44 → 0.45.45
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 +142 -29
- package/README.md +83 -20
- package/dist/bundled-content.js +7 -7
- package/dist/client.js +15 -1
- package/dist/compact-tools.js +1 -1
- package/dist/server.js +49 -2
- package/dist/tools/access.js +75 -0
- package/dist/tools/domain.js +33 -0
- package/dist/tools/email.js +69 -0
- package/dist/tools/extensions.js +131 -0
- package/dist/tools/forms.js +20 -3
- package/dist/tools/media.js +12 -0
- package/dist/tools/pages.js +1 -1
- package/dist/tools/partials.js +1 -1
- package/dist/tools/reusable-blocks.js +1 -1
- package/dist/tools/settings.js +20 -10
- package/dist/tools/sites.js +25 -3
- package/dist/tools/versions.js +21 -3
- package/dist/tools/workflows.js +61 -0
- package/dist/tools/working-copy.js +62 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/tr-forms.md +18 -4
- package/skills/tr-migrate-wp.md +7 -3
- package/skills/tr-new-site.md +3 -1
- package/skills/tr-redesign-branch.md +15 -1
- package/skills/tr-seo.md +14 -0
package/dist/tools/settings.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// Settings tools.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
1
|
+
// Settings tools. update_site_settings accepts every field the portal
|
|
2
|
+
// Settings form does — including scripts_head, scripts_body_end,
|
|
3
|
+
// custom_css, cookie-consent scripts, default_og_image, twitter_handle,
|
|
4
|
+
// organization (JSON-LD) and staging_url — with the same admin permission
|
|
5
|
+
// the portal requires. A bearer-token caller takes responsibility for what
|
|
6
|
+
// it ships, exactly as a site admin in the portal does. (The in-portal chat
|
|
7
|
+
// assistant has its own, narrower settings tool; that is unrelated to MCP.)
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { ok, withErrorBoundary, versionParam } from './helpers.js';
|
|
10
10
|
function v(version) {
|
|
@@ -13,7 +13,7 @@ function v(version) {
|
|
|
13
13
|
export const settingsTools = [
|
|
14
14
|
{
|
|
15
15
|
name: 'read_site_settings',
|
|
16
|
-
description: "Read every site setting: name, tagline, logo, favicon/app icons, colors, fonts, contact info, social links, URL trailing-slash policy, iframe host allowlist, default SEO suffix/description, language, robots_txt, image_sizes_default, plus the scriptable surfaces scripts_head, scripts_body_end, and custom_css, and `render` (the site's platform render version, the latest version and what upgrading would change). Pass `version` to read a branch's settings (with copy-on-write chain-fallback to main for fields the branch hasn't overridden).",
|
|
16
|
+
description: "Read every site setting: name, tagline, logo, favicon/app icons, colors, fonts, contact info, social links, URL trailing-slash policy, iframe host allowlist, default SEO suffix/description, default_og_image, twitter_handle, organization (JSON-LD), language, robots_txt, image_sizes_default, cookie_consent, plus the scriptable surfaces scripts_head, scripts_body_end, and custom_css, `urls` (including `urls.staging`, the site's staging_url) and `render` (the site's platform render version, the latest version and what upgrading would change). Pass `version` to read a branch's settings (with copy-on-write chain-fallback to main for fields the branch hasn't overridden).",
|
|
17
17
|
inputSchema: {
|
|
18
18
|
version: versionParam,
|
|
19
19
|
},
|
|
@@ -24,12 +24,14 @@ export const settingsTools = [
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: 'update_site_settings',
|
|
27
|
-
description: 'Patch site settings, including responsive breakpoints for block layouts and visibility. Only the fields you pass change. ' +
|
|
27
|
+
description: 'Patch site settings, including responsive breakpoints for block layouts and visibility. Accepts everything the portal Settings form does. Requires admin permission on the site, as in the portal. Only the fields you pass change. ' +
|
|
28
28
|
'Pass fields at the TOP LEVEL of the object — do NOT wrap in a "settings" key. ' +
|
|
29
29
|
'Example: {"site_name": "Acme", "colors": {"primary": "#ff0"}} not {"settings": {...}}. ' +
|
|
30
30
|
'Nested objects (colors, fonts, contact, social) are shallow-merged into the existing value. ' +
|
|
31
31
|
'Unknown top-level keys return a 400 error listing the valid fields. ' +
|
|
32
|
-
'scripts_head / scripts_body_end / custom_css ARE writable here — useful for a global stylesheet across all pages. ' +
|
|
32
|
+
'scripts_head / scripts_body_end / custom_css and cookie_consent scripts ARE writable here — useful for a global stylesheet or analytics tag across all pages. ' +
|
|
33
|
+
'Social sharing and structured data: default_og_image, twitter_handle, organization ({name, logo, same_as[]}, replaced as a whole; null clears). ' +
|
|
34
|
+
'staging_url is stored on the Site (not per version), so it applies whichever `version` you pass. ' +
|
|
33
35
|
'Pass `version` to scope the write to a branch (copy-on-write) instead of main — the right way to brand/recolor a site inside a redesign branch (colors, fonts, logo, custom_css) without touching the live settings. Omit it to write main.',
|
|
34
36
|
inputSchema: {
|
|
35
37
|
version: versionParam,
|
|
@@ -54,6 +56,14 @@ export const settingsTools = [
|
|
|
54
56
|
scripts_head: z.string().optional().describe('Raw HTML injected into <head> on every page. Use for analytics, fonts, third-party CSS links.'),
|
|
55
57
|
scripts_body_end: z.string().optional().describe('Raw HTML injected just before </body> on every page. Use for chat widgets, deferred analytics.'),
|
|
56
58
|
custom_css: z.string().optional().describe('Global CSS in a <style> in <head>, after block CSS and before the page\'s own custom CSS and the template base stylesheet (reset + global). Base rules for :root tokens (spacing, radius, container widths), body font and line-height load after it, so override those with a more specific selector (for example html:root or body.page) rather than a bare :root/body rule. Preview uses the same order. Lets you define site-wide design tokens (CSS variables, @media queries, :hover states) without inlining on every element. Prefer named styles (create_style) for anything a style can express. Syntax errors (unbalanced braces, unclosed comments or strings, expression()/javascript:) refuse the write; selectors on platform markup ([data-block], .block-*) come back as warnings because they can change between render versions — target s-<style> classes or block custom_class instead.'),
|
|
59
|
+
default_og_image: z.string().optional().describe('Site-wide fallback og:image URL for pages without their own social image. Empty string clears.'),
|
|
60
|
+
twitter_handle: z.string().optional().describe('Twitter/X handle for twitter:site, with or without the leading @ (stored without it). Empty string clears.'),
|
|
61
|
+
organization: z.object({
|
|
62
|
+
name: z.string().optional(),
|
|
63
|
+
logo: z.string().optional().describe('Absolute logo URL for the Organization JSON-LD.'),
|
|
64
|
+
same_as: z.array(z.string()).max(50).optional().describe('Profile URLs (LinkedIn, X, Facebook, …) emitted as sameAs.'),
|
|
65
|
+
}).strict().nullable().optional().describe('Organization schema.org JSON-LD emitted on every page. Replaces the stored value as a whole; null (or all-empty) clears it.'),
|
|
66
|
+
staging_url: z.string().nullable().optional().describe('URL of a staging environment for this site, reported as urls.staging. Stored on the Site, not per version. Trailing slashes are dropped; empty string or null clears.'),
|
|
57
67
|
render_version: z.number().int().min(1).optional().describe('Platform render version. Platform output changes ship as new versions so existing sites never change look on their own. Upgrade only after previewing (get_preview_link render_version) and with the user\'s approval; the tr-upgrade-rendering skill compares every page. Lowering it returns to an earlier version.'),
|
|
58
68
|
colors: z.record(z.string()).optional(),
|
|
59
69
|
fonts: z.record(z.unknown()).optional(),
|
package/dist/tools/sites.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
// Sites tools — discovery
|
|
1
|
+
// Sites tools — discovery, Site-level identity edits and the site lifecycle
|
|
2
|
+
// (archive / restore). Each maps to a v1 route with the same permission
|
|
3
|
+
// check as the corresponding portal action.
|
|
2
4
|
import { z } from 'zod';
|
|
3
5
|
import { ok, withErrorBoundary } from './helpers.js';
|
|
4
6
|
export const siteTools = [
|
|
@@ -30,7 +32,7 @@ export const siteTools = [
|
|
|
30
32
|
},
|
|
31
33
|
{
|
|
32
34
|
name: 'get_site',
|
|
33
|
-
description: 'Read this site\'s metadata (id, name, slug, domain, active version) + a urls object covering the production / fallback / preview_base URLs. Useful as a first call to confirm the key is wired up and to learn what URLs the site is reachable at.',
|
|
35
|
+
description: 'Read this site\'s metadata (id, name, slug, domain, language, ai_scripts_enabled, lifecycle {status: active|archived}, active version) + a urls object covering the production / fallback / preview_base / staging URLs. Useful as a first call to confirm the key is wired up and to learn what URLs the site is reachable at.',
|
|
34
36
|
handler: withErrorBoundary(async (_args, { client, siteId }) => {
|
|
35
37
|
const res = await client.get(siteId, '');
|
|
36
38
|
return ok(res);
|
|
@@ -65,16 +67,36 @@ export const siteTools = [
|
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
name: 'update_site',
|
|
68
|
-
description: 'Edit Site-level
|
|
70
|
+
description: 'Edit Site-level fields: name (display), slug (drives the {slug}.typeroll-fallback subdomain — kebab-case, 3-48 chars, unique across the org), domain (the customer\'s real hostname; pass "" to clear), language, and ai_scripts_enabled (the portal\'s "Allow AI to write block scripts" toggle; requires admin permission, as in the portal). For colors / fonts / contact info / tagline / staging_url use update_site_settings instead.',
|
|
69
71
|
inputSchema: {
|
|
70
72
|
name: z.string().min(1).optional(),
|
|
71
73
|
slug: z.string().optional().describe('Kebab-case identifier, 3-48 chars [a-z0-9-]. Empty string clears.'),
|
|
72
74
|
domain: z.string().optional().describe('Bare hostname e.g. "example.com". Empty string clears.'),
|
|
73
75
|
language: z.string().optional().describe('Default content language as a BCP-47 tag (e.g. "en", "sv", "en-GB"). Drives <html lang> and the default for alt-text generation. Empty string clears.'),
|
|
76
|
+
ai_scripts_enabled: z.boolean().optional().describe('"Allow AI to write block scripts": lets the in-portal chat assistant author block JavaScript for this site. API keys and MCP are not gated by it — they can always write block `script` and core/embed `js`. Requires admin permission.'),
|
|
74
77
|
},
|
|
75
78
|
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
76
79
|
const res = await client.patch(siteId, '', args);
|
|
77
80
|
return ok(res);
|
|
78
81
|
}),
|
|
79
82
|
},
|
|
83
|
+
{
|
|
84
|
+
name: 'archive_site',
|
|
85
|
+
description: 'Archive (retire) this site, the same action as Settings → Archive site in the portal. An archived site stays readable but refuses every write and publish until restored; the last published output keeps serving. Refused with 409 while a custom domain is still live or verified — move or remove the domain first. Requires an admin key of the organization that OWNS the site (a site-scoped key or the owner organization\'s org key); a key that reaches the site through a share is refused. Idempotent. Confirm with the user before calling.',
|
|
86
|
+
inputSchema: {
|
|
87
|
+
reason: z.string().max(500).optional().describe('Why the site is retired; shown in the portal.'),
|
|
88
|
+
},
|
|
89
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
90
|
+
const res = await client.post(siteId, 'lifecycle', { action: 'archive', ...(args.reason ? { reason: args.reason } : {}) });
|
|
91
|
+
return ok(res);
|
|
92
|
+
}),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'restore_site',
|
|
96
|
+
description: 'Restore an archived site so it accepts writes and publishing again, the same action as Restore in the portal. Same permission as archive_site (owner-organization admin). Idempotent: restoring an active site succeeds without change.',
|
|
97
|
+
handler: withErrorBoundary(async (_args, { client, siteId }) => {
|
|
98
|
+
const res = await client.post(siteId, 'lifecycle', { action: 'restore' });
|
|
99
|
+
return ok(res);
|
|
100
|
+
}),
|
|
101
|
+
},
|
|
80
102
|
];
|
package/dist/tools/versions.js
CHANGED
|
@@ -12,7 +12,7 @@ export const versionTools = [
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'create_branch',
|
|
15
|
-
description: "Create a copy-on-write branch from main (or the version passed in `base`) — the RECOMMENDED first step for any larger or experimental change (redesigns, multi-page edits, trying a new design direction). Work lands on the branch, never on the live main version, until you merge_branch it. New branches default to robots_blocked:true (a half-finished design can't be indexed) and get their own stable deploy address for stakeholder review: after the branch's first trigger_deploy, read it from deploy_url in list_versions or read_version (the publishing setup decides the host: under a Hosting Group it is a v-… host under that group's site address base, otherwise the address the host reported; never construct it yourself). Pass the returned id as ?version= on every subsequent read/write. When in doubt, branch — it's cheap and keeps the live site safe. The tr-redesign-branch skill (read_skill) walks the full flow.",
|
|
15
|
+
description: "Create a copy-on-write branch from main (or the version passed in `base`) — the RECOMMENDED first step for any larger or experimental change (redesigns, multi-page edits, trying a new design direction). Work lands on the branch, never on the live main version, until you merge_branch it. New branches default to robots_blocked:true (a half-finished design can't be indexed) and get their own stable deploy address for stakeholder review: after the branch's first trigger_deploy, read it from deploy_url in list_versions or read_version (the publishing setup decides the host: under a Hosting Group it is a v-… host under that group's site address base, otherwise the address the host reported; never construct it yourself). Pass the returned id as ?version= on every subsequent read/write. When in doubt, branch — it's cheap and keeps the live site safe. The tr-redesign-branch skill (read_skill) walks the full flow. Admin permission on the site is required, as in the portal.",
|
|
16
16
|
inputSchema: {
|
|
17
17
|
name: z.string().min(1),
|
|
18
18
|
base: z.string().optional().describe('Source version id; defaults to main.'),
|
|
@@ -33,16 +33,34 @@ export const versionTools = [
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: 'delete_branch',
|
|
36
|
-
description: 'Discard a branch (main cannot be deleted).',
|
|
36
|
+
description: 'Discard a branch with its overrides, tombstones and revision history (main cannot be deleted). Admin permission required.',
|
|
37
37
|
inputSchema: { version_id: z.string() },
|
|
38
38
|
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
39
39
|
const res = await client.del(siteId, `versions/${encodeURIComponent(args.version_id)}`);
|
|
40
40
|
return ok(res);
|
|
41
41
|
}),
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
name: 'diff_version',
|
|
45
|
+
description: 'Read-only: what a branch changes relative to main, per collection (pages, partials, redirects, contentTypes, pageTemplates, blockTypes): ids it adds, modifies and deletes, plus whether it overrides site settings and totalChanges. This is exactly what merge_branch would land on main and what reset_version would discard. Use it to summarise a branch for review before asking for merge approval.',
|
|
46
|
+
inputSchema: { version_id: z.string().describe('Branch id (main has nothing to diff).') },
|
|
47
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
48
|
+
const res = await client.get(siteId, `versions/${encodeURIComponent(args.version_id)}/diff`);
|
|
49
|
+
return ok(res);
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'reset_version',
|
|
54
|
+
description: 'Discard EVERY change on a branch (all overrides and deletions), so it reads straight through to main again. The branch itself, its deploy address and its revision history are kept. Destructive for the branch\'s work: run diff_version first and get explicit user approval. Returns { cleared } — the diff that was discarded. Admin permission required. Main cannot be reset.',
|
|
55
|
+
inputSchema: { version_id: z.string() },
|
|
56
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
57
|
+
const res = await client.post(siteId, `versions/${encodeURIComponent(args.version_id)}/reset`);
|
|
58
|
+
return ok(res);
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
43
61
|
{
|
|
44
62
|
name: 'merge_branch',
|
|
45
|
-
description: 'Promote a branch\'s overrides + tombstones onto main. The branch is left in place so you can keep iterating; delete_branch removes it when you\'re done.',
|
|
63
|
+
description: 'Promote a branch\'s overrides + tombstones onto main (diff_version shows exactly what will land). The branch is left in place so you can keep iterating; delete_branch removes it when you\'re done. Admin permission required.',
|
|
46
64
|
inputSchema: { version_id: z.string() },
|
|
47
65
|
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
48
66
|
const res = await client.post(siteId, `versions/${encodeURIComponent(args.version_id)}/merge`);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Workflow tools — the portal's server-side workflows (WordPress migration,
|
|
2
|
+
// AI site planning, SEO / link / performance audits, content generation and
|
|
3
|
+
// improvement, schema markup, URL parity, rebuild & deploy) and creating a
|
|
4
|
+
// Site together with its first workflow.
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { ok, versionParam, withErrorBoundary } from './helpers.js';
|
|
7
|
+
const WORKFLOW_TYPES = [
|
|
8
|
+
'migration', 'site_planning', 'seo_audit', 'content_improvement', 'link_check',
|
|
9
|
+
'performance_audit', 'content_generation', 'schema_markup', 'url_parity', 'rebuild_deploy',
|
|
10
|
+
];
|
|
11
|
+
export const workflowTools = [
|
|
12
|
+
{
|
|
13
|
+
name: 'list_workflows',
|
|
14
|
+
description: 'List the workflow types this Site can run (label, description, steps, required_permission) and its most recent runs with status. Read only. Migration, site planning and URL parity pause for review; check get_workflow for paused_for_review.',
|
|
15
|
+
inputSchema: { limit: z.number().int().min(1).max(100).optional() },
|
|
16
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, 'workflows', args.limit ? { limit: args.limit } : undefined))),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'start_workflow',
|
|
20
|
+
description: 'Start a server-side workflow on this Site; it runs in the background and returns workflow_id. Poll get_workflow. Config per type (same fields as the portal form): migration { wp_url, helper_api_key? } (needs verified organization import storage); site_planning { business_description }; content_generation { topic, tone?, audience? }; content_improvement { limit? }; url_parity { target_origin?, source_origin?, check_source?, statuses? }; rebuild_deploy { environment: staging | production }; seo_audit, link_check, performance_audit and schema_markup take none. Needs write permission; rebuild_deploy publishes and needs admin. Workflows that change content write to the given version (default main) — get the user\'s agreement first.',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: z.enum(WORKFLOW_TYPES),
|
|
23
|
+
config: z.record(z.unknown()).optional(),
|
|
24
|
+
version: versionParam,
|
|
25
|
+
},
|
|
26
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.post(siteId, 'workflows', { type: args.type, config: args.config }, args.version ? { version: args.version } : undefined))),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'get_workflow',
|
|
30
|
+
description: 'Read one workflow run: status (pending | running | paused_for_review | completed | failed), current step, progress, log, review_message/review_data when paused, results and failure_reason. Credential config is masked.',
|
|
31
|
+
inputSchema: { workflow_id: z.string() },
|
|
32
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, `workflows/${encodeURIComponent(args.workflow_id)}`))),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'approve_workflow',
|
|
36
|
+
description: 'Approve the review gate of a run that is paused_for_review; it resumes from the next step in the background. Show the user review_message and review_data from get_workflow and get their approval first — approval is theirs to give, not the tool\'s. Write permission; any other status returns 409.',
|
|
37
|
+
inputSchema: { workflow_id: z.string() },
|
|
38
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.post(siteId, `workflows/${encodeURIComponent(args.workflow_id)}/approve`))),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'create_site_and_migrate',
|
|
42
|
+
noSite: true,
|
|
43
|
+
description: 'Create a new Site in the Organization and start a WordPress migration into it, like "Migrate from WordPress" on the portal\'s New site page. Requires an organization API key and verified organization import storage (409 import_storage_required otherwise — nothing is created). Returns site and workflow ids; poll get_workflow with that site_id. Run get_migration_readiness on the new Site if you need the preflight first.',
|
|
44
|
+
inputSchema: {
|
|
45
|
+
name: z.string().min(1).describe('Site display name; slugified into the Site id.'),
|
|
46
|
+
wp_url: z.string().url().describe('Public WordPress address, e.g. https://oldsite.example.'),
|
|
47
|
+
helper_api_key: z.string().optional().describe('Typeroll Helper plugin key from the WordPress admin, if installed. Stored for the run and never returned.'),
|
|
48
|
+
},
|
|
49
|
+
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPost('sites/create-and-migrate', args))),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'create_site_and_plan',
|
|
53
|
+
noSite: true,
|
|
54
|
+
description: 'Create a new Site in the Organization and start AI site planning from a business description, like "Plan a new site with AI" on the New site page. Requires an organization API key. The plan pauses for review: read it with get_workflow and approve_workflow only after the user agrees.',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
name: z.string().min(1),
|
|
57
|
+
business_description: z.string().min(1).describe('What the business does, for whom, and what sets it apart.'),
|
|
58
|
+
},
|
|
59
|
+
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPost('sites/create-and-plan', args))),
|
|
60
|
+
},
|
|
61
|
+
];
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
// Save button)
|
|
10
10
|
// discard_working_copy → throw the draft away
|
|
11
11
|
// list/read/restore_page_revision → saved-state history (undo)
|
|
12
|
+
// preview_page_revision → render a saved state
|
|
13
|
+
// list/read/restore_partial_revision → the same for partials
|
|
12
14
|
//
|
|
13
15
|
// The portal editor shows any agent-written draft as "Unsaved changes", so
|
|
14
16
|
// the human can also Save or Discard it from the UI.
|
|
@@ -118,4 +120,64 @@ export const workingCopyTools = [
|
|
|
118
120
|
return ok(res);
|
|
119
121
|
}),
|
|
120
122
|
},
|
|
123
|
+
{
|
|
124
|
+
name: 'preview_page_revision',
|
|
125
|
+
description: 'Render one saved page revision as the whole preview document (header, body, footer, site CSS and block scripts), exactly what the editor\'s History panel shows before a restore. Read-only. The revision\'s fields are laid over the current page; the current header, footer and settings give context. Returns { page_id, revision_id, slug, title, rendered_html, internal_links }. Pass annotate:true to tag block roots with data-block-id + data-block-type. Compare with get_page_preview before restore_page_revision.',
|
|
126
|
+
inputSchema: {
|
|
127
|
+
page_id: z.string(),
|
|
128
|
+
revision_id: z.string(),
|
|
129
|
+
annotate: z.boolean().optional(),
|
|
130
|
+
version: versionParam,
|
|
131
|
+
},
|
|
132
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
133
|
+
const query = { ...(v(args.version) ?? {}) };
|
|
134
|
+
if (args.annotate)
|
|
135
|
+
query.annotate = 'true';
|
|
136
|
+
const res = await client.get(siteId, `pages/${encodeURIComponent(args.page_id)}/revisions/${encodeURIComponent(args.revision_id)}/preview`, query);
|
|
137
|
+
return ok(res);
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'list_partial_revisions',
|
|
142
|
+
description: "Saved-state history of a partial (header, footer or global block) on this version, newest first. Every save snapshots the partial as it was BEFORE the save. Returns { revisions: [{ id, created_at, created_by, note, name, content_mode, date_updated }], total }. Use read_partial_revision for the full document and restore_partial_revision to undo.",
|
|
143
|
+
inputSchema: {
|
|
144
|
+
partial_id: z.string(),
|
|
145
|
+
limit: z.number().int().min(1).max(100).optional().describe('Newest N entries (default 50).'),
|
|
146
|
+
version: versionParam,
|
|
147
|
+
},
|
|
148
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
149
|
+
const query = { ...(v(args.version) ?? {}) };
|
|
150
|
+
if (args.limit)
|
|
151
|
+
query.limit = String(args.limit);
|
|
152
|
+
const res = await client.get(siteId, `partials/${encodeURIComponent(args.partial_id)}/revisions`, query);
|
|
153
|
+
return ok(res);
|
|
154
|
+
}),
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'read_partial_revision',
|
|
158
|
+
description: 'Read one partial revision with the full saved document (name, kind, html_content or blocks, status) — compare it with read_partial before restoring.',
|
|
159
|
+
inputSchema: {
|
|
160
|
+
partial_id: z.string(),
|
|
161
|
+
revision_id: z.string(),
|
|
162
|
+
version: versionParam,
|
|
163
|
+
},
|
|
164
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
165
|
+
const res = await client.get(siteId, `partials/${encodeURIComponent(args.partial_id)}/revisions/${encodeURIComponent(args.revision_id)}`, v(args.version));
|
|
166
|
+
return ok(res);
|
|
167
|
+
}),
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'restore_partial_revision',
|
|
171
|
+
description: "Restore a partial revision's name and content (HTML or block tree) into the partial's DRAFT, replacing the current draft. Pass save:true to save it at once; the save snapshots the current partial first, so the restore is itself undoable. Status and kind are kept. A revision from the other content mode is refused (409) — switch mode first. Returns { restored_revision, saved, has_unsaved_changes, staged_fields, sanitization_warnings }.",
|
|
172
|
+
inputSchema: {
|
|
173
|
+
partial_id: z.string(),
|
|
174
|
+
revision_id: z.string(),
|
|
175
|
+
save: z.boolean().optional().describe('Save immediately (default false: leave it as an unsaved draft to preview).'),
|
|
176
|
+
version: versionParam,
|
|
177
|
+
},
|
|
178
|
+
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
179
|
+
const res = await client.post(siteId, `partials/${encodeURIComponent(args.partial_id)}/revisions/${encodeURIComponent(args.revision_id)}/restore`, { save: args.save === true }, v(args.version));
|
|
180
|
+
return ok(res);
|
|
181
|
+
}),
|
|
182
|
+
},
|
|
121
183
|
];
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/skills/tr-forms.md
CHANGED
|
@@ -112,8 +112,19 @@ update_form form_id=contact patch={ actions: [
|
|
|
112
112
|
```
|
|
113
113
|
|
|
114
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.
|
|
116
|
-
|
|
115
|
+
`secret`; send the masked value back to keep a stored secret.
|
|
116
|
+
`get_form_capabilities` lists every action type the site offers, including
|
|
117
|
+
types from installed apps, with the config fields each one takes.
|
|
118
|
+
|
|
119
|
+
Email actions send through the site's email provider. Check it with
|
|
120
|
+
`get_email_settings`; if `email` is null, connect one with `set_email_settings`
|
|
121
|
+
(for example `type: "postmark"`, `from`, `config: { server_token }`) and confirm
|
|
122
|
+
with `send_test_email`. Without a provider, submissions are stored but nobody is
|
|
123
|
+
notified. These tools need admin permission, like Settings → Email & notifications.
|
|
124
|
+
|
|
125
|
+
`list_form_submissions` reads what visitors sent, `read_form_submission` reads
|
|
126
|
+
one entry (admins also see webhook delivery status) and `delete_form_submission`
|
|
127
|
+
removes one.
|
|
117
128
|
|
|
118
129
|
## Verify
|
|
119
130
|
|
|
@@ -121,8 +132,11 @@ reads what visitors sent.
|
|
|
121
132
|
2. Preview the page and confirm the authoring reference has expanded to a form
|
|
122
133
|
with `data-tr-form-el`, a signed token, and the platform runtime.
|
|
123
134
|
3. Submit a test entry and confirm it appears in Forms → Submissions.
|
|
124
|
-
4. If a webhook is configured, confirm its delivery status
|
|
125
|
-
system's idempotency key before
|
|
135
|
+
4. If a webhook is configured, confirm its delivery status
|
|
136
|
+
(`read_form_submission`) and the receiving system's idempotency key before
|
|
137
|
+
deploying.
|
|
138
|
+
5. If an email action is configured, confirm `get_email_settings` shows a
|
|
139
|
+
provider and the test message arrived.
|
|
126
140
|
|
|
127
141
|
## Common patterns
|
|
128
142
|
|
package/skills/tr-migrate-wp.md
CHANGED
|
@@ -19,9 +19,13 @@ Its shared evidence record is required for visual acceptance.
|
|
|
19
19
|
> `trigger_deploy`. Preview your drafts with `include_working_copy: true`.
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
The platform's
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
The platform's migration workflow is the "managed" path for customers who
|
|
23
|
+
want one-click. It runs on the server and is also available to you:
|
|
24
|
+
`start_workflow type="migration" config={ wp_url }` on an existing site, or
|
|
25
|
+
`create_site_and_migrate` (organization key) for a new one; poll `get_workflow`
|
|
26
|
+
and approve its review gate only with the user's consent. This skill is the
|
|
27
|
+
"power-user" path: you do it locally, mix data sources freely, and the user
|
|
28
|
+
reviews each step in their terminal.
|
|
25
29
|
|
|
26
30
|
## Preconditions
|
|
27
31
|
|
package/skills/tr-new-site.md
CHANGED
|
@@ -32,7 +32,9 @@ wrapper. Load only the relevant guide section and recipe. Discover site apps wit
|
|
|
32
32
|
read_app_documentation when needed; do not bundle private app guides locally.
|
|
33
33
|
|
|
34
34
|
No Site yet? Use hosted MCP with an Organization key and create_site, or create it
|
|
35
|
-
in the portal.
|
|
35
|
+
in the portal. To start from an AI site plan instead of a blank Site, use
|
|
36
|
+
create_site_and_plan, poll get_workflow and approve its structure review only
|
|
37
|
+
with the user's consent. Read back its ID before editing. Use one explicit Site/Version for
|
|
36
38
|
related operations. Larger changes to an existing site should use a branch.
|
|
37
39
|
|
|
38
40
|
Before importing content or a media library, require get_import_readiness to pass.
|
|
@@ -245,6 +245,15 @@ compiled output or merge. Wait for an explicit "looks good, ship it."
|
|
|
245
245
|
|
|
246
246
|
### 7. Merge + deploy
|
|
247
247
|
|
|
248
|
+
Before asking for sign-off, summarise exactly what will land:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
diff_version version_id="<branch>" # added / modified / deleted per collection
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Then, once approved (creating and merging branches need site admin
|
|
255
|
+
permission):
|
|
256
|
+
|
|
248
257
|
```
|
|
249
258
|
merge_branch version_id="<branch>" # branch's diffs land on main
|
|
250
259
|
trigger_deploy
|
|
@@ -274,7 +283,12 @@ disk cost is tiny.)
|
|
|
274
283
|
the DB, reflects edits on reload); deploy only for the compiled static
|
|
275
284
|
output or merge (steps 6–7).
|
|
276
285
|
- **Auto-merge.** Don't `merge_branch` without explicit user sign-off.
|
|
277
|
-
Once merged, the only undo is another branch + reverse edits
|
|
286
|
+
Once merged, the only undo is another branch + reverse edits (or
|
|
287
|
+
restoring individual saved states with `restore_page_revision` /
|
|
288
|
+
`restore_partial_revision` on main).
|
|
289
|
+
- **Starting over.** To abandon a direction but keep the branch and its
|
|
290
|
+
address, `reset_version version_id="<branch>"` discards every change on it
|
|
291
|
+
(check `diff_version` and ask first); `delete_branch` removes it entirely.
|
|
278
292
|
- **Header rewrites that drop the brand block.** Even when the
|
|
279
293
|
redesign is dramatic, preserve the brand mark + the nav skeleton
|
|
280
294
|
unless the user said to redo them.
|
package/skills/tr-seo.md
CHANGED
|
@@ -97,11 +97,25 @@ batch_update_pages updates=[
|
|
|
97
97
|
OG image dimensions: 1200×630px ideal. The platform doesn't resize —
|
|
98
98
|
use a correctly-sized source image.
|
|
99
99
|
|
|
100
|
+
For pages without their own image, set a site-wide fallback and the X/Twitter
|
|
101
|
+
handle (admin permission, as in the portal Settings form):
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
update_site_settings default_og_image="<cdn_url>" twitter_handle="@acmestudio"
|
|
105
|
+
```
|
|
106
|
+
|
|
100
107
|
### 5. Add structured data (JSON-LD)
|
|
101
108
|
|
|
102
109
|
Typeroll auto-generates Article and Page schema, but you can override or
|
|
103
110
|
extend with custom JSON-LD per page. Example: LocalBusiness on the homepage.
|
|
104
111
|
|
|
112
|
+
The site-wide Organization schema comes from settings — set it once instead of
|
|
113
|
+
repeating it on every page (`null` clears it):
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
update_site_settings organization={"name":"Acme Studio","logo":"<cdn_url>","same_as":["https://www.linkedin.com/company/acme"]}
|
|
117
|
+
```
|
|
118
|
+
|
|
105
119
|
```
|
|
106
120
|
update_page page_id="home" patch={
|
|
107
121
|
"json_ld": "{\"@context\":\"https://schema.org\",\"@type\":\"LocalBusiness\",\"name\":\"Acme Studio\",\"url\":\"https://acme.se\",\"telephone\":\"+46812345\",\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":\"Drottninggatan 1\",\"addressLocality\":\"Stockholm\",\"postalCode\":\"111 51\",\"addressCountry\":\"SE\"}}"
|