@wootsup/yt-builder-mcp 1.2.0 → 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 +15 -11
- 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/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 +41 -5
- package/dist/gateway/essentials.js.map +1 -1
- package/dist/gateway/test-support.d.ts +2 -2
- package/dist/gateway/test-support.js +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- 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 +5 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +13 -3
- package/dist/server.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/client-pool.d.ts.map +1 -1
- package/dist/sites/client-pool.js +21 -3
- 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/use-site.d.ts.map +1 -1
- package/dist/sites/tools/use-site.js +26 -6
- package/dist/sites/tools/use-site.js.map +1 -1
- 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 +59 -11
- package/dist/tools/elements/builders.js.map +1 -1
- package/dist/tools/elements/handlers-write.d.ts +19 -2
- package/dist/tools/elements/handlers-write.d.ts.map +1 -1
- package/dist/tools/elements/handlers-write.js +179 -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 +74 -7
- 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 +124 -1
- package/dist/tools/format/elements-format.js.map +1 -1
- package/dist/tools/format/inspection-format.d.ts +18 -0
- package/dist/tools/format/inspection-format.d.ts.map +1 -1
- package/dist/tools/format/inspection-format.js +22 -1
- 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 +140 -41
- 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 +11 -2
- package/dist/tools/multi-items/builders.js.map +1 -1
- package/dist/tools/multi-items/inspect-handler.d.ts +13 -0
- package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -1
- package/dist/tools/multi-items/inspect-handler.js +147 -3
- package/dist/tools/multi-items/inspect-handler.js.map +1 -1
- package/dist/tools/pages/builders.d.ts.map +1 -1
- package/dist/tools/pages/builders.js +88 -25
- package/dist/tools/pages/builders.js.map +1 -1
- package/dist/tools/pages/handlers-read.d.ts +5 -1
- package/dist/tools/pages/handlers-read.d.ts.map +1 -1
- package/dist/tools/pages/handlers-read.js +192 -47
- package/dist/tools/pages/handlers-read.js.map +1 -1
- package/dist/tools/pages/handlers-write.d.ts +95 -1
- package/dist/tools/pages/handlers-write.d.ts.map +1 -1
- package/dist/tools/pages/handlers-write.js +137 -8
- 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 +54 -0
- package/dist/tools/pages/schemas.d.ts.map +1 -1
- package/dist/tools/pages/schemas.js +199 -2
- 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 +15 -13
- 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 +163 -1
- 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 +43 -6
- 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/manifest.json +1 -1
- package/package.json +4 -2
- package/skills/yt-builder-mcp/SKILL.md +146 -81
|
@@ -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
|
|
@@ -25,20 +31,16 @@ export const ELEMENT_PATH = z
|
|
|
25
31
|
.describe(
|
|
26
32
|
// Wave-16 #34 (6.3): lead with the standard JSON-Pointer (RFC-6901)
|
|
27
33
|
// docstring so every element_path param across all tools opens with
|
|
28
|
-
// the canonical form + the enumerate-paths pointer.
|
|
29
|
-
//
|
|
30
|
-
//
|
|
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.
|
|
31
38
|
'JSON-Pointer (RFC-6901) style: /0/children/1. ' +
|
|
32
39
|
'Use yootheme_builder_element_list to enumerate valid paths. ' +
|
|
33
|
-
'
|
|
34
|
-
'`
|
|
35
|
-
'`
|
|
36
|
-
'
|
|
37
|
-
'— copy it straight back here as `element_path` (e.g. `/children/0` ' +
|
|
38
|
-
'or `/children/0/children/1`); the server resolves it within this ' +
|
|
39
|
-
'template. Fully-qualified pointers (`/templates/<id>/layout/' +
|
|
40
|
-
'children/0/...`) are also accepted. Both forms work everywhere ' +
|
|
41
|
-
'`element_path` appears.');
|
|
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.');
|
|
42
44
|
export const ETAG = z
|
|
43
45
|
.string()
|
|
44
46
|
.min(1)
|
|
@@ -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;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ;AACL,+DAA+D;AAC/D,qEAAqE;AACrE,sEAAsE;AACtE,uEAAuE;AACvE,kEAAkE;IAC9D,yEAAyE,CAChF,CAAC;AAEN,oEAAoE;AACpE,qEAAqE;AACrE,qEAAqE;AACrE,+DAA+D;AAC/D,kEAAkE;AAClE,mEAAmE;AACnE,qBAAqB;AACrB,MAAM,C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,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;IAC1D,+DAA+D;IAC/D,gCAAgC;IAChC,MAAM,WAAW,GAAG,IAAI,EAAE,WAAW,CAAC;IACtC,MAAM,QAAQ,GAAG,CAAC,UAAwC,EAAsB,EAAE,CAC9E,CAAC,WAAW,KAAK,SAAS;QACtB,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE;QACrC,CAAC,CAAC,EAAE,MAAM,EAAE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,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;AAeH,OAAO,EAIH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;
|
|
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"}
|
|
@@ -14,6 +14,7 @@ import { RestError } from '../../errors.js';
|
|
|
14
14
|
import { flattenSourcesPayload, mapSourceRow, } from '../format/sources-format.js';
|
|
15
15
|
import { ambiguityFallbackError, } from '../elicitation.js';
|
|
16
16
|
import { confirmGuard, errorResult, jsonResult, } from '../tool-builder.js';
|
|
17
|
+
import { GRID_ITEM_ITERATOR_REJECT, SLOT_COLLISION_STEERING, } from '../bind-guidance.js';
|
|
17
18
|
/**
|
|
18
19
|
* Wave-12 F9 — extract validation-hint fields surfaced by the WP REST
|
|
19
20
|
* plugin when `source_name` is rejected (`unknown_source` code). The PHP
|
|
@@ -38,6 +39,145 @@ function extractUnknownSourceHints(body) {
|
|
|
38
39
|
all_published_sources: d.all_published_sources,
|
|
39
40
|
};
|
|
40
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* F189 — true iff the REST error body is the slot-collision reject (409). The
|
|
44
|
+
* WP plugin writes `code` = `…source_binding.slot_collision`; both platforms
|
|
45
|
+
* also carry `data.error_code === 'slot_collision'` (WordPress nests hint data
|
|
46
|
+
* under `data`; the Joomla envelope surfaces the same `error_code`).
|
|
47
|
+
*/
|
|
48
|
+
function isSlotCollision(body) {
|
|
49
|
+
if (body === null || typeof body !== 'object')
|
|
50
|
+
return false;
|
|
51
|
+
const root = body;
|
|
52
|
+
if (typeof root.code === 'string' &&
|
|
53
|
+
root.code.endsWith('source_binding.slot_collision')) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (root.error_code === 'slot_collision')
|
|
57
|
+
return true;
|
|
58
|
+
const data = root.data;
|
|
59
|
+
if (data !== null && typeof data === 'object') {
|
|
60
|
+
return data.error_code === 'slot_collision';
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
/** Pull a `list<string>` from a passthrough body field, or `[]`. */
|
|
65
|
+
function stringList(value) {
|
|
66
|
+
if (!Array.isArray(value))
|
|
67
|
+
return [];
|
|
68
|
+
return value.filter((k) => typeof k === 'string');
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* F174 — the bind succeeded but with ZERO field mappings: each of the N
|
|
72
|
+
* cloned items will render only the template's static placeholder text
|
|
73
|
+
* ("Title" / "Lorem ipsum"), not real data. This is a silent footgun: a
|
|
74
|
+
* caged agent bound source_name + bindingLevel only, the call returned 200
|
|
75
|
+
* + binding_level:"item", and element_get_binding reported a healthy-looking
|
|
76
|
+
* binding — but the frontend showed N identical placeholder cards. The
|
|
77
|
+
* warning is NOT a hard reject (a first bind of just the source can be a
|
|
78
|
+
* legitimate intermediate step), but it must be unmissable.
|
|
79
|
+
*
|
|
80
|
+
* `hadMappings` is true when the bind REQUEST carried a non-empty
|
|
81
|
+
* field_mappings object. We fire only when the request had no mappings AND
|
|
82
|
+
* the response did not report any dropped mappings (a re-bind that shrinks an
|
|
83
|
+
* existing map keeps real data on the kept props — that is the F147 warning's
|
|
84
|
+
* territory, not this one).
|
|
85
|
+
*/
|
|
86
|
+
function zeroFieldMappingsWarning() {
|
|
87
|
+
return ('0 field mappings bound — the cloned items will render the template\'s ' +
|
|
88
|
+
'static placeholder texts (Title / Lorem ipsum), not real data. ' +
|
|
89
|
+
'Re-bind with field_mappings AT THIS ITEM (call element_bind_source ' +
|
|
90
|
+
'again on THIS same element_path with a non-empty ' +
|
|
91
|
+
'field_mappings:{<element_prop>:<source_field>}). Do NOT bind the ' +
|
|
92
|
+
'individual child leaves instead: on YT5 a "#parent" leaf bind written ' +
|
|
93
|
+
'directly under an iterating item renders placeholder text — the ' +
|
|
94
|
+
'field_mappings-at-the-item form is the shape that resolves. Discover ' +
|
|
95
|
+
'props via yootheme_builder_element_type_get_schema, source fields via ' +
|
|
96
|
+
'apimapper_yootheme_binding_for_flow.');
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* F129 + F147 + F174 — when the REST plugin's bind response carries
|
|
100
|
+
* `unknown_prop_keys` (field_mappings keys the target element-type does
|
|
101
|
+
* not render) and/or `dropped_field_mappings` (leaves the new, smaller
|
|
102
|
+
* field_mappings dropped from the prior binding — full replace, not
|
|
103
|
+
* merge), promote them to a TOP-LEVEL `warning` string so both silent-
|
|
104
|
+
* footgun signals are the first thing the agent sees. F174: when the bind
|
|
105
|
+
* persisted a source binding with ZERO field mappings (request had none and
|
|
106
|
+
* none were dropped), promote the placeholder-render footgun warning too.
|
|
107
|
+
* Returns the body unchanged when no signal is present (no warning on the
|
|
108
|
+
* happy path).
|
|
109
|
+
*/
|
|
110
|
+
function withBindWarnings(body, hadMappings) {
|
|
111
|
+
if (body === null || typeof body !== 'object' || Array.isArray(body))
|
|
112
|
+
return body;
|
|
113
|
+
const root = body;
|
|
114
|
+
const unknownKeys = stringList(root.unknown_prop_keys);
|
|
115
|
+
const droppedKeys = stringList(root.dropped_field_mappings);
|
|
116
|
+
const parts = [];
|
|
117
|
+
if (unknownKeys.length > 0) {
|
|
118
|
+
parts.push(`These field_mappings keys are not props the target element renders, ` +
|
|
119
|
+
`so their values will be silently dropped: ${unknownKeys.join(', ')}. ` +
|
|
120
|
+
`Run yootheme_builder_element_type_get_schema for valid prop names ` +
|
|
121
|
+
`(see unknown_prop_keys_did_you_mean for suggestions), or re-bind onto ` +
|
|
122
|
+
`an element that exposes these props.`);
|
|
123
|
+
}
|
|
124
|
+
// G2 (WF1 Phase-2) — the VALUE-side mirror of unknown_prop_keys. A
|
|
125
|
+
// field_mappings VALUE that names a source-field the bound flow does NOT
|
|
126
|
+
// emit binds to nothing → the bind returns 200 but the element renders
|
|
127
|
+
// blank. The PHP chokepoint is the only place that resolves BOTH the
|
|
128
|
+
// source's field set AND the target element, so it flags these as
|
|
129
|
+
// `unknown_source_field_values` (with the available set in
|
|
130
|
+
// `unknown_source_field_values_available`). Promote both into the
|
|
131
|
+
// top-level warning so the agent sees which field is wrong AND the
|
|
132
|
+
// valid choices, in one step.
|
|
133
|
+
const unknownFieldValues = stringList(root.unknown_source_field_values);
|
|
134
|
+
if (unknownFieldValues.length > 0) {
|
|
135
|
+
const available = stringList(root.unknown_source_field_values_available);
|
|
136
|
+
const availableHint = available.length > 0
|
|
137
|
+
? ` Available source fields: ${available.join(', ')}.`
|
|
138
|
+
: '';
|
|
139
|
+
parts.push(`These field_mappings values name source fields the bound source does ` +
|
|
140
|
+
`not emit, so they bind to nothing (the element renders blank): ` +
|
|
141
|
+
`${unknownFieldValues.join(', ')}.${availableHint} Re-bind with a ` +
|
|
142
|
+
`source-field name the flow actually emits — list them via ` +
|
|
143
|
+
`apimapper_yootheme_binding_for_flow.`);
|
|
144
|
+
}
|
|
145
|
+
if (droppedKeys.length > 0) {
|
|
146
|
+
parts.push(`field_mappings is a full REPLACE, not a merge — this re-bind dropped ` +
|
|
147
|
+
`the previously-bound prop(s): ${droppedKeys.join(', ')}. If that was ` +
|
|
148
|
+
`unintended, re-bind with the full set (include the dropped keys).`);
|
|
149
|
+
}
|
|
150
|
+
// F174 — only when the request bound a source with no mappings AND no
|
|
151
|
+
// prior mappings were dropped. A bind that dropped keys still kept real
|
|
152
|
+
// data on the survivors → not a zero-mappings placeholder situation.
|
|
153
|
+
if (!hadMappings && droppedKeys.length === 0 && bindPersistedSource(root)) {
|
|
154
|
+
parts.push(zeroFieldMappingsWarning());
|
|
155
|
+
}
|
|
156
|
+
// F189 — the bind landed a `…List` source on a LEAF renderer (grid_item /
|
|
157
|
+
// any non-container) that ALSO carries nested children. The item's own slot
|
|
158
|
+
// bind resolved, but its nested children are render-dead (the template never
|
|
159
|
+
// renders them). Promote the reject-recipe text so the agent fixes the shape
|
|
160
|
+
// instead of shipping a placeholder grid.
|
|
161
|
+
if (root.iterator_is_leaf_renderer === true) {
|
|
162
|
+
parts.push(GRID_ITEM_ITERATOR_REJECT);
|
|
163
|
+
}
|
|
164
|
+
if (parts.length === 0)
|
|
165
|
+
return body;
|
|
166
|
+
return { ...root, warning: parts.join(' ') };
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* F174 — did the bind response persist an actual source binding (vs an
|
|
170
|
+
* unbind / no-op)? True when the response `binding.source_name` (or the
|
|
171
|
+
* top-level `source_name`) is a non-empty string. Guards the zero-mappings
|
|
172
|
+
* warning so it never fires on an unbind echo.
|
|
173
|
+
*/
|
|
174
|
+
function bindPersistedSource(root) {
|
|
175
|
+
const fromBinding = root.binding !== null && typeof root.binding === 'object' && !Array.isArray(root.binding)
|
|
176
|
+
? root.binding.source_name
|
|
177
|
+
: undefined;
|
|
178
|
+
const name = typeof fromBinding === 'string' ? fromBinding : root.source_name;
|
|
179
|
+
return typeof name === 'string' && name.length > 0;
|
|
180
|
+
}
|
|
41
181
|
// ─── element_bind_source (G.4.3 — ambiguity resolution) ─────────────
|
|
42
182
|
/**
|
|
43
183
|
* Look up sources matching `source_name`. Returns at most one row per
|
|
@@ -108,7 +248,17 @@ export async function handleElementBindSource({ client, elicitation }, input) {
|
|
|
108
248
|
}
|
|
109
249
|
try {
|
|
110
250
|
const data = await client.put(`/pages/${encodeTemplateId(template_id)}/elements/${encoded}/binding`, { body: resolvedBody, etag });
|
|
111
|
-
|
|
251
|
+
// F129 + F147 + F174 — the bind persisted (200), but the REST plugin
|
|
252
|
+
// may have flagged field_mappings keys the target element-type does
|
|
253
|
+
// not render (`unknown_prop_keys`) and/or leaves the new, smaller
|
|
254
|
+
// map dropped from the prior binding (`dropped_field_mappings` —
|
|
255
|
+
// full replace, not merge); and the bind may have persisted a source
|
|
256
|
+
// with ZERO field mappings (renders only template placeholders).
|
|
257
|
+
// All are silent footguns at render time. Lift them into a TOP-LEVEL
|
|
258
|
+
// warning so the agent notices and corrects, rather than leaving the
|
|
259
|
+
// signal buried in the passthrough body.
|
|
260
|
+
const hadMappings = field_mappings !== undefined && Object.keys(field_mappings).length > 0;
|
|
261
|
+
return jsonResult(withBindWarnings(data, hadMappings));
|
|
112
262
|
}
|
|
113
263
|
catch (e) {
|
|
114
264
|
// Wave-12 F9 — surface unknown-source hints directly into the
|
|
@@ -121,6 +271,18 @@ export async function handleElementBindSource({ client, elicitation }, input) {
|
|
|
121
271
|
...(source_id ? { source_id } : {}),
|
|
122
272
|
};
|
|
123
273
|
if (e instanceof RestError) {
|
|
274
|
+
// F189 — slot collision (409): two fields would land on the same
|
|
275
|
+
// parent prop slot during F188 consolidation, OR the lifted key is
|
|
276
|
+
// not a slot of the parent type. The server's message already names
|
|
277
|
+
// the slot + recipe; surface the canonical steering as the hint so
|
|
278
|
+
// the agent gives each field its own leaf / a distinct slot.
|
|
279
|
+
if (isSlotCollision(e.body)) {
|
|
280
|
+
return errorResult({
|
|
281
|
+
error: e,
|
|
282
|
+
context: baseContext,
|
|
283
|
+
hint: SLOT_COLLISION_STEERING,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
124
286
|
const hints = extractUnknownSourceHints(e.body);
|
|
125
287
|
if (hints !== null) {
|
|
126
288
|
if (hints.did_you_mean !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers-bind.js","sourceRoot":"","sources":["../../../src/tools/sources/handlers-bind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACH,qBAAqB,EACrB,YAAY,GAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,sBAAsB,GAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,YAAY,EACZ,WAAW,EACX,UAAU,GAEb,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers-bind.js","sourceRoot":"","sources":["../../../src/tools/sources/handlers-bind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC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YACR,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;YACtC,IAAI,EAAE,yDAAyD;SAClE,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
|
|
@@ -18,12 +18,15 @@ export declare const SOURCES_LIST_OUTPUT_SCHEMA: z.ZodObject<{
|
|
|
18
18
|
projected_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
19
|
available_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
20
|
unknown_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
projection_warning: z.ZodOptional<z.ZodString>;
|
|
21
22
|
}, z.core.$strip>;
|
|
22
23
|
export declare const BINDING_OUTPUT_SCHEMA: z.ZodObject<{
|
|
23
24
|
template_id: z.ZodString;
|
|
24
25
|
element_path: z.ZodString;
|
|
25
26
|
binding: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
27
|
has_binding: z.ZodBoolean;
|
|
28
|
+
field_mapping_count: z.ZodNumber;
|
|
29
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
27
30
|
}, z.core.$strip>;
|
|
28
31
|
export interface SourcesHandlerDeps {
|
|
29
32
|
readonly client: RestClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/sources/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AASvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAQlE,OAAO,EAGH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,0BAA0B;;;;;;;iBAWrC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;iBAahC,CAAC;AAEH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACnD;AAID,wBAAsB,iBAAiB,CACnC,EAAE,MAAM,EAAE,EAAE,kBAAkB,EAC9B,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3C,OAAO,CAAC,UAAU,CAAC,CA2CrB;AAID,wBAAsB,uBAAuB,CACzC,EAAE,MAAM,EAAE,EAAE,kBAAkB,EAC9B,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC7E,OAAO,CAAC,UAAU,CAAC,CAwDrB;AAID,OAAO,EACH,uBAAuB,EACvB,yBAAyB,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
import { detailResult, tableResult } from '@getimo/mcp-toolkit';
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { encodeElementPath, encodeTemplateId } from '../../client.js';
|
|
14
|
-
import { SOURCES_TABLE_COLUMNS, buildBindingDetail, flattenSourcesPayload, mapSourceRow, remapOriginForPlatform, } from '../format/sources-format.js';
|
|
15
|
-
import { DEFAULT_FIELDS_SOURCES_LIST, projectFields, projectedFieldsEcho, projectionFeedback, } from '../sparse-fields.js';
|
|
14
|
+
import { SOURCES_TABLE_COLUMNS, bindingFieldMappingCount, buildBindingDetail, flattenSourcesPayload, mapSourceRow, remapOriginForPlatform, } from '../format/sources-format.js';
|
|
15
|
+
import { DEFAULT_FIELDS_SOURCES_LIST, projectFields, projectedFieldsEcho, projectionFeedback, projectionWarning, } from '../sparse-fields.js';
|
|
16
16
|
import { errorResult, structuredResult, } from '../tool-builder.js';
|
|
17
17
|
// ─── outputSchemas (Wave G.2 §4) ─────────────────────────────────────
|
|
18
18
|
export const SOURCES_LIST_OUTPUT_SCHEMA = z.object({
|
|
@@ -22,12 +22,24 @@ export const SOURCES_LIST_OUTPUT_SCHEMA = z.object({
|
|
|
22
22
|
// F-004 fix (2026-05-25 exhaustive audit): see sparse-fields::projectionFeedback.
|
|
23
23
|
available_fields: z.array(z.string()).optional(),
|
|
24
24
|
unknown_fields: z.array(z.string()).optional(),
|
|
25
|
+
// F23 (2026-06-10): the LOUD unknown-projection warning also rides in
|
|
26
|
+
// structuredContent — hosts that surface structuredContent (not the
|
|
27
|
+
// text leg) to the model would otherwise never see it.
|
|
28
|
+
projection_warning: z.string().optional(),
|
|
25
29
|
});
|
|
26
30
|
export const BINDING_OUTPUT_SCHEMA = z.object({
|
|
27
31
|
template_id: z.string(),
|
|
28
32
|
element_path: z.string(),
|
|
29
33
|
binding: z.record(z.string(), z.unknown()),
|
|
30
34
|
has_binding: z.boolean(),
|
|
35
|
+
// F174 — number of field mappings on the binding. Always present (0 when
|
|
36
|
+
// unbound or mapping-less) so a "verification" read of a bound-but-
|
|
37
|
+
// mapping-less element no longer looks healthy.
|
|
38
|
+
field_mapping_count: z.number().int().nonnegative(),
|
|
39
|
+
// F174 — top-level warning when the element IS bound but has 0 field
|
|
40
|
+
// mappings (the N clones render only the template's static placeholder
|
|
41
|
+
// text). Absent on the happy path.
|
|
42
|
+
warning: z.string().optional(),
|
|
31
43
|
});
|
|
32
44
|
// ─── sources_list ────────────────────────────────────────────────────
|
|
33
45
|
export async function handleSourcesList({ client }, { fields }) {
|
|
@@ -46,13 +58,14 @@ export async function handleSourcesList({ client }, { fields }) {
|
|
|
46
58
|
const items = projectFields(mappedRecords, fields, DEFAULT_FIELDS_SOURCES_LIST);
|
|
47
59
|
const echo = projectedFieldsEcho(fields, DEFAULT_FIELDS_SOURCES_LIST);
|
|
48
60
|
const feedback = projectionFeedback(mappedRecords, fields);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: '';
|
|
61
|
+
// F23 (2026-06-09): shared loud-warning helper.
|
|
62
|
+
const unknownNote = projectionWarning(feedback);
|
|
52
63
|
const toolkitResult = tableResult(mappedRecords, {
|
|
53
64
|
columns: [...SOURCES_TABLE_COLUMNS],
|
|
54
65
|
header: (count) => `${String(count)} sources${unknownNote}`,
|
|
55
|
-
footer: '
|
|
66
|
+
footer: 'Bind one directly: yootheme_builder_element_bind_source({ template_id, ' +
|
|
67
|
+
'element_path, source_name, field_mappings }) ' +
|
|
68
|
+
'(a first-class tool in tools/list since F116).',
|
|
56
69
|
});
|
|
57
70
|
return structuredResult(toolkitResult, {
|
|
58
71
|
items,
|
|
@@ -61,6 +74,7 @@ export async function handleSourcesList({ client }, { fields }) {
|
|
|
61
74
|
...(feedback !== undefined ? {
|
|
62
75
|
available_fields: [...feedback.available_fields],
|
|
63
76
|
unknown_fields: [...feedback.unknown_fields],
|
|
77
|
+
...(unknownNote.trim() !== '' ? { projection_warning: unknownNote.trim() } : {}),
|
|
64
78
|
} : {}),
|
|
65
79
|
});
|
|
66
80
|
}
|
|
@@ -86,12 +100,35 @@ export async function handleElementGetBinding({ client }, { template_id, element
|
|
|
86
100
|
? binding.has_binding
|
|
87
101
|
: typeof binding.source_name === 'string' &&
|
|
88
102
|
binding.source_name.length > 0;
|
|
103
|
+
// F174 — count the field mappings (same extraction the detail builder
|
|
104
|
+
// uses) so a "verification" read surfaces the zero-mappings footgun
|
|
105
|
+
// instead of silently looking healthy. The warning fires ONLY when the
|
|
106
|
+
// element is actually bound but carries no mappings — the N clones then
|
|
107
|
+
// render the template's static placeholder text, not real data.
|
|
108
|
+
const fieldMappingCount = bindingFieldMappingCount(binding);
|
|
109
|
+
const zeroFieldMappings = hasBinding && fieldMappingCount === 0;
|
|
89
110
|
const toolkitResult = detailResult(buildBindingDetail({ template_id, element_path, binding }));
|
|
90
111
|
return structuredResult(toolkitResult, {
|
|
91
112
|
template_id,
|
|
92
113
|
element_path,
|
|
93
114
|
binding,
|
|
94
115
|
has_binding: hasBinding,
|
|
116
|
+
field_mapping_count: fieldMappingCount,
|
|
117
|
+
...(zeroFieldMappings
|
|
118
|
+
? {
|
|
119
|
+
warning: 'This element is bound to a source but has 0 field mappings, ' +
|
|
120
|
+
'so its cloned items render the template\'s static placeholder ' +
|
|
121
|
+
'text (Title / Lorem ipsum), not real data. Re-bind with ' +
|
|
122
|
+
'field_mappings AT THIS ITEM via ' +
|
|
123
|
+
'yootheme_builder_element_bind_source on THIS element_path ' +
|
|
124
|
+
'with field_mappings:{<element_prop>:<source_field>}. Do NOT ' +
|
|
125
|
+
'bind the individual child leaves instead: on YT5 a "#parent" ' +
|
|
126
|
+
'leaf bind written directly under an iterating item renders ' +
|
|
127
|
+
'placeholder text. Discover props with ' +
|
|
128
|
+
'yootheme_builder_element_type_get_schema, source fields ' +
|
|
129
|
+
'with apimapper_yootheme_binding_for_flow.',
|
|
130
|
+
}
|
|
131
|
+
: {}),
|
|
95
132
|
});
|
|
96
133
|
}
|
|
97
134
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/sources/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,GACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACH,2BAA2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AAiB;gBACjB,CAAC,CAAC;oBACI,OAAO,EACH,8DAA8D;wBAC9D,gEAAgE;wBAChE,0DAA0D;wBAC1D,kCAAkC;wBAClC,4DAA4D;wBAC5D,8DAA8D;wBAC9D,+DAA+D;wBAC/D,6DAA6D;wBAC7D,wCAAwC;wBACxC,0DAA0D;wBAC1D,2CAA2C;iBAClD;gBACH,CAAC,CAAC,EAAE,CAAC;SACZ,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,WAAW,CAAC;YACf,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;YACtC,IAAI,EAAE,wDAAwD;SACjE,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAED,uEAAuE;AACvE,+DAA+D;AAC/D,OAAO,EACH,uBAAuB,EACvB,yBAAyB,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -103,4 +103,27 @@ export interface ProjectionFeedback {
|
|
|
103
103
|
readonly unknown_fields: readonly string[];
|
|
104
104
|
}
|
|
105
105
|
export declare function projectionFeedback(items: readonly Record<string, unknown>[], requested: readonly string[] | undefined): ProjectionFeedback | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* F23 (2026-06-09): single source of truth for the LOUD text-leg warning
|
|
108
|
+
* a tool appends to its table header when a `fields[]` projection
|
|
109
|
+
* contained keys that did not exist on any row.
|
|
110
|
+
*
|
|
111
|
+
* Before this helper every read tool assembled the note inline (subtly
|
|
112
|
+
* different wording per tool, and a new tool wiring `projectionFeedback`
|
|
113
|
+
* could silently forget the text-leg note entirely — only the
|
|
114
|
+
* structuredContent `unknown_fields` array surfaced it, which cold
|
|
115
|
+
* agents never read). Centralising the string here means ALL tools
|
|
116
|
+
* surface the identical, self-correcting signal:
|
|
117
|
+
*
|
|
118
|
+
* " (unknown projection fields ignored: type — available: rel_path, …)"
|
|
119
|
+
*
|
|
120
|
+
* Returns the EMPTY string when there is nothing to warn about (feedback
|
|
121
|
+
* undefined, or `unknown_fields` empty) so call-sites can unconditionally
|
|
122
|
+
* append the result to their header.
|
|
123
|
+
*
|
|
124
|
+
* The leading space lets a call-site write `header${warning}` without an
|
|
125
|
+
* extra separator; the parentheses keep it visually scoped inside the
|
|
126
|
+
* header line.
|
|
127
|
+
*/
|
|
128
|
+
export declare function projectionWarning(feedback: ProjectionFeedback | undefined): string;
|
|
106
129
|
//# sourceMappingURL=sparse-fields.d.ts.map
|