@typeroll/mcp-server 0.45.166 → 0.45.167
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/dist/server.js +2 -0
- package/dist/tools/apps.js +2 -2
- package/dist/tools/clipboard.js +5 -3
- package/dist/tools/collection.js +4 -2
- package/dist/tools/deploy.js +3 -3
- package/dist/tools/domain.js +26 -2
- package/dist/tools/email.js +6 -6
- package/dist/tools/media.js +1 -1
- package/dist/tools/packages.js +4 -2
- package/dist/tools/sites.js +5 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -128,6 +128,8 @@ export function effectFor(name) {
|
|
|
128
128
|
|| name === 'restore_site'
|
|
129
129
|
|| name === 'purge_site_media'
|
|
130
130
|
|| name === 'replace_media'
|
|
131
|
+
// Publishing a PDF makes it public like a deploy; the routes require Site admin.
|
|
132
|
+
|| name === 'publish_media_file'
|
|
131
133
|
// Irreversible removal of published copies; owner-organization admin, as the route enforces.
|
|
132
134
|
|| name === 'remove_published_media_copies'
|
|
133
135
|
// Owner authority is checked by the route; admin is the least it needs.
|
package/dist/tools/apps.js
CHANGED
|
@@ -29,7 +29,7 @@ export const appTools = [
|
|
|
29
29
|
{
|
|
30
30
|
name: 'read_app',
|
|
31
31
|
description: 'Read one Typeroll app by registry id, including its field schema and masked state. Use list_apps to discover ids and required config fields. Secret values are never returned. For setup guidance without admin access, use read_app_documentation. Admin permission required. ' +
|
|
32
|
-
'For analytics, `setup` reports its Cloudflare Web Analytics site: status "ready" with the account it lives in (`account.owner` "organization" = the Cloudflare account of the site\'s Hosting Group, used for customer publishing; "installation" = the installation\'s own account, used for managed and self-hosted sites), or "action_required" with `code`, `message`, `next_step` and optional `settings_url` (for example analytics_site_disabled: Cloudflare has the Web Analytics site turned off and ignores the beacon; analytics_site_host_mismatch: the site is labelled with another host). ' +
|
|
32
|
+
'For analytics, `setup` reports its Cloudflare Web Analytics site: status "ready" with the account it lives in (`account.owner` "organization" = the Cloudflare account of the site\'s Hosting Group, used for customer publishing; "installation" = the installation\'s own account, used for managed and self-hosted sites), or "action_required" with `code`, `message`, `next_step` and optional `settings_url` (for example analytics_site_disabled: Cloudflare has the Web Analytics site turned off and ignores the beacon; analytics_site_host_mismatch: the site is labelled with another host; a site for a zone covers every host in it, and a *.zone host every subdomain). ' +
|
|
33
33
|
'With Analytics disabled, `setup` is null, or status "warning" with code analytics_events_not_recorded when its config still has event_rules: events that installed apps send for those rules are not recorded until Analytics is enabled and the site published. An app that relies on Analytics must check that `state.enabled` is true and `setup.status` is "ready".',
|
|
34
34
|
inputSchema: {
|
|
35
35
|
app_id: z.string().min(1).describe('Registry id returned by list_apps, for example analytics or integrations.'),
|
|
@@ -42,7 +42,7 @@ export const appTools = [
|
|
|
42
42
|
name: 'update_app',
|
|
43
43
|
description: 'Enable, configure, or disable any registered Typeroll app through the same admin API key used for publishing. Read the app first and send config keys from its field schema. Omitted fields preserve existing values, including encrypted secrets; secret values are masked on reads and encrypted server-side on writes. If affects_build is true, trigger_deploy is required to publish the change. For setup guidance without admin access, use read_app_documentation. Admin permission required. ' +
|
|
44
44
|
'Analytics: enabling creates the Cloudflare Web Analytics site in the account that hosts the site (customer publishing: the Hosting Group\'s Cloudflare connection, never the installation\'s account) and fills beacon_token and site_tag; a pasted beacon_token is resolved to its site_tag in that same account. Typeroll then checks that Cloudflare has that Web Analytics site enabled and labelled with the site\'s host. ' +
|
|
45
|
-
'When no beacon could be set up, the call fails with HTTP 409, a stable `code` (for example analytics_cloudflare_access_required, analytics_cloudflare_connection_required, analytics_host_required, analytics_provider_error, analytics_token_not_in_account) and `details.next_step`;
|
|
45
|
+
'When no beacon could be set up, the call fails with HTTP 409, a stable `code` (for example analytics_cloudflare_access_required, analytics_cloudflare_connection_required, analytics_host_required, analytics_provider_error, analytics_token_not_in_account) and `details.next_step`; `details.saved` says whether the enabled state was stored. A Web Analytics site that Cloudflare has turned off answers 200 with the token saved and setup.status "action_required", setup.code analytics_site_disabled: enable it in Cloudflare, then call update_app again. Relay the next step to the person (approving Cloudflare permissions needs an organization owner or admin in the browser: one "Approve update" per Cloudflare account on the Publishing page, or on older deployments "Approve Analytics access" on the module), then call update_app again. A 200 response carries `setup` too. Check diagnose_organization_cloudflare_connection permissions first to see whether the hosting account may create Web Analytics sites. To choose several Sites at once use set_organization_analytics.',
|
|
46
46
|
inputSchema: {
|
|
47
47
|
app_id: z.string().min(1).describe('Registry id returned by list_apps.'),
|
|
48
48
|
enabled: z.boolean(),
|
package/dist/tools/clipboard.js
CHANGED
|
@@ -6,10 +6,11 @@ import { z } from 'zod';
|
|
|
6
6
|
import { ok, versionParam, withErrorBoundary } from './helpers.js';
|
|
7
7
|
const v = (version) => (version ? { version } : undefined);
|
|
8
8
|
const STYLES = 'Into another site, the styles the blocks use are created there, never mapped to "nearest" styles: one the site has with another definition is created under a new id (hero-2, "Hero (imported)") and the pasted blocks are rewritten to it; an identical one is reused. Site block types and free global blocks follow the same rule, app blocks reconnect to the app when the site has it installed, and links to the source site\'s pages become plain addresses. Each media file is copied into the site\'s Media library only when this connection may read the site it came from (an organization key reads the organization\'s sites, a site key only its own); a private file it cannot read is left out with a warning. Into the same site the blocks are placed as they are.';
|
|
9
|
+
const SCRIPTS = 'Blocks can carry JavaScript that runs in visitors\' browsers; copy_blocks lists each in scripts. paste_blocks refuses blocks that add JavaScript, also within one site, with 400 package_scripts_confirmation_required (details.scripts) unless allow_scripts is true. Show the user the scripts and ask; never set allow_scripts on your own.';
|
|
9
10
|
export const clipboardTools = [
|
|
10
11
|
{
|
|
11
12
|
name: 'copy_blocks',
|
|
12
|
-
description: 'Copy blocks of a page\'s draft (with everything inside them) to a clipboard, as Cmd/Ctrl+C does in the block editor. Returns { clipboard, count: { top, total }, warnings }: clipboard is a JSON text marked "typeroll_clipboard" that holds the blocks in page order with the styles, site block types and free global blocks they use; media stay at their addresses. Pass clipboard unchanged to paste_blocks on this or another site. A person can paste the same text in the block editor with Cmd/Ctrl+V. Writes nothing.',
|
|
13
|
+
description: 'Copy blocks of a page\'s draft (with everything inside them) to a clipboard, as Cmd/Ctrl+C does in the block editor. Returns { clipboard, count: { top, total }, warnings, scripts }: clipboard is a JSON text marked "typeroll_clipboard" that holds the blocks in page order with the styles, site block types and free global blocks they use; media stay at their addresses. Pass clipboard unchanged to paste_blocks on this or another site. A person can paste the same text in the block editor with Cmd/Ctrl+V. Writes nothing.',
|
|
13
14
|
inputSchema: {
|
|
14
15
|
page_id: z.string().min(1),
|
|
15
16
|
block_ids: z.array(z.string().min(1)).min(1).max(200).describe('Ids of the blocks to copy (from read_page); a block inside another listed block comes with it.'),
|
|
@@ -17,12 +18,12 @@ export const clipboardTools = [
|
|
|
17
18
|
},
|
|
18
19
|
handler: withErrorBoundary(async ({ version, ...body }, { client, siteId }) => {
|
|
19
20
|
const result = await client.post(siteId, 'clipboard/copy', body, v(version));
|
|
20
|
-
return ok({ clipboard: result.clipboard_text, count: result.count, warnings: result.warnings });
|
|
21
|
+
return ok({ clipboard: result.clipboard_text, count: result.count, warnings: result.warnings, scripts: result.scripts });
|
|
21
22
|
}),
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
name: 'paste_blocks',
|
|
25
|
-
description: 'Paste blocks from copy_blocks (or text a person copied in the block editor) into a page\'s draft, with new block ids: after after_block_id (in that block\'s parent or slot when it is nested), or at position (top level, or in parent_id / slot_index); at the end by default. Returns { report, page: { id, added_ids, blocks }, mode (same_site | other_site), media: { copied, reused, left_out, kept_external }, message }; save the page to publish the change. ' + STYLES,
|
|
26
|
+
description: 'Paste blocks from copy_blocks (or text a person copied in the block editor) into a page\'s draft, with new block ids: after after_block_id (in that block\'s parent or slot when it is nested), or at position (top level, or in parent_id / slot_index); at the end by default. Returns { report, page: { id, added_ids, blocks }, mode (same_site | other_site), media: { copied, reused, left_out, kept_external }, message }; save the page to publish the change. ' + STYLES + ' ' + SCRIPTS,
|
|
26
27
|
inputSchema: {
|
|
27
28
|
clipboard: z.string().min(1).describe('The clipboard text from copy_blocks, unchanged.'),
|
|
28
29
|
page_id: z.string().min(1),
|
|
@@ -30,6 +31,7 @@ export const clipboardTools = [
|
|
|
30
31
|
position: z.number().int().min(0).optional(),
|
|
31
32
|
parent_id: z.string().nullable().optional(),
|
|
32
33
|
slot_index: z.number().int().min(0).optional(),
|
|
34
|
+
allow_scripts: z.boolean().optional().describe('true: the user reviewed the JavaScript the blocks add (scripts from copy_blocks) and allows it on this site.'),
|
|
33
35
|
version: versionParam,
|
|
34
36
|
},
|
|
35
37
|
handler: withErrorBoundary(async ({ version, ...body }, { client, siteId }) => ok(await client.post(siteId, 'clipboard/paste', Object.fromEntries(Object.entries(body).filter(([, value]) => value !== undefined)), v(version)))),
|
package/dist/tools/collection.js
CHANGED
|
@@ -9,6 +9,7 @@ const v = (version) => (version ? { version } : undefined);
|
|
|
9
9
|
const entryId = z.string().regex(/^[a-z0-9][a-z0-9_-]{0,79}$/).describe('Entry id from list_collection_entries.');
|
|
10
10
|
const WHO = 'The collection belongs to the site\'s organization and is visible to its owners, administrators and builders; a client given one site through a share never sees it (404), nor does a site-scoped key. Typeroll\'s built-in starters are listed as read-only entries.';
|
|
11
11
|
const STYLES = 'Inserting is a package import: every style the entry uses is created on the site, never mapped to a "nearest" style; a differing style with the same id is created under a new id (hero-2, "Hero (imported)") and the inserted content is rewritten to it. Block types and global blocks follow the same rule; media is copied into the site\'s Media library.';
|
|
12
|
+
const SCRIPTS = 'An entry can carry JavaScript that runs in visitors\' browsers; read_collection_entry lists each in scripts. insert_from_collection refuses an insert that adds JavaScript with 400 package_scripts_confirmation_required (details.scripts) unless allow_scripts is true. Show the user the scripts and ask; never set allow_scripts on your own.';
|
|
12
13
|
export const collectionTools = [
|
|
13
14
|
{
|
|
14
15
|
name: 'list_collection_entries',
|
|
@@ -19,7 +20,7 @@ export const collectionTools = [
|
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
22
|
name: 'read_collection_entry',
|
|
22
|
-
description: 'Read one collection entry with its whole package (blocks, styles, block types, global blocks, media list).',
|
|
23
|
+
description: 'Read one collection entry with its whole package (blocks, styles, block types, global blocks, media list) and the JavaScript it carries (scripts).',
|
|
23
24
|
inputSchema: { entry_id: entryId, version: versionParam },
|
|
24
25
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, `collection/${encodeURIComponent(args.entry_id)}`, v(args.version)))),
|
|
25
26
|
},
|
|
@@ -45,7 +46,7 @@ export const collectionTools = [
|
|
|
45
46
|
},
|
|
46
47
|
{
|
|
47
48
|
name: 'insert_from_collection',
|
|
48
|
-
description: 'Insert a collection entry into this site. target "library" adds the block template, page template, global block or block type (a built-in header or footer replaces the site\'s own; a whole package imports its content). target "page" places a section\'s, block template\'s or free global block\'s blocks in the page\'s draft: after after_block_id (in that block\'s parent or slot when it is nested), or at position (top level, or in parent_id / slot_index); at the end by default. Returns { report, page?: { id, added_ids, blocks } }; save the page to publish the change. ' + STYLES,
|
|
49
|
+
description: 'Insert a collection entry into this site. target "library" adds the block template, page template, global block or block type (a built-in header or footer replaces the site\'s own; a whole package imports its content). target "page" places a section\'s, block template\'s or free global block\'s blocks in the page\'s draft: after after_block_id (in that block\'s parent or slot when it is nested), or at position (top level, or in parent_id / slot_index); at the end by default. Returns { report, page?: { id, added_ids, blocks } }; save the page to publish the change. ' + STYLES + ' ' + SCRIPTS,
|
|
49
50
|
inputSchema: {
|
|
50
51
|
entry_id: entryId,
|
|
51
52
|
target: z.enum(['library', 'page']).default('library'),
|
|
@@ -54,6 +55,7 @@ export const collectionTools = [
|
|
|
54
55
|
position: z.number().int().min(0).optional(),
|
|
55
56
|
parent_id: z.string().nullable().optional(),
|
|
56
57
|
slot_index: z.number().int().min(0).optional(),
|
|
58
|
+
allow_scripts: z.boolean().optional().describe('true: the user reviewed the JavaScript the entry adds (scripts from read_collection_entry) and allows it on this site.'),
|
|
57
59
|
version: versionParam,
|
|
58
60
|
},
|
|
59
61
|
handler: withErrorBoundary(async ({ entry_id, version, ...body }, { client, siteId }) => ok(await client.post(siteId, `collection/${encodeURIComponent(entry_id)}/insert`, Object.fromEntries(Object.entries(body).filter(([, value]) => value !== undefined)), v(version)))),
|
package/dist/tools/deploy.js
CHANGED
|
@@ -6,13 +6,13 @@ function v(version) {
|
|
|
6
6
|
export const deployTools = [
|
|
7
7
|
{
|
|
8
8
|
name: 'get_publication_impact',
|
|
9
|
-
description: 'Read where a deploy lands and provisional net saved public-source changes against the selected version’s last verified publication. targets lists every public URL the publication serves (live domains first, then the temporary address); production: true means the site is cut over and a deploy publishes to live_domains. Reports additions, removals, shared inputs, metadata-only changes and unavailable baselines. changes_known: false (comparison baseline_unavailable) means nothing was compared: total 0 and an empty changes list then mean UNKNOWN, not no changes; baseline.reason says why (not_published, publication_not_verified, snapshot_without_source_baseline, baseline_snapshot_unreadable, baseline_identity_mismatch) and baseline.message what to do: the next publication still publishes every saved page; publish once to record a baseline, and use trigger_deploy dry_run: true meanwhile to validate the saved source (a dry run does not build). platform_changes lists what Typeroll itself changed since the baseline (id core_commit or extension_runtime, with before, after and affects_output), never counted in total or changes: it is not an edit to the site; extension_runtime affects output only on a site with Extension installations. build_engine compares the Node.js version the organization’s selected build engine runs (node_version) with the one this Typeroll builds with (required_node_version); blocks_publication: true means the publication is refused until an organization admin updates the engine (setup_organization_build_engine), while with auto_update on the publication updates the engine before it builds. Does not build or deploy. From Core 0.3.53, build_forecast reports mode full/automatic/unknown, fixed reasons and cache availability/size after scoped metadata checks; automatic means eligible, not guaranteed route reuse. A Core release label alone need not invalidate identical rendering code. execution is automatic and reuse_verified is false before the build; inspect job.render_report afterwards for actual rendered/reused counts; source-level classification does not prove output reuse or cost savings.',
|
|
9
|
+
description: 'Read where a deploy lands and provisional net saved public-source changes against the selected version’s last verified publication. targets lists every public URL the publication serves (live domains first, then the temporary address); production: true means the site is cut over and a deploy publishes to live_domains. Reports additions, removals, shared inputs, metadata-only changes and unavailable baselines. changes_known: false (comparison baseline_unavailable) means nothing was compared: total 0 and an empty changes list then mean UNKNOWN, not no changes; baseline.reason says why (not_published, publication_not_verified, snapshot_without_source_baseline, baseline_snapshot_unreadable, baseline_identity_mismatch) and baseline.message what to do: the next publication still publishes every saved page; publish once to record a baseline, and use trigger_deploy dry_run: true meanwhile to validate the saved source (a dry run does not build). platform_changes lists what Typeroll itself changed since the baseline (id core_commit or extension_runtime, with before, after and affects_output), never counted in total or changes: it is not an edit to the site; extension_runtime affects output only on a site with Extension installations. A changed configuration entry lists changed_by (who or what changed it after the baseline) only for a caller acting for the organization that owns the site; a site shared with another organization gets each change without changed_by. build_engine compares the Node.js version the organization’s selected build engine runs (node_version) with the one this Typeroll builds with (required_node_version); blocks_publication: true means the publication is refused until an organization admin updates the engine (setup_organization_build_engine), while with auto_update on the publication updates the engine before it builds. Does not build or deploy. From Core 0.3.53, build_forecast reports mode full/automatic/unknown, fixed reasons and cache availability/size after scoped metadata checks; automatic means eligible, not guaranteed route reuse. A Core release label alone need not invalidate identical rendering code. execution is automatic and reuse_verified is false before the build; inspect job.render_report afterwards for actual rendered/reused counts; source-level classification does not prove output reuse or cost savings.',
|
|
10
10
|
inputSchema: { version: versionParam },
|
|
11
11
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, 'publishing/impact', v(args.version)))),
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'get_publication_plan',
|
|
15
|
-
description: 'Read, before publishing, one answer for the selected version: verdict (ready, ready_with_notes or blocked); blockers (what refuses the publication now: build setup, a build engine whose Node.js is older than this Typeroll requires, a publication of this site already running, content that cannot be compared); notes (what only makes it slower: the engine is updated first, images still being prepared, other builds in the organization first, every page rebuilt); steps (what is left, in order, each with the tool that does it); targets and production as in get_publication_impact; estimate (typical_minutes from the site’s last successful publications and what makes this one longer); build_engine (node_version, required_node_version, auto_update, blocks_publication); and impact, the full get_publication_impact comparison, where each changed configuration entry lists details (the paths that changed, with before and after for technical settings the site publishes such as extension versions and endpoints; only the path for site settings) and changed_by (extension releases used automatically, installation and app changes, extension audit events and API writes after the baseline, with times and actor ids; or details_unavailable when the baseline predates recorded paths). Read only: it starts no engine update and no publication. Requires a site API key; REST: GET /api/v1/sites/{siteId}/publishing/plan.',
|
|
15
|
+
description: 'Read, before publishing, one answer for the selected version: verdict (ready, ready_with_notes or blocked); blockers (what refuses the publication now: build setup, a build engine whose Node.js is older than this Typeroll requires, a publication of this site already running, content that cannot be compared); notes (what only makes it slower: the engine is updated first, images still being prepared, other builds in the organization first, every page rebuilt); steps (what is left, in order, each with the tool that does it); targets and production as in get_publication_impact; estimate (typical_minutes from the site’s last successful publications and what makes this one longer); build_engine (node_version, required_node_version, auto_update, blocks_publication); and impact, the full get_publication_impact comparison, where each changed configuration entry lists details (the paths that changed, with before and after for technical settings the site publishes such as extension versions and endpoints; only the path for site settings) and changed_by (extension releases used automatically, installation and app changes, extension audit events and API writes after the baseline, with times and actor ids; or details_unavailable when the baseline predates recorded paths); builds_ahead (the organization’s other builds that run first). A caller outside the organization that owns the site, such as an organization the site is shared with, gets only this site’s builds in builds_ahead and no changed_by. Read only: it starts no engine update and no publication. Requires a site API key; REST: GET /api/v1/sites/{siteId}/publishing/plan.',
|
|
16
16
|
inputSchema: { version: versionParam },
|
|
17
17
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.get(siteId, 'publishing/plan', v(args.version)))),
|
|
18
18
|
},
|
|
@@ -49,7 +49,7 @@ export const deployTools = [
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
name: 'get_deploy_status',
|
|
52
|
-
description: "Status of a single deploy job. Optional top-level build_progress reports the exact task status, attempt, step and completed/total files; not an overall percentage or ETA. Media preparation runs in windows of about 12 minutes that each save their position, so attempt rises in a healthy build: media_continuations counts those planned windows, retries counts failed runs started again, and deadline is when the build stops for good. Do not cancel while completed still rises. While a build or verification step waits for a runner, build_progress.status is queued, deadline is null (its working time starts when a runner claims it) and build_progress.queue says why: { state, message, queued_at, queued_for_seconds, provider, provider_status, ahead, ahead_kinds, running_kinds, expires_at }. state waiting_for_provider means nothing in this organization is ahead and the provider has not started a runner yet (provider_status is the provider's own status, e.g. queued or initializing; running_kinds lists this organization's other builds on the same account, such as media_preparation); waiting_for_other_builds means ahead other builds of this organization run first. job.phase carries the same message. A queued build is normal and can wait many minutes: keep polling (every 30–60 s is enough) and do not retrigger, cancel or start another publication. Only a step that no runner claims by expires_at (6 hours) fails, with job.failure.code build_queue_timeout. Returns { job, queued_for_seconds, queue_timeout_seconds }. job.targets and job.production, when present, record where the publication was admitted to publish and whether that included a live domain. job.status is one of queued | running | succeeded | failed. On a failed build, job.error names the failed step and the cause the step printed, job.failure.code is the reported code (e.g. media_build_process_exit_1) and job.failure.diagnostic holds { cause, lines } (the last 40 lines that step printed, credentials removed). On the Cloudflare build engine job.failure.provider_log also holds { step, build_id, summary, lines } from the provider's build log (last 60 lines). Read them before retrying; retrying does not fix a cause that is in the content or the build engine. From Core 0.3.55, job.pages_cache_retention records removed public URLs retained by Pages after exact static candidate verification: each entry includes origin, route, checked_at, actual_status 200, expected_status 404, uncached_status 404 and safe cache headers. A succeeded job with these observations is published with a cache warning, not proof of immediate public removal; report it to the user and do not rebuild to clear the cache. Current file bytes and exact candidate checks must still pass. job.transport_compression, when present, says whether the publication sends compressed HTML on its website host: state enabled (Typeroll's Cloudflare Configuration Rule response_body_buffering none was read back for hosts, so those hosts drop no-transform), permission_required (relay next_step: Approve update for config-settings.read/write), unavailable or
|
|
52
|
+
description: "Status of a single deploy job. Optional top-level build_progress reports the exact task status, attempt, step and completed/total files; not an overall percentage or ETA. Media preparation runs in windows of about 12 minutes that each save their position, so attempt rises in a healthy build: media_continuations counts those planned windows, retries counts failed runs started again, and deadline is when the build stops for good. Do not cancel while completed still rises. While a build or verification step waits for a runner, build_progress.status is queued, deadline is null (its working time starts when a runner claims it) and build_progress.queue says why: { state, message, queued_at, queued_for_seconds, provider, provider_status, ahead, ahead_kinds, running_kinds, expires_at }. state waiting_for_provider means nothing in this organization is ahead and the provider has not started a runner yet (provider_status is the provider's own status, e.g. queued or initializing; running_kinds lists this organization's other builds on the same account, such as media_preparation); waiting_for_other_builds means ahead other builds of this organization run first. job.phase carries the same message. A queued build is normal and can wait many minutes: keep polling (every 30–60 s is enough) and do not retrigger, cancel or start another publication. Only a step that no runner claims by expires_at (6 hours) fails, with job.failure.code build_queue_timeout. Returns { job, queued_for_seconds, queue_timeout_seconds }. job.targets and job.production, when present, record where the publication was admitted to publish and whether that included a live domain. job.status is one of queued | running | succeeded | failed. On a failed build, job.error names the failed step and the cause the step printed, job.failure.code is the reported code (e.g. media_build_process_exit_1) and job.failure.diagnostic holds { cause, lines } (the last 40 lines that step printed, credentials removed). On the Cloudflare build engine job.failure.provider_log also holds { step, build_id, summary, lines } from the provider's build log (last 60 lines). Read them before retrying; retrying does not fix a cause that is in the content or the build engine. From Core 0.3.55, job.pages_cache_retention records removed public URLs retained by Pages after exact static candidate verification: each entry includes origin, route, checked_at, actual_status 200, expected_status 404, uncached_status 404 and safe cache headers. A succeeded job with these observations is published with a cache warning, not proof of immediate public removal; report it to the user and do not rebuild to clear the cache. Current file bytes and exact candidate checks must still pass. job.transport_compression, when present, says whether the publication sends compressed HTML on its website host: state enabled (Typeroll's Cloudflare Configuration Rule response_body_buffering none was read back for hosts, so text responses on those hosts drop no-transform; images, video, audio, fonts and PDFs keep it), permission_required (relay next_step: Approve update for config-settings.read/write), unavailable, not_applicable, or degraded with code rule_changed (the rule no longer read back exactly right before the deployment went live; the publication still went live and the next publication checks the rule again), with code and message. It never blocks a publication, and every state but enabled and degraded keeps no-transform and exact bytes. job.warnings, when present, lists non-blocking findings of a deploy that still ran, for example a media file left out of the publication because it could not be published safely (an SVG that could not be sanitized) or because it was missing and the deploy accepted that (accept_missing_media); report them to the user. A failed job with job.failure.code media_missing lists the referenced files whose copy to media storage failed in job.failure.missing_media (at most 100; missing_media_total counts them all): retry the media migration or re-import them, or ask the owner whether to publish with accept_missing_media: true. Polling cadence: ~5s for queued/running. job.render_report, when present, reports actual HTML mode (full/partial), rendered, reused, total and removed route counts plus a fallback reason. From Core 0.3.53, optional render_report.cache separates read/save state, encoding, retained/omitted routes, bounded byte counts, renderer/global/runtime invalidations and transfer/storage failures. Transfer details require an updated organization engine; inspect them before retrying a full-render publication. From Core 0.2.17, custom blocks and consumed image metadata are tracked per route; older caches require one full build. It does not measure media or provider startup savings. job.coordinator, when present, reports the last completed CMS phase and duration_ms for that attempt; external build waiting is excluded. Keep observing the same job across checkpoints; do not trigger duplicate deploys. A job whose own status stays 'queued' (not a queued build step, which runs under job.status running) for longer than queue_timeout_seconds (default 300s) auto-flips to failed with phase='queue_timeout' — so a single poll past that timestamp returns the terminal state and you can stop polling.",
|
|
53
53
|
inputSchema: { job_id: z.string(), diagnostics: z.boolean().optional().describe('Read bounded numeric build phase/media timings. For an older Cloudflare engine, reads the completed job\'s provider log once; returns no raw logs or credentials and starts no build. Missing measurements are not zero.'), include_provider: z.boolean().optional().describe('Also read the exact Git commit and Cloudflare build stages for a customer Git publication. Does not return build secrets.') },
|
|
54
54
|
handler: withErrorBoundary(async (args, { client, siteId }) => {
|
|
55
55
|
const route = `deploys/${encodeURIComponent(args.job_id)}`;
|
package/dist/tools/domain.js
CHANGED
|
@@ -103,7 +103,7 @@ export const domainTools = [
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
name: 'read_organization_build_engine', noSite: true,
|
|
106
|
-
description: 'Read the selected provider, saved Cloudflare and GitHub build engines, and active jobs for the organization (each with job_id, site_id, kind and status: queued, running, or publishing while a built publication uploads and verifies; image preparation jobs are media-…). A queued job also has queue (the same object as get_deploy_status build_progress.queue: waiting_for_provider while the provider has not started a runner yet, waiting_for_other_builds while other jobs in this organization go first) and phase, its message; queueing is normal, do not retrigger. A job stays listed until its deploy reaches a final status, except a domain switch that is built and verified and only waits for DNS approval: it is listed under awaiting_approval, uses no build capacity, and does not block other sites from publishing. selection.auto_update says whether outdated engines are updated by the next publication (set_organization_build_auto_update); each engine (and the selected one at the top level) has node_version (the Node.js version its builds run on) and required_node_version (the one this Typeroll builds with), update_available (boolean) and update_reason: engine_source_changed (older code than this Typeroll; publishing still works) or capability_missing (publishing is blocked until the engine is updated), else null. With selection.auto_update on, the next publication applies the update first; otherwise an organization admin updates it with setup_organization_build_engine when no build is running. Requires an organization API key; REST: GET /api/v1/publishing/builds. No provider credentials are returned.',
|
|
106
|
+
description: 'Read the selected provider, saved Cloudflare and GitHub build engines, and active jobs for the organization (each with job_id, site_id, kind and status: queued, running, or publishing while a built publication uploads and verifies; image preparation jobs are media-…). A queued job also has queue (the same object as get_deploy_status build_progress.queue: waiting_for_provider while the provider has not started a runner yet, waiting_for_other_builds while other jobs in this organization go first) and phase, its message; queueing is normal, do not retrigger. A job stays listed until its deploy reaches a final status, except a domain switch that is built and verified and only waits for DNS approval: it is listed under awaiting_approval, uses no build capacity, and does not block other sites from publishing. selection.auto_update says whether outdated engines are updated by the next publication (set_organization_build_auto_update); local_builds { enabled, sites, fallback_ms } says which Sites local build agents build (set_organization_local_builds, list_organization_build_agents), an active job has runner { type: agent, agent_id, name } while a build agent runs it, and a queued job kept for a build agent has queue.state waiting_for_build_agent with fallback_at, when the cloud engine builds it instead; each engine (and the selected one at the top level) has node_version (the Node.js version its builds run on) and required_node_version (the one this Typeroll builds with), update_available (boolean) and update_reason: engine_source_changed (older code than this Typeroll; publishing still works) or capability_missing (publishing is blocked until the engine is updated), else null. With selection.auto_update on, the next publication applies the update first; otherwise an organization admin updates it with setup_organization_build_engine when no build is running. Requires an organization API key; REST: GET /api/v1/publishing/builds. No provider credentials are returned.',
|
|
107
107
|
inputSchema: {},
|
|
108
108
|
handler: withErrorBoundary(async (_args, { client }) => ok(await client.rootGet('publishing/builds'))),
|
|
109
109
|
},
|
|
@@ -125,6 +125,30 @@ export const domainTools = [
|
|
|
125
125
|
inputSchema: { enabled: z.boolean(), revision: z.string() },
|
|
126
126
|
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPost('publishing/builds', { ...args, action: 'auto_update' }))),
|
|
127
127
|
},
|
|
128
|
+
{
|
|
129
|
+
name: 'set_organization_local_builds', noSite: true,
|
|
130
|
+
description: 'Choose which Sites the organization’s local build agents (the Typeroll Build Agent app on members’ own computers) build, and how long a queued build waits for one. enabled turns local builds on or off; sites is "all" or a list of this organization’s Site ids; fallback_ms (15000–600000, default 60000) is how long a queued build of an enabled Site waits for a ready agent before the organization’s cloud build engine builds it. Omitted fields keep their value. A step an agent already started is never cancelled. The current settings are local_builds in read_organization_build_engine. Requires an organization API key and selection.revision from read_organization_build_engine (a stale revision is refused with build_settings_changed and details.current_revision); REST: POST /api/v1/publishing/builds with action local_builds.',
|
|
131
|
+
inputSchema: { revision: z.string(), enabled: z.boolean().optional(), sites: z.union([z.literal('all'), z.array(z.string()).max(500)]).optional(), fallback_ms: z.number().int().min(15000).max(600000).optional() },
|
|
132
|
+
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPost('publishing/builds', { ...args, action: 'local_builds' }))),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'list_organization_build_agents', noSite: true,
|
|
136
|
+
description: 'List the organization’s local build agents: name, platform, concurrency, scope (organization or one Site), status (online, busy, offline, deactivated or revoked; online means a heartbeat in the last 30 seconds), last_heartbeat_at, current_work (Site, step kind, stage, progress 0–1) and who approved it, plus local_builds. Never returns agent secrets. Agents are registered only from the Typeroll Build Agent app with an owner’s or admin’s approval. Requires an organization API key; REST: GET /api/v1/publishing/build-agents.',
|
|
137
|
+
inputSchema: {},
|
|
138
|
+
handler: withErrorBoundary(async (_args, { client }) => ok(await client.rootGet('publishing/build-agents'))),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'set_organization_build_agent_active', noSite: true,
|
|
142
|
+
description: 'Deactivate a local build agent (active: false) or activate it again (active: true). A deactivated agent gets no builds, and a build it is running stops and starts again on another agent or the cloud build engine. Its sign-in is kept, so activating it needs no new sign-in; a revoked agent answers 409 build_agent_revoked. Requires an organization API key and agent_id from list_organization_build_agents; REST: POST /api/v1/publishing/build-agents/{agent_id}.',
|
|
143
|
+
inputSchema: { agent_id: z.string().regex(/^ba[a-f0-9]{24}$/), active: z.boolean() },
|
|
144
|
+
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPost(`publishing/build-agents/${args.agent_id}`, { active: args.active }))),
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'revoke_organization_build_agent', noSite: true,
|
|
148
|
+
description: 'Revoke a local build agent and the sign-in it was registered with. It stops at its next request; a build it already started keeps its lease until it ends or expires, and queued builds go to another agent or the cloud build engine. Cannot be undone: the person signs in again from the app to register the computer anew. Requires an organization API key and agent_id from list_organization_build_agents; REST: DELETE /api/v1/publishing/build-agents/{agent_id}.',
|
|
149
|
+
inputSchema: { agent_id: z.string().regex(/^ba[a-f0-9]{24}$/) },
|
|
150
|
+
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootDelete(`publishing/build-agents/${args.agent_id}`))),
|
|
151
|
+
},
|
|
128
152
|
{
|
|
129
153
|
name: 'cancel_organization_build', noSite: true,
|
|
130
154
|
description: 'Cancel an active GitHub build using its key from active_jobs. Requires an organization API key. Revokes the attempt before requesting provider cancellation; it cannot publish afterward. Completed builds cannot be cancelled here.',
|
|
@@ -160,7 +184,7 @@ export const domainTools = [
|
|
|
160
184
|
},
|
|
161
185
|
{
|
|
162
186
|
name: 'set_site_hosting_group',
|
|
163
|
-
description: 'Select the Hosting Group for an unpublished site. Requires site admin permission and previous_group_id from read_site_hosting_group. Published sites or active builds require a hosting migration and are rejected.',
|
|
187
|
+
description: 'Select the Hosting Group for an unpublished site. Requires site admin permission in the organization that owns the site (a share, however privileged, is refused) and previous_group_id from read_site_hosting_group. Published sites or active builds require a hosting migration and are rejected.',
|
|
164
188
|
inputSchema: { hosting_group_id: z.string(), previous_group_id: z.string() },
|
|
165
189
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.put(siteId, 'publishing/hosting-group', args))),
|
|
166
190
|
},
|
package/dist/tools/email.js
CHANGED
|
@@ -12,7 +12,7 @@ export const emailTools = [
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
name: 'set_email_settings',
|
|
15
|
-
description: "Connect or change the site's outgoing email provider, like Settings → Email & notifications in the portal. Read get_email_settings first for the provider field schema. Examples: postmark config { server_token, message_stream? }; smtp config { host, port?, secure?, user?, password? }. Secrets are encrypted server-side and never returned; omit a secret (or send the masked value) to keep the stored one. Then call send_test_email. Admin permission required.",
|
|
15
|
+
description: "Connect or change the site's outgoing email provider, like Settings → Email & notifications in the portal. Read get_email_settings first for the provider field schema. Examples: postmark config { server_token, message_stream? }; smtp config { host, port?, secure?, user?, password? }. Secrets are encrypted server-side and never returned; omit a secret (or send the masked value) to keep the stored one, which works only while the provider type and every other config field are unchanged. Changing any of them without the secret fails with 400 email_secret_required: ask the user to enter it in the portal. Then call send_test_email. Admin permission required.",
|
|
16
16
|
inputSchema: {
|
|
17
17
|
type: z.string().min(1).optional().describe('Provider type when configuring this site’s own account.'),
|
|
18
18
|
from: z.string().min(1).optional().describe('Sender when configuring this site’s own account.'),
|
|
@@ -31,24 +31,24 @@ export const emailTools = [
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: 'get_organization_email_settings', noSite: true,
|
|
34
|
-
description: 'Read the selected Organization’s shared email account with secrets masked, its exact revision and the owned Sites allowed to use it. Only a current Organization owner, through a personal connection or an owner-issued organization API key,
|
|
34
|
+
description: 'Read the selected Organization’s shared email account with secrets masked, its exact revision and the owned Sites allowed to use it. Only a current Organization owner can read it, through a personal connection or an owner-issued organization API key; changes, tests and disconnection need the owner’s personal connection. Site keys are refused.',
|
|
35
35
|
inputSchema: {}, handler: withErrorBoundary(async (_args, { client }) => ok(await client.rootGet('organization/email'))),
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
name: 'set_organization_email_settings', noSite: true,
|
|
39
|
-
description: 'Configure the Organization’s shared email account or its explicit Site grants. Read get_organization_email_settings first and pass its expected_revision. Prefer entering secrets in the portal; never repeat a secret. Omitted fields preserve the account or grants; a new account allows no Sites by default. Sites must still select the organization account themselves and retain their own campaign budgets.
|
|
39
|
+
description: 'Configure the Organization’s shared email account or its explicit Site grants. Read get_organization_email_settings first and pass its expected_revision. Prefer entering secrets in the portal; never repeat a secret. Omitted fields preserve the account or grants; a new account allows no Sites by default. A stored secret is kept only while the provider type and every other config field are unchanged; otherwise the call fails with 400 email_secret_required. Sites must still select the organization account themselves and retain their own campaign budgets. Requires a current owner’s personal connection; organization API keys are refused.',
|
|
40
40
|
inputSchema: { expected_revision: z.string().regex(/^[a-f0-9]{64}$/), type: z.string().optional(), from: z.string().optional(), reply_to: z.string().optional(), config: z.record(z.string(), z.unknown()).optional(), allowed_site_ids: z.array(z.string()).max(1000).optional() },
|
|
41
41
|
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPut('organization/email', args))),
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
name: 'remove_organization_email_settings', noSite: true,
|
|
45
|
-
description: 'Disconnect the Organization’s shared mail account and withdraw all Site grants. Sites using it stop sending through that account; they do not silently fall back to another account. Requires the current expected_revision,
|
|
45
|
+
description: 'Disconnect the Organization’s shared mail account and withdraw all Site grants. Sites using it stop sending through that account; they do not silently fall back to another account. Requires the current expected_revision, a current owner’s personal connection (organization API keys are refused) and the user’s approval for this disconnection.',
|
|
46
46
|
inputSchema: { expected_revision: z.string().regex(/^[a-f0-9]{64}$/) },
|
|
47
47
|
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootDelete('organization/email', args))),
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
name: 'send_organization_test_email', noSite: true,
|
|
51
|
-
description: 'Send one test through the stored Organization mail account, only when the user requested this test and recipient. Requires
|
|
51
|
+
description: 'Send one test through the stored Organization mail account, only when the user requested this test and recipient. Requires a current owner’s personal connection; organization API keys are refused. It does not start a campaign or grant Site access.',
|
|
52
52
|
inputSchema: { to: z.string().min(3) },
|
|
53
53
|
handler: withErrorBoundary(async (args, { client }) => ok(await client.rootPost('organization/email', args))),
|
|
54
54
|
},
|
|
@@ -59,7 +59,7 @@ export const emailTools = [
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
name: 'send_test_email',
|
|
62
|
-
description: 'Send a test email through the stored email connector to check it works, like "Send test" in the portal. Save the connector with set_email_settings first. Admin permission required.',
|
|
62
|
+
description: 'Send a test email through the stored email connector to check it works, like "Send test" in the portal. Save the connector with set_email_settings first. `to` must be exactly one address (400 invalid_test_recipient otherwise); each test counts against the site\'s daily transactional mail limit (429 when reached). Admin permission required.',
|
|
63
63
|
inputSchema: {
|
|
64
64
|
to: z.string().min(3).describe('Recipient address for the test message.'),
|
|
65
65
|
},
|
package/dist/tools/media.js
CHANGED
|
@@ -14,7 +14,7 @@ async function uploadFromUrl(args, deps) {
|
|
|
14
14
|
export const mediaTools = [
|
|
15
15
|
{
|
|
16
16
|
name: 'publish_media_file',
|
|
17
|
-
description: 'Make a finalized PDF publicly accessible on the organization media domain, independently of website builds and image preparation. Requires
|
|
17
|
+
description: 'Make a finalized PDF publicly accessible on the organization media domain, independently of website builds and image preparation. Requires site admin permission, like a deploy (editors, write shares and Extension installation credentials are refused), and connected organization storage/media domain. Upload and finalize first; uploading alone stays private. This explicitly publishes the file: obtain the owner’s authorization before sharing private material. Returns public_url only after anonymous delivery and SHA-256 verification. Retry the same media id after a transient copy or verification failure. Repeated publication preserves the link, including after display-name edits. The link remains until the file is deleted; website releases do not remove it. Do not share the authenticated cdn_url for private uploads.',
|
|
18
18
|
inputSchema: { media_id: z.string().min(1) },
|
|
19
19
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.post(siteId, `media/${encodeURIComponent(args.media_id)}/publish`))),
|
|
20
20
|
},
|
package/dist/tools/packages.js
CHANGED
|
@@ -10,6 +10,7 @@ const FORMAT = 'A package belongs to no organization: it carries no organization
|
|
|
10
10
|
const STYLES = 'Styles are never mapped to the site\'s "nearest" styles: every style the imported content uses is created on the site. A style is reused only when the site has one with the same id and the same definition; a differing one is created under a new id (hero-2, named "Hero (imported)") and the imported content is rewritten to it. Block types, templates, global blocks, menus and pages that collide get new ids the same way.';
|
|
11
11
|
const DESIGN = 'options.design: "content" (default: the blocks and the styles they use), "styles" (also the package\'s other class styles) or "full" (also the element styles body/h1–h6/link replacing the site\'s, colours, typography, scales, content widths and font roles; requires admin). ' +
|
|
12
12
|
'Font files in the package are added to the Fonts library only with options.font_licence_confirmed: true, which means the user confirmed the font licence allows use on this site; ask the user, never assume it. options.fonts: false leaves the fonts out. Adobe Fonts, Bunny Fonts and Fontshare kits never transfer: only the family names, with a warning.';
|
|
13
|
+
const SCRIPTS = 'A package can carry JavaScript that runs in visitors\' browsers: a block type\'s script and block fields a block type declares as code (such as the JavaScript of an Embed block). inspect_package lists each in plan.scripts and sets needs.scripts; import_package refuses such a package with 400 package_scripts_confirmation_required (details.scripts) unless options.allow_scripts is true. Show the user the scripts and ask; never set allow_scripts on your own.';
|
|
13
14
|
const source = {
|
|
14
15
|
data_base64: z.string().optional().describe('The .typeroll file, base64-encoded (at most 16 MB). Send this or source_url.'),
|
|
15
16
|
source_url: z.string().optional().describe('An https:// address to download the package from (up to 200 MB), instead of data_base64.'),
|
|
@@ -19,6 +20,7 @@ const options = z.object({
|
|
|
19
20
|
fonts: z.boolean().optional().describe('With design "full": import the package\'s font roles and font files (default true).'),
|
|
20
21
|
only: z.array(z.string()).max(5000).optional().describe('Only these entries, e.g. ["block_templates.hero", "menus.main"]; all when absent.'),
|
|
21
22
|
font_licence_confirmed: z.boolean().optional().describe('true: the user confirmed the licence of the package\'s font files allows use on this site.'),
|
|
23
|
+
allow_scripts: z.boolean().optional().describe('true: the user reviewed the JavaScript the package adds (plan.scripts from inspect_package) and allows it on this site. Required when the package carries scripts.'),
|
|
22
24
|
}).strict();
|
|
23
25
|
const body = (args) => Object.fromEntries(Object.entries(args).filter(([key, value]) => key !== 'version' && value !== undefined));
|
|
24
26
|
export const packageTools = [
|
|
@@ -51,14 +53,14 @@ export const packageTools = [
|
|
|
51
53
|
{
|
|
52
54
|
name: 'inspect_package',
|
|
53
55
|
description: 'Read a Typeroll package and show what importing it into the site would do, without changing anything: the package (name, version, author, licence, counts), its signature (verified with the publisher when a trusted publisher signed it; unsigned or unknown otherwise), the plan (per style, block type, template, global block, menu, page and media file: create, reuse, rename or replace, with the id maps), warnings, errors that would stop the import, and needs (admin, font_licence). ' +
|
|
54
|
-
STYLES + ' ' + DESIGN + ' Run it before import_package and show the user the plan.',
|
|
56
|
+
STYLES + ' ' + DESIGN + ' ' + SCRIPTS + ' Run it before import_package and show the user the plan.',
|
|
55
57
|
inputSchema: { ...source, options: options.optional(), version: versionParam },
|
|
56
58
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.post(siteId, 'packages/inspect', body(args), v(args.version)))),
|
|
57
59
|
},
|
|
58
60
|
{
|
|
59
61
|
name: 'import_package',
|
|
60
62
|
description: 'Import a Typeroll package into the site: media first (into the Media library, reusing files with the same bytes; demo files are marked for replacement before publication), then fonts, block types, design and styles, global blocks, block templates (with where they came from), page templates, menus, site fields and, for a site package, pages. Returns a report of what was created, reused, renamed and replaced. ' +
|
|
61
|
-
STYLES + ' ' + DESIGN + ' ' +
|
|
63
|
+
STYLES + ' ' + DESIGN + ' ' + SCRIPTS + ' ' +
|
|
62
64
|
'Requires write permission; admin for design "full" or when the import adds fonts or settings pages. The whole plan is checked before anything is written; a write that fails part-way answers package_import_partial with the report of what was written.',
|
|
63
65
|
inputSchema: { ...source, options, version: versionParam },
|
|
64
66
|
handler: withErrorBoundary(async (args, { client, siteId }) => ok(await client.post(siteId, 'packages/import', body(args), v(args.version)))),
|
package/dist/tools/sites.js
CHANGED
|
@@ -39,6 +39,7 @@ export const siteTools = [
|
|
|
39
39
|
'START FROM A TEMPLATE with at most one of: `from_site_id` (another site of YOUR organization, optionally `from_site_version`; sites shared in from other organizations are refused with 404), `from_collection_entry` (a `package` entry of the organization collection, see list_collection_entries), `from_package_base64` or `from_package_url` (a whole-site .typeroll package; a package belongs to no organization, so a bought one works). ' +
|
|
40
40
|
'Copied: pages (block and HTML pages and records of every content type), header, footer and global blocks, menus, styles (created with their ids, never mapped to "nearest" ones), block types, block and page templates, site fields with values, content types, forms (without their actions) and snippets, and media into the new site\'s own library (demo images stay marked for replacement; readiness lists them). Never copied: domains, publishing and hosting settings, API keys, shares, app installations (listed in warnings: install them on the new site), form actions and credentials, integrations, custom/tracking scripts, robots.txt, noindex switches, redirects, deploy history and revisions. A home page, header, footer and the primary/footer menus are created only where the template has none (started_from.defaults). ' +
|
|
41
41
|
'`design`: "full" (default for a new site: element styles, colours, typography, scales, content widths and font roles), "styles" or "content" (the default look). Font files in the template are added only with `font_licence_confirmed: true` (ask the user whether the font licence allows use on the new site; never assume it), or left out with `fonts: false`; otherwise 400 font_licence_required. A package with an invalid signature is refused (package_signature_invalid); one that is not a whole site answers package_not_a_site. If the import fails the half-created site is removed again (site_create_failed, details.site_removed). ' +
|
|
42
|
+
'A template that carries JavaScript running in visitors\' browsers is refused with 400 package_scripts_confirmation_required (details.scripts) and no site is created, unless `allow_scripts` is true: show the user the scripts and ask; never set it on your own. ' +
|
|
42
43
|
'Returns the new site\'s id, language + urls, and with a template `started_from` { kind, source, report, defaults, warnings } — show the warnings to the user. Use the id as `site_id`/`TYPEROLL_SITE_ID` for follow-up calls. After creating a blank site, run list_skills → read_skill tr-new-site to bootstrap the design.',
|
|
43
44
|
noSite: true,
|
|
44
45
|
inputSchema: {
|
|
@@ -56,15 +57,16 @@ export const siteTools = [
|
|
|
56
57
|
design: z.enum(['full', 'styles', 'content']).optional().describe('With a template: how much of its look to take (default "full"). REST body: `options.design`.'),
|
|
57
58
|
fonts: z.boolean().optional().describe('With a template and design "full": take its font roles and font files (default true). REST body: `options.fonts`.'),
|
|
58
59
|
font_licence_confirmed: z.boolean().optional().describe('true: the user confirmed the licence of the template\'s font files allows use on the new site. REST body: `options.font_licence_confirmed`.'),
|
|
60
|
+
allow_scripts: z.boolean().optional().describe('true: the user reviewed the JavaScript the template adds (details.scripts of the refusal) and allows it on the new site. REST body: `options.allow_scripts`.'),
|
|
59
61
|
},
|
|
60
62
|
handler: withErrorBoundary(async (args, { client }) => {
|
|
61
|
-
const { from_site_id, from_site_version, from_collection_entry, from_package_base64, from_package_url, design, fonts, font_licence_confirmed, ...site } = args;
|
|
63
|
+
const { from_site_id, from_site_version, from_collection_entry, from_package_base64, from_package_url, design, fonts, font_licence_confirmed, allow_scripts, ...site } = args;
|
|
62
64
|
const sources = [from_site_id, from_collection_entry, from_package_base64, from_package_url].filter(value => value !== undefined);
|
|
63
65
|
if (sources.length > 1)
|
|
64
66
|
return fail(new Error('Pass at most one of from_site_id, from_collection_entry, from_package_base64 and from_package_url.'));
|
|
65
|
-
const options = definedFields({ design, fonts, font_licence_confirmed });
|
|
67
|
+
const options = definedFields({ design, fonts, font_licence_confirmed, allow_scripts });
|
|
66
68
|
if (!sources.length && (from_site_version !== undefined || Object.keys(options).length)) {
|
|
67
|
-
return fail(new Error('from_site_version, design, fonts and
|
|
69
|
+
return fail(new Error('from_site_version, design, fonts, font_licence_confirmed and allow_scripts apply only when starting from a template (from_site_id, from_collection_entry or from_package_*).'));
|
|
68
70
|
}
|
|
69
71
|
const from = from_site_id !== undefined ? { site_id: from_site_id, ...(from_site_version !== undefined ? { version: from_site_version } : {}) }
|
|
70
72
|
: from_collection_entry !== undefined ? { collection_entry: from_collection_entry }
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.45.
|
|
1
|
+
export declare const VERSION = "0.45.167";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typeroll/mcp-server",
|
|
3
3
|
"mcpName": "io.github.Typeroll/typeroll",
|
|
4
|
-
"version": "0.45.
|
|
4
|
+
"version": "0.45.167",
|
|
5
5
|
"description": "Typeroll CMS MCP server \u2013 connect AI agents to the REST API to manage content and publish static websites.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|