@typeroll/mcp-server 0.45.127 → 0.45.128

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.
@@ -12,7 +12,7 @@ export const deployTools = [
12
12
  },
13
13
  {
14
14
  name: 'trigger_deploy',
15
- description: "Enqueue a deploy (static-page build → hosting) of the currently active version. Returns a job_id immediately; poll get_deploy_status until the status leaves queued/running. NOT for previewing iterative design/content edits — that's what get_preview_link is for (it renders live from the DB with no build). Reserve trigger_deploy for publishing, a stakeholder link to the compiled site, or pre-merge validation. Publishing to the temporary address ends at cutover: once a site serves its live custom domain, the same publication serves both, so every deploy of main is a production release. Then get the owner's approval and pass confirm_live_domains: true; without it a real deploy is refused with live_domain_confirmation_required, naming the live URLs and targets. Review changes on a cut-over site with get_preview_link (include_working_copy) or dry_run:true, which need no confirmation. The result reports production, live_domains and targets (live domains first, then the temporary address). Deploys build SAVED content only — unsaved drafts (working copies) are excluded, so commit_working_copy (or save:true on your writes) before deploying, or your changes won't ship. Customer publishing freezes a consistent saved source, then resumes source/Git/build-dispatch checkpoints without recapturing later edits. GitHub or Cloudflare performs rendering and media work. With dry_run:true, publishing validates frozen source without a Git push or external build; it does not prove an Astro build succeeds. Check the reported phase. All sites in an organization share one build engine: publish one site at a time, starting the next only when the previous job has finished and read_organization_build_engine shows no active_jobs. A domain switch waiting for DNS approval (awaiting_approval) does not block other sites.",
15
+ description: "Enqueue a deploy (static-page build → hosting) of the currently active version. Returns a job_id immediately; poll get_deploy_status until the status leaves queued/running. NOT for previewing iterative design/content edits — that's what get_preview_link is for (it renders live from the DB with no build). Reserve trigger_deploy for publishing, a stakeholder link to the compiled site, or pre-merge validation. Publishing to the temporary address ends at cutover: once a site serves its live custom domain, the same publication serves both, so every deploy of main is a production release. Then get the owner's approval and pass confirm_live_domains: true; without it a real deploy is refused with live_domain_confirmation_required, naming the live URLs and targets. Review changes on a cut-over site with get_preview_link (include_working_copy) or dry_run:true, which need no confirmation. The result reports production, live_domains and targets (live domains first, then the temporary address). Deploys build SAVED content only — unsaved drafts (working copies) are excluded, so commit_working_copy (or save:true on your writes) before deploying, or your changes won't ship. Customer publishing freezes a consistent saved source, then resumes source/Git/build-dispatch checkpoints without recapturing later edits. GitHub or Cloudflare performs rendering and media work. With dry_run:true, publishing validates frozen source without a Git push or external build; it does not prove an Astro build succeeds. Check the reported phase. A build waits in the build provider's queue while the provider (Cloudflare Workers Builds or GitHub Actions in the organization's account) has no free build capacity, for example during a long background media preparation; get_deploy_status reports this in build_progress.queue. That is normal: keep polling the same job and do not trigger it again. All sites in an organization share one build engine: publish one site at a time, starting the next only when the previous job has finished and read_organization_build_engine shows no active_jobs. A domain switch waiting for DNS approval (awaiting_approval) does not block other sites.",
16
16
  inputSchema: {
17
17
  environment: z.enum(['production', 'staging']).optional(),
18
18
  confirm_live_domains: z.boolean().optional().describe('Required (true) for a real deploy of a cut-over site: acknowledges that the deploy publishes to the live domains named by get_publication_impact or the live_domain_confirmation_required error. Only after the site owner approved this production release. Not needed for dry_run or sites that are not cut over.'),
@@ -42,7 +42,7 @@ export const deployTools = [
42
42
  },
43
43
  {
44
44
  name: 'get_deploy_status',
45
- 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. 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. 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); report them to the user. 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.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 stuck in 'queued' 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.",
45
+ 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. 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); report them to the user. 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.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.",
46
46
  inputSchema: { job_id: z.string(), 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.') },
47
47
  handler: withErrorBoundary(async (args, { client, siteId }) => {
48
48
  const res = await client.get(siteId, `deploys/${encodeURIComponent(args.job_id)}`);
@@ -102,7 +102,7 @@ export const domainTools = [
102
102
  },
103
103
  {
104
104
  name: 'read_organization_build_engine', noSite: true,
105
- 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 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); an engine with update_available runs older code than this Typeroll. Requires an organization API key; REST: GET /api/v1/publishing/builds. No provider credentials are returned.',
105
+ 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); an engine with update_available runs older code than this Typeroll. Requires an organization API key; REST: GET /api/v1/publishing/builds. No provider credentials are returned.',
106
106
  inputSchema: {},
107
107
  handler: withErrorBoundary(async (_args, { client }) => ok(await client.rootGet('publishing/builds'))),
108
108
  },
@@ -56,7 +56,7 @@ export const mediaTools = [
56
56
  },
57
57
  {
58
58
  name: 'read_media',
59
- description: 'Read one media item\'s metadata by id.',
59
+ description: 'Read one media item\'s metadata by id. For a file imported from a URL, import reports { state: pending | complete | failed, error_code, message, retry { automatic, next_attempt_at, failed_attempts } }; poll it after upload_media_from_url answers import.state "pending".',
60
60
  inputSchema: { media_id: z.string() },
61
61
  handler: withErrorBoundary(async (args, { client, siteId }) => {
62
62
  const res = await client.get(siteId, `media/${encodeURIComponent(args.media_id)}`);
@@ -79,7 +79,7 @@ export const mediaTools = [
79
79
  },
80
80
  {
81
81
  name: 'upload_media_from_url',
82
- description: 'Fetch an image (or PDF) from any public URL and push it to the site\'s media library in one call. The organization\'s media transfer Worker downloads the source from verified public HTTP(S) destinations straight into the organization\'s storage; private addresses and unsafe redirects are refused. Integrity-safe: the bytes are streamed, never transcribed as base64 through the model, so (unlike a large `upload_media_inline` payload) they can\'t be silently corrupted in transit. Returns { media_id, cdn_url, filename, finalize }. Each upload queues image preparation (finalize.preparation): one job per site on the organization\'s shared build engine, started once uploads have been quiet for 30 s (at most 5 min after the first), so a series of uploads shares one job. get_media_preparation returns its build_job_id; let it finish, like any other active build, before publishing another site of the organization.',
82
+ description: 'Fetch an image (or PDF) from any public URL and push it to the site\'s media library in one call. The organization\'s media transfer Worker downloads the source from verified public HTTP(S) destinations straight into the organization\'s storage; private addresses and unsafe redirects are refused. Integrity-safe: the bytes are streamed, never transcribed as base64 through the model, so (unlike a large `upload_media_inline` payload) they can\'t be silently corrupted in transit. Returns { media_id, cdn_url, filename, finalize, import }. When the media record was created but the copy failed for a passing reason (a busy or rate-limited source, an interrupted transfer, a transfer Worker 5xx), the call answers HTTP 202 with import.state "pending", import.error_code, import.retry { automatic: true, next_attempt_at } and finalize null: the site\'s media migration retries the copy after 1, 5, 15, 30 and 60 minutes. Do not import it again; poll read_media until import.state is "complete" before referencing the file in published content. A refused source (4xx) is an error and leaves no record. Each upload queues image preparation (finalize.preparation): one job per site on the organization\'s shared build engine, started once uploads have been quiet for 30 s (at most 5 min after the first), so a series of uploads shares one job. get_media_preparation returns its build_job_id; let it finish, like any other active build, before publishing another site of the organization.',
83
83
  inputSchema: {
84
84
  source_url: z.string().url().describe('Public URL to download the image from.'),
85
85
  filename: z.string().optional().describe('Override the filename used on R2. Defaults to the last path segment of source_url. When its extension does not match the content type, the type\'s extension is appended; the response returns the stored filename.'),
@@ -95,7 +95,7 @@ export const mediaTools = [
95
95
  },
96
96
  {
97
97
  name: 'upload_media_batch_from_urls',
98
- description: 'Upload 1–50 public images/PDFs (max 25 MiB each) in one MCP call. Uses the same integrity-safe download → signed PUT → finalize pipeline as upload_media_from_url, with four concurrent workers. Returns one result per source URL; individual failures do not abort the batch. Uploads queue image preparation as upload_media_from_url describes; consecutive batches share one preparation job while each starts within 30 s of the previous one.',
98
+ description: 'Upload 1–50 public images/PDFs (max 25 MiB each) in one MCP call. Uses the same integrity-safe download → signed PUT → finalize pipeline as upload_media_from_url, with four concurrent workers. Returns one result per source URL; individual failures do not abort the batch. A result with pending: true has a media record whose copy is retried automatically (see upload_media_from_url); `pending` counts them. Uploads queue image preparation as upload_media_from_url describes; consecutive batches share one preparation job while each starts within 30 s of the previous one.',
99
99
  inputSchema: {
100
100
  items: z.array(z.object({
101
101
  source_url: z.string().url(),
@@ -112,7 +112,8 @@ export const mediaTools = [
112
112
  const index = cursor++;
113
113
  const item = args.items[index];
114
114
  try {
115
- results[index] = { source_url: item.source_url, ok: true, ...(await uploadFromUrl(item, deps)) };
115
+ const result = await uploadFromUrl(item, deps);
116
+ results[index] = { source_url: item.source_url, ok: true, pending: result.import?.state === 'pending', ...result };
116
117
  }
117
118
  catch (error) {
118
119
  results[index] = { source_url: item.source_url, ok: false, error: error instanceof Error ? error.message : String(error) };
@@ -124,6 +125,7 @@ export const mediaTools = [
124
125
  results,
125
126
  succeeded: results.filter((result) => result.ok === true).length,
126
127
  failed: results.filter((result) => result.ok === false).length,
128
+ pending: results.filter((result) => result.pending === true).length,
127
129
  });
128
130
  }),
129
131
  },
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@
8
8
  //
9
9
  // Keep it in lockstep with package.json: tests/version.test.ts asserts
10
10
  // VERSION === package.json.version, so a bump that forgets this line fails CI.
11
- export const VERSION = '0.45.127';
11
+ export const VERSION = '0.45.128';
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.127",
4
+ "version": "0.45.128",
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": {