@typeroll/mcp-server 0.45.148 → 0.45.150

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.
@@ -44,7 +44,7 @@ export const mediaTools = [
44
44
  },
45
45
  {
46
46
  name: 'list_media',
47
- description: 'List uploaded media items (CDN URLs, alt text, mime). Newest first, cursor-paginated.',
47
+ description: 'List media records (CDN URLs, alt text, mime, import status and readiness). Unfinished or failed imports remain listed for repair; only choose entries with readiness.selectable true. Newest first, cursor-paginated.',
48
48
  inputSchema: {
49
49
  limit: z.number().int().min(1).max(200).optional(),
50
50
  cursor: z.string().optional(),
@@ -68,7 +68,7 @@ export const mediaTools = [
68
68
  },
69
69
  {
70
70
  name: 'read_media',
71
- 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".',
71
+ description: 'Read one media item\'s metadata by id. readiness reports state (ready, pending or failed), selectable and message; only use selectable files for new content references. 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".',
72
72
  inputSchema: { media_id: z.string() },
73
73
  handler: withErrorBoundary(async (args, { client, siteId }) => {
74
74
  const res = await client.get(siteId, `media/${encodeURIComponent(args.media_id)}`);
@@ -77,7 +77,7 @@ export const mediaTools = [
77
77
  },
78
78
  {
79
79
  name: 'create_upload_url',
80
- description: 'Mint a 5-min signed PUT URL for direct-to-R2 upload. The returned cdn_url is an authenticated editor reference, not a public sharing link. REQUIRED follow-up: call `finalize_media` after the PUT succeeds to verify and freeze the private original. Publish a PDF explicitly with `publish_media_file`; images become public with a website publication. The response carries `finalize_url` as a reminder. This signed-PUT path is the INTEGRITY-SAFE way to upload bytes from disk or a generated asset — a direct `curl --data-binary @file` sends the bytes straight to R2 without transcribing them through the model, so it can\'t be corrupted the way a large `upload_media_inline` base64 blob can (ESPECIALLY use this, not inline, for SVG/logos). For a public source URL, `upload_media_from_url` is the one-call equivalent; reserve `upload_media_inline` for tiny payloads only.',
80
+ description: 'Mint a temporary signed PUT URL for direct-to-R2 upload; use the returned expiry. The returned cdn_url is an authenticated editor reference, not a public sharing link. REQUIRED follow-up: call `finalize_media` after the PUT succeeds to verify and freeze the private original. Publish a PDF explicitly with `publish_media_file`; images become public with a website publication. The response carries `finalize_url` as a reminder. This signed-PUT path is the INTEGRITY-SAFE way to upload bytes from disk or a generated asset — a direct `curl --data-binary @file` sends the bytes straight to R2 without transcribing them through the model, so it can\'t be corrupted the way a large `upload_media_inline` base64 blob can (ESPECIALLY use this, not inline, for SVG/logos). For a public source URL, `upload_media_from_url` is the one-call equivalent; reserve `upload_media_inline` for tiny payloads only.',
81
81
  inputSchema: {
82
82
  filename: z.string().min(1).describe('Should end in an extension of content_type (e.g. logo.png with image/png). When the extension is missing or belongs to another type, the type\'s extension is appended (logo → logo.png, photo.html → photo.html.png); the response returns the stored filename. Unsupported types answer 415.'),
83
83
  content_type: z.string().min(1).describe('e.g. "image/png", "image/jpeg", "application/pdf". SVGs are sanitized at finalize; an SVG that cannot be sanitized is refused.'),
@@ -91,7 +91,7 @@ export const mediaTools = [
91
91
  },
92
92
  {
93
93
  name: 'upload_media_from_url',
94
- 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.',
94
+ 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 cdn_url/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 new record; an existing pending record is retained with import.state failed and automatic retries stopped. 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.',
95
95
  inputSchema: {
96
96
  source_url: z.string().url().describe('Public URL to download the image from.'),
97
97
  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.'),
@@ -107,7 +107,7 @@ export const mediaTools = [
107
107
  },
108
108
  {
109
109
  name: 'upload_media_batch_from_urls',
110
- 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.',
110
+ 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; `succeeded` counts only completed imports. 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.',
111
111
  inputSchema: {
112
112
  items: z.array(z.object({
113
113
  source_url: z.string().url(),
@@ -135,7 +135,7 @@ export const mediaTools = [
135
135
  await Promise.all(workers);
136
136
  return ok({
137
137
  results,
138
- succeeded: results.filter((result) => result.ok === true).length,
138
+ succeeded: results.filter((result) => result.ok === true && result.pending !== true).length,
139
139
  failed: results.filter((result) => result.ok === false).length,
140
140
  pending: results.filter((result) => result.pending === true).length,
141
141
  });
@@ -173,7 +173,7 @@ export const mediaTools = [
173
173
  if (!putRes.ok) {
174
174
  throw new Error(`R2 upload failed: ${putRes.status} ${putRes.statusText}`);
175
175
  }
176
- // Auto-finalize (cache headers + AVIF/WebP variants). See
176
+ // Verify and freeze the original; images queue private preparation. See
177
177
  // upload_media_from_url for the same pattern + rationale.
178
178
  let finalizeResult = null;
179
179
  let finalizeError = null;
@@ -201,7 +201,7 @@ export const mediaTools = [
201
201
  media_id: z.string(),
202
202
  alt_text: z.string().optional(),
203
203
  filename: z.string().optional(),
204
- public_path: z.string().nullable().optional().describe('Optional stable path such as /wp-content/uploads/2023/photo.jpg. Applied at the next build; existing public image URLs stay available.'),
204
+ public_path: z.string().nullable().optional().describe('Optional path such as /products/photo.jpg. New uploads default to the root filename without date folders. Publication numbers names used by different bytes. Safe old aliases are retained for included media; reserved names do not republish deleted or unused files. Use null to choose the current filename again.'),
205
205
  },
206
206
  handler: withErrorBoundary(async (args, { client, siteId }) => {
207
207
  const { media_id, ...body } = args;
@@ -211,7 +211,7 @@ export const mediaTools = [
211
211
  },
212
212
  {
213
213
  name: 'generate_image_variants',
214
- description: 'Run the build-time srcset pipeline for one image: produces webp + avif variants at 320 / 640 / 1024 / 1920 (skipping upscales), uploads them to R2 alongside the original, and patches the media doc with a variants[] array. Synchronous; takes ~1-5s per image. Skips PDFs and non-image media without erroring. NOTE: prefer `finalize_media` for new uploads — it does this PLUS sets immutable Cache-Control on the original. Use this tool only for surgical variant reruns.',
214
+ description: 'Compatibility endpoint that reports pending build-time responsive image work. It does not transcode images synchronously or upload variants from the portal. The organization build engine generates smaller WebP/AVIF widths and the full original width without upscaling during preparation or publication. Finalize each new direct upload with finalize_media; use get_media_preparation to observe queued preparation. Non-processable files, including PDFs, return skipped: true. A variants_pending response is not proof that a file is ready or public.',
215
215
  inputSchema: { media_id: z.string() },
216
216
  handler: withErrorBoundary(async (args, { client, siteId }) => {
217
217
  const res = await client.post(siteId, `media/${encodeURIComponent(args.media_id)}/generate-variants`);
@@ -233,7 +233,7 @@ export const mediaTools = [
233
233
  },
234
234
  {
235
235
  name: 'finalize_all_media',
236
- description: 'Backfill version of finalize_media: walks the entire media library, applies cache headers + variant generation to every item missing them. Use this once on legacy sites to fix Lighthouse "cache lifetimes" + "image delivery" warnings in one go. Synchronous, can take minutes on large libraries (~1-5s per image needing variants, ~50ms for cache-only). Idempotent.',
236
+ description: 'Admin-only compatibility backfill. For customer publishing, returns variants_pending and instructs you to finalize each direct upload using its finalize_url; it does not finalize every private upload. Legacy runtime-storage sites apply missing cache metadata by walking the library synchronously. Neither path transcodes responsive image variants in the portal. Use finalize_media for new uploads and get_media_preparation for background build progress.',
237
237
  inputSchema: {},
238
238
  handler: withErrorBoundary(async (_args, { client, siteId }) => {
239
239
  const res = await client.post(siteId, 'media/finalize-all');
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.148';
11
+ export const VERSION = '0.45.150';
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.148",
4
+ "version": "0.45.150",
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": {
@@ -7,7 +7,8 @@ description: Use when the user asks for an image, hero, illustration, or logo to
7
7
 
8
8
  The Typeroll API does NOT accept image bytes directly. Uploads go
9
9
  through a signed PUT URL straight to Cloudflare R2, and the API only
10
- sees the metadata. Two-step flow:
10
+ sees the metadata. For local files, mint an upload URL, PUT the bytes, then
11
+ finalize and verify the result before referencing it:
11
12
 
12
13
  For public source URLs, prefer `upload_media_from_url`; for 2–50 files use
13
14
  `upload_media_batch_from_urls` (max 25 MiB per file). Both download, upload,
@@ -18,13 +19,41 @@ PUT.
18
19
 
19
20
  ## Recipe
20
21
 
22
+ ### Public address continuity
23
+
24
+ Do not create a redirect for every uploaded image or generated variant. Update
25
+ all current HTML, `srcset`, CSS and share-image references to the verified new
26
+ address. Preserve old public file URLs for external embeds, image search and
27
+ shared links: keep safe aliases where possible, use an established prefix
28
+ mapping when the complete remaining path is unchanged, and retain exact rules
29
+ for exceptions such as unrelated content hashes. A `public_path` preserves a
30
+ path, not a hostname. Never invent a wildcard from a partial import inventory.
31
+ Private editor addresses and never-public variants need no automatic redirects.
32
+ Do not delete configured redirects merely because current HTML no longer uses
33
+ them. Core 0.3.48 compacts equivalent per-file rules in the frozen publication;
34
+ stored rules stay intact. See https://typeroll.com/docs/tools/redirects/.
35
+
36
+ From Core 0.3.49, new uploads default to the media root (`photo.jpg`), without
37
+ automatic year/month folders. Explicit folders and WordPress upload-relative
38
+ folders are preserved; `wp-content/uploads` and multisite prefixes are removed
39
+ from new addresses. Different bytes receive permanent numeric names (`photo-2.jpg`);
40
+ safe old aliases for included media stay available without a redirect per replacement.
41
+ Managed WordPress imports declare their uploads namespace so publication can
42
+ use one prefix with exact collision exceptions. A borrowed image alone does
43
+ not declare a namespace. Check the returned public paths and the complete old
44
+ URL inventory; Cloud requires the corresponding platform release. A reserved name
45
+ does not retain a deleted or unused file in every future build. Private object
46
+ keys and responsive variants can still contain hashes; never construct URLs
47
+ from those internal keys.
48
+
21
49
  ### 1. Get an image
22
50
 
23
51
  Options, in order of preference:
24
52
 
25
- a. **Reuse an existing one.** `list_media` returns CDN URLs for every
26
- image already on this site. Search the list before generating
27
- anything — saves bandwidth and keeps the visual catalog tight.
53
+ a. **Reuse an existing one.** Search `list_media` before generating anything.
54
+ From Core 0.3.48 it also lists pending or failed imports for repair: select
55
+ only records whose `readiness.selectable` is true. A reserved CDN address
56
+ alone does not establish that a usable file exists.
28
57
 
29
58
  b. **Generate locally.** The user's Claude Code installation has
30
59
  access to whatever image-gen tools they've configured (DALL-E,
@@ -48,8 +77,8 @@ Returns:
48
77
  ```json
49
78
  {
50
79
  "upload_url": "https://...r2.cloudflarestorage.com/.../signed-...",
51
- "cdn_url": "https://cdn.example.com/orgs/.../images/...png",
52
- "key": "orgs/.../images/...png",
80
+ "cdn_url": "https://portal.example.com/api/sites/site/media/abc123/content",
81
+ "key": "private/media/<site-prefix>/uploads/<upload-id>/hero-services.png",
53
82
  "media_id": "abc123",
54
83
  "expires_in": 300
55
84
  }
@@ -72,10 +101,12 @@ Body: <file bytes>
72
101
  In a shell:
73
102
 
74
103
  ```bash
75
- curl -sS -X PUT --data-binary @hero-services.png "$UPLOAD_URL"
104
+ curl --fail-with-body -sS -X PUT -H "Content-Type: image/png" \
105
+ --data-binary @hero-services.png "$UPLOAD_URL"
76
106
  ```
77
107
 
78
- Optionally with `-H "Content-Type: image/png"` if you need to override what R2 will infer. **Nothing else.**
108
+ Send the same `Content-Type` used to request the upload URL. Do not attach your
109
+ Typeroll API key or copy the URL's signing query parameters into headers.
79
110
 
80
111
  > The signed URL embeds checksum-related query parameters
81
112
  > (`x-amz-checksum-crc32`, `x-amz-sdk-checksum-algorithm`) for legacy
@@ -94,16 +125,20 @@ await fetch(uploadUrl, {
94
125
  });
95
126
  ```
96
127
 
97
- Parallelise N uploads via shell `&` + `wait`:
98
-
99
- ```bash
100
- while IFS=$'\t' read -r filename signed_url; do
101
- curl -sS -X PUT --data-binary @"$filename" "$signed_url" &
102
- done < manifest.tsv
103
- wait
104
- ```
105
-
106
- A 200 OK from R2 means the image is now live at `cdn_url`.
128
+ For many local files, use bounded concurrency and record each PUT result
129
+ against its media ID. Send each file's declared Content-Type, finalize only
130
+ successful uploads, and inspect every finalization result before creating
131
+ references. A background shell loop's final exit code does not prove that
132
+ all its uploads succeeded. Retry failed entries, not the entire batch.
133
+
134
+ A successful PUT means the upload reached storage; it is not yet a verified
135
+ or public image. Call `finalize_media media_id=<id> expected_sha256=<source-hash>`
136
+ (or the returned finalization endpoint) and inspect the result before referencing it.
137
+ Finalization freezes the private original and queues background image
138
+ preparation. It does not publish the file. Use the returned authenticated
139
+ `cdn_url` in content only after verification; website publication rewrites it
140
+ to the public address. A PDF can be published separately with
141
+ `publish_media_file`. A 202/pending import is not a completed upload.
107
142
 
108
143
  ### 4. Patch metadata (alt text, etc.)
109
144
 
@@ -181,9 +216,10 @@ width, without upscaling or duplicate width descriptors. Check `currentSrc` and
181
216
  the actual encoded dimensions on the published site; the CMS preview can use the
182
217
  original and hide an undersized derivative. Do not compensate with custom CSS
183
218
  or `sizes` alone. Existing static sites need republication for the versioned v2
184
- recipe; unchanged subsequent builds reuse verified media. Explicit API variant
185
- workflows must regenerate their variant metadata before rebuilding.
186
-
219
+ recipe; unchanged subsequent builds reuse verified media.
220
+ `generate_image_variants` reports pending build-time work; it does not encode
221
+ variants synchronously or repair a broken upload. Inspect `get_media_preparation`
222
+ and the actual published output instead of looping that endpoint.
187
223
 
188
224
  ## Replace an existing image efficiently
189
225
 
@@ -16,7 +16,6 @@ Use standard blocks first, reviewed custom types next, rare documented HTML last
16
16
  All four combinations must preserve or meaningfully redirect every old public URL. That
17
17
  shared contract defines acceptance; this recipe only adds source-specific steps.
18
18
 
19
-
20
19
  > **The buffer model (draft writes).** Every content write in this recipe
21
20
  > (pages, blocks and partials) lands in an unsaved per-doc
22
21
  > DRAFT — deploys and plain previews only see SAVED content. For recipe-style
@@ -24,7 +23,6 @@ shared contract defines acceptance; this recipe only adds source-specific steps.
24
23
  > the task itself), or run `commit_working_copy` per doc before any
25
24
  > `trigger_deploy`. Preview your drafts with `include_working_copy: true`.
26
25
 
27
-
28
26
  ## When to use this vs tr-migrate-wp
29
27
 
30
28
  | Source | Use |
@@ -145,6 +143,28 @@ Always draft first. The user signs off before publishing.
145
143
 
146
144
  ### 5. Handle redirects
147
145
 
146
+ For images and files, rewriting current HTML does not preserve old public URLs
147
+ used by image search, external embeds or shared links. Keep safe aliases where
148
+ possible, use an established prefix rule when the entire remaining path stays
149
+ unchanged, and keep individual rules for exceptions such as unrelated hashes.
150
+ Do not infer a wildcard from a partial inventory or create automatic redirects
151
+ for private and never-public addresses. Existing configured rules stay intact;
152
+ Core 0.3.48 compacts equivalent per-file lines only in frozen publication output.
153
+ See https://typeroll.com/docs/tools/redirects/ for the policy and Bulk quotas.
154
+
155
+ From Core 0.3.49, new uploads default to the media root (`photo.jpg`), without
156
+ automatic year/month folders. Explicit folders and WordPress upload-relative
157
+ folders are preserved; `wp-content/uploads` and multisite prefixes are removed
158
+ from new addresses. Different bytes receive permanent numeric names (`photo-2.jpg`);
159
+ safe old aliases for included media stay available without a redirect per replacement.
160
+ Managed WordPress imports declare their uploads namespace so publication can
161
+ use one prefix with exact collision exceptions. A borrowed image alone does
162
+ not declare a namespace. Check the returned public paths and the complete old
163
+ URL inventory; Cloud requires the corresponding platform release. A reserved name
164
+ does not retain a deleted or unused file in every future build. Private object
165
+ keys and responsive variants can still contain hashes; never construct URLs
166
+ from those internal keys.
167
+
148
168
  If the source URLs differ from the target slugs, create redirects:
149
169
 
150
170
  ```
@@ -86,6 +86,20 @@ to returned media URLs. Use direct upload URLs for local bytes and the customer
86
86
  transfer flow for remote media; do not relay large base64 payloads through the
87
87
  model. Preserve alt text, captions, dimensions, links and image variants.
88
88
 
89
+ ### Media identity and public URL checks
90
+
91
+ Follow `tr-images` for upload → verification → private preparation → publication.
92
+ Do not use pending imports or share authenticated editor URLs. From Core
93
+ 0.3.49, new uploads default to root filenames without date folders; explicit
94
+ folders and WordPress upload-relative folders remain supported. Read returned
95
+ paths rather than flattening names or predicting numeric collision suffixes.
96
+ Keep each Site's media namespace separate, including when several old Sites
97
+ are merged. Verify historical image/PDF URLs independently of rewritten HTML;
98
+ use established prefix mappings and exact exceptions, not a redirect for every
99
+ new variant. The matching Core runtime is required. See
100
+ https://typeroll.com/docs/tools/media/ and
101
+ https://typeroll.com/docs/tools/redirects/#image-and-file-addresses.
102
+
89
103
  ## Listing and verification
90
104
 
91
105
  An archive is a Page with `core/page_list` filtered by `content_type`. Configure
@@ -190,6 +190,20 @@ source JavaScript, and carry each market's own analytics and advertising IDs
190
190
  over in that site's Integrations app with its cookie banner enabled. Never
191
191
  reuse one market's tracking IDs on another.
192
192
 
193
+ ### Media identity and public URL checks
194
+
195
+ Follow `tr-images` for upload → verification → private preparation → publication.
196
+ Do not use pending imports or share authenticated editor URLs. From Core
197
+ 0.3.49, new uploads default to root filenames without date folders; explicit
198
+ folders and WordPress upload-relative folders remain supported. Read returned
199
+ paths rather than flattening names or predicting numeric collision suffixes.
200
+ Keep each Site's media namespace separate, including when several old Sites
201
+ are merged. Verify historical image/PDF URLs independently of rewritten HTML;
202
+ use established prefix mappings and exact exceptions, not a redirect for every
203
+ new variant. The matching Core runtime is required. See
204
+ https://typeroll.com/docs/tools/media/ and
205
+ https://typeroll.com/docs/tools/redirects/#image-and-file-addresses.
206
+
193
207
  ## Phase 5 — Redirects for everything you didn't preserve
194
208
 
195
209
  Work the coverage report, not your memory:
@@ -16,7 +16,6 @@ Use standard blocks first, reviewed custom types next, rare documented HTML last
16
16
  All four combinations must preserve or meaningfully redirect every old public URL. That
17
17
  shared contract defines acceptance; this recipe only adds source-specific steps.
18
18
 
19
-
20
19
  > **The buffer model (draft writes).** Every content write in this recipe
21
20
  > (pages, blocks and partials) lands in an unsaved per-doc
22
21
  > DRAFT — deploys and plain previews only see SAVED content. For recipe-style
@@ -24,7 +23,6 @@ shared contract defines acceptance; this recipe only adds source-specific steps.
24
23
  > the task itself), or run `commit_working_copy` per doc before any
25
24
  > `trigger_deploy`. Preview your drafts with `include_working_copy: true`.
26
25
 
27
-
28
26
  The platform's migration workflow is the "managed" path for customers who
29
27
  want one-click. It runs on the server and is also available to you:
30
28
  `start_workflow type="migration" config={ wp_url }` on an existing site, or
@@ -69,7 +67,6 @@ Verify a primary/surface change in a test Version across header, footer, cards,
69
67
  menus and buttons, then restore the test settings. Do not republish automatically.
70
68
 
71
69
 
72
-
73
70
  ## Preconditions
74
71
 
75
72
  **Run the readiness check FIRST — before touching any content:**
@@ -237,6 +234,30 @@ c. Migrate referenced images with `upload_media_from_url`. The customer's
237
234
  media reference only after verification. Stop and report a failed required
238
235
  transfer; do not silently hotlink the WordPress source.
239
236
 
237
+ Preserve the old public image addresses separately from rewriting the new
238
+ HTML. Prefer a safe existing address or `public_path` when appropriate;
239
+ changing the host still needs compatible routing. Use a prefix redirect only
240
+ for a complete, established namespace whose remaining paths and filenames are
241
+ unchanged. Use exact mappings for different filenames or statuses, with Bulk
242
+ overflow when needed. Do not generate a redirect for each private or
243
+ never-public variant, infer a wildcard from a partial image inventory, or
244
+ delete existing rules after rewriting HTML. Core 0.3.48 omits redundant
245
+ per-file lines covered by an equivalent existing rule in the frozen output,
246
+ without changing stored rules. See https://typeroll.com/docs/tools/redirects/.
247
+
248
+ From Core 0.3.49, new uploads default to the media root (`photo.jpg`), without
249
+ automatic year/month folders. Explicit folders and WordPress upload-relative
250
+ folders are preserved; `wp-content/uploads` and multisite prefixes are removed
251
+ from new addresses. Different bytes receive permanent numeric names (`photo-2.jpg`);
252
+ safe old aliases for included media stay available without a redirect per replacement.
253
+ Managed WordPress imports declare their uploads namespace so publication can
254
+ use one prefix with exact collision exceptions. A borrowed image alone does
255
+ not declare a namespace. Check the returned public paths and the complete old
256
+ URL inventory; Cloud requires the corresponding platform release. A reserved name
257
+ does not retain a deleted or unused file in every future build. Private object
258
+ keys and responsive variants can still contain hashes; never construct URLs
259
+ from those internal keys.
260
+
240
261
  The managed importer stores cleaned HTML. Typeroll does not convert HTML into blocks, and `set_page_mode` never rewrites HTML. You, the external agent, rebuild the imported content with ordinary block tools. The owner does not need to convert every Page manually. There is no editor conversion preview; it was removed in Core 0.2.58. Preserve the complete source before switching modes and never publish the empty intermediate Page.
241
262
 
242
263
  d. Rebuild into editable blocks according to the selected intent. Preserve exact
@@ -469,7 +490,6 @@ Compare ordered headings/text/media/CTAs, including malformed wrappers, lazy and
469
490
  noscript images and related-content boundaries. Existing Pages are not rewritten;
470
491
  repair confirmed placement errors against raw source without reimporting edits.
471
492
 
472
-
473
493
  ## Navigation and empty-media variants
474
494
 
475
495
  Inventory first-step input banners independently of final submission providers.
@@ -486,7 +506,6 @@ explicit `show_image: false`. Compare actual footer link height plus gap, wrappi
486
506
  focus and column breakpoints; compact navigation density is an intentional option.
487
507
  Verify native preview and static output on the agreed viewport boundaries.
488
508
 
489
-
490
509
  ## Before retiring the source
491
510
 
492
511
  Follow the starter's workflows/source-media.md. Archive unused and print originals
@@ -366,8 +366,32 @@ Core 0.2.107 checks Pages capacity during dry-run and final upload:
366
366
  2,000 static, 100 dynamic, 1,000 characters per line, with generated slash variants
367
367
  and hostname aliases included. `_redirects` has a bounded 10 MiB transport envelope;
368
368
  `_headers` keeps 128 KiB. Source preflight counts configured rules conservatively;
369
- final output excludes redirects shadowing built pages. Remove obsolete shadowed
370
- rules at source when close to capacity. Never split `_redirects` into multiple files.
369
+ final output excludes redirects shadowing built pages. Core 0.3.46 and later
370
+ deliver excess exact paths through account-scoped Bulk Redirects with the
371
+ Organization's shared build engine and approved Cloudflare scopes. All active
372
+ and staging lists share the account quota. Never drop required mappings or
373
+ prioritize only popular URLs to fit that quota; resolve the capacity blocker.
374
+ Core 0.3.48 omits literal file rules already covered by an existing prefix or
375
+ placeholder with the same destination and HTTP status, including narrower-rule
376
+ precedence and generated aliases. Stored rules are unchanged. Keep old public
377
+ file URLs working independently of rewriting HTML; do not invent wildcards from
378
+ partial media inventories or create automatic rules for never-public variants.
379
+ Use https://typeroll.com/docs/tools/redirects/ for current budgets and the policy.
380
+
381
+ From Core 0.3.49, new uploads default to the media root (`photo.jpg`), without
382
+ automatic year/month folders. Explicit folders and WordPress upload-relative
383
+ folders are preserved; `wp-content/uploads` and multisite prefixes are removed
384
+ from new addresses. Different bytes receive permanent numeric names (`photo-2.jpg`);
385
+ safe old aliases for included media stay available without a redirect per replacement.
386
+ Managed WordPress imports declare their uploads namespace so publication can
387
+ use one prefix with exact collision exceptions. A borrowed image alone does
388
+ not declare a namespace. Check the returned public paths and the complete old
389
+ URL inventory; Cloud requires the corresponding platform release. A reserved name
390
+ does not retain a deleted or unused file in every future build. Private object
391
+ keys and responsive variants can still contain hashes; never construct URLs
392
+ from those internal keys.
393
+
394
+ Never split `_redirects` into multiple files.
371
395
  After publication, run `verify_migration_urls` against the agreed full inventory.
372
396
  Do not delete old provider redirect lists without separate explicit approval.
373
397
 
@@ -32,6 +32,21 @@ the CMS. Do not delete source files or cancel old hosting as part of this routin
32
32
  separate old-host retirement decision. This archive does not preserve old
33
33
  public URLs by itself: keep URL parity/redirect acceptance separate.
34
34
 
35
+ ## Keep archive keys separate from public media paths
36
+
37
+ An archive preserves full source identity. Core 0.3.49 public CMS names instead
38
+ default new uploads to the Site's media root, preserve optional/WordPress
39
+ upload-relative folders, and assign permanent numeric suffixes for conflicts.
40
+ Those delivery names are not a substitute for this archive manifest. Never
41
+ flatten source folders or infer the archive key from a new public filename.
42
+
43
+ Verify copied bytes before creating content references. Private upload/editor
44
+ URLs are not public or permanent archive links, and preparation is not
45
+ publication. A prefix redirect cannot restore unavailable files or prove a
46
+ complete source inventory. Keep old image/PDF URL verification separate from
47
+ private archiving and the approval to retire hosting. See the public media
48
+ and redirect guides for the installed Core version.
49
+
35
50
  ## Prepare print images for the web
36
51
 
37
52
  Use `scripts/typeroll/prepare_image.py` for a reviewed local TIFF or other original.