@wootsup/yt-builder-mcp 1.1.7 → 1.3.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.
- package/README.md +14 -10
- package/bin/yt-builder-mcp.js +55 -40
- package/dist/auth.d.ts +18 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +18 -0
- package/dist/auth.js.map +1 -1
- package/dist/catalog/build-catalog.d.ts +63 -0
- package/dist/catalog/build-catalog.d.ts.map +1 -0
- package/dist/catalog/build-catalog.js +166 -0
- package/dist/catalog/build-catalog.js.map +1 -0
- package/dist/cli/invocation-decision.d.ts +57 -0
- package/dist/cli/invocation-decision.d.ts.map +1 -0
- package/dist/cli/invocation-decision.js +86 -0
- package/dist/cli/invocation-decision.js.map +1 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +40 -1
- package/dist/client.js.map +1 -1
- package/dist/clients/claude-code.d.ts.map +1 -1
- package/dist/clients/claude-code.js +3 -1
- package/dist/clients/claude-code.js.map +1 -1
- package/dist/clients/claude-desktop.d.ts.map +1 -1
- package/dist/clients/claude-desktop.js +3 -1
- package/dist/clients/claude-desktop.js.map +1 -1
- package/dist/clients/cline.d.ts.map +1 -1
- package/dist/clients/cline.js +3 -1
- package/dist/clients/cline.js.map +1 -1
- package/dist/clients/codex-cli.d.ts +1 -1
- package/dist/clients/codex-cli.d.ts.map +1 -1
- package/dist/clients/codex-cli.js +98 -0
- package/dist/clients/codex-cli.js.map +1 -1
- package/dist/clients/continue.d.ts.map +1 -1
- package/dist/clients/continue.js +70 -1
- package/dist/clients/continue.js.map +1 -1
- package/dist/clients/cursor.d.ts.map +1 -1
- package/dist/clients/cursor.js +3 -1
- package/dist/clients/cursor.js.map +1 -1
- package/dist/clients/gemini-cli.d.ts.map +1 -1
- package/dist/clients/gemini-cli.js +3 -1
- package/dist/clients/gemini-cli.js.map +1 -1
- package/dist/clients/index.d.ts +104 -0
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +141 -0
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/roo-code.d.ts.map +1 -1
- package/dist/clients/roo-code.js +3 -1
- package/dist/clients/roo-code.js.map +1 -1
- package/dist/clients/zed.d.ts.map +1 -1
- package/dist/clients/zed.js +3 -1
- package/dist/clients/zed.js.map +1 -1
- package/dist/gateway/advanced-read-tool.d.ts +37 -0
- package/dist/gateway/advanced-read-tool.d.ts.map +1 -0
- package/dist/gateway/advanced-read-tool.js +156 -0
- package/dist/gateway/advanced-read-tool.js.map +1 -0
- package/dist/gateway/advanced-tool/domains.d.ts +18 -3
- package/dist/gateway/advanced-tool/domains.d.ts.map +1 -1
- package/dist/gateway/advanced-tool/domains.js +28 -9
- package/dist/gateway/advanced-tool/domains.js.map +1 -1
- package/dist/gateway/advanced-tool/register.d.ts.map +1 -1
- package/dist/gateway/advanced-tool/register.js +43 -11
- package/dist/gateway/advanced-tool/register.js.map +1 -1
- package/dist/gateway/essentials.d.ts +14 -4
- package/dist/gateway/essentials.d.ts.map +1 -1
- package/dist/gateway/essentials.js +55 -5
- package/dist/gateway/essentials.js.map +1 -1
- package/dist/gateway/test-support.d.ts +3 -3
- package/dist/gateway/test-support.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/install-skill.js +1 -1
- package/dist/proxy/bridge.d.ts +36 -0
- package/dist/proxy/bridge.d.ts.map +1 -0
- package/dist/proxy/bridge.js +129 -0
- package/dist/proxy/bridge.js.map +1 -0
- package/dist/proxy/mode.d.ts +10 -0
- package/dist/proxy/mode.d.ts.map +1 -0
- package/dist/proxy/mode.js +20 -0
- package/dist/proxy/mode.js.map +1 -0
- package/dist/server.d.ts +6 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +14 -4
- package/dist/server.js.map +1 -1
- package/dist/setup-cli.d.ts +41 -0
- package/dist/setup-cli.d.ts.map +1 -1
- package/dist/setup-cli.js +163 -1
- package/dist/setup-cli.js.map +1 -1
- package/dist/setup-prompts.d.ts +23 -0
- package/dist/setup-prompts.d.ts.map +1 -1
- package/dist/setup-prompts.js +76 -1
- package/dist/setup-prompts.js.map +1 -1
- package/dist/setup-wizard.d.ts.map +1 -1
- package/dist/setup-wizard.js +7 -0
- package/dist/setup-wizard.js.map +1 -1
- package/dist/sites/bootstrap.d.ts +41 -0
- package/dist/sites/bootstrap.d.ts.map +1 -0
- package/dist/sites/bootstrap.js +58 -0
- package/dist/sites/bootstrap.js.map +1 -0
- package/dist/sites/client-pool.d.ts +33 -0
- package/dist/sites/client-pool.d.ts.map +1 -1
- package/dist/sites/client-pool.js +69 -1
- package/dist/sites/client-pool.js.map +1 -1
- package/dist/sites/registry.d.ts +30 -0
- package/dist/sites/registry.d.ts.map +1 -1
- package/dist/sites/registry.js.map +1 -1
- package/dist/sites/store.d.ts +8 -1
- package/dist/sites/store.d.ts.map +1 -1
- package/dist/sites/store.js +17 -2
- package/dist/sites/store.js.map +1 -1
- package/dist/sites/tools/index.d.ts.map +1 -1
- package/dist/sites/tools/index.js +9 -1
- package/dist/sites/tools/index.js.map +1 -1
- package/dist/sites/tools/use-site.d.ts +47 -0
- package/dist/sites/tools/use-site.d.ts.map +1 -0
- package/dist/sites/tools/use-site.js +203 -0
- package/dist/sites/tools/use-site.js.map +1 -0
- package/dist/tools/bind-guidance.d.ts +80 -0
- package/dist/tools/bind-guidance.d.ts.map +1 -0
- package/dist/tools/bind-guidance.js +95 -0
- package/dist/tools/bind-guidance.js.map +1 -0
- package/dist/tools/elements/builders.d.ts.map +1 -1
- package/dist/tools/elements/builders.js +75 -18
- package/dist/tools/elements/builders.js.map +1 -1
- package/dist/tools/elements/handlers-write.d.ts +20 -3
- package/dist/tools/elements/handlers-write.d.ts.map +1 -1
- package/dist/tools/elements/handlers-write.js +372 -10
- package/dist/tools/elements/handlers-write.js.map +1 -1
- package/dist/tools/elements/handlers.d.ts +6 -1
- package/dist/tools/elements/handlers.d.ts.map +1 -1
- package/dist/tools/elements/handlers.js +77 -10
- package/dist/tools/elements/handlers.js.map +1 -1
- package/dist/tools/elements/layout-hierarchy-rules.d.ts +62 -0
- package/dist/tools/elements/layout-hierarchy-rules.d.ts.map +1 -0
- package/dist/tools/elements/layout-hierarchy-rules.js +154 -0
- package/dist/tools/elements/layout-hierarchy-rules.js.map +1 -0
- package/dist/tools/format/elements-format.d.ts +35 -0
- package/dist/tools/format/elements-format.d.ts.map +1 -1
- package/dist/tools/format/elements-format.js +134 -12
- package/dist/tools/format/elements-format.js.map +1 -1
- package/dist/tools/format/inspection-format.d.ts +29 -0
- package/dist/tools/format/inspection-format.d.ts.map +1 -1
- package/dist/tools/format/inspection-format.js +99 -22
- package/dist/tools/format/inspection-format.js.map +1 -1
- package/dist/tools/format/pages-format.d.ts.map +1 -1
- package/dist/tools/format/pages-format.js +7 -0
- package/dist/tools/format/pages-format.js.map +1 -1
- package/dist/tools/format/sources-format.d.ts +8 -0
- package/dist/tools/format/sources-format.d.ts.map +1 -1
- package/dist/tools/format/sources-format.js +10 -0
- package/dist/tools/format/sources-format.js.map +1 -1
- package/dist/tools/health.d.ts.map +1 -1
- package/dist/tools/health.js +24 -0
- package/dist/tools/health.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inspection.d.ts +24 -0
- package/dist/tools/inspection.d.ts.map +1 -1
- package/dist/tools/inspection.js +297 -5
- package/dist/tools/inspection.js.map +1 -1
- package/dist/tools/layout-flatten.d.ts +11 -8
- package/dist/tools/layout-flatten.d.ts.map +1 -1
- package/dist/tools/layout-flatten.js +17 -6
- package/dist/tools/layout-flatten.js.map +1 -1
- package/dist/tools/multi-items/builders.d.ts.map +1 -1
- package/dist/tools/multi-items/builders.js +18 -3
- package/dist/tools/multi-items/builders.js.map +1 -1
- package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -1
- package/dist/tools/multi-items/clean-implode-handler.js +2 -2
- package/dist/tools/multi-items/clean-implode-handler.js.map +1 -1
- package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
- package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
- package/dist/tools/multi-items/format/inspection-format.js +64 -0
- package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
- package/dist/tools/multi-items/inspect-handler.d.ts +50 -2
- package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -1
- package/dist/tools/multi-items/inspect-handler.js +237 -10
- package/dist/tools/multi-items/inspect-handler.js.map +1 -1
- package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
- package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
- package/dist/tools/multi-items/inspection-cache.js +126 -0
- package/dist/tools/multi-items/inspection-cache.js.map +1 -0
- package/dist/tools/pages/builders.d.ts +31 -2
- package/dist/tools/pages/builders.d.ts.map +1 -1
- package/dist/tools/pages/builders.js +173 -17
- package/dist/tools/pages/builders.js.map +1 -1
- package/dist/tools/pages/handlers-read.d.ts +6 -2
- package/dist/tools/pages/handlers-read.d.ts.map +1 -1
- package/dist/tools/pages/handlers-read.js +228 -26
- package/dist/tools/pages/handlers-read.js.map +1 -1
- package/dist/tools/pages/handlers-write.d.ts +143 -7
- package/dist/tools/pages/handlers-write.d.ts.map +1 -1
- package/dist/tools/pages/handlers-write.js +215 -11
- package/dist/tools/pages/handlers-write.js.map +1 -1
- package/dist/tools/pages/index.d.ts +1 -1
- package/dist/tools/pages/index.d.ts.map +1 -1
- package/dist/tools/pages/index.js +1 -1
- package/dist/tools/pages/index.js.map +1 -1
- package/dist/tools/pages/schemas.d.ts +166 -0
- package/dist/tools/pages/schemas.d.ts.map +1 -1
- package/dist/tools/pages/schemas.js +347 -0
- package/dist/tools/pages/schemas.js.map +1 -1
- package/dist/tools/shared-schemas.d.ts.map +1 -1
- package/dist/tools/shared-schemas.js +26 -11
- package/dist/tools/shared-schemas.js.map +1 -1
- package/dist/tools/sources/builders.d.ts.map +1 -1
- package/dist/tools/sources/builders.js +64 -6
- package/dist/tools/sources/builders.js.map +1 -1
- package/dist/tools/sources/handlers-bind.d.ts +13 -1
- package/dist/tools/sources/handlers-bind.d.ts.map +1 -1
- package/dist/tools/sources/handlers-bind.js +219 -5
- package/dist/tools/sources/handlers-bind.js.map +1 -1
- package/dist/tools/sources/handlers.d.ts +3 -0
- package/dist/tools/sources/handlers.d.ts.map +1 -1
- package/dist/tools/sources/handlers.js +45 -8
- package/dist/tools/sources/handlers.js.map +1 -1
- package/dist/tools/sparse-fields.d.ts +23 -0
- package/dist/tools/sparse-fields.d.ts.map +1 -1
- package/dist/tools/sparse-fields.js +29 -0
- package/dist/tools/sparse-fields.js.map +1 -1
- package/dist/tools/sublayout/builders.d.ts +23 -0
- package/dist/tools/sublayout/builders.d.ts.map +1 -0
- package/dist/tools/sublayout/builders.js +54 -0
- package/dist/tools/sublayout/builders.js.map +1 -0
- package/dist/tools/sublayout/index.d.ts +13 -0
- package/dist/tools/sublayout/index.d.ts.map +1 -0
- package/dist/tools/sublayout/index.js +13 -0
- package/dist/tools/sublayout/index.js.map +1 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.d.ts +95 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.d.ts.map +1 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.js +181 -0
- package/dist/tools/sublayout/inspect-sublayout-handler.js.map +1 -0
- package/dist/tools/tool-builder/results.d.ts +31 -0
- package/dist/tools/tool-builder/results.d.ts.map +1 -1
- package/dist/tools/tool-builder/results.js +95 -4
- package/dist/tools/tool-builder/results.js.map +1 -1
- package/dist/uninstall-skill.d.ts +52 -0
- package/dist/uninstall-skill.d.ts.map +1 -0
- package/dist/uninstall-skill.js +146 -0
- package/dist/uninstall-skill.js.map +1 -0
- package/dist/uninstall.d.ts +73 -0
- package/dist/uninstall.d.ts.map +1 -0
- package/dist/uninstall.js +82 -0
- package/dist/uninstall.js.map +1 -0
- package/icon.png +0 -0
- package/manifest.json +10 -10
- package/package.json +7 -3
- package/skills/yt-builder-mcp/SKILL.md +157 -88
|
@@ -26,6 +26,12 @@ export const PAGES_LIST_OUTPUT_SCHEMA = z.object({
|
|
|
26
26
|
// this template.") so the agent can render an instruction to the
|
|
27
27
|
// end-user. All three keys are kept on the row-record (not an extra
|
|
28
28
|
// schema object) so per-item sparse-field projection works.
|
|
29
|
+
//
|
|
30
|
+
// F33 (2026-06-10): each row also carries `builder_url` — a version-
|
|
31
|
+
// aware (WP YT4/YT5) + platform-aware (Joomla com_ajax) "open in the
|
|
32
|
+
// YOOtheme Pro builder" deep-link (or null when the host could not
|
|
33
|
+
// resolve the admin base). Kept on the row-record so per-item sparse-
|
|
34
|
+
// field projection + available_fields discovery surface it.
|
|
29
35
|
items: z.array(z.record(z.string(), z.unknown())),
|
|
30
36
|
total: z.number(),
|
|
31
37
|
etag: z.string().optional(),
|
|
@@ -37,6 +43,10 @@ export const PAGES_LIST_OUTPUT_SCHEMA = z.object({
|
|
|
37
43
|
// (previously: items came back as `[{}, {}, …]` silently).
|
|
38
44
|
available_fields: z.array(z.string()).optional(),
|
|
39
45
|
unknown_fields: z.array(z.string()).optional(),
|
|
46
|
+
// F23 (2026-06-10): the LOUD unknown-projection warning also rides in
|
|
47
|
+
// structuredContent — hosts that surface structuredContent (not the
|
|
48
|
+
// text leg) to the model would otherwise never see it.
|
|
49
|
+
projection_warning: z.string().optional(),
|
|
40
50
|
});
|
|
41
51
|
export const SCHEMA_OUTPUT_SCHEMA = z.object({
|
|
42
52
|
// F-006 (2026-05-26): `rel_path` is the agent-preferred path form
|
|
@@ -79,4 +89,341 @@ export const TEMPLATE_SUMMARY_OUTPUT_SCHEMA = z.object({
|
|
|
79
89
|
})),
|
|
80
90
|
etag: z.string(),
|
|
81
91
|
});
|
|
92
|
+
// ─── C1 — pages_create + pages_delete (v1.2) ──────────────────────────
|
|
93
|
+
//
|
|
94
|
+
// MCP tool schemas wrapping the Phase B REST endpoints:
|
|
95
|
+
// POST /pages → yootheme_builder_pages_create
|
|
96
|
+
// DELETE /pages/{post_id} → yootheme_builder_pages_delete
|
|
97
|
+
//
|
|
98
|
+
// These schemas drive (a) input validation at the MCP boundary and (b)
|
|
99
|
+
// the structured-content outputSchema for client introspection.
|
|
100
|
+
/**
|
|
101
|
+
* Input shape for `yootheme_builder_pages_create`.
|
|
102
|
+
*
|
|
103
|
+
* Mirrors the args of `POST /pages` (Phase B).
|
|
104
|
+
*
|
|
105
|
+
* Design pins:
|
|
106
|
+
* - `post_type` is intentionally NOT exposed. Layer 9 defensive guard
|
|
107
|
+
* on the REST side rejects it server-side; surfacing it at the MCP
|
|
108
|
+
* boundary would invite a footgun where an agent tries to set it
|
|
109
|
+
* and fails confusingly.
|
|
110
|
+
* - `status` defaults to `draft` on the server (Q6 design — no public
|
|
111
|
+
* empty page).
|
|
112
|
+
* - `dry_run` triggers validation Layers 1+2+4 without persisting.
|
|
113
|
+
*/
|
|
114
|
+
export const PAGES_CREATE_INPUT = {
|
|
115
|
+
title: z
|
|
116
|
+
.string()
|
|
117
|
+
.min(1)
|
|
118
|
+
.describe('Page title (required, byte-equal stored in post_title).'),
|
|
119
|
+
slug: z
|
|
120
|
+
.string()
|
|
121
|
+
.optional()
|
|
122
|
+
.describe('Optional explicit slug; defaults to sanitize_title($title).'),
|
|
123
|
+
status: z
|
|
124
|
+
.enum(['publish', 'draft', 'pending', 'private', 'future'])
|
|
125
|
+
.optional()
|
|
126
|
+
.describe('Initial post status. Default: draft (Q6 design — no public empty page). ' +
|
|
127
|
+
'WordPress accepts all five; Joomla maps draft→state 0 / publish→state 1 ' +
|
|
128
|
+
'(the other three are WP-only). For the common make-it-live case prefer ' +
|
|
129
|
+
'the `published` boolean below.'),
|
|
130
|
+
// F12 (2026-06-09): friendly one-boolean publish shortcut. A fresh
|
|
131
|
+
// draft on Joomla returns 404 to anonymous front-end visitors (state
|
|
132
|
+
// 0); there was no ergonomic MCP path to flip it live. `published`
|
|
133
|
+
// maps to the existing `status` field the PHP host already honours
|
|
134
|
+
// (WP post_status=publish, Joomla state=1) — see the handler. Default
|
|
135
|
+
// false keeps the safe "no public empty page" behaviour. When the
|
|
136
|
+
// caller sets an explicit `status`, that wins (published is the
|
|
137
|
+
// shortcut, not an override).
|
|
138
|
+
published: z
|
|
139
|
+
.boolean()
|
|
140
|
+
.default(false)
|
|
141
|
+
.describe('When true, the page/article is created LIVE (WP post_status=publish, ' +
|
|
142
|
+
'Joomla state=1) so anonymous visitors can render it immediately. ' +
|
|
143
|
+
'Default false: created as a draft, visible only in the builder until ' +
|
|
144
|
+
'you publish. Ignored when an explicit `status` is provided.'),
|
|
145
|
+
// F64 (2026-06-10): Joomla-only routing helper. A published Joomla
|
|
146
|
+
// article without a menu item has NO SEF route (anonymous 404). When
|
|
147
|
+
// truthy AND the article is published, the host creates a
|
|
148
|
+
// com_content single-article menu item via the Joomla Menu-Table API
|
|
149
|
+
// under a dedicated HIDDEN menutype (string value picks the
|
|
150
|
+
// menutype; `mainmenu` is rejected server-side so customer
|
|
151
|
+
// navigation is never polluted). Ignored on WordPress.
|
|
152
|
+
menu_item: z
|
|
153
|
+
.union([z.boolean(), z.string().min(1).max(64)])
|
|
154
|
+
.optional()
|
|
155
|
+
.describe('Joomla only: create a SEF route for the new article. true = ' +
|
|
156
|
+
'hidden default menutype; a string picks the menutype ' +
|
|
157
|
+
'("mainmenu" is rejected). Requires published/status=publish. ' +
|
|
158
|
+
'Without a route a published Joomla article 404s for visitors.'),
|
|
159
|
+
layout: z
|
|
160
|
+
.record(z.string(), z.unknown())
|
|
161
|
+
.optional()
|
|
162
|
+
.describe('Optional initial YT layout. Default: {type:"layout",children:[]}.'),
|
|
163
|
+
dry_run: z
|
|
164
|
+
.boolean()
|
|
165
|
+
.optional()
|
|
166
|
+
.describe('When true, runs validation Layers 1+2+4 without persisting.'),
|
|
167
|
+
// post_type intentionally NOT exposed — Layer 9 defensive guard rejects
|
|
168
|
+
// it server-side. Exposing it would invite footgun attempts.
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Wire shape for `yootheme_builder_pages_create` on success (non-dry-run).
|
|
172
|
+
*
|
|
173
|
+
* Mirrors the REST 201 response shape.
|
|
174
|
+
*
|
|
175
|
+
* Design pins:
|
|
176
|
+
* - `frontend_url` is nullable: REST returns null for fresh drafts
|
|
177
|
+
* before publish.
|
|
178
|
+
* - `template_id` is a plain string. The "page:{post_id}" prefix is
|
|
179
|
+
* enforced server-side; adding a `.startsWith()` here would buy no
|
|
180
|
+
* MCP-client value while adding Zod complexity.
|
|
181
|
+
* - `warnings` is a lean string array (e.g. "slug_collision_resolved"
|
|
182
|
+
* when WP auto-appends `-2`). The REST surface may expand this to
|
|
183
|
+
* richer objects in v1.3; strings keep the v1.2 surface minimal.
|
|
184
|
+
*/
|
|
185
|
+
export const PAGES_CREATE_OUTPUT_SCHEMA = z
|
|
186
|
+
.object({
|
|
187
|
+
// E1 cross-platform divergence: WP returns `page_id`, Joomla returns
|
|
188
|
+
// `article_id`. Both are positive ints; at least one is always present.
|
|
189
|
+
page_id: z.number().int().positive().optional(),
|
|
190
|
+
article_id: z.number().int().positive().optional(),
|
|
191
|
+
title: z.string(),
|
|
192
|
+
slug: z.string(),
|
|
193
|
+
status: z.string(),
|
|
194
|
+
frontend_url: z.string().nullable(),
|
|
195
|
+
// F33 (2026-06-10): "open in the YOOtheme Pro builder" deep-link for
|
|
196
|
+
// the freshly-created page/article. Version-aware (WP YT4/YT5) +
|
|
197
|
+
// platform-aware (Joomla com_ajax). Nullable: null when the host
|
|
198
|
+
// could not resolve the admin base. `.optional()` keeps the schema
|
|
199
|
+
// back-compatible with an older host that predates the field.
|
|
200
|
+
builder_url: z.string().nullable().optional(),
|
|
201
|
+
template_id: z
|
|
202
|
+
.string()
|
|
203
|
+
.describe('Synthetic per-page template id, e.g. "page:3275" (WP) or "article:42" (Joomla).'),
|
|
204
|
+
etag: z.string(),
|
|
205
|
+
warnings: z
|
|
206
|
+
.array(z.string())
|
|
207
|
+
.describe('e.g. "slug_collision_resolved" when slug collision was resolved.'),
|
|
208
|
+
})
|
|
209
|
+
.refine((v) => typeof v.page_id === 'number' || typeof v.article_id === 'number', { message: 'response must contain either page_id (WP) or article_id (Joomla)' });
|
|
210
|
+
/**
|
|
211
|
+
* Wire shape for `yootheme_builder_pages_create` when `dry_run:true`.
|
|
212
|
+
*
|
|
213
|
+
* Design pin: NO `etag` field. The B6 fix-cycle decision was that
|
|
214
|
+
* surfacing a "live" ETag with a dry-run response invites a stale-
|
|
215
|
+
* If-Match footgun (caller pins the ETag, then non-dry-run mutates,
|
|
216
|
+
* stale ETag rejected with 412). Dry-run is validation-only.
|
|
217
|
+
*
|
|
218
|
+
* `template_id_pattern` is a literal — the actual `template_id` cannot
|
|
219
|
+
* be materialised before WP allocates the post_id.
|
|
220
|
+
*/
|
|
221
|
+
export const PAGES_CREATE_DRY_RUN_OUTPUT_SCHEMA = z.object({
|
|
222
|
+
dry_run: z.literal(true),
|
|
223
|
+
would_create: z.object({
|
|
224
|
+
title: z.string(),
|
|
225
|
+
slug: z.string(),
|
|
226
|
+
status: z.string(),
|
|
227
|
+
// E1 cross-platform divergence: WP returns 'page:{post_id}', Joomla returns 'article:{article_id}'.
|
|
228
|
+
template_id_pattern: z.enum(['page:{post_id}', 'article:{article_id}']),
|
|
229
|
+
}),
|
|
230
|
+
validation_report: z.object({
|
|
231
|
+
layer_1_structural: z.literal('passed'),
|
|
232
|
+
layer_2_element_types: z.literal('passed'),
|
|
233
|
+
layer_4_renderer: z.literal('passed'),
|
|
234
|
+
}),
|
|
235
|
+
// No `etag` field — by design (see B6 fix-cycle: stale-If-Match footgun).
|
|
236
|
+
});
|
|
237
|
+
/**
|
|
238
|
+
* Input shape for `yootheme_builder_pages_delete`.
|
|
239
|
+
*
|
|
240
|
+
* Mirrors the args of `DELETE /pages/{post_id}` (Phase B).
|
|
241
|
+
*
|
|
242
|
+
* Design pin: `confirm` is `z.literal(true)`. This is the Zod-side
|
|
243
|
+
* enforcement of the confirm gate — the MCP boundary rejects requests
|
|
244
|
+
* without `confirm:true` before they ever hit the REST layer.
|
|
245
|
+
*
|
|
246
|
+
* `force` defaults to false server-side → wp_delete_post(trash). When
|
|
247
|
+
* true → hard delete (irrecoverable).
|
|
248
|
+
*/
|
|
249
|
+
export const PAGES_DELETE_INPUT = {
|
|
250
|
+
post_id: z
|
|
251
|
+
.number()
|
|
252
|
+
.int()
|
|
253
|
+
.positive()
|
|
254
|
+
.describe('ID of the page/article to delete — WordPress post_id or Joomla article_id ' +
|
|
255
|
+
'(the numeric part of the template_id, e.g. 42 for "article:42").'),
|
|
256
|
+
confirm: z
|
|
257
|
+
.literal(true)
|
|
258
|
+
.describe('Must be true. Confirm gate prevents accidental deletes.'),
|
|
259
|
+
force: z
|
|
260
|
+
.boolean()
|
|
261
|
+
.optional()
|
|
262
|
+
.describe('If true, hard-deletes (wp_delete_post force=true). Default: trash (recoverable).'),
|
|
263
|
+
};
|
|
264
|
+
// ─── P-G (Goldstandard wave 3) — page_dynamize ────────────────────────
|
|
265
|
+
//
|
|
266
|
+
// The composite "dynamize an existing designed layout" write. The recipe
|
|
267
|
+
// of `dynamize-existing-layout.md` encoded server-side — the agent supplies
|
|
268
|
+
// ONLY the language-level inputs (which list source, which leaf maps to
|
|
269
|
+
// which flow field). F98 HYBRID EXECUTION: server runs the deterministic
|
|
270
|
+
// steps (copy byte-identically, swap queries + leaf names, keep everything
|
|
271
|
+
// else), reaching 85-95% compliance vs 60-70% for instruction-only.
|
|
272
|
+
/**
|
|
273
|
+
* A single `leaf_map` / `conditions` value — the F96 FieldMappingValue
|
|
274
|
+
* shape reused verbatim (mirrors `field_mappings` in `sources/builders.ts`):
|
|
275
|
+
* EITHER a plain string (the new flat field name) OR a structured
|
|
276
|
+
* `{name, filters?}` carrying an explicit YT5 filters operator (e.g. a
|
|
277
|
+
* `_condition` `{condition:'!!'}` or a date format `{date:'D, d.m.y'}`).
|
|
278
|
+
*/
|
|
279
|
+
const FIELD_MAPPING_VALUE = z.union([
|
|
280
|
+
z.string(),
|
|
281
|
+
z
|
|
282
|
+
.object({
|
|
283
|
+
name: z.string().min(1).describe('Source-field name (e.g. "home_crest").'),
|
|
284
|
+
filters: z
|
|
285
|
+
.record(z.string(), z.unknown())
|
|
286
|
+
.optional()
|
|
287
|
+
.describe('YT5 filters operator object. Examples: {condition:"!!"} ' +
|
|
288
|
+
'(render only when non-empty), {condition:"!"} (only when empty), ' +
|
|
289
|
+
'{date:"D, d.m.y"} (format an ISO date).'),
|
|
290
|
+
})
|
|
291
|
+
.strict(),
|
|
292
|
+
]);
|
|
293
|
+
/**
|
|
294
|
+
* Input shape for `yootheme_builder_page_dynamize`. Wraps
|
|
295
|
+
* `POST /pages/dynamize`. Narrowest-schema rule: `template_id` +
|
|
296
|
+
* `list_source_name` + `page.title` are required non-empty; `page` carries
|
|
297
|
+
* the create-machinery passthrough; the reference selector is `section_name`
|
|
298
|
+
* OR `element_path` (exactly-one is enforced server-side so a miss can list
|
|
299
|
+
* the available named sections as remediation).
|
|
300
|
+
*/
|
|
301
|
+
export const PAGE_DYNAMIZE_INPUT = {
|
|
302
|
+
template_id: z
|
|
303
|
+
.string()
|
|
304
|
+
.min(1)
|
|
305
|
+
.describe('Template holding the REFERENCE section (e.g. "default"). ' +
|
|
306
|
+
'Use yootheme_builder_pages_list / yootheme_builder_template_summary to discover.'),
|
|
307
|
+
section_name: z
|
|
308
|
+
.string()
|
|
309
|
+
.min(1)
|
|
310
|
+
.optional()
|
|
311
|
+
.describe('Named landmark section to copy (as listed in ' +
|
|
312
|
+
'yootheme_builder_template_summary.named_sections). Provide THIS or ' +
|
|
313
|
+
'`element_path` — exactly one. On a miss the error lists the available sections.'),
|
|
314
|
+
element_path: z
|
|
315
|
+
.string()
|
|
316
|
+
.min(1)
|
|
317
|
+
.optional()
|
|
318
|
+
.describe('JSON-Pointer / rel-path to the reference subtree (e.g. "/children/2"). ' +
|
|
319
|
+
'Provide THIS or `section_name` — exactly one.'),
|
|
320
|
+
list_source_name: z
|
|
321
|
+
.string()
|
|
322
|
+
.min(1)
|
|
323
|
+
.optional()
|
|
324
|
+
.describe('SINGLE-block path: the published flow LIST source the one iterating column ' +
|
|
325
|
+
'query is rewritten to (e.g. "apiMapperFlowAbcList"). Provide THIS or ' +
|
|
326
|
+
'`source_map` — exactly one. Use yootheme_builder_sources_list to discover.'),
|
|
327
|
+
// F201 (multi-block): a section with SEVERAL source blocks (Played / Next /
|
|
328
|
+
// Later) dynamizes in ONE call. Each entry keys the EXISTING iterating
|
|
329
|
+
// column query (`match`) to its flow list source (`source_name`) + its own
|
|
330
|
+
// leaf_map. Provide THIS or `list_source_name` — exactly one.
|
|
331
|
+
source_map: z
|
|
332
|
+
.array(z
|
|
333
|
+
.object({
|
|
334
|
+
match: z
|
|
335
|
+
.string()
|
|
336
|
+
.min(1)
|
|
337
|
+
.describe('The EXISTING iterating column query name to swap (e.g. "theme.played").'),
|
|
338
|
+
source_name: z
|
|
339
|
+
.string()
|
|
340
|
+
.min(1)
|
|
341
|
+
.describe('The flow LIST source this block is rewritten to (e.g. "apiMapperFlowPlayedList").'),
|
|
342
|
+
leaf_map: z
|
|
343
|
+
.record(z.string(), FIELD_MAPPING_VALUE)
|
|
344
|
+
.optional()
|
|
345
|
+
.describe('Per-block leaf remap — same shape + rules as the single-block `leaf_map`.'),
|
|
346
|
+
})
|
|
347
|
+
.strict())
|
|
348
|
+
.optional()
|
|
349
|
+
.describe('MULTI-block path: a section with several source blocks (Played / Next / Later) ' +
|
|
350
|
+
'dynamizes in ONE call. Array of {match, source_name, leaf_map?}. Unmatched ' +
|
|
351
|
+
'blocks stay verbatim and surface in summary.unmatched_sources.'),
|
|
352
|
+
leaf_map: z
|
|
353
|
+
.record(z.string(), FIELD_MAPPING_VALUE)
|
|
354
|
+
.optional()
|
|
355
|
+
.describe('Maps ORIGINAL leaf field-names (the source.props.*.name values in the ' +
|
|
356
|
+
'copied subtree, INCLUDING nested originals like ' +
|
|
357
|
+
'"field.match.home_team.crest.imagefile") → your flow\'s flat field names. ' +
|
|
358
|
+
'Each value is a plain string OR {name, filters?} (F96 shape). The #parent ' +
|
|
359
|
+
'query form is preserved — only the leaf NAME changes. Unmapped leaves are ' +
|
|
360
|
+
'KEPT verbatim (default-KEEP). For a SUB-QUERY panel (its own source.query, ' +
|
|
361
|
+
'leaves bound RELATIVE), key by the QUALIFIED "<subquery>.<leaf>" form (e.g. ' +
|
|
362
|
+
'"field.match_home_team.name") so the panel converts to #parent. Map an IMAGE ' +
|
|
363
|
+
'leaf to an image/path field — binding a text field to an image prop renders a ' +
|
|
364
|
+
'broken 0x0 image.'),
|
|
365
|
+
conditions: z
|
|
366
|
+
.record(z.string(), z
|
|
367
|
+
.object({
|
|
368
|
+
name: z.string().min(1).describe('Source-field name driving the condition.'),
|
|
369
|
+
filters: z
|
|
370
|
+
.object({
|
|
371
|
+
condition: z
|
|
372
|
+
.enum(['!', '!!'])
|
|
373
|
+
.describe('"!!" = render only when the field is non-empty; "!" = only when empty.'),
|
|
374
|
+
})
|
|
375
|
+
.describe('YT5 _condition operator.'),
|
|
376
|
+
})
|
|
377
|
+
.strict())
|
|
378
|
+
.optional()
|
|
379
|
+
.describe('Optional per-prop `_condition` overrides, keyed by ELEMENT-PROP name ' +
|
|
380
|
+
'(e.g. "content"). Use for per-row visibility (played vs upcoming).'),
|
|
381
|
+
remove_leaves: z
|
|
382
|
+
.array(z.string().min(1))
|
|
383
|
+
.optional()
|
|
384
|
+
.describe('EXPLICIT prop-path removals (rel-path pointers, e.g. "/children/0/children/1"). ' +
|
|
385
|
+
'Default is KEEP — only remove a leaf whose TARGET cannot exist for the new ' +
|
|
386
|
+
'data (e.g. a detail-link whose article doesn\'t exist for API rows).'),
|
|
387
|
+
page: z
|
|
388
|
+
.object({
|
|
389
|
+
title: z.string().min(1).describe('New page title (required).'),
|
|
390
|
+
slug: z.string().min(1).optional().describe('Optional explicit slug.'),
|
|
391
|
+
published: z
|
|
392
|
+
.boolean()
|
|
393
|
+
.optional()
|
|
394
|
+
.describe('When true, the page is created LIVE (anonymous visitors can render it).'),
|
|
395
|
+
status: z
|
|
396
|
+
.enum(['publish', 'draft', 'pending', 'private', 'future'])
|
|
397
|
+
.optional()
|
|
398
|
+
.describe('Fine-grained WordPress status (wins over `published`).'),
|
|
399
|
+
menu_item: z
|
|
400
|
+
.union([z.boolean(), z.string().min(1).max(64)])
|
|
401
|
+
.optional()
|
|
402
|
+
.describe('Joomla only: create a SEF route. true = hidden menutype; a string picks it.'),
|
|
403
|
+
})
|
|
404
|
+
.describe('Passthrough to the existing create machinery (slug-collision, menu_item routing).'),
|
|
405
|
+
etag: z
|
|
406
|
+
.string()
|
|
407
|
+
.min(1)
|
|
408
|
+
.optional()
|
|
409
|
+
.describe('Optimistic-lock ETag from yootheme_builder_get_etag. Optional; when provided, ' +
|
|
410
|
+
'412 on conflict. Recommended for collaborative edits.'),
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Wire shape for `yootheme_builder_pages_delete` on success.
|
|
414
|
+
*
|
|
415
|
+
* `deleted` is `z.literal(true)` — the success-response invariant. A
|
|
416
|
+
* failed delete surfaces as `isError:true` with a structured-error
|
|
417
|
+
* envelope, not as `deleted:false`.
|
|
418
|
+
*/
|
|
419
|
+
export const PAGES_DELETE_OUTPUT_SCHEMA = z
|
|
420
|
+
.object({
|
|
421
|
+
deleted: z.literal(true),
|
|
422
|
+
// E1 cross-platform divergence: WP returns page_id, Joomla returns article_id.
|
|
423
|
+
page_id: z.number().int().positive().optional(),
|
|
424
|
+
article_id: z.number().int().positive().optional(),
|
|
425
|
+
force_deleted: z.boolean(),
|
|
426
|
+
etag: z.string(),
|
|
427
|
+
})
|
|
428
|
+
.refine((v) => typeof v.page_id === 'number' || typeof v.article_id === 'number', { message: 'response must contain either page_id (WP) or article_id (Joomla)' });
|
|
82
429
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/tools/pages/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,gEAAgE;IAChE,sEAAsE;IACtE,gEAAgE;IAChE,+DAA+D;IAC/D,wEAAwE;IACxE,sEAAsE;IACtE,yBAAyB;IACzB,kEAAkE;IAClE,uEAAuE;IACvE,4BAA4B;IAC5B,qEAAqE;IACrE,sEAAsE;IACtE,sDAAsD;IACtD,qEAAqE;IACrE,mEAAmE;IACnE,iEAAiE;IACjE,oEAAoE;IACpE,4DAA4D;IAC5D,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,iEAAiE;IACjE,qEAAqE;IACrE,oEAAoE;IACpE,iEAAiE;IACjE,2DAA2D;IAC3D,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/tools/pages/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM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R,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACL,gFAAgF;QAC5E,uDAAuD,CAC9D;CACR,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACtC,MAAM,CAAC;IACJ,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,+EAA+E;IAC/E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC;KACD,MAAM,CACH,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,EACxE,EAAE,OAAO,EAAE,kEAAkE,EAAE,CAClF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/shared-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"shared-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/shared-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW,aAUnB,CAAC;AASN,eAAO,MAAM,YAAY,aAgBpB,CAAC;AAEN,eAAO,MAAM,IAAI,aAYZ,CAAC;AAEN,eAAO,MAAM,KAAK,wCAKb,CAAC;AAEN;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,4BAOtB,CAAC"}
|
|
@@ -11,7 +11,13 @@ import { z } from 'zod';
|
|
|
11
11
|
export const TEMPLATE_ID = z
|
|
12
12
|
.string()
|
|
13
13
|
.min(1)
|
|
14
|
-
.describe(
|
|
14
|
+
.describe(
|
|
15
|
+
// F206 (P3): name the argument key explicitly and rule out the
|
|
16
|
+
// look-alikes. The Desktop client guessed `page_id` / `id` for tools
|
|
17
|
+
// that take this schema; the arg key is `template_id` (NOT `page_id`,
|
|
18
|
+
// NOT `id`). Use yootheme_builder_pages_list to discover valid values.
|
|
19
|
+
'Template ID (e.g. "default"). The argument key is `template_id` ' +
|
|
20
|
+
'(NOT `page_id`, NOT `id`). Use yootheme_builder_pages_list to discover.');
|
|
15
21
|
// F-102 (2026-05-26): the input-arg name is **`element_path`** (NOT
|
|
16
22
|
// `element_rel_path`). `rel_path` is a PROJECTION COLUMN name on the
|
|
17
23
|
// output of `element_list` / `page_get_schema` — copy its VALUE back
|
|
@@ -22,21 +28,30 @@ export const TEMPLATE_ID = z
|
|
|
22
28
|
export const ELEMENT_PATH = z
|
|
23
29
|
.string()
|
|
24
30
|
.min(1)
|
|
25
|
-
.describe(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
31
|
+
.describe(
|
|
32
|
+
// Wave-16 #34 (6.3): lead with the standard JSON-Pointer (RFC-6901)
|
|
33
|
+
// docstring so every element_path param across all tools opens with
|
|
34
|
+
// the canonical form + the enumerate-paths pointer. F165 (2026-06-11)
|
|
35
|
+
// tightened the trailing essay; the F-102 disambiguation
|
|
36
|
+
// (element_path is the INPUT arg, element_rel_path is only the
|
|
37
|
+
// element_list projection COLUMN) stays load-bearing.
|
|
38
|
+
'JSON-Pointer (RFC-6901) style: /0/children/1. ' +
|
|
39
|
+
'Use yootheme_builder_element_list to enumerate valid paths. ' +
|
|
40
|
+
'Preferred: copy a `rel_path` VALUE from element_list (e.g. ' +
|
|
41
|
+
'`/children/0`); fully-qualified pointers also work. The arg is ' +
|
|
42
|
+
'`element_path`; `element_rel_path` is only the list projection ' +
|
|
43
|
+
'column, not an input arg.');
|
|
34
44
|
export const ETAG = z
|
|
35
45
|
.string()
|
|
36
46
|
.min(1)
|
|
37
47
|
.describe('Optimistic-lock ETag from yootheme_builder_get_etag. Required to ' +
|
|
38
48
|
'detect concurrent edits — call get_etag first, pass the value here. ' +
|
|
39
|
-
'On 412 Precondition Failed, re-fetch the ETag and retry.'
|
|
49
|
+
'On 412 Precondition Failed, re-fetch the ETag and retry. ' +
|
|
50
|
+
'Note (Wave-8 C2 2026-05-29): every successful write returns a NEW ' +
|
|
51
|
+
'ETag in the response body — use that next-ETag for the following ' +
|
|
52
|
+
'call, do NOT reuse the same value across multiple writes (the server ' +
|
|
53
|
+
'bumps a monotonic revision per persist, so byte-identical state ' +
|
|
54
|
+
'still surfaces as a distinct ETag).');
|
|
40
55
|
export const PROPS = z
|
|
41
56
|
.record(z.string(), z.unknown())
|
|
42
57
|
.describe('Element props object (e.g. `{title: "Hello", margin: "default"}`). ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-schemas.js","sourceRoot":"","sources":["../../src/tools/shared-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACvB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,
|
|
1
|
+
{"version":3,"file":"shared-schemas.js","sourceRoot":"","sources":["../../src/tools/shared-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACvB,MAAM,EAAE;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-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,EAMH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,kBAAkB,EAK1B,MAAM,eAAe,CAAC;AAEvB,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACnC,SAAS,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,EAMH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,kBAAkB,EAK1B,MAAM,eAAe,CAAC;AAEvB,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,UAAU,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACnC,SAAS,iBAAiB,EAAE,CA+L9B"}
|
|
@@ -26,7 +26,7 @@ export function buildSourcesTools(pool, deps) {
|
|
|
26
26
|
description: 'List all data sources, feeds, and dynamic content sources available in the ' +
|
|
27
27
|
'YOOtheme Pro builder. Returns name + label + origin (apimapper / wordpress / ' +
|
|
28
28
|
'joomla / essentials) per source. CALL THIS BEFORE binding any element to a data source. ' +
|
|
29
|
-
'
|
|
29
|
+
'Then bind directly with yootheme_builder_element_bind_source (a first-class tool in tools/list). ' +
|
|
30
30
|
'Keywords: list sources, list data sources, list feeds, list bindings, ' +
|
|
31
31
|
'dynamic content, available data, what sources exist. ' +
|
|
32
32
|
'Pass `fields[]` to narrow each row. Operates on the default site unless site_id is provided.',
|
|
@@ -55,9 +55,22 @@ export function buildSourcesTools(pool, deps) {
|
|
|
55
55
|
}),
|
|
56
56
|
defineTool({
|
|
57
57
|
name: 'yootheme_builder_element_bind_source',
|
|
58
|
-
description: 'Binds a Builder source to an element (
|
|
59
|
-
'
|
|
60
|
-
'first *_item child
|
|
58
|
+
description: 'Binds a Builder source to an element (canonical shape: `source` top-level). ' +
|
|
59
|
+
'Pass `field_mappings` in the SAME call; bindingLevel "item" binds a ' +
|
|
60
|
+
'container\'s first *_item child. ' +
|
|
61
|
+
// F71/C3 (2026-06-10) + F188/F189 (2026-06-12): a leaf DIRECTLY
|
|
62
|
+
// under an iterating *_item auto-CONSOLIDATES onto the item's own
|
|
63
|
+
// slots (409 slot_collision when the slot is taken / not a slot);
|
|
64
|
+
// a leaf under a `#parent` fragment keeps the INHERIT form; a
|
|
65
|
+
// standalone query renders empty on YT5. A `…List` on a grid_item
|
|
66
|
+
// with nested children is render-dead (iterator_is_leaf_renderer).
|
|
67
|
+
'Leaf under an iterating *_item → CONSOLIDATE onto item slots (409 ' +
|
|
68
|
+
'slot_collision if taken/not a slot); leaf under a #parent fragment → INHERIT ' +
|
|
69
|
+
'(`__node_item__`); standalone renders empty. List on a grid_item with ' +
|
|
70
|
+
'children → iterator_is_leaf_renderer. ' +
|
|
71
|
+
// F39 (2026-06-10): map_item location contract.
|
|
72
|
+
'Map: bind `map_item`, map `location` to a "lat,lng" field or no markers. ' +
|
|
73
|
+
'Requires ETag. Call directly. ' +
|
|
61
74
|
'Operates on the default site unless site_id is provided.',
|
|
62
75
|
inputSchema: {
|
|
63
76
|
site_id: SITE_ID_SCHEMA,
|
|
@@ -74,9 +87,54 @@ export function buildSourcesTools(pool, deps) {
|
|
|
74
87
|
.describe('Optional explicit "<origin>:<name>" id; skips ambiguity ' +
|
|
75
88
|
'resolution when ≥2 sources share `source_name`.'),
|
|
76
89
|
field_mappings: z
|
|
77
|
-
.record(z.string(),
|
|
90
|
+
.record(z.string(),
|
|
91
|
+
// F96/F82 (2026-06-10): a value may be EITHER a plain
|
|
92
|
+
// string source-field name OR a structured object
|
|
93
|
+
// `{name, filters?}`. The object form carries an
|
|
94
|
+
// explicit YT5 filters operator so the theme-canonical
|
|
95
|
+
// leaf (e.g. a `_condition` prop with
|
|
96
|
+
// `{condition: '!!'}`, or a date-format
|
|
97
|
+
// `{date: 'D, d.m.y'}`) is authorable in ONE bind call.
|
|
98
|
+
z.union([
|
|
99
|
+
z.string(),
|
|
100
|
+
z
|
|
101
|
+
.object({
|
|
102
|
+
name: z
|
|
103
|
+
.string()
|
|
104
|
+
.min(1)
|
|
105
|
+
.describe('Source-field name (e.g. "match_date").'),
|
|
106
|
+
filters: z
|
|
107
|
+
.record(z.string(), z.unknown())
|
|
108
|
+
.optional()
|
|
109
|
+
.describe('YT5 filters operator object. Examples: ' +
|
|
110
|
+
'{condition:"!!"} (render only when the field is ' +
|
|
111
|
+
'non-empty — used on a `_condition` prop), ' +
|
|
112
|
+
'{condition:"!"} (only when empty), ' +
|
|
113
|
+
'{date:"D, d.m.y"} (format an ISO date).'),
|
|
114
|
+
})
|
|
115
|
+
.strict(),
|
|
116
|
+
]))
|
|
78
117
|
.optional()
|
|
79
|
-
.describe('Optional {prop_name:
|
|
118
|
+
.describe('Optional {prop_name: mapping} written to `source.props`. Each mapping ' +
|
|
119
|
+
'is EITHER a plain source-field name string, OR an object ' +
|
|
120
|
+
'{name, filters?} where `filters` is a YT5 operator object. ' +
|
|
121
|
+
// F96/F82 (2026-06-10): the object form unlocks the theme-canonical
|
|
122
|
+
// leaf. A `_condition` prop needs `filters:{condition:"!!"}` (render
|
|
123
|
+
// only when filled) / `{condition:"!"}` (only when empty) — a bare
|
|
124
|
+
// `_condition` with no filters operator is INERT (renders always).
|
|
125
|
+
'Use the object form for the theme-canonical YT5 leaf: a `_condition` ' +
|
|
126
|
+
'prop REQUIRES filters {condition:"!!"} (render only when the field is ' +
|
|
127
|
+
'non-empty) or {condition:"!"} (only when empty) — a bare _condition ' +
|
|
128
|
+
'with no filters operator renders ALWAYS. Date-format leaves use ' +
|
|
129
|
+
'{name:"<field>", filters:{date:"D, d.m.y"}}. ' +
|
|
130
|
+
// F43 (2026-06-10): this is a FULL REPLACE, not a merge — each
|
|
131
|
+
// bind call rebuilds props from ONLY these mappings; anything
|
|
132
|
+
// omitted is dropped. Re-send ALL mappings you want to keep on
|
|
133
|
+
// every call (do not pass a partial patch to refine one field).
|
|
134
|
+
'FULL REPLACE (not a merge): each call rebuilds `source.props` from ' +
|
|
135
|
+
'only these mappings — omitted props are dropped (dropped keys are ' +
|
|
136
|
+
'surfaced as `dropped_field_mappings` + a warning), so re-send ALL ' +
|
|
137
|
+
'mappings you want to keep every call. ' +
|
|
80
138
|
'Pass "__node_item__" (or "__node_item__:<field>") as the value to ' +
|
|
81
139
|
'emit YT-Pro INHERIT bindings ("Node - Item (Source/Items)" picker ' +
|
|
82
140
|
'entry) on child *_item elements.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../../src/tools/sources/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACH,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,YAAY,GAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAE1B,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AAEvB,MAAM,UAAU,iBAAiB,CAC7B,IAAgB,EAChB,IAAkC;IAElC,0DAA0D;I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AAE,YAAY;gBAC1B,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,CAAC;qBACL,OAAO,EAAE;qBACT,QAAQ,EAAE;qBACV,QAAQ,CACL,qEAAqE;oBACjE,iEAAiE;oBACjE,wDAAwD,CAC/D;aACR;YACD,WAAW,EAAE,WAAW,CAAC,eAAe,CAAC;YACzC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CACpC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAChD,YAAY,CAAC,MAAM,yBAAyB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;SACvF,CAAC;KACL,CAAC;AACN,CAAC"}
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type ToolResult } from '../tool-builder.js';
|
|
12
12
|
import type { SourcesHandlerDeps } from './handlers.js';
|
|
13
|
+
/**
|
|
14
|
+
* A single `field_mappings` value. F96/F82 (2026-06-10): EITHER a plain
|
|
15
|
+
* source-field name string, OR a structured `{name, filters?}` object that
|
|
16
|
+
* carries an explicit YT5 filters operator (e.g. `{condition: '!!'}` on a
|
|
17
|
+
* `_condition` prop, or `{date: 'D, d.m.y'}` for a date format). Mirrors the
|
|
18
|
+
* `field_mappings` union in `./builders.ts`. The handler forwards the value
|
|
19
|
+
* verbatim — the PHP SourcesController normalises + persists it.
|
|
20
|
+
*/
|
|
21
|
+
export type FieldMappingValue = string | {
|
|
22
|
+
name: string;
|
|
23
|
+
filters?: Record<string, unknown>;
|
|
24
|
+
};
|
|
13
25
|
export declare function handleElementBindSource({ client, elicitation }: SourcesHandlerDeps, input: {
|
|
14
26
|
template_id: string;
|
|
15
27
|
element_path: string;
|
|
@@ -17,7 +29,7 @@ export declare function handleElementBindSource({ client, elicitation }: Sources
|
|
|
17
29
|
source_id?: string;
|
|
18
30
|
etag: string;
|
|
19
31
|
bindingLevel?: 'auto' | 'container' | 'item';
|
|
20
|
-
field_mappings?: Record<string,
|
|
32
|
+
field_mappings?: Record<string, FieldMappingValue>;
|
|
21
33
|
}): Promise<ToolResult>;
|
|
22
34
|
export declare function handleElementUnbindSource({ client, elicitation }: SourcesHandlerDeps, input: {
|
|
23
35
|
template_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers-bind.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/handlers-bind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"handlers-bind.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/handlers-bind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH,OAAO,EAIH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAyMxD;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACvB,MAAM,GACN;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAE1D,wBAAsB,uBAAuB,CACzC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,kBAAkB,EAC3C,KAAK,EAAE;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CACtD,GACF,OAAO,CAAC,UAAU,CAAC,CAgIrB;AAID,wBAAsB,yBAAyB,CAC3C,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,kBAAkB,EAC3C,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACtF,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
|