@json-layout/core 2.8.2 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/package.json +4 -2
  2. package/src/compile/index.js +3 -1
  3. package/src/compile/skeleton-node.js +46 -5
  4. package/src/compile/types.ts +1 -0
  5. package/src/compile/utils/resolve-refs.js +5 -8
  6. package/src/compile/utils/x-i18n.js +15 -6
  7. package/src/state/index.js +18 -1
  8. package/src/state/state-node.js +11 -2
  9. package/src/state/utils/urls.js +2 -0
  10. package/src/utils/json-pointer.js +29 -0
  11. package/src/webmcp/README.md +144 -0
  12. package/src/webmcp/index.js +88 -82
  13. package/src/webmcp/project.js +479 -111
  14. package/src/webmcp/resolve.js +37 -1
  15. package/src/webmcp/schema.js +169 -0
  16. package/src/webmcp/suggestions-store.js +121 -0
  17. package/src/webmcp/tools/describe-state.js +20 -64
  18. package/src/webmcp/tools/edit-array.js +51 -28
  19. package/src/webmcp/tools/fill-form-skill.js +17 -41
  20. package/src/webmcp/tools/get-data.js +66 -13
  21. package/src/webmcp/tools/get-field-suggestions.js +12 -23
  22. package/src/webmcp/tools/set-data.js +79 -28
  23. package/src/webmcp/tools/set-field-value.js +49 -39
  24. package/src/webmcp/variants-memo.js +53 -0
  25. package/types/compile/index.d.ts.map +1 -1
  26. package/types/compile/skeleton-node.d.ts +9 -2
  27. package/types/compile/skeleton-node.d.ts.map +1 -1
  28. package/types/compile/types.d.ts +1 -0
  29. package/types/compile/types.d.ts.map +1 -1
  30. package/types/compile/utils/resolve-refs.d.ts.map +1 -1
  31. package/types/compile/utils/x-i18n.d.ts +1 -1
  32. package/types/compile/utils/x-i18n.d.ts.map +1 -1
  33. package/types/state/index.d.ts +10 -0
  34. package/types/state/index.d.ts.map +1 -1
  35. package/types/state/state-node.d.ts.map +1 -1
  36. package/types/state/utils/urls.d.ts.map +1 -1
  37. package/types/utils/json-pointer.d.ts +22 -0
  38. package/types/utils/json-pointer.d.ts.map +1 -0
  39. package/types/webmcp/index.d.ts +23 -15
  40. package/types/webmcp/index.d.ts.map +1 -1
  41. package/types/webmcp/project.d.ts +159 -57
  42. package/types/webmcp/project.d.ts.map +1 -1
  43. package/types/webmcp/resolve.d.ts +7 -3
  44. package/types/webmcp/resolve.d.ts.map +1 -1
  45. package/types/webmcp/schema.d.ts +44 -0
  46. package/types/webmcp/schema.d.ts.map +1 -0
  47. package/types/webmcp/suggestions-store.d.ts +82 -0
  48. package/types/webmcp/suggestions-store.d.ts.map +1 -0
  49. package/types/webmcp/tools/describe-state.d.ts +5 -57
  50. package/types/webmcp/tools/describe-state.d.ts.map +1 -1
  51. package/types/webmcp/tools/edit-array.d.ts +8 -37
  52. package/types/webmcp/tools/edit-array.d.ts.map +1 -1
  53. package/types/webmcp/tools/fill-form-skill.d.ts +10 -13
  54. package/types/webmcp/tools/fill-form-skill.d.ts.map +1 -1
  55. package/types/webmcp/tools/get-data.d.ts +17 -15
  56. package/types/webmcp/tools/get-data.d.ts.map +1 -1
  57. package/types/webmcp/tools/get-field-suggestions.d.ts +4 -30
  58. package/types/webmcp/tools/get-field-suggestions.d.ts.map +1 -1
  59. package/types/webmcp/tools/set-data.d.ts +17 -34
  60. package/types/webmcp/tools/set-data.d.ts.map +1 -1
  61. package/types/webmcp/tools/set-field-value.d.ts +20 -57
  62. package/types/webmcp/tools/set-field-value.d.ts.map +1 -1
  63. package/types/webmcp/variants-memo.d.ts +42 -0
  64. package/types/webmcp/variants-memo.d.ts.map +1 -0
@@ -6,20 +6,26 @@ export function getDescription(dataTitle: string): string;
6
6
  /**
7
7
  * @param {import('../../state/index.js').StatefulLayout} statefulLayout
8
8
  * @param {{ path: string, action: 'add'|'remove', index?: number, value?: unknown }} args
9
- * @returns {{ valid: boolean, itemCount: number, errors: Array<{path: string, message: string}> }}
9
+ * @param {import('../variants-memo.js').VariantsMemo} [variantsMemo] - a new item of a
10
+ * recursive schema carries the same union as the item that contains it; the memo keeps the
11
+ * response from printing it again
12
+ * @returns {{ valid: boolean, itemCount: number, index: number, itemMarkdown?: string, errors: Array<{path: string, message: string}>, otherErrors: number }}
10
13
  */
11
14
  export function execute(statefulLayout: import("../../state/index.js").StatefulLayout, args: {
12
15
  path: string;
13
16
  action: "add" | "remove";
14
17
  index?: number;
15
18
  value?: unknown;
16
- }): {
19
+ }, variantsMemo?: import("../variants-memo.js").VariantsMemo): {
17
20
  valid: boolean;
18
21
  itemCount: number;
22
+ index: number;
23
+ itemMarkdown?: string;
19
24
  errors: Array<{
20
25
  path: string;
21
26
  message: string;
22
27
  }>;
28
+ otherErrors: number;
23
29
  };
24
30
  export namespace inputSchema {
25
31
  let type: string;
@@ -50,39 +56,4 @@ export namespace inputSchema {
50
56
  }
51
57
  let required: string[];
52
58
  }
53
- export namespace outputSchema {
54
- let type_4: string;
55
- export { type_4 as type };
56
- export namespace properties_1 {
57
- namespace valid {
58
- let type_5: string;
59
- export { type_5 as type };
60
- }
61
- namespace itemCount {
62
- let type_6: string;
63
- export { type_6 as type };
64
- }
65
- namespace errors {
66
- let type_7: string;
67
- export { type_7 as type };
68
- export namespace items {
69
- let type_8: string;
70
- export { type_8 as type };
71
- export namespace properties_2 {
72
- export namespace path_1 {
73
- let type_9: string;
74
- export { type_9 as type };
75
- }
76
- export { path_1 as path };
77
- export namespace message {
78
- let type_10: string;
79
- export { type_10 as type };
80
- }
81
- }
82
- export { properties_2 as properties };
83
- }
84
- }
85
- }
86
- export { properties_1 as properties };
87
- }
88
59
  //# sourceMappingURL=edit-array.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edit-array.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/edit-array.js"],"names":[],"mappings":"AAgDA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,GAAC,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GACvE;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAE,CAqCjG"}
1
+ {"version":3,"file":"edit-array.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/edit-array.js"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,wCAPW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,GAAC,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,iBACzE,OAAO,qBAAqB,EAAE,YAAY,GAGxC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CA2E5J"}
@@ -1,24 +1,21 @@
1
+ /**
2
+ * @file fillFormSkill tool
3
+ */
1
4
  /**
2
5
  * @param {string} dataTitle
3
6
  * @returns {string}
4
7
  */
5
8
  export function getDescription(dataTitle: string): string;
6
9
  /**
7
- * Generate skill content with dataTitle injected
10
+ * The one path. There used to be three, chosen by counting normalized layouts and calling
11
+ * the result small, medium or large — a threshold nobody could justify, measuring the
12
+ * schema when the question was about data, and duplicated between here and index.js. Four
13
+ * commits in a row went to fixing contradictions between those branches, and across four
14
+ * recorded baselines the small and medium advice was never taken on a real form: setData
15
+ * was used zero times and getSchema once.
8
16
  * @param {string} dataTitle
9
17
  * @param {string} prefixName
10
- * @param {boolean} hasSchema
11
- * @param {import('../../state/index.js').StatefulLayout} statefulLayout
12
18
  * @returns {string}
13
19
  */
14
- export function generateSkill(dataTitle: string, prefixName: string, hasSchema: boolean, statefulLayout: import("../../state/index.js").StatefulLayout): string;
15
- export namespace outputSchema {
16
- let type: string;
17
- namespace properties {
18
- namespace content {
19
- let type_1: string;
20
- export { type_1 as type };
21
- }
22
- }
23
- }
20
+ export function generateSkill(dataTitle: string, prefixName: string): string;
24
21
  //# sourceMappingURL=fill-form-skill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fill-form-skill.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/fill-form-skill.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,yCANW,MAAM,cACN,MAAM,aACN,OAAO,kBACP,OAAO,sBAAsB,EAAE,cAAc,GAC3C,MAAM,CAyClB"}
1
+ {"version":3,"file":"fill-form-skill.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/fill-form-skill.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;;;;GAUG;AACH,yCAJW,MAAM,cACN,MAAM,GACJ,MAAM,CAqBlB"}
@@ -4,28 +4,30 @@
4
4
  */
5
5
  export function getDescription(dataTitle: string): string;
6
6
  /**
7
+ * Read the data, whole or at a path. Whatever it returns is the real value: an agent may
8
+ * forward it to an API, so nothing here is ever abbreviated. `path` exists so that
9
+ * wanting one field is not a reason to pull a document that can run to tens of kilobytes.
7
10
  * @param {import('../../state/index.js').StatefulLayout} statefulLayout
8
- * @param {{}} _args
9
- * @returns {{ data: unknown, valid: boolean }}
11
+ * @param {{ path?: string }} args
12
+ * @returns {{ data?: unknown, unset?: boolean, valid: boolean }}
10
13
  */
11
- export function execute(statefulLayout: import("../../state/index.js").StatefulLayout, _args: {}): {
12
- data: unknown;
14
+ export function execute(statefulLayout: import("../../state/index.js").StatefulLayout, args: {
15
+ path?: string;
16
+ }): {
17
+ data?: unknown;
18
+ unset?: boolean;
13
19
  valid: boolean;
14
20
  };
21
+ /** Most field paths named in a refusal before the rest are counted instead. */
22
+ export const NAMED_FIELDS_MAX: 12;
15
23
  export namespace inputSchema {
16
24
  let type: string;
17
- let properties: {};
18
- }
19
- export namespace outputSchema {
20
- let type_1: string;
21
- export { type_1 as type };
22
- export namespace properties_1 {
23
- let data: {};
24
- namespace valid {
25
- let type_2: string;
26
- export { type_2 as type };
25
+ namespace properties {
26
+ namespace path {
27
+ let type_1: string;
28
+ export { type_1 as type };
29
+ export let description: string;
27
30
  }
28
31
  }
29
- export { properties_1 as properties };
30
32
  }
31
33
  //# sourceMappingURL=get-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-data.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/get-data.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,SAC7C,EAAE,GACA;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAO7C"}
1
+ {"version":3,"file":"get-data.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/get-data.js"],"names":[],"mappings":"AAwCA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACf;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAkC/D;AAlFD,+EAA+E;AAC/E,+BAAgC,EAAE,CAAA"}
@@ -6,17 +6,19 @@ export function getDescription(dataTitle: string): string;
6
6
  /**
7
7
  * @param {import('../../state/index.js').StatefulLayout} statefulLayout
8
8
  * @param {{ path: string, query?: string }} args
9
- * @returns {Promise<{items: Array<{value: unknown, title: string, key?: string}>}>}
9
+ * @param {import('../suggestions-store.js').SuggestionsStore} [store] - memorizes the full items so that setFieldValue can apply one by index
10
+ * @returns {Promise<{items: Array<{value: unknown, title: string, key?: string}>, baseIndex: number}>}
10
11
  */
11
12
  export function execute(statefulLayout: import("../../state/index.js").StatefulLayout, args: {
12
13
  path: string;
13
14
  query?: string;
14
- }): Promise<{
15
+ }, store?: import("../suggestions-store.js").SuggestionsStore): Promise<{
15
16
  items: Array<{
16
17
  value: unknown;
17
18
  title: string;
18
19
  key?: string;
19
20
  }>;
21
+ baseIndex: number;
20
22
  }>;
21
23
  export namespace inputSchema {
22
24
  let type: string;
@@ -35,32 +37,4 @@ export namespace inputSchema {
35
37
  }
36
38
  let required: string[];
37
39
  }
38
- export namespace outputSchema {
39
- let type_3: string;
40
- export { type_3 as type };
41
- export namespace properties_1 {
42
- namespace items {
43
- let type_4: string;
44
- export { type_4 as type };
45
- export namespace items_1 {
46
- let type_5: string;
47
- export { type_5 as type };
48
- export namespace properties_2 {
49
- let value: {};
50
- namespace title {
51
- let type_6: string;
52
- export { type_6 as type };
53
- }
54
- namespace key {
55
- let type_7: string;
56
- export { type_7 as type };
57
- }
58
- }
59
- export { properties_2 as properties };
60
- }
61
- export { items_1 as items };
62
- }
63
- }
64
- export { properties_1 as properties };
65
- }
66
40
  //# sourceMappingURL=get-field-suggestions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-field-suggestions.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/get-field-suggestions.js"],"names":[],"mappings":"AAsCA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAC,CAAC,CAkClF"}
1
+ {"version":3,"file":"get-field-suggestions.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/get-field-suggestions.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CASlB;AAED;;;;;GAKG;AACH,wCALW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,UAChC,OAAO,yBAAyB,EAAE,gBAAgB,GAChD,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAAC,CAkCrG"}
@@ -1,18 +1,25 @@
1
1
  /**
2
2
  * @param {string} dataTitle
3
- * @param {"small"|"medium"|"large"} [complexity]
4
3
  * @returns {string}
5
4
  */
6
- export function getDescription(dataTitle: string, complexity?: "small" | "medium" | "large"): string;
5
+ export function getDescription(dataTitle: string): string;
7
6
  /**
8
7
  * @param {import('../../state/index.js').StatefulLayout} statefulLayout
9
- * @param {{ data: unknown }} args
10
- * @returns {{ valid: boolean, errors: Array<{path: string, message: string}> }}
8
+ * @param {{ data: unknown, merge?: boolean }} args
9
+ * @returns {{ valid: boolean, written: string[], removed: string[], unknownKeys: string[], visibility?: { revealed: string[], hidden: string[] }, errors: Array<{path: string, message: string}> }}
11
10
  */
12
11
  export function execute(statefulLayout: import("../../state/index.js").StatefulLayout, args: {
13
12
  data: unknown;
13
+ merge?: boolean;
14
14
  }): {
15
15
  valid: boolean;
16
+ written: string[];
17
+ removed: string[];
18
+ unknownKeys: string[];
19
+ visibility?: {
20
+ revealed: string[];
21
+ hidden: string[];
22
+ };
16
23
  errors: Array<{
17
24
  path: string;
18
25
  message: string;
@@ -24,37 +31,13 @@ export namespace inputSchema {
24
31
  namespace data {
25
32
  let description: string;
26
33
  }
27
- }
28
- let required: string[];
29
- }
30
- export namespace outputSchema {
31
- let type_1: string;
32
- export { type_1 as type };
33
- export namespace properties_1 {
34
- namespace valid {
35
- let type_2: string;
36
- export { type_2 as type };
37
- }
38
- namespace errors {
39
- let type_3: string;
40
- export { type_3 as type };
41
- export namespace items {
42
- let type_4: string;
43
- export { type_4 as type };
44
- export namespace properties_2 {
45
- namespace path {
46
- let type_5: string;
47
- export { type_5 as type };
48
- }
49
- namespace message {
50
- let type_6: string;
51
- export { type_6 as type };
52
- }
53
- }
54
- export { properties_2 as properties };
55
- }
34
+ namespace merge {
35
+ let type_1: string;
36
+ export { type_1 as type };
37
+ let description_1: string;
38
+ export { description_1 as description };
56
39
  }
57
40
  }
58
- export { properties_1 as properties };
41
+ let required: string[];
59
42
  }
60
43
  //# sourceMappingURL=set-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"set-data.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/set-data.js"],"names":[],"mappings":"AAiCA;;;;GAIG;AACH,0CAJW,MAAM,eACN,OAAO,GAAC,QAAQ,GAAC,OAAO,GACtB,MAAM,CAOlB;AAED;;;;GAIG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACf;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAE,CAS9E"}
1
+ {"version":3,"file":"set-data.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/set-data.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AA2BD;;;;GAIG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAE,CAoDlM"}
@@ -5,19 +5,29 @@
5
5
  export function getDescription(dataTitle: string): string;
6
6
  /**
7
7
  * @param {import('../../state/index.js').StatefulLayout} statefulLayout
8
- * @param {{ path: string, value: unknown }} args
9
- * @returns {{ valid: boolean, field: ReturnType<typeof projectFieldResult>, errors: Array<{path: string, message: string}> }}
8
+ * @param {{ path: string, value?: unknown, suggestionIndex?: number }} args
9
+ * @param {import('../suggestions-store.js').SuggestionsStore} [store]
10
+ * @param {import('../variants-memo.js').VariantsMemo} [variantsMemo] - the activated branch
11
+ * may nest the same union again; the memo keeps the response from printing it twice
12
+ * @returns {{ valid: boolean, field: ReturnType<typeof projectFieldResult>, errors: Array<{path: string, message: string}>, otherErrors: number, activatedMarkdown?: string, visibility?: { revealed: string[], hidden: string[] } }}
10
13
  */
11
14
  export function execute(statefulLayout: import("../../state/index.js").StatefulLayout, args: {
12
15
  path: string;
13
- value: unknown;
14
- }): {
16
+ value?: unknown;
17
+ suggestionIndex?: number;
18
+ }, store?: import("../suggestions-store.js").SuggestionsStore, variantsMemo?: import("../variants-memo.js").VariantsMemo): {
15
19
  valid: boolean;
16
20
  field: ReturnType<typeof projectFieldResult>;
17
21
  errors: Array<{
18
22
  path: string;
19
23
  message: string;
20
24
  }>;
25
+ otherErrors: number;
26
+ activatedMarkdown?: string;
27
+ visibility?: {
28
+ revealed: string[];
29
+ hidden: string[];
30
+ };
21
31
  };
22
32
  export namespace inputSchema {
23
33
  let type: string;
@@ -31,61 +41,14 @@ export namespace inputSchema {
31
41
  let description_1: string;
32
42
  export { description_1 as description };
33
43
  }
34
- }
35
- let required: string[];
36
- }
37
- export namespace outputSchema {
38
- let type_2: string;
39
- export { type_2 as type };
40
- export namespace properties_1 {
41
- namespace valid {
42
- let type_3: string;
43
- export { type_3 as type };
44
- }
45
- namespace field {
46
- let type_4: string;
47
- export { type_4 as type };
48
- export namespace properties_2 {
49
- export namespace path_1 {
50
- let type_5: string;
51
- export { type_5 as type };
52
- }
53
- export { path_1 as path };
54
- export namespace type_6 {
55
- let type_7: string;
56
- export { type_7 as type };
57
- }
58
- export { type_6 as type };
59
- export let data: {};
60
- export namespace error {
61
- let type_8: string;
62
- export { type_8 as type };
63
- }
64
- }
65
- export { properties_2 as properties };
66
- }
67
- namespace errors {
68
- let type_9: string;
69
- export { type_9 as type };
70
- export namespace items {
71
- let type_10: string;
72
- export { type_10 as type };
73
- export namespace properties_3 {
74
- export namespace path_2 {
75
- let type_11: string;
76
- export { type_11 as type };
77
- }
78
- export { path_2 as path };
79
- export namespace message {
80
- let type_12: string;
81
- export { type_12 as type };
82
- }
83
- }
84
- export { properties_3 as properties };
85
- }
44
+ namespace suggestionIndex {
45
+ let type_2: string;
46
+ export { type_2 as type };
47
+ let description_2: string;
48
+ export { description_2 as description };
86
49
  }
87
50
  }
88
- export { properties_1 as properties };
51
+ let required: string[];
89
52
  }
90
53
  import { projectFieldResult } from '../project.js';
91
54
  //# sourceMappingURL=set-field-value.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"set-field-value.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/set-field-value.js"],"names":[],"mappings":"AA+CA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,wCAJW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAE,CAwB5H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA9EiD,eAAe"}
1
+ {"version":3,"file":"set-field-value.d.ts","sourceRoot":"","sources":["../../../src/webmcp/tools/set-field-value.js"],"names":[],"mappings":"AAyBA;;;GAGG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,wCAPW,OAAO,sBAAsB,EAAE,cAAc,QAC7C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,UAC3D,OAAO,yBAAyB,EAAE,gBAAgB,iBAClD,OAAO,qBAAqB,EAAE,YAAY,GAExC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE,CAqDpO;;;;;;;;;;;;;;;;;;;;;;mCAxFkH,eAAe"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @file Remembers which variant lists have already been sent to the agent.
3
+ *
4
+ * A discriminated union is a constant: the 39 branches of a portal page element are the
5
+ * same 39 whether they are reached at /elements/0 or at /elements/0/.../children2/0. The
6
+ * markdown projection used to print all of them every time one of those nodes appeared,
7
+ * and on a recursive schema that is most of the response — measured on the portal-page
8
+ * eval case, three emissions of one list were 4.45 KB of a 10.8 KB session, and the agent
9
+ * read it once and used it once.
10
+ *
11
+ * The memo is keyed on the SKELETON POINTER rather than the data path, which is what makes
12
+ * it catch recursion: every one of those nodes resolves to
13
+ * `page-config-simple#/$defs/element/oneOf`. It records where the list was first printed so
14
+ * a later response can point the agent back at it in its own transcript.
15
+ *
16
+ * It is never cleared on a write: unlike memorized suggestions, a schema's branches cannot
17
+ * be invalidated by editing the data. `describeState` projects into a fresh memo and merges
18
+ * it in afterwards, so a full read always prints every list once and stays authoritative.
19
+ */
20
+ export class VariantsMemo {
21
+ /**
22
+ * first path each pointer's variant list was printed at
23
+ * @type {Map<string, string>}
24
+ */
25
+ _listedAt: Map<string, string>;
26
+ /**
27
+ * @param {string} pointer - skeleton pointer of the one-of-select node
28
+ * @returns {string | undefined} the path it was first listed at, or undefined if never
29
+ */
30
+ listedAt(pointer: string): string | undefined;
31
+ /**
32
+ * @param {string} pointer
33
+ * @param {string} path
34
+ */
35
+ record(pointer: string, path: string): void;
36
+ /**
37
+ * @param {VariantsMemo} other
38
+ */
39
+ merge(other: VariantsMemo): void;
40
+ clear(): void;
41
+ }
42
+ //# sourceMappingURL=variants-memo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants-memo.d.ts","sourceRoot":"","sources":["../../src/webmcp/variants-memo.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACE;;;OAGG;IACH,WAFU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAER;IAErB;;;OAGG;IACH,kBAHW,MAAM,GACJ,MAAM,GAAG,SAAS,CAI9B;IAED;;;OAGG;IACH,gBAHW,MAAM,QACN,MAAM,QAIhB;IAED;;OAEG;IACH,aAFW,YAAY,QAItB;IAED,cAEC;CACF"}