@wootsup/yt-builder-mcp 1.4.1 → 1.6.0

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.
Files changed (154) hide show
  1. package/dist/auth.d.ts +11 -0
  2. package/dist/auth.d.ts.map +1 -1
  3. package/dist/auth.js +11 -0
  4. package/dist/auth.js.map +1 -1
  5. package/dist/cli/doctor-command.d.ts.map +1 -1
  6. package/dist/cli/doctor-command.js +96 -8
  7. package/dist/cli/doctor-command.js.map +1 -1
  8. package/dist/client.d.ts +18 -0
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +13 -1
  11. package/dist/client.js.map +1 -1
  12. package/dist/clients/claude-code.d.ts.map +1 -1
  13. package/dist/clients/claude-code.js +5 -2
  14. package/dist/clients/claude-code.js.map +1 -1
  15. package/dist/clients/claude-desktop.d.ts.map +1 -1
  16. package/dist/clients/claude-desktop.js +5 -2
  17. package/dist/clients/claude-desktop.js.map +1 -1
  18. package/dist/clients/cline.d.ts.map +1 -1
  19. package/dist/clients/cline.js +5 -2
  20. package/dist/clients/cline.js.map +1 -1
  21. package/dist/clients/codex-cli.d.ts.map +1 -1
  22. package/dist/clients/codex-cli.js +127 -2
  23. package/dist/clients/codex-cli.js.map +1 -1
  24. package/dist/clients/continue.d.ts.map +1 -1
  25. package/dist/clients/continue.js +11 -2
  26. package/dist/clients/continue.js.map +1 -1
  27. package/dist/clients/cursor.d.ts.map +1 -1
  28. package/dist/clients/cursor.js +5 -2
  29. package/dist/clients/cursor.js.map +1 -1
  30. package/dist/clients/gemini-cli.d.ts.map +1 -1
  31. package/dist/clients/gemini-cli.js +5 -2
  32. package/dist/clients/gemini-cli.js.map +1 -1
  33. package/dist/clients/index.d.ts +49 -0
  34. package/dist/clients/index.d.ts.map +1 -1
  35. package/dist/clients/index.js +79 -0
  36. package/dist/clients/index.js.map +1 -1
  37. package/dist/clients/roo-code.d.ts.map +1 -1
  38. package/dist/clients/roo-code.js +5 -2
  39. package/dist/clients/roo-code.js.map +1 -1
  40. package/dist/clients/zed.d.ts.map +1 -1
  41. package/dist/clients/zed.js +22 -2
  42. package/dist/clients/zed.js.map +1 -1
  43. package/dist/diagnostics/doctor.d.ts +60 -2
  44. package/dist/diagnostics/doctor.d.ts.map +1 -1
  45. package/dist/diagnostics/doctor.js +185 -8
  46. package/dist/diagnostics/doctor.js.map +1 -1
  47. package/dist/diagnostics/startup-self-probe.d.ts +39 -0
  48. package/dist/diagnostics/startup-self-probe.d.ts.map +1 -0
  49. package/dist/diagnostics/startup-self-probe.js +87 -0
  50. package/dist/diagnostics/startup-self-probe.js.map +1 -0
  51. package/dist/gateway/essentials.d.ts +15 -6
  52. package/dist/gateway/essentials.d.ts.map +1 -1
  53. package/dist/gateway/essentials.js +51 -5
  54. package/dist/gateway/essentials.js.map +1 -1
  55. package/dist/index.d.ts +15 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +37 -2
  58. package/dist/index.js.map +1 -1
  59. package/dist/net/proxy-dispatcher.d.ts +7 -0
  60. package/dist/net/proxy-dispatcher.d.ts.map +1 -1
  61. package/dist/net/proxy-dispatcher.js +7 -2
  62. package/dist/net/proxy-dispatcher.js.map +1 -1
  63. package/dist/net/site-basic-auth.d.ts +65 -0
  64. package/dist/net/site-basic-auth.d.ts.map +1 -0
  65. package/dist/net/site-basic-auth.js +118 -0
  66. package/dist/net/site-basic-auth.js.map +1 -0
  67. package/dist/proxy/bridge.d.ts +18 -1
  68. package/dist/proxy/bridge.d.ts.map +1 -1
  69. package/dist/proxy/bridge.js +23 -3
  70. package/dist/proxy/bridge.js.map +1 -1
  71. package/dist/setup-wizard-types.d.ts +9 -0
  72. package/dist/setup-wizard-types.d.ts.map +1 -1
  73. package/dist/setup-wizard.d.ts.map +1 -1
  74. package/dist/setup-wizard.js +37 -0
  75. package/dist/setup-wizard.js.map +1 -1
  76. package/dist/sites/client-pool.d.ts +35 -1
  77. package/dist/sites/client-pool.d.ts.map +1 -1
  78. package/dist/sites/client-pool.js +45 -1
  79. package/dist/sites/client-pool.js.map +1 -1
  80. package/dist/tools/elements/builders.d.ts.map +1 -1
  81. package/dist/tools/elements/builders.js +65 -8
  82. package/dist/tools/elements/builders.js.map +1 -1
  83. package/dist/tools/elements/handlers.d.ts +45 -0
  84. package/dist/tools/elements/handlers.d.ts.map +1 -1
  85. package/dist/tools/elements/handlers.js +178 -2
  86. package/dist/tools/elements/handlers.js.map +1 -1
  87. package/dist/tools/format/elements-format.d.ts.map +1 -1
  88. package/dist/tools/format/elements-format.js +8 -0
  89. package/dist/tools/format/elements-format.js.map +1 -1
  90. package/dist/tools/format/health-format.d.ts +2 -0
  91. package/dist/tools/format/health-format.d.ts.map +1 -1
  92. package/dist/tools/format/health-format.js +11 -0
  93. package/dist/tools/format/health-format.js.map +1 -1
  94. package/dist/tools/format/pages-format.d.ts +42 -0
  95. package/dist/tools/format/pages-format.d.ts.map +1 -1
  96. package/dist/tools/format/pages-format.js +43 -0
  97. package/dist/tools/format/pages-format.js.map +1 -1
  98. package/dist/tools/format/source-schema-format.d.ts +64 -0
  99. package/dist/tools/format/source-schema-format.d.ts.map +1 -0
  100. package/dist/tools/format/source-schema-format.js +161 -0
  101. package/dist/tools/format/source-schema-format.js.map +1 -0
  102. package/dist/tools/health.d.ts.map +1 -1
  103. package/dist/tools/health.js +31 -0
  104. package/dist/tools/health.js.map +1 -1
  105. package/dist/tools/multi-items/builders.js +2 -2
  106. package/dist/tools/multi-items/builders.js.map +1 -1
  107. package/dist/tools/multi-items/clean-implode-handler.d.ts +2 -1
  108. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -1
  109. package/dist/tools/multi-items/clean-implode-handler.js +9 -1
  110. package/dist/tools/multi-items/clean-implode-handler.js.map +1 -1
  111. package/dist/tools/multi-items/inspect-handler.d.ts +8 -0
  112. package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -1
  113. package/dist/tools/multi-items/inspect-handler.js +48 -2
  114. package/dist/tools/multi-items/inspect-handler.js.map +1 -1
  115. package/dist/tools/pages/builders.d.ts.map +1 -1
  116. package/dist/tools/pages/builders.js +126 -28
  117. package/dist/tools/pages/builders.js.map +1 -1
  118. package/dist/tools/pages/handlers-read.d.ts +21 -2
  119. package/dist/tools/pages/handlers-read.d.ts.map +1 -1
  120. package/dist/tools/pages/handlers-read.js +183 -11
  121. package/dist/tools/pages/handlers-read.js.map +1 -1
  122. package/dist/tools/pages/handlers-write.d.ts +42 -1
  123. package/dist/tools/pages/handlers-write.d.ts.map +1 -1
  124. package/dist/tools/pages/handlers-write.js +114 -5
  125. package/dist/tools/pages/handlers-write.js.map +1 -1
  126. package/dist/tools/pages/schemas.d.ts +26 -0
  127. package/dist/tools/pages/schemas.d.ts.map +1 -1
  128. package/dist/tools/pages/schemas.js +38 -0
  129. package/dist/tools/pages/schemas.js.map +1 -1
  130. package/dist/tools/pool-resolve-helper.d.ts +11 -26
  131. package/dist/tools/pool-resolve-helper.d.ts.map +1 -1
  132. package/dist/tools/pool-resolve-helper.js +50 -0
  133. package/dist/tools/pool-resolve-helper.js.map +1 -1
  134. package/dist/tools/sources/builders.d.ts.map +1 -1
  135. package/dist/tools/sources/builders.js +258 -4
  136. package/dist/tools/sources/builders.js.map +1 -1
  137. package/dist/tools/sources/handlers-bind.d.ts +107 -0
  138. package/dist/tools/sources/handlers-bind.d.ts.map +1 -1
  139. package/dist/tools/sources/handlers-bind.js +197 -2
  140. package/dist/tools/sources/handlers-bind.js.map +1 -1
  141. package/dist/tools/sources/handlers.d.ts +54 -0
  142. package/dist/tools/sources/handlers.d.ts.map +1 -1
  143. package/dist/tools/sources/handlers.js +82 -0
  144. package/dist/tools/sources/handlers.js.map +1 -1
  145. package/dist/tools/sparse-fields.d.ts +37 -1
  146. package/dist/tools/sparse-fields.d.ts.map +1 -1
  147. package/dist/tools/sparse-fields.js +35 -5
  148. package/dist/tools/sparse-fields.js.map +1 -1
  149. package/dist/tools/tool-builder/results.d.ts.map +1 -1
  150. package/dist/tools/tool-builder/results.js +39 -0
  151. package/dist/tools/tool-builder/results.js.map +1 -1
  152. package/manifest.json +1 -1
  153. package/package.json +1 -1
  154. package/skills/yt-builder-mcp/SKILL.md +237 -39
@@ -13,13 +13,13 @@
13
13
  * @license MIT
14
14
  */
15
15
  import { z } from 'zod';
16
- import { withSiteRetry } from '../pool-resolve-helper.js';
17
- import { POST_ID, RESOLVE_URL, SITE_ID_SCHEMA, TEMPLATE_ID, TEMPLATE_ID_OPTIONAL, } from '../shared-schemas.js';
16
+ import { withSiteRetry, withWriteSiteRetry } from '../pool-resolve-helper.js';
17
+ import { ETAG as ETAG_STRICT, POST_ID, RESOLVE_URL, SITE_ID_SCHEMA, TEMPLATE_ID, TEMPLATE_ID_OPTIONAL, } from '../shared-schemas.js';
18
18
  import { FIELDS, FLAT, MAX_CHARS } from '../sparse-fields.js';
19
19
  import { creating, defineTool, mutating, readOnly, withSiteMeta, } from '../tool-builder.js';
20
- import { handleGetEtag, handlePageGetLayout, handlePageGetSchema, handlePagesList, handlePagesResolve, handleTemplateSummary, } from './handlers-read.js';
21
- import { handlePageDynamize, handlePagePublish, handlePagesCreate, handlePagesDelete, handlePageSave, } from './handlers-write.js';
22
- import { ETAG_OUTPUT_SCHEMA, PAGE_DYNAMIZE_INPUT, PAGES_CREATE_INPUT, PAGES_DELETE_INPUT, PAGES_DELETE_OUTPUT_SCHEMA, PAGES_LIST_OUTPUT_SCHEMA, PAGES_RESOLVE_INPUT, PAGES_RESOLVE_OUTPUT_SCHEMA, SCHEMA_OUTPUT_SCHEMA, TEMPLATE_SUMMARY_OUTPUT_SCHEMA, } from './schemas.js';
20
+ import { handleGetEtag, handlePageGetLayout, handlePageGetSchema, handlePagesList, handlePagesResolve, handleRenderPreview, handleTemplateSummary, } from './handlers-read.js';
21
+ import { handlePageDynamize, handlePagePublish, handlePagesCreate, handlePagesDelete, handlePageSave, handleTemplateSetType, TEMPLATE_SET_TYPE_OUTPUT_SCHEMA, } from './handlers-write.js';
22
+ import { ETAG_OUTPUT_SCHEMA, PAGE_DYNAMIZE_INPUT, PAGES_CREATE_INPUT, PAGES_DELETE_INPUT, PAGES_DELETE_OUTPUT_SCHEMA, PAGES_LIST_OUTPUT_SCHEMA, PAGES_RESOLVE_INPUT, PAGES_RESOLVE_OUTPUT_SCHEMA, RENDER_PREVIEW_OUTPUT_SCHEMA, SCHEMA_OUTPUT_SCHEMA, TEMPLATE_SUMMARY_OUTPUT_SCHEMA, } from './schemas.js';
23
23
  // F-14: page-level save/publish accept OPTIONAL ETag (no precondition lock
24
24
  // at template level — element/binding mutations REQUIRE one via the strict
25
25
  // ETAG in shared-schemas.ts). Schema and description now agree: optional
@@ -111,14 +111,13 @@ export function buildPagesTools(pool) {
111
111
  defineTool({
112
112
  name: 'yootheme_builder_page_get_layout',
113
113
  description: 'Get the layout tree for one template — address it by `template_id` ' +
114
- '(from pages_list), `post_id` (numeric post/article id), or `url` ' +
115
- '(public page URL, resolved in one call). For dynamize/bind work prefer ' +
116
- '`mode:"bindings_only"` the binding skeleton only (no style props). ' +
117
- 'Default `mode:"full"` returns nested `{layout, etag}`. `flat:true` gives ' +
118
- 'a depth-first `{elements:[...], etag}` array (with `fields[]`). A repeated ' +
119
- 'unchanged read auto-skips `[unchanged]`; `force:true` re-fetches. ' +
120
- '`max_chars` bounds the (full-mode) text output. ' +
121
- 'Operates on the default site unless site_id is provided.',
114
+ '(from pages_list), `post_id` (numeric post/article id), or `url`. For ' +
115
+ 'dynamize/bind prefer `mode:"bindings_only"` (binding skeleton, no style ' +
116
+ 'props). Default `mode:"full"` returns nested `{layout, etag}`; `flat:true` ' +
117
+ 'gives a depth-first `{elements:[...]}` array (with `fields[]`). A repeated ' +
118
+ 'unchanged read auto-skips (`force:true` re-fetches). `max_chars` bounds the ' +
119
+ 'text; a clipped read returns `next_cursor` (pass back as `cursor`) to page ' +
120
+ 'the rest. Operates on the default site unless site_id is provided.',
122
121
  inputSchema: {
123
122
  site_id: SITE_ID_SCHEMA,
124
123
  // G-A (Track-C URL→layout): three interchangeable addressing modes
@@ -129,12 +128,21 @@ export function buildPagesTools(pool) {
129
128
  url: RESOLVE_URL,
130
129
  // F195 (P0): bindings_only returns the trimmed binding skeleton —
131
130
  // recommended for dynamize/bind workflows (token-efficient).
131
+ // G1 (V3): outline returns a token-efficient INDENTED semantic
132
+ // outline — one line per node, cheapest way to orient in a large
133
+ // layout before reading specifics.
132
134
  mode: z
133
- .enum(['full', 'bindings_only'])
135
+ .enum(['full', 'bindings_only', 'outline'])
134
136
  .optional()
135
137
  .describe('full (default) = whole nested layout; bindings_only = trimmed ' +
136
138
  'binding skeleton (path/type/name/has_binding/source/children, ' +
137
- 'no style props). Prefer bindings_only for dynamize/bind work.'),
139
+ 'no style props); outline = a token-efficient INDENTED text ' +
140
+ 'tree (one line per node: label ▸ type (bound: …) [sN]) for ' +
141
+ 'cheap orientation in a large layout. Each outline line carries ' +
142
+ 'a per-read handle [sN] AND the node’s real JSON-Pointer ' +
143
+ 'path; the handle is a short alias that is STATE-SCOPED — re-read ' +
144
+ 'after any mutation. Prefer bindings_only for dynamize/bind, ' +
145
+ 'outline to first map an unfamiliar template.'),
138
146
  // F195 (P0): bypass the per-process unchanged-read dedup.
139
147
  force: z
140
148
  .boolean()
@@ -144,6 +152,15 @@ export function buildPagesTools(pool) {
144
152
  flat: FLAT,
145
153
  fields: FIELDS,
146
154
  max_chars: MAX_CHARS,
155
+ // B7 (Glöckle continuation cursor): resume a clipped full/
156
+ // bindings_only text leg from its char offset. Opaque
157
+ // base64url `o:<n>` — the SAME offset-cursor contract
158
+ // pages_list/sources_list use. Omit to read from the start.
159
+ cursor: z
160
+ .string()
161
+ .optional()
162
+ .describe('Char-offset cursor from a clipped response\'s next_cursor — resumes ' +
163
+ 'the same dump at that offset (use with max_chars).'),
147
164
  },
148
165
  // No outputSchema: the response shape is a union (nested OR flat with
149
166
  // optional projection) and the JSON-Pointer-keyed nested shape is
@@ -221,14 +238,44 @@ export function buildPagesTools(pool) {
221
238
  annotations: readOnly('Template Summary'),
222
239
  handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleTemplateSummary(client, rest), site)),
223
240
  }),
241
+ // ─── F5 + N5 (Glöckle HANDOFF-4/5) — render_preview ───────────
242
+ // The authenticated post-write render HEALTHCHECK. READ-ONLY: renders
243
+ // the template server-side over the existing Bearer channel and reports
244
+ // {rendered, item_count, empty, error?} + a cache_purge_hint — answering
245
+ // "does my saved page actually render, with how many items?" where an
246
+ // external cURL 401s behind QA Basic-Auth. L2 (advanced-read) — reached
247
+ // via yootheme_builder_advanced_read, NOT in ESSENTIAL_TOOLS, so the L1
248
+ // token-baseline stays at 32. Addressing mirrors page_get_layout:
249
+ // template_id OR url (exactly one).
250
+ defineTool({
251
+ name: 'yootheme_builder_render_preview',
252
+ description: 'Render-check a saved template over the authenticated channel — does it ' +
253
+ 'actually render, with how many items, or is it blank? Address by ' +
254
+ '`template_id` (from pages_list) OR `url` (a public page URL, resolved for ' +
255
+ 'you). Returns {rendered, item_count, empty, error?, cache_purge_hint}. Use ' +
256
+ 'AFTER a page_save / element_bind_source to confirm the live page is not ' +
257
+ 'silently empty (a bad binding "saves" then renders blank); the swallowed ' +
258
+ 'YOOtheme render error is surfaced in `error`. Read-only — renders without ' +
259
+ 'persisting. Operates on the default site unless site_id is provided.',
260
+ inputSchema: {
261
+ site_id: SITE_ID_SCHEMA,
262
+ // Exactly one of template_id / url — mirrors page_get_layout's
263
+ // TEMPLATE_ID_OPTIONAL + url addressing (resolveEffectiveTemplateId).
264
+ template_id: TEMPLATE_ID_OPTIONAL,
265
+ url: RESOLVE_URL,
266
+ },
267
+ outputSchema: RENDER_PREVIEW_OUTPUT_SCHEMA,
268
+ annotations: readOnly('Render Preview'),
269
+ handler: async ({ site_id, ...rest }) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handleRenderPreview(client, rest), site)),
270
+ }),
224
271
  defineTool({
225
272
  name: 'yootheme_builder_page_save',
226
- description: 'Re-run save-transforms + flush caches. Optionally pass a whole `layout` to ' +
227
- 'REPLACE the template tree ATOMICALLY (F85)ideal for wholesale dynamization ' +
228
- '(read layout swap query remap fields write back). A supplied layout is ' +
229
- 'validated + ETag-locked; on rejection nothing is persisted. Omit `layout` to just ' +
230
- 're-run transforms (no-op if byte-identical) for incremental edits use ' +
231
- 'element_add/update/bind/delete first. New pages: pages_create. Publish: page_publish. ' +
273
+ description: 'Re-run save-transforms + flush caches. Optionally REPLACE the template tree by ' +
274
+ 'passing the INNER {type:"layout",children:[...]} tree as `layout`NOT the full ' +
275
+ 'template node page_get_layout returns (rejected 422, would blank the page). ' +
276
+ 'Validated + ETag-locked; on reject nothing persists. An unrenderable layout is ' +
277
+ 'refused PRE-WRITE (422). `dry_run:true` preflights; the success response carries ' +
278
+ '`previous_layout` for 1-call rollback. Omit `layout` to re-run transforms only. ' +
232
279
  'ETag optional (412 on conflict; else last-write-wins). ' +
233
280
  'Operates on the default site unless site_id is provided.',
234
281
  inputSchema: {
@@ -240,12 +287,22 @@ export function buildPagesTools(pool) {
240
287
  layout: z
241
288
  .record(z.string(), z.unknown())
242
289
  .optional()
243
- .describe('Optional whole YT layout-node object (e.g. {type:"layout",children:[...]}) ' +
244
- 'to replace the template tree atomically. Validated + ETag-locked. ' +
290
+ .describe('Optional whole YT layout-node object the INNER tree ' +
291
+ '{type:"layout",children:[...]}, NOT the full template node ' +
292
+ 'page_get_layout returns (passing that is rejected as a double-nest). ' +
293
+ 'Replaces the template tree atomically. Validated + ETag-locked. ' +
245
294
  'Omit to just re-run save-transforms.'),
295
+ // U3/F3 (Glöckle HANDOFF-4): optional render preflight.
296
+ dry_run: z
297
+ .boolean()
298
+ .optional()
299
+ .describe('Optional. When true, run the double-nest guard + a read-only Builder ' +
300
+ 'render dry-run and return a validation_report WITHOUT persisting ' +
301
+ '(no write, no cache flush, no ETag bump). Use to verify a binding ' +
302
+ 'renders before it can blank the live page. Omit to actually save.'),
246
303
  },
247
304
  annotations: mutating('Save Page'),
248
- handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePageSave(client, rest, extra), site), buildRenderContext({
305
+ handler: async ({ site_id, ...rest }, extra) => withWriteSiteRetry(pool, site_id, 'yootheme_builder_page_save', async (client, site) => withRenderContext(withSiteMeta(await handlePageSave(client, rest, extra), site), buildRenderContext({
249
306
  siteUrl: site.url,
250
307
  parentTemplateId: rest.template_id,
251
308
  locale: localeForSite(site),
@@ -266,7 +323,48 @@ export function buildPagesTools(pool) {
266
323
  // unchanged template snapshots the same ETag and flushes
267
324
  // the same caches. Matrix marks `idempotentHint:true`.
268
325
  annotations: mutating('Publish Page'),
269
- handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePagePublish(client, rest, extra), site), buildRenderContext({
326
+ handler: async ({ site_id, ...rest }, extra) => withWriteSiteRetry(pool, site_id, 'yootheme_builder_page_publish', async (client, site) => withRenderContext(withSiteMeta(await handlePagePublish(client, rest, extra), site), buildRenderContext({
327
+ siteUrl: site.url,
328
+ parentTemplateId: rest.template_id,
329
+ locale: localeForSite(site),
330
+ }))),
331
+ }),
332
+ // ─── N3 (Glöckle HANDOFF-5) — template_set_type ───────────────
333
+ // L2 (advanced): set which archive/single a YOOtheme theme template
334
+ // is assigned to (the `templates.<id>.type` condition pages_list
335
+ // reads). The #1 missing step in a taxonomy/CPT-rename workflow —
336
+ // after categoryFaq→categoryHelp the `taxonomy-category_faq` /
337
+ // `single-gloeckle_faq` templates are orphaned and must be re-typed.
338
+ defineTool({
339
+ name: 'yootheme_builder_template_set_type',
340
+ description:
341
+ // N3 (Glöckle HANDOFF-5) — archive/single TYPE reassignment.
342
+ 'Reassign which archive/single a YOOtheme THEME template applies to — ' +
343
+ 'set its `type` condition (the value pages_list shows) in ONE ETag-locked ' +
344
+ 'write. Use after a taxonomy/CPT rename orphans a template (e.g. re-type ' +
345
+ '"taxonomy-category_faq" → "taxonomy-category_help", "single-gloeckle_faq" ' +
346
+ '→ "single-gloeckle_help"). Returns {type, previous_type, new_etag} — ' +
347
+ 'previous_type is the read of the prior assignment, folded in. THEME ' +
348
+ 'templates only: a page:/article: layout is refused (422). ETag req. ' +
349
+ 'Operates on the default site unless site_id is provided.',
350
+ inputSchema: {
351
+ site_id: SITE_ID_SCHEMA,
352
+ template_id: TEMPLATE_ID,
353
+ type: z
354
+ .string()
355
+ .min(1)
356
+ .describe('The new archive/single TYPE assignment (the `type` condition ' +
357
+ 'pages_list surfaces), e.g. "taxonomy-category_help", ' +
358
+ '"single-gloeckle_help", "archive-post", or the bare "template". ' +
359
+ 'Read the current value via pages_list (the `type` column) or ' +
360
+ 'GET the template first. `page`/`article` are NOT valid here.'),
361
+ // Required strict ETag (the re-type is a real mutation; the PHP
362
+ // controller enforces If-Match → 428 if omitted, 412 on stale).
363
+ etag: ETAG_STRICT,
364
+ },
365
+ outputSchema: TEMPLATE_SET_TYPE_OUTPUT_SCHEMA,
366
+ annotations: mutating('Set Template Type'),
367
+ handler: async ({ site_id, ...rest }, extra) => withWriteSiteRetry(pool, site_id, 'yootheme_builder_template_set_type', async (client, site) => withRenderContext(withSiteMeta(await handleTemplateSetType(client, rest, extra), site), buildRenderContext({
270
368
  siteUrl: site.url,
271
369
  parentTemplateId: rest.template_id,
272
370
  locale: localeForSite(site),
@@ -290,7 +388,7 @@ export function buildPagesTools(pool) {
290
388
  // No outputSchema: the response shape is a discriminated union
291
389
  // (201 wet vs 200 dry-run). page_get_layout uses the same pattern.
292
390
  annotations: mutating('Create Page'),
293
- handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePagesCreate(client, rest, extra), site), buildRenderContext({
391
+ handler: async ({ site_id, ...rest }, extra) => withWriteSiteRetry(pool, site_id, 'yootheme_builder_pages_create', async (client, site) => withRenderContext(withSiteMeta(await handlePagesCreate(client, rest, extra), site), buildRenderContext({
294
392
  siteUrl: site.url,
295
393
  // A new page has no caller-supplied parent
296
394
  // template; null until the REST response carries
@@ -320,7 +418,7 @@ export function buildPagesTools(pool) {
320
418
  // `summary` object — pages_create uses the same no-outputSchema
321
419
  // pattern for its discriminated union.
322
420
  annotations: creating('Dynamize Page'),
323
- handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withRenderContext(withSiteMeta(await handlePageDynamize(client, rest, extra), site), buildRenderContext({
421
+ handler: async ({ site_id, ...rest }, extra) => withWriteSiteRetry(pool, site_id, 'yootheme_builder_page_dynamize', async (client, site) => withRenderContext(withSiteMeta(await handlePageDynamize(client, rest, extra), site), buildRenderContext({
324
422
  siteUrl: site.url,
325
423
  parentTemplateId: null,
326
424
  locale: localeForSite(site),
@@ -336,7 +434,7 @@ export function buildPagesTools(pool) {
336
434
  inputSchema: { site_id: SITE_ID_SCHEMA, ...PAGES_DELETE_INPUT },
337
435
  outputSchema: PAGES_DELETE_OUTPUT_SCHEMA,
338
436
  annotations: mutating('Delete Page'),
339
- handler: async ({ site_id, ...rest }, extra) => withSiteRetry(pool, site_id, async (client, site) => withSiteMeta(await handlePagesDelete(client, rest, extra), site)),
437
+ handler: async ({ site_id, ...rest }, extra) => withWriteSiteRetry(pool, site_id, 'yootheme_builder_pages_delete', async (client, site) => withSiteMeta(await handlePagesDelete(client, rest, extra), site)),
340
438
  }),
341
439
  ];
342
440
  }
@@ -1 +1 @@
1
- {"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/pages/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACH,OAAO,EACP,WAAW,EACX,cAAc,EACd,WAAW,EACX,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,E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cAAc,EAAE,GAAG,kBAAkB,EAAE;YAC/D,YAAY,EAAE,0BAA0B;YACxC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC;YACpC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAC3C,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,+BAA+B,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CACtF,YAAY,CAAC,MAAM,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;SAC5E,CAAC;KACL,CAAC;AACN,CAAC"}
@@ -38,14 +38,15 @@ export declare function handlePagesResolve(client: RestClient, { url }: {
38
38
  }): Promise<ToolResult>;
39
39
  /** Test-only: clear the dedup cache between cases (mirrors the bus reset idiom). */
40
40
  export declare function __resetLayoutDedupCacheForTests(): void;
41
- export declare function handlePageGetLayout(client: RestClient, { template_id, post_id, url, flat, fields, mode, force, max_chars }: {
41
+ export declare function handlePageGetLayout(client: RestClient, { template_id, post_id, url, flat, fields, mode, force, cursor, max_chars }: {
42
42
  template_id?: string;
43
43
  post_id?: number;
44
44
  url?: string;
45
45
  flat?: boolean;
46
46
  fields?: readonly string[];
47
- mode?: 'full' | 'bindings_only';
47
+ mode?: 'full' | 'bindings_only' | 'outline';
48
48
  force?: boolean;
49
+ cursor?: string;
49
50
  max_chars?: number;
50
51
  }): Promise<ToolResult>;
51
52
  export declare function handlePageGetSchema(client: RestClient, { template_id, post_id, url, fields, max_chars }: {
@@ -65,4 +66,22 @@ export declare function handleGetEtag(client: RestClient): Promise<ToolResult>;
65
66
  export declare function handleTemplateSummary(client: RestClient, { template_id }: {
66
67
  template_id: string;
67
68
  }): Promise<ToolResult>;
69
+ /**
70
+ * F5 + N5 (Glöckle HANDOFF-4/5): the authenticated post-write render
71
+ * HEALTHCHECK. Resolves the EFFECTIVE template_id from `template_id` OR `url`
72
+ * (the SAME `resolveEffectiveTemplateId` precedence page_get_layout uses — a
73
+ * pasted public URL is reverse-resolved via GET /pages/resolve first), then
74
+ * GETs `/pages/{id}/render-preview` which runs the in-process read-only Builder
75
+ * render server-side over the already-authenticated Bearer channel — answering
76
+ * "renders / N items / blank?" where an external cURL 401s behind QA Basic-Auth.
77
+ *
78
+ * Returns the strict RENDER_PREVIEW_OUTPUT_SCHEMA shape: `{rendered, item_count,
79
+ * empty, error?, cache_purge_hint, template_id}`. A render that resolved to zero
80
+ * items, or that threw inside the Builder pipeline (the swallowed YOOtheme
81
+ * render error surfaced as `error`), is a SUCCESS — not a tool error.
82
+ */
83
+ export declare function handleRenderPreview(client: RestClient, { template_id, url }: {
84
+ template_id?: string;
85
+ url?: string;
86
+ }): Promise<ToolResult>;
68
87
  //# sourceMappingURL=handlers-read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handlers-read.d.ts","sourceRoot":"","sources":["../../../src/tools/pages/handlers-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAqBpE,OAAO,EAIH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAgC5B,wBAAsB,eAAe,CACjC,MAAM,EAAE,UAAU,EAClB,EACI,MAAM,EACN,KAAK,EACL,MAAM,EACN,cAAc,EACd,SAAS,GACZ,EAAE;IACC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,GACF,OAAO,CAAC,UAAU,CAAC,CAmFrB;AAID,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EA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AAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAoB3E;AAID;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACvC,MAAM,EAAE,UAAU,EAClB,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACzC,OAAO,CAAC,UAAU,CAAC,CA8CrB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,UAAU,EAClB,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,OAAO,CAAC,UAAU,CAAC,CAkDrB"}
@@ -10,8 +10,8 @@
10
10
  import { detailResult, tableResult } from '@getimo/mcp-toolkit';
11
11
  import { encodeTemplateId } from '../../client.js';
12
12
  import { flattenLayout } from '../layout-flatten.js';
13
- import { PAGES_COMPACT_COLUMNS, PAGES_TABLE_COLUMNS, SCHEMA_COMPACT_COLUMNS, SCHEMA_TABLE_COLUMNS, buildEtagDetail, buildSchemaRows, mapPageRow, } from '../format/pages-format.js';
14
- import { DEFAULT_FIELDS_PAGES_LIST, DEFAULT_FIELDS_SCHEMA, applyMaxChars, columnsFromFields, projectFields, projectedFieldsEcho, projectionFeedback, projectionWarning, } from '../sparse-fields.js';
13
+ import { PAGES_COMPACT_COLUMNS, PAGES_TABLE_COLUMNS, SCHEMA_COMPACT_COLUMNS, SCHEMA_TABLE_COLUMNS, buildEtagDetail, buildOutlineText, buildRenderPreviewDetail, buildSchemaRows, mapPageRow, } from '../format/pages-format.js';
14
+ import { DEFAULT_FIELDS_PAGES_LIST, DEFAULT_FIELDS_SCHEMA, applyMaxChars, clipTextWindow, columnsFromFields, decodeOffsetCursor, encodeOffsetCursor, projectFields, projectedFieldsEcho, projectionFeedback, projectionWarning, } from '../sparse-fields.js';
15
15
  import { errorResult, jsonResult, structuredResult, } from '../tool-builder.js';
16
16
  // ─── pages_list ─────────────────────────────────────────────────────
17
17
  /** Default page size for pages_list when `limit` is omitted (B2). */
@@ -290,7 +290,84 @@ async function resolveEffectiveTemplateId(client, args) {
290
290
  }),
291
291
  };
292
292
  }
293
- export async function handlePageGetLayout(client, { template_id, post_id, url, flat, fields, mode, force, max_chars }) {
293
+ /**
294
+ * G1 (V3): coerce the REST `nodes` field into a typed `OutlineNode[]` for the
295
+ * pure render sidecar. The wire shape is the canonical `PageQuery::outline()`
296
+ * projection (depth/label/type/handle/path/bound); this guard tolerates a
297
+ * malformed or absent field by emitting an empty list rather than throwing,
298
+ * so an unexpected payload degrades to an empty outline (never a 500).
299
+ */
300
+ function parseOutlineNodes(raw) {
301
+ if (!Array.isArray(raw)) {
302
+ return [];
303
+ }
304
+ const out = [];
305
+ for (const item of raw) {
306
+ if (item === null || typeof item !== 'object') {
307
+ continue;
308
+ }
309
+ const n = item;
310
+ const boundRaw = n.bound;
311
+ let bound = null;
312
+ if (boundRaw !== null && typeof boundRaw === 'object') {
313
+ const b = boundRaw;
314
+ bound = {
315
+ query_name: typeof b.query_name === 'string' ? b.query_name : '',
316
+ has_condition: b.has_condition === true,
317
+ };
318
+ }
319
+ out.push({
320
+ depth: typeof n.depth === 'number' && Number.isFinite(n.depth) ? Math.trunc(n.depth) : 0,
321
+ label: typeof n.label === 'string' ? n.label : '',
322
+ type: typeof n.type === 'string' ? n.type : 'unknown',
323
+ handle: typeof n.handle === 'string' ? n.handle : '',
324
+ path: typeof n.path === 'string' ? n.path : '',
325
+ bound,
326
+ });
327
+ }
328
+ return out;
329
+ }
330
+ /**
331
+ * B7 (Glöckle continuation cursor) — build the full-dump TEXT leg windowed at
332
+ * `[offset, offset+max_chars)` and, when more remains, append a `next_cursor`.
333
+ *
334
+ * The truncated full/bindings_only TEXT leg of page_get_layout had NO
335
+ * continuation: once `max_chars` clipped the JSON dump there was no way to
336
+ * fetch the rest of THAT subtree. This windows the SAME serialized JSON
337
+ * `jsonResult(data)` would emit, slices it from `offset` for up to `max_chars`
338
+ * chars, and emits a `next_cursor` (base64url `o:<n>`, the SAME opaque
339
+ * offset-cursor contract pages_list/sources_list use) when the body is clipped
340
+ * so a follow-up call resumes from the offset. The structured leg carries the
341
+ * cursor + offsets verbatim (page_get_layout declares no outputSchema).
342
+ *
343
+ * `max_chars === undefined` AND `offset === 0` returns the whole body with NO
344
+ * cursor — byte-identical to the pre-B7 `applyMaxChars(jsonResult(data),
345
+ * undefined)` no-op. A final slice (nothing left after it) carries no cursor.
346
+ */
347
+ function windowedFullDump(data, offset, maxChars) {
348
+ const firstBlock = jsonResult(data).content[0];
349
+ const fullText = firstBlock !== undefined && firstBlock.type === 'text' && typeof firstBlock.text === 'string'
350
+ ? firstBlock.text
351
+ : '';
352
+ const fullLength = fullText.length;
353
+ const window = clipTextWindow(fullText, offset, maxChars);
354
+ const nextCursor = window.clipped ? encodeOffsetCursor(window.nextOffset) : undefined;
355
+ // The text leg the LLM reads: the windowed slice. When a cursor is emitted
356
+ // the clip marker already rides inside `window.text`; append the resume
357
+ // hint so an agent reading ONLY the text leg can still page.
358
+ const text = nextCursor !== undefined
359
+ ? `${window.text}\n[continued] pass cursor:"${nextCursor}" to page_get_layout to read chars ` +
360
+ `${String(window.nextOffset)}–${String(fullLength)} of this layout.`
361
+ : window.text;
362
+ return structuredResult({ content: [{ type: 'text', text }] }, {
363
+ ...data,
364
+ ...(nextCursor !== undefined ? { next_cursor: nextCursor } : {}),
365
+ char_offset: window.offset,
366
+ char_total: fullLength,
367
+ returned_chars: window.text.length,
368
+ });
369
+ }
370
+ export async function handlePageGetLayout(client, { template_id, post_id, url, flat, fields, mode, force, cursor, max_chars }) {
294
371
  try {
295
372
  // G-A: resolve the effective template_id from template_id | post_id | url.
296
373
  const effective = await resolveEffectiveTemplateId(client, { template_id, post_id, url });
@@ -298,22 +375,54 @@ export async function handlePageGetLayout(client, { template_id, post_id, url, f
298
375
  return effective.error;
299
376
  }
300
377
  const templateId = effective.templateId;
378
+ // B7 (Glöckle continuation cursor): an opaque char-offset cursor
379
+ // (base64url `o:<n>`) resumes a previously-clipped full/bindings_only
380
+ // text leg from the offset. A present cursor makes the read a
381
+ // CONTINUATION — it is NEVER served from the [unchanged] dedup cache
382
+ // (the agent is intentionally paging the rest of the dump). `0` (no
383
+ // cursor / start) keeps the pre-B7 behaviour.
384
+ const charOffset = decodeOffsetCursor(cursor);
385
+ const isContinuation = cursor !== undefined && cursor !== '';
301
386
  // F195 (P0): forward `mode=bindings_only` so the server returns the
302
- // trimmed binding skeleton the dynamize/bind workflow needs. `full`
303
- // (default) appends no query param byte-identical to the pre-F195
304
- // request shape.
387
+ // trimmed binding skeleton the dynamize/bind workflow needs. G1 (V3):
388
+ // `mode=outline` forwards `?mode=outline` for the flat semantic-outline
389
+ // node list. `full` (default) appends no query param — byte-identical
390
+ // to the pre-F195 request shape.
305
391
  const isBindingsOnly = mode === 'bindings_only';
306
- const query = isBindingsOnly ? '?mode=bindings_only' : '';
392
+ const isOutline = mode === 'outline';
393
+ const query = isBindingsOnly ? '?mode=bindings_only' : isOutline ? '?mode=outline' : '';
307
394
  const data = await client.get(`/pages/${encodeTemplateId(templateId)}/layout${query}`);
395
+ // G1 (V3): outline is the cheapest projection (and, like bindings_only,
396
+ // the recommended map-first path), so it is NEVER deduped — the
397
+ // per-process unchanged-read cache mis-keys on a non-full shape. The
398
+ // flat `nodes[]` are rendered to indented breadcrumb text via the pure
399
+ // sidecar; the full structured payload rides along for structured hosts.
400
+ if (isOutline) {
401
+ const nodes = parseOutlineNodes(data.nodes);
402
+ return structuredResult({ content: [{ type: 'text', text: buildOutlineText(nodes) }] }, data);
403
+ }
308
404
  // F195 (P0): per-process dedup of REPEATED full reads. bindings_only
309
405
  // is already cheap (and the recommended path), so it is never deduped.
310
- // The skeleton passes straight through unchanged.
406
+ // The skeleton passes straight through unchanged — EXCEPT B7: when
407
+ // `max_chars` clips it (or the caller resumes with a `cursor`), it gets
408
+ // the SAME char-offset continuation window the full leg does, so the
409
+ // binding skeleton of a very large template is pageable too.
311
410
  if (isBindingsOnly) {
411
+ if (max_chars !== undefined || isContinuation) {
412
+ return windowedFullDump(data, charOffset, max_chars);
413
+ }
312
414
  return jsonResult(data);
313
415
  }
314
416
  const etag = typeof data.etag === 'string' ? data.etag : undefined;
315
417
  const dedupKey = `${client.getPlatform().baseUrl}|${templateId}`;
316
- if (force !== true && flat !== true && etag !== undefined) {
418
+ // B7: a WINDOWED read either a continuation (cursor present) or a
419
+ // first slice (max_chars set) — must NEVER short-circuit on the
420
+ // [unchanged] dedup. The agent explicitly wants a (paged) slice of the
421
+ // body, and the one-line `[unchanged]` notice carries no slice + no
422
+ // cursor, which would strand the pager. Only the un-windowed full read
423
+ // is deduped (the forensic's duplicate-84KB waste this guards).
424
+ const isWindowedRead = isContinuation || max_chars !== undefined;
425
+ if (!isWindowedRead && force !== true && flat !== true && etag !== undefined) {
317
426
  const lastServed = layoutDedupCache.get(dedupKey);
318
427
  if (lastServed === etag) {
319
428
  // Identical (template, etag) already emitted this process —
@@ -336,8 +445,16 @@ export async function handlePageGetLayout(client, { template_id, post_id, url, f
336
445
  if (flat !== true) {
337
446
  // Default: nested passthrough — unchanged from pre-G.3, except an
338
447
  // OPTIONAL G-B `max_chars` caps the (potentially large) JSON text
339
- // leg. jsonResult is otherwise un-capped, so this is the only knob
340
- // an agent on a tight budget has to bound a full layout dump.
448
+ // leg. B7 (Glöckle continuation cursor): when the dump is clipped
449
+ // (by `max_chars` or resumed via `cursor`) it now also emits a
450
+ // `next_cursor` so an agent can page through the REST of the
451
+ // subtree instead of being stuck with the first slice. With no
452
+ // `max_chars` AND no cursor the whole body is returned with no
453
+ // cursor — byte-identical to the pre-B7 `applyMaxChars(…,
454
+ // undefined)` no-op.
455
+ if (max_chars !== undefined || isContinuation) {
456
+ return windowedFullDump(data, charOffset, max_chars);
457
+ }
341
458
  return applyMaxChars(jsonResult(data), max_chars);
342
459
  }
343
460
  // flat: true → depth-first walk on the nested layout. Apply
@@ -585,4 +702,59 @@ export async function handleTemplateSummary(client, { template_id }) {
585
702
  });
586
703
  }
587
704
  }
705
+ // ─── render_preview (F5 + N5 — authenticated post-write render check) ──
706
+ /**
707
+ * F5 + N5 (Glöckle HANDOFF-4/5): the authenticated post-write render
708
+ * HEALTHCHECK. Resolves the EFFECTIVE template_id from `template_id` OR `url`
709
+ * (the SAME `resolveEffectiveTemplateId` precedence page_get_layout uses — a
710
+ * pasted public URL is reverse-resolved via GET /pages/resolve first), then
711
+ * GETs `/pages/{id}/render-preview` which runs the in-process read-only Builder
712
+ * render server-side over the already-authenticated Bearer channel — answering
713
+ * "renders / N items / blank?" where an external cURL 401s behind QA Basic-Auth.
714
+ *
715
+ * Returns the strict RENDER_PREVIEW_OUTPUT_SCHEMA shape: `{rendered, item_count,
716
+ * empty, error?, cache_purge_hint, template_id}`. A render that resolved to zero
717
+ * items, or that threw inside the Builder pipeline (the swallowed YOOtheme
718
+ * render error surfaced as `error`), is a SUCCESS — not a tool error.
719
+ */
720
+ export async function handleRenderPreview(client, { template_id, url }) {
721
+ try {
722
+ // G-A precedence: template_id wins, else resolve `url` to its template_id.
723
+ const effective = await resolveEffectiveTemplateId(client, { template_id, url });
724
+ if ('error' in effective) {
725
+ return effective.error;
726
+ }
727
+ const templateId = effective.templateId;
728
+ const data = await client.get(`/pages/${encodeTemplateId(templateId)}/render-preview`);
729
+ // Normalize the REST body into the strict output shape. Defensive
730
+ // coercion keeps a malformed/partial host payload from tripping the
731
+ // strict outputSchema (-32602) — the structured leg MUST validate.
732
+ const payload = {
733
+ template_id: typeof data.template_id === 'string' ? data.template_id : templateId,
734
+ rendered: data.rendered === true,
735
+ item_count: typeof data.item_count === 'number' && Number.isFinite(data.item_count)
736
+ ? Math.max(0, Math.trunc(data.item_count))
737
+ : 0,
738
+ empty: data.empty !== false,
739
+ cache_purge_hint: typeof data.cache_purge_hint === 'string' ? data.cache_purge_hint : '',
740
+ ...(typeof data.error === 'string' ? { error: data.error } : {}),
741
+ };
742
+ return structuredResult(detailResult(buildRenderPreviewDetail(payload)), {
743
+ rendered: payload.rendered,
744
+ item_count: payload.item_count,
745
+ empty: payload.empty,
746
+ cache_purge_hint: payload.cache_purge_hint,
747
+ template_id: payload.template_id,
748
+ ...(payload.error !== undefined ? { error: payload.error } : {}),
749
+ });
750
+ }
751
+ catch (e) {
752
+ return errorResult({
753
+ error: e,
754
+ context: { template_id, url },
755
+ hint: 'Verify the template_id exists via yootheme_builder_pages_list ' +
756
+ '(or that the url resolves). Run yootheme_builder_diagnose to check auth.',
757
+ });
758
+ }
759
+ }
588
760
  //# sourceMappingURL=handlers-read.js.map