@wootsup/yt-builder-mcp 1.1.7 → 1.2.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 (157) hide show
  1. package/README.md +7 -7
  2. package/bin/yt-builder-mcp.js +55 -40
  3. package/dist/auth.d.ts +18 -0
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +18 -0
  6. package/dist/auth.js.map +1 -1
  7. package/dist/cli/invocation-decision.d.ts +57 -0
  8. package/dist/cli/invocation-decision.d.ts.map +1 -0
  9. package/dist/cli/invocation-decision.js +86 -0
  10. package/dist/cli/invocation-decision.js.map +1 -0
  11. package/dist/client.d.ts +28 -0
  12. package/dist/client.d.ts.map +1 -1
  13. package/dist/client.js +40 -1
  14. package/dist/client.js.map +1 -1
  15. package/dist/clients/claude-code.d.ts.map +1 -1
  16. package/dist/clients/claude-code.js +3 -1
  17. package/dist/clients/claude-code.js.map +1 -1
  18. package/dist/clients/claude-desktop.d.ts.map +1 -1
  19. package/dist/clients/claude-desktop.js +3 -1
  20. package/dist/clients/claude-desktop.js.map +1 -1
  21. package/dist/clients/cline.d.ts.map +1 -1
  22. package/dist/clients/cline.js +3 -1
  23. package/dist/clients/cline.js.map +1 -1
  24. package/dist/clients/codex-cli.d.ts +1 -1
  25. package/dist/clients/codex-cli.d.ts.map +1 -1
  26. package/dist/clients/codex-cli.js +98 -0
  27. package/dist/clients/codex-cli.js.map +1 -1
  28. package/dist/clients/continue.d.ts.map +1 -1
  29. package/dist/clients/continue.js +70 -1
  30. package/dist/clients/continue.js.map +1 -1
  31. package/dist/clients/cursor.d.ts.map +1 -1
  32. package/dist/clients/cursor.js +3 -1
  33. package/dist/clients/cursor.js.map +1 -1
  34. package/dist/clients/gemini-cli.d.ts.map +1 -1
  35. package/dist/clients/gemini-cli.js +3 -1
  36. package/dist/clients/gemini-cli.js.map +1 -1
  37. package/dist/clients/index.d.ts +104 -0
  38. package/dist/clients/index.d.ts.map +1 -1
  39. package/dist/clients/index.js +141 -0
  40. package/dist/clients/index.js.map +1 -1
  41. package/dist/clients/roo-code.d.ts.map +1 -1
  42. package/dist/clients/roo-code.js +3 -1
  43. package/dist/clients/roo-code.js.map +1 -1
  44. package/dist/clients/zed.d.ts.map +1 -1
  45. package/dist/clients/zed.js +3 -1
  46. package/dist/clients/zed.js.map +1 -1
  47. package/dist/gateway/essentials.d.ts +4 -4
  48. package/dist/gateway/essentials.d.ts.map +1 -1
  49. package/dist/gateway/essentials.js +19 -5
  50. package/dist/gateway/essentials.js.map +1 -1
  51. package/dist/gateway/test-support.d.ts +3 -3
  52. package/dist/gateway/test-support.js +3 -3
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +9 -1
  56. package/dist/index.js.map +1 -1
  57. package/dist/install-skill.js +1 -1
  58. package/dist/server.d.ts +3 -3
  59. package/dist/server.js +3 -3
  60. package/dist/setup-cli.d.ts +41 -0
  61. package/dist/setup-cli.d.ts.map +1 -1
  62. package/dist/setup-cli.js +163 -1
  63. package/dist/setup-cli.js.map +1 -1
  64. package/dist/setup-prompts.d.ts +23 -0
  65. package/dist/setup-prompts.d.ts.map +1 -1
  66. package/dist/setup-prompts.js +76 -1
  67. package/dist/setup-prompts.js.map +1 -1
  68. package/dist/sites/bootstrap.d.ts +41 -0
  69. package/dist/sites/bootstrap.d.ts.map +1 -0
  70. package/dist/sites/bootstrap.js +58 -0
  71. package/dist/sites/bootstrap.js.map +1 -0
  72. package/dist/sites/client-pool.d.ts +33 -0
  73. package/dist/sites/client-pool.d.ts.map +1 -1
  74. package/dist/sites/client-pool.js +51 -1
  75. package/dist/sites/client-pool.js.map +1 -1
  76. package/dist/sites/tools/index.d.ts.map +1 -1
  77. package/dist/sites/tools/index.js +9 -1
  78. package/dist/sites/tools/index.js.map +1 -1
  79. package/dist/sites/tools/use-site.d.ts +47 -0
  80. package/dist/sites/tools/use-site.d.ts.map +1 -0
  81. package/dist/sites/tools/use-site.js +183 -0
  82. package/dist/sites/tools/use-site.js.map +1 -0
  83. package/dist/tools/elements/builders.d.ts.map +1 -1
  84. package/dist/tools/elements/builders.js +16 -7
  85. package/dist/tools/elements/builders.js.map +1 -1
  86. package/dist/tools/elements/handlers-write.d.ts +1 -1
  87. package/dist/tools/elements/handlers-write.d.ts.map +1 -1
  88. package/dist/tools/elements/handlers-write.js +202 -9
  89. package/dist/tools/elements/handlers-write.js.map +1 -1
  90. package/dist/tools/elements/handlers.d.ts.map +1 -1
  91. package/dist/tools/elements/handlers.js +3 -3
  92. package/dist/tools/elements/handlers.js.map +1 -1
  93. package/dist/tools/format/elements-format.d.ts.map +1 -1
  94. package/dist/tools/format/elements-format.js +10 -11
  95. package/dist/tools/format/elements-format.js.map +1 -1
  96. package/dist/tools/format/inspection-format.d.ts +11 -0
  97. package/dist/tools/format/inspection-format.d.ts.map +1 -1
  98. package/dist/tools/format/inspection-format.js +77 -21
  99. package/dist/tools/format/inspection-format.js.map +1 -1
  100. package/dist/tools/inspection.d.ts.map +1 -1
  101. package/dist/tools/inspection.js +194 -1
  102. package/dist/tools/inspection.js.map +1 -1
  103. package/dist/tools/multi-items/builders.d.ts.map +1 -1
  104. package/dist/tools/multi-items/builders.js +7 -1
  105. package/dist/tools/multi-items/builders.js.map +1 -1
  106. package/dist/tools/multi-items/clean-implode-handler.d.ts.map +1 -1
  107. package/dist/tools/multi-items/clean-implode-handler.js +2 -2
  108. package/dist/tools/multi-items/clean-implode-handler.js.map +1 -1
  109. package/dist/tools/multi-items/format/inspection-format.d.ts +41 -0
  110. package/dist/tools/multi-items/format/inspection-format.d.ts.map +1 -0
  111. package/dist/tools/multi-items/format/inspection-format.js +64 -0
  112. package/dist/tools/multi-items/format/inspection-format.js.map +1 -0
  113. package/dist/tools/multi-items/inspect-handler.d.ts +37 -2
  114. package/dist/tools/multi-items/inspect-handler.d.ts.map +1 -1
  115. package/dist/tools/multi-items/inspect-handler.js +93 -10
  116. package/dist/tools/multi-items/inspect-handler.js.map +1 -1
  117. package/dist/tools/multi-items/inspection-cache.d.ts +85 -0
  118. package/dist/tools/multi-items/inspection-cache.d.ts.map +1 -0
  119. package/dist/tools/multi-items/inspection-cache.js +126 -0
  120. package/dist/tools/multi-items/inspection-cache.js.map +1 -0
  121. package/dist/tools/pages/builders.d.ts +31 -2
  122. package/dist/tools/pages/builders.d.ts.map +1 -1
  123. package/dist/tools/pages/builders.js +102 -9
  124. package/dist/tools/pages/builders.js.map +1 -1
  125. package/dist/tools/pages/handlers-read.d.ts +1 -1
  126. package/dist/tools/pages/handlers-read.d.ts.map +1 -1
  127. package/dist/tools/pages/handlers-read.js +78 -21
  128. package/dist/tools/pages/handlers-read.js.map +1 -1
  129. package/dist/tools/pages/handlers-write.d.ts +48 -6
  130. package/dist/tools/pages/handlers-write.d.ts.map +1 -1
  131. package/dist/tools/pages/handlers-write.js +83 -8
  132. package/dist/tools/pages/handlers-write.js.map +1 -1
  133. package/dist/tools/pages/schemas.d.ts +112 -0
  134. package/dist/tools/pages/schemas.d.ts.map +1 -1
  135. package/dist/tools/pages/schemas.js +150 -0
  136. package/dist/tools/pages/schemas.js.map +1 -1
  137. package/dist/tools/shared-schemas.d.ts.map +1 -1
  138. package/dist/tools/shared-schemas.js +15 -2
  139. package/dist/tools/shared-schemas.js.map +1 -1
  140. package/dist/tools/sources/handlers-bind.d.ts.map +1 -1
  141. package/dist/tools/sources/handlers-bind.js +56 -4
  142. package/dist/tools/sources/handlers-bind.js.map +1 -1
  143. package/dist/tools/sources/handlers.d.ts.map +1 -1
  144. package/dist/tools/sources/handlers.js +2 -2
  145. package/dist/tools/sources/handlers.js.map +1 -1
  146. package/dist/uninstall-skill.d.ts +52 -0
  147. package/dist/uninstall-skill.d.ts.map +1 -0
  148. package/dist/uninstall-skill.js +146 -0
  149. package/dist/uninstall-skill.js.map +1 -0
  150. package/dist/uninstall.d.ts +73 -0
  151. package/dist/uninstall.d.ts.map +1 -0
  152. package/dist/uninstall.js +82 -0
  153. package/dist/uninstall.js.map +1 -0
  154. package/icon.png +0 -0
  155. package/manifest.json +10 -10
  156. package/package.json +4 -2
  157. package/skills/yt-builder-mcp/SKILL.md +30 -26
@@ -1 +1 @@
1
- {"version":3,"file":"clean-implode-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/clean-implode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAKH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,2BAA2B;;;;;;;;;iBAWtC,CAAC;AAEH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC/B;AAED,wBAAsB,4BAA4B,CAC9C,EAAE,MAAM,EAAE,EAAE,uBAAuB,EACnC,EACI,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,OAAO,GACV,EAAE;IACC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,GACF,OAAO,CAAC,UAAU,CAAC,CAgCrB"}
1
+ {"version":3,"file":"clean-implode-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/clean-implode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAKH,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,2BAA2B;;;;;;;;;iBAWtC,CAAC;AAEH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC/B;AAED,wBAAsB,4BAA4B,CAC9C,EAAE,MAAM,EAAE,EAAE,uBAAuB,EACnC,EACI,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,OAAO,GACV,EAAE;IACC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,GACF,OAAO,CAAC,UAAU,CAAC,CAgCrB"}
@@ -12,7 +12,7 @@
12
12
  * @license MIT
13
13
  */
14
14
  import { z } from 'zod';
15
- import { encodeElementPath } from '../../client.js';
15
+ import { encodeElementPath, encodeTemplateId } from '../../client.js';
16
16
  import { confirmGuard, errorResult, jsonResult, structuredResult, } from '../tool-builder.js';
17
17
  export const CLEAN_IMPLODE_OUTPUT_SCHEMA = z.object({
18
18
  template_id: z.string(),
@@ -37,7 +37,7 @@ export async function handleCleanImplodeDirectives({ client }, { template_id, el
37
37
  }
38
38
  const encoded = encodeElementPath(element_path);
39
39
  try {
40
- const data = await client.post(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/multi-items/clean-implode`, { body: {}, etag });
40
+ const data = await client.post(`/pages/${encodeTemplateId(template_id)}/elements/${encoded}/multi-items/clean-implode`, { body: {}, etag });
41
41
  // The REST endpoint returns the canonical CLEAN_IMPLODE_OUTPUT_SCHEMA
42
42
  // shape ({template_id, element_path, cleaned_count, removed_directives,
43
43
  // new_etag}) — pass it through as structuredContent so the declared
@@ -1 +1 @@
1
- {"version":3,"file":"clean-implode-handler.js","sourceRoot":"","sources":["../../../src/tools/multi-items/clean-implode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACH,YAAY,EACZ,WAAW,EACX,UAAU,EACV,gBAAgB,GAEnB,MAAM,oBA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pD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,WAAW,CAAC;YACf,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;YACtC,IAAI,EACA,4EAA4E;gBAC5E,iDAAiD;SACxD,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"clean-implode-handler.js","sourceRoot":"","sources":["../../../src/tools/multi-items/clean-implode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACH,YAAY,EACZ,WAAW,EACX,UAAU,EACV,gBAAgB,GAEnB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,kBAAkB,EAAE,CAAC,CAAC,KAAK,CACvB,CAAC,CAAC,MAAM,CAAC;QACL,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KAC/C,CAAC,CACL;IACD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAMH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAC9C,EAAE,MAAM,EAA2B,EACnC,EACI,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,OAAO,GAMV;IAED,qEAAqE;IACrE,qEAAqE;IACrE,sEAAsE;IACtE,8EAA8E;IAC9E,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,YAAY,CAAC;YAChB,SAAS,EAAE,+CAA+C;YAC1D,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;SACzC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,OAAO,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAChD,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAC1B,UAAU,gBAAgB,CAAC,WAAW,CAAC,aAAa,OAAO,4BAA4B,EACvF,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CACrB,CAAC;QACF,sEAAsE;QACtE,wEAAwE;QACxE,oEAAoE;QACpE,mEAAmE;QACnE,4DAA4D;QAC5D,OAAO,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,OAAO,WAAW,CAAC;YACf,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE;YACtC,IAAI,EACA,4EAA4E;gBAC5E,iDAAiD;SACxD,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Multi-Items inspection format-sidecar.
3
+ *
4
+ * Wave-16 #34 (6.1): the `inspect_multi_items_binding` report is passed
5
+ * through verbatim to `structuredContent` (which must stay schema-pure),
6
+ * but the human-readable text leg is serialized from the same payload.
7
+ * A deeply-nested report (e.g. a fully-qualified element subtree under
8
+ * `props` / `minimal_layout`, or a future `children` array) would balloon
9
+ * that text leg without bound. `capInspectionDepth` walks the value and
10
+ * truncates any object/array whose depth exceeds the cap, replacing it
11
+ * with an `…and N more` marker so the agent still sees that the subtree
12
+ * was elided rather than silently dropped.
13
+ *
14
+ * Pure / stateless. `structuredContent` is never passed through this —
15
+ * only the text-render copy — so output-schema validation is unaffected.
16
+ *
17
+ * @license MIT
18
+ */
19
+ /**
20
+ * Default recursion cap for the inspect text render. Objects/arrays at a
21
+ * depth strictly greater than this are collapsed to the `…and N more`
22
+ * marker. The root value sits at depth 0.
23
+ */
24
+ export declare const MAX_INSPECTION_DEPTH = 3;
25
+ /**
26
+ * Recursively cap the depth of a JSON-serializable value.
27
+ *
28
+ * - Primitives (string / number / boolean / null / undefined) pass
29
+ * through untouched at any depth.
30
+ * - An object or array sitting AT `maxDepth` is replaced by the
31
+ * `…and N more` marker (N = its immediate child count) instead of
32
+ * recursing further.
33
+ * - Otherwise the container is rebuilt with each child capped at
34
+ * `depth + 1`.
35
+ *
36
+ * @param value the value to cap.
37
+ * @param maxDepth recursion cap (defaults to {@link MAX_INSPECTION_DEPTH}).
38
+ * @param depth current depth (internal; callers omit it).
39
+ */
40
+ export declare function capInspectionDepth(value: unknown, maxDepth?: number, depth?: number): unknown;
41
+ //# sourceMappingURL=inspection-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-format.d.ts","sourceRoot":"","sources":["../../../../src/tools/multi-items/format/inspection-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAYtC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAA6B,EACvC,KAAK,SAAI,GACV,OAAO,CAeT"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Multi-Items inspection format-sidecar.
3
+ *
4
+ * Wave-16 #34 (6.1): the `inspect_multi_items_binding` report is passed
5
+ * through verbatim to `structuredContent` (which must stay schema-pure),
6
+ * but the human-readable text leg is serialized from the same payload.
7
+ * A deeply-nested report (e.g. a fully-qualified element subtree under
8
+ * `props` / `minimal_layout`, or a future `children` array) would balloon
9
+ * that text leg without bound. `capInspectionDepth` walks the value and
10
+ * truncates any object/array whose depth exceeds the cap, replacing it
11
+ * with an `…and N more` marker so the agent still sees that the subtree
12
+ * was elided rather than silently dropped.
13
+ *
14
+ * Pure / stateless. `structuredContent` is never passed through this —
15
+ * only the text-render copy — so output-schema validation is unaffected.
16
+ *
17
+ * @license MIT
18
+ */
19
+ /**
20
+ * Default recursion cap for the inspect text render. Objects/arrays at a
21
+ * depth strictly greater than this are collapsed to the `…and N more`
22
+ * marker. The root value sits at depth 0.
23
+ */
24
+ export const MAX_INSPECTION_DEPTH = 3;
25
+ /** Render the marker that replaces a truncated subtree. */
26
+ function truncationMarker(childCount, maxDepth) {
27
+ return `…and ${String(childCount)} more (truncated at depth ${String(maxDepth)})`;
28
+ }
29
+ /** Number of immediate children an object/array exposes. */
30
+ function childCountOf(value) {
31
+ return Array.isArray(value) ? value.length : Object.keys(value).length;
32
+ }
33
+ /**
34
+ * Recursively cap the depth of a JSON-serializable value.
35
+ *
36
+ * - Primitives (string / number / boolean / null / undefined) pass
37
+ * through untouched at any depth.
38
+ * - An object or array sitting AT `maxDepth` is replaced by the
39
+ * `…and N more` marker (N = its immediate child count) instead of
40
+ * recursing further.
41
+ * - Otherwise the container is rebuilt with each child capped at
42
+ * `depth + 1`.
43
+ *
44
+ * @param value the value to cap.
45
+ * @param maxDepth recursion cap (defaults to {@link MAX_INSPECTION_DEPTH}).
46
+ * @param depth current depth (internal; callers omit it).
47
+ */
48
+ export function capInspectionDepth(value, maxDepth = MAX_INSPECTION_DEPTH, depth = 0) {
49
+ if (value === null || typeof value !== 'object') {
50
+ return value;
51
+ }
52
+ if (depth >= maxDepth) {
53
+ return truncationMarker(childCountOf(value), maxDepth);
54
+ }
55
+ if (Array.isArray(value)) {
56
+ return value.map((item) => capInspectionDepth(item, maxDepth, depth + 1));
57
+ }
58
+ const out = {};
59
+ for (const [key, child] of Object.entries(value)) {
60
+ out[key] = capInspectionDepth(child, maxDepth, depth + 1);
61
+ }
62
+ return out;
63
+ }
64
+ //# sourceMappingURL=inspection-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-format.js","sourceRoot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AC;QAC1E,GAAG,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -6,11 +6,27 @@
6
6
  * src/modules/builder-source-binding/src/MultiItemsInspector.php
7
7
  * for the report shape.
8
8
  *
9
+ * Wave-16 #34:
10
+ * - 6.1 depth-cap: the human-readable text leg is capped at
11
+ * {@link MAX_INSPECTION_DEPTH}; structuredContent stays verbatim so
12
+ * it keeps validating against the output schema.
13
+ * - 6.4 severity marker: the response carries a typed `hint.severity`
14
+ * ("advisory" | "blocking") so the agent can tell a structural
15
+ * container-level binding bug apart from informational guidance.
16
+ *
9
17
  * @license MIT
10
18
  */
11
19
  import { z } from 'zod';
12
20
  import { type RestClient } from '../../client.js';
13
21
  import { type ToolResult } from '../tool-builder.js';
22
+ import { InspectionCache } from './inspection-cache.js';
23
+ /**
24
+ * Severity of the advisory hint the inspector attaches to every report.
25
+ * `blocking` means the binding is structurally wrong (sits on the
26
+ * container instead of the `*_item` child) and the rendered output will
27
+ * be broken until fixed; `advisory` is informational guidance.
28
+ */
29
+ export type HintSeverity = 'advisory' | 'blocking';
14
30
  export declare const INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA: z.ZodObject<{
15
31
  template_id: z.ZodString;
16
32
  report: z.ZodObject<{
@@ -21,21 +37,40 @@ export declare const INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA: z.ZodObject<{
21
37
  container_type: z.ZodNullable<z.ZodString>;
22
38
  item_type: z.ZodNullable<z.ZodString>;
23
39
  current_binding_level: z.ZodEnum<{
24
- none: "none";
25
40
  container: "container";
26
41
  item: "item";
42
+ none: "none";
27
43
  }>;
28
44
  has_implode_directives: z.ZodBoolean;
29
45
  warning: z.ZodOptional<z.ZodString>;
30
46
  recommended_fix: z.ZodOptional<z.ZodString>;
31
47
  }, z.core.$strip>;
32
48
  etag: z.ZodString;
49
+ hint: z.ZodOptional<z.ZodObject<{
50
+ severity: z.ZodEnum<{
51
+ advisory: "advisory";
52
+ blocking: "blocking";
53
+ }>;
54
+ message: z.ZodString;
55
+ }, z.core.$strip>>;
33
56
  }, z.core.$strip>;
57
+ /** The structured inspect payload the handler caches + emits. */
58
+ type InspectStructured = Record<string, unknown>;
34
59
  export interface MultiItemsHandlerDeps {
35
60
  readonly client: RestClient;
61
+ /**
62
+ * 6.2 — optional inspection cache. When provided, the handler keys
63
+ * results on (template_id, element_path, global-etag) with a 60s TTL.
64
+ * The builder injects one shared instance so repeat inspects within
65
+ * the TTL skip the REST round-trip; a write bumps the global etag and
66
+ * naturally invalidates the entry. Omit it to disable caching (e.g.
67
+ * the cold-AI shape-pin tests that assert the raw round-trip).
68
+ */
69
+ readonly cache?: InspectionCache<InspectStructured>;
36
70
  }
37
- export declare function handleInspectMultiItemsBinding({ client }: MultiItemsHandlerDeps, { template_id, element_path }: {
71
+ export declare function handleInspectMultiItemsBinding({ client, cache }: MultiItemsHandlerDeps, { template_id, element_path }: {
38
72
  template_id: string;
39
73
  element_path: string;
40
74
  }): Promise<ToolResult>;
75
+ export {};
41
76
  //# sourceMappingURL=inspect-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspect-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/inspect-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;iBAe5C,CAAC;AAEH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC/B;AAED,wBAAsB,8BAA8B,CAChD,EAAE,MAAM,EAAE,EAAE,qBAAqB,EACjC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC7E,OAAO,CAAC,UAAU,CAAC,CAqBrB"}
1
+ {"version":3,"file":"inspect-handler.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/inspect-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwB5C,CAAC;AAEH,iEAAiE;AACjE,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CACvD;AAoDD,wBAAsB,8BAA8B,CAChD,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,qBAAqB,EACxC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC7E,OAAO,CAAC,UAAU,CAAC,CAwCrB"}
@@ -6,11 +6,20 @@
6
6
  * src/modules/builder-source-binding/src/MultiItemsInspector.php
7
7
  * for the report shape.
8
8
  *
9
+ * Wave-16 #34:
10
+ * - 6.1 depth-cap: the human-readable text leg is capped at
11
+ * {@link MAX_INSPECTION_DEPTH}; structuredContent stays verbatim so
12
+ * it keeps validating against the output schema.
13
+ * - 6.4 severity marker: the response carries a typed `hint.severity`
14
+ * ("advisory" | "blocking") so the agent can tell a structural
15
+ * container-level binding bug apart from informational guidance.
16
+ *
9
17
  * @license MIT
10
18
  */
11
19
  import { z } from 'zod';
12
- import { encodeElementPath } from '../../client.js';
20
+ import { encodeElementPath, encodeTemplateId } from '../../client.js';
13
21
  import { errorResult, jsonResult, structuredResult } from '../tool-builder.js';
22
+ import { capInspectionDepth } from './format/inspection-format.js';
14
23
  export const INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA = z.object({
15
24
  template_id: z.string(),
16
25
  report: z.object({
@@ -26,25 +35,99 @@ export const INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA = z.object({
26
35
  recommended_fix: z.string().optional(),
27
36
  }),
28
37
  etag: z.string(),
38
+ // 6.4 — typed advisory/blocking marker. Optional so a verbatim REST
39
+ // passthrough that predates this field still validates, but the
40
+ // handler always populates it.
41
+ hint: z
42
+ .object({
43
+ severity: z.enum(['advisory', 'blocking']),
44
+ message: z.string(),
45
+ })
46
+ .optional(),
29
47
  });
30
- export async function handleInspectMultiItemsBinding({ client }, { template_id, element_path }) {
48
+ /**
49
+ * Classify the report into an advisory/blocking hint. A binding that
50
+ * sits on the container level is the structural bug Multi-Items aims to
51
+ * surface — that is `blocking`. Everything else is `advisory`.
52
+ */
53
+ function buildHint(report) {
54
+ const r = (report ?? {});
55
+ if (r.current_binding_level === 'container') {
56
+ const fix = typeof r.recommended_fix === 'string' && r.recommended_fix !== ''
57
+ ? r.recommended_fix
58
+ : 'Move the binding to the first `*_item` child element.';
59
+ return { severity: 'blocking', message: fix };
60
+ }
61
+ return {
62
+ severity: 'advisory',
63
+ message: 'Binding looks structurally correct. Verify element_path via ' +
64
+ 'yootheme_builder_element_list if the source still renders empty.',
65
+ };
66
+ }
67
+ /**
68
+ * Render a structured inspect payload into the ToolResult envelope.
69
+ * Shared by the cache-hit and cache-miss paths so both legs (text +
70
+ * structuredContent) are built identically.
71
+ *
72
+ * 6.1 — the text leg is depth-capped so a deeply-nested report cannot
73
+ * balloon the LLM context. structuredContent stays verbatim so it keeps
74
+ * validating against INSPECT_MULTI_ITEMS_OUTPUT_SCHEMA
75
+ * (additionalProperties:false).
76
+ */
77
+ function renderInspectResult(structured) {
78
+ const text = jsonResult(capInspectionDepth(structured));
79
+ return structuredResult(text, structured);
80
+ }
81
+ export async function handleInspectMultiItemsBinding({ client, cache }, { template_id, element_path }) {
31
82
  const encoded = encodeElementPath(element_path);
32
83
  try {
33
- const data = await client.get(`/pages/${encodeURIComponent(template_id)}/elements/${encoded}/multi-items/inspect`);
34
- // The REST endpoint already returns the canonical
35
- // {template_id, report, etag} shape pass it through as
36
- // structuredContent so the declared outputSchema is satisfied
37
- // (a tool with an outputSchema MUST emit structuredContent, else
38
- // the MCP SDK rejects the call with -32602).
39
- return structuredResult(jsonResult(data), data);
84
+ // 6.2 when a cache is wired, key on the GLOBAL state etag. Every
85
+ // write tool bumps it, so a mutated template surfaces a fresh etag
86
+ // a new key a guaranteed miss. Read-only repeats within the TTL
87
+ // skip the inspect round-trip below.
88
+ let cacheEtag;
89
+ if (cache !== undefined) {
90
+ cacheEtag = await fetchStateEtag(client);
91
+ if (cacheEtag !== undefined) {
92
+ const cached = cache.get(template_id, element_path, cacheEtag);
93
+ if (cached !== undefined) {
94
+ return renderInspectResult(cached);
95
+ }
96
+ }
97
+ }
98
+ const data = await client.get(`/pages/${encodeTemplateId(template_id)}/elements/${encoded}/multi-items/inspect`);
99
+ // 6.4 — attach the typed severity marker to the structured payload.
100
+ const hint = buildHint(data.report);
101
+ const structured = { ...data, hint };
102
+ if (cache !== undefined && cacheEtag !== undefined) {
103
+ cache.set(template_id, element_path, cacheEtag, structured);
104
+ }
105
+ return renderInspectResult(structured);
40
106
  }
41
107
  catch (e) {
42
108
  return errorResult({
43
109
  error: e,
44
110
  context: { template_id, element_path },
45
111
  hint: 'Verify element_path via yootheme_builder_element_list. Paths are JSON-Pointer ' +
46
- 'style ("/templates/<id>/layout/children/0").',
112
+ '(RFC-6901) style: /0/children/1. Use yootheme_builder_element_list to enumerate ' +
113
+ 'valid paths.',
47
114
  });
48
115
  }
49
116
  }
117
+ /**
118
+ * Read the global state ETag used as the cache-invalidation token.
119
+ * Returns `undefined` (cache disabled for this call) if the etag probe
120
+ * fails or returns a non-string — a missing etag must never poison the
121
+ * cache key, and a probe failure should fall through to a live inspect
122
+ * rather than abort the whole call.
123
+ */
124
+ async function fetchStateEtag(client) {
125
+ try {
126
+ const res = await client.get('/etag');
127
+ return typeof res.etag === 'string' && res.etag !== '' ? res.etag : undefined;
128
+ }
129
+ catch {
130
+ return undefined;
131
+ }
132
+ }
50
133
  //# sourceMappingURL=inspect-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspect-handler.js","sourceRoot":"","sources":["../../../src/tools/multi-items/inspect-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAEhG,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrC,SAAS,EAAE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_binding` results.
5
+ * Keyed by `(template_id, element_path, etag)`:
6
+ *
7
+ * - `template_id` + `element_path` identify the element;
8
+ * - `etag` is the GLOBAL state ETag (from `GET /etag`). Every write
9
+ * tool bumps it (see ETAG schema note: "every successful write
10
+ * returns a NEW ETag"). So a write to ANY template surfaces a fresh
11
+ * etag → a NEW cache key → a guaranteed miss. The stale entry for a
12
+ * mutated template can never be served. This reuses the existing
13
+ * etag-bump mechanism rather than inventing a parallel invalidation
14
+ * channel.
15
+ *
16
+ * TTL is a hard 60s upper bound so an entry cannot live indefinitely
17
+ * even if the etag never changes (read-only sessions). The clock is
18
+ * injectable so the TTL behaviour is testable without sleeping.
19
+ *
20
+ * Bounded growth — Wave-16 Phase-6 nit. The key embeds the GLOBAL etag,
21
+ * and every write bumps it, so each `set()` lands under a NEW key while
22
+ * the old-etag entries are never re-queried (the handler always reads the
23
+ * current etag). Without a bound they would accumulate in the Map forever
24
+ * in a long-lived high-write session. Two cheap defenses keep it bounded:
25
+ *
26
+ * 1. Opportunistic sweep on every `set()`: drop entries already past
27
+ * the TTL. The TTL is a hard upper bound, so a past-TTL entry is dead
28
+ * and can never be served — sweeping it changes no observable
29
+ * behaviour, it only reclaims the slot.
30
+ * 2. Hard max-size cap with oldest-first eviction (belt-and-suspenders)
31
+ * for the pathological case where many DISTINCT keys all stay fresh
32
+ * (a read-only burst the sweep cannot reclaim). `Map` preserves
33
+ * insertion order, so the oldest entry is the first key.
34
+ *
35
+ * Concrete generic type `T` — no `any`. The cache stores whatever the
36
+ * handler computed (the structured inspect payload).
37
+ *
38
+ * @license MIT
39
+ */
40
+ /** Hard TTL upper bound for a cached inspection entry (60 seconds). */
41
+ export declare const INSPECTION_CACHE_TTL_MS = 60000;
42
+ /**
43
+ * Hard ceiling on live entries. Reached only when many DISTINCT keys stay
44
+ * fresh inside the TTL (a read-only burst the TTL-sweep cannot reclaim);
45
+ * the normal write-driven etag churn is reclaimed by the sweep long before
46
+ * this. 256 covers a generous working set while keeping the Map tiny.
47
+ */
48
+ export declare const INSPECTION_CACHE_MAX_ENTRIES = 256;
49
+ /** Monotonic-ish millisecond clock; defaults to `Date.now`. */
50
+ export type Clock = () => number;
51
+ export declare class InspectionCache<T> {
52
+ private readonly store;
53
+ private readonly now;
54
+ private readonly ttlMs;
55
+ private readonly maxEntries;
56
+ constructor(now?: Clock, ttlMs?: number, maxEntries?: number);
57
+ /** Build the composite cache key. Pipe-joined; the parts are
58
+ * server-controlled identifiers (template id, JSON-Pointer, quoted
59
+ * etag) so collision via a literal `|` in a value is not a concern. */
60
+ private key;
61
+ /** Read a fresh entry, or `undefined` on miss / expiry. Expired
62
+ * entries are evicted on access. */
63
+ get(templateId: string, elementPath: string, etag: string): T | undefined;
64
+ /**
65
+ * Store a value under the composite key, stamped with the clock.
66
+ *
67
+ * Bounds the Map first (sweep past-TTL entries, then enforce the
68
+ * max-size cap with oldest-first eviction) so a long-lived high-write
69
+ * session cannot leak old-etag keys. See class doc for the why.
70
+ */
71
+ set(templateId: string, elementPath: string, etag: string, value: T): void;
72
+ /**
73
+ * Number of LIVE (non-expired) entries currently held. Counts rather
74
+ * than returns `store.size` so a caller (and the tests) sees the true
75
+ * working-set size even if a not-yet-swept dead entry lingers.
76
+ */
77
+ size(): number;
78
+ /** Drop every entry whose TTL has elapsed. Cheap, and dead entries
79
+ * can never be served, so this changes no observable behaviour. */
80
+ private sweepExpired;
81
+ /** Evict oldest-first until the Map is within the max-size cap. `Map`
82
+ * iterates in insertion order, so the first key is the oldest. */
83
+ private enforceMaxEntries;
84
+ }
85
+ //# sourceMappingURL=inspection-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-cache.d.ts","sourceRoot":"","sources":["../../../src/tools/multi-items/inspection-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,+DAA+D;AAC/D,MAAM,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC;AAOjC,qBAAa,eAAe,CAAC,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAGhC,GAAG,GAAE,KAAgB,EACrB,KAAK,GAAE,MAAgC,EACvC,UAAU,GAAE,MAAqC;IAOrD;;2EAEuE;IACvE,OAAO,CAAC,GAAG;IAIX;wCACoC;IACpC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAWzE;;;;;;OAMG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAO1E;;;;OAIG;IACH,IAAI,IAAI,MAAM;IASd;uEACmE;IACnE,OAAO,CAAC,YAAY;IASpB;sEACkE;IAClE,OAAO,CAAC,iBAAiB;CAO5B"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * InspectionCache — Wave-16 #34 (6.2).
3
+ *
4
+ * A tiny in-process TTL cache for `inspect_multi_items_binding` results.
5
+ * Keyed by `(template_id, element_path, etag)`:
6
+ *
7
+ * - `template_id` + `element_path` identify the element;
8
+ * - `etag` is the GLOBAL state ETag (from `GET /etag`). Every write
9
+ * tool bumps it (see ETAG schema note: "every successful write
10
+ * returns a NEW ETag"). So a write to ANY template surfaces a fresh
11
+ * etag → a NEW cache key → a guaranteed miss. The stale entry for a
12
+ * mutated template can never be served. This reuses the existing
13
+ * etag-bump mechanism rather than inventing a parallel invalidation
14
+ * channel.
15
+ *
16
+ * TTL is a hard 60s upper bound so an entry cannot live indefinitely
17
+ * even if the etag never changes (read-only sessions). The clock is
18
+ * injectable so the TTL behaviour is testable without sleeping.
19
+ *
20
+ * Bounded growth — Wave-16 Phase-6 nit. The key embeds the GLOBAL etag,
21
+ * and every write bumps it, so each `set()` lands under a NEW key while
22
+ * the old-etag entries are never re-queried (the handler always reads the
23
+ * current etag). Without a bound they would accumulate in the Map forever
24
+ * in a long-lived high-write session. Two cheap defenses keep it bounded:
25
+ *
26
+ * 1. Opportunistic sweep on every `set()`: drop entries already past
27
+ * the TTL. The TTL is a hard upper bound, so a past-TTL entry is dead
28
+ * and can never be served — sweeping it changes no observable
29
+ * behaviour, it only reclaims the slot.
30
+ * 2. Hard max-size cap with oldest-first eviction (belt-and-suspenders)
31
+ * for the pathological case where many DISTINCT keys all stay fresh
32
+ * (a read-only burst the sweep cannot reclaim). `Map` preserves
33
+ * insertion order, so the oldest entry is the first key.
34
+ *
35
+ * Concrete generic type `T` — no `any`. The cache stores whatever the
36
+ * handler computed (the structured inspect payload).
37
+ *
38
+ * @license MIT
39
+ */
40
+ /** Hard TTL upper bound for a cached inspection entry (60 seconds). */
41
+ export const INSPECTION_CACHE_TTL_MS = 60_000;
42
+ /**
43
+ * Hard ceiling on live entries. Reached only when many DISTINCT keys stay
44
+ * fresh inside the TTL (a read-only burst the TTL-sweep cannot reclaim);
45
+ * the normal write-driven etag churn is reclaimed by the sweep long before
46
+ * this. 256 covers a generous working set while keeping the Map tiny.
47
+ */
48
+ export const INSPECTION_CACHE_MAX_ENTRIES = 256;
49
+ export class InspectionCache {
50
+ store = new Map();
51
+ now;
52
+ ttlMs;
53
+ maxEntries;
54
+ constructor(now = Date.now, ttlMs = INSPECTION_CACHE_TTL_MS, maxEntries = INSPECTION_CACHE_MAX_ENTRIES) {
55
+ this.now = now;
56
+ this.ttlMs = ttlMs;
57
+ this.maxEntries = maxEntries;
58
+ }
59
+ /** Build the composite cache key. Pipe-joined; the parts are
60
+ * server-controlled identifiers (template id, JSON-Pointer, quoted
61
+ * etag) so collision via a literal `|` in a value is not a concern. */
62
+ key(templateId, elementPath, etag) {
63
+ return `${templateId}|${elementPath}|${etag}`;
64
+ }
65
+ /** Read a fresh entry, or `undefined` on miss / expiry. Expired
66
+ * entries are evicted on access. */
67
+ get(templateId, elementPath, etag) {
68
+ const k = this.key(templateId, elementPath, etag);
69
+ const entry = this.store.get(k);
70
+ if (entry === undefined)
71
+ return undefined;
72
+ if (this.now() - entry.storedAt >= this.ttlMs) {
73
+ this.store.delete(k);
74
+ return undefined;
75
+ }
76
+ return entry.value;
77
+ }
78
+ /**
79
+ * Store a value under the composite key, stamped with the clock.
80
+ *
81
+ * Bounds the Map first (sweep past-TTL entries, then enforce the
82
+ * max-size cap with oldest-first eviction) so a long-lived high-write
83
+ * session cannot leak old-etag keys. See class doc for the why.
84
+ */
85
+ set(templateId, elementPath, etag, value) {
86
+ const k = this.key(templateId, elementPath, etag);
87
+ this.sweepExpired();
88
+ this.store.set(k, { value, storedAt: this.now() });
89
+ this.enforceMaxEntries();
90
+ }
91
+ /**
92
+ * Number of LIVE (non-expired) entries currently held. Counts rather
93
+ * than returns `store.size` so a caller (and the tests) sees the true
94
+ * working-set size even if a not-yet-swept dead entry lingers.
95
+ */
96
+ size() {
97
+ let live = 0;
98
+ const cutoff = this.now();
99
+ for (const entry of this.store.values()) {
100
+ if (cutoff - entry.storedAt < this.ttlMs)
101
+ live++;
102
+ }
103
+ return live;
104
+ }
105
+ /** Drop every entry whose TTL has elapsed. Cheap, and dead entries
106
+ * can never be served, so this changes no observable behaviour. */
107
+ sweepExpired() {
108
+ const cutoff = this.now();
109
+ for (const [k, entry] of this.store) {
110
+ if (cutoff - entry.storedAt >= this.ttlMs) {
111
+ this.store.delete(k);
112
+ }
113
+ }
114
+ }
115
+ /** Evict oldest-first until the Map is within the max-size cap. `Map`
116
+ * iterates in insertion order, so the first key is the oldest. */
117
+ enforceMaxEntries() {
118
+ while (this.store.size > this.maxEntries) {
119
+ const oldest = this.store.keys().next().value;
120
+ if (oldest === undefined)
121
+ break;
122
+ this.store.delete(oldest);
123
+ }
124
+ }
125
+ }
126
+ //# sourceMappingURL=inspection-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-cache.js","sourceRoot":"","sources":["../../../src/tools/multi-items/inspection-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAUhD,MAAM,OAAO,eAAe;IACP,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;IACzC,GAAG,CAAQ;IACX,KAAK,CAAS;IACd,UAAU,CAAS;IAEpC,YACI,MAAa,IAAI,CAAC,GAAG,EACrB,QAAgB,uBAAuB,EACvC,aAAqB,4BAA4B;QAEjD,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;2EAEuE;IAC/D,GAAG,CAAC,UAAkB,EAAE,WAAmB,EAAE,IAAY;QAC7D,OAAO,GAAG,UAAU,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;IAClD,CAAC;IAED;wCACoC;IACpC,GAAG,CAAC,UAAkB,EAAE,WAAmB,EAAE,IAAY;QACrD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC1C,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,QA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IACL,CAAC;IAED;sEACkE;IAC1D,iBAAiB;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YAC9C,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM;YAChC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC;CACJ"}
@@ -3,12 +3,41 @@
3
3
  *
4
4
  * Split out of `src/tools/pages.ts` (Round-2 R2-A2-CRIT1). Handler
5
5
  * bodies live in `./handlers-read.ts` (pages_list, page_get_layout,
6
- * page_get_schema, get_etag) and `./handlers-write.ts` (page_save,
7
- * page_publish — 3-phase progress contract).
6
+ * page_get_schema, get_etag, template_summary) and `./handlers-write.ts`
7
+ * (page_save, page_publish, pages_create, pages_delete — 3-phase
8
+ * progress contract).
9
+ *
10
+ * Surface: 9 page-level tools (pre-C4: 7; v1.2 C4 added pages_create +
11
+ * pages_delete wrapping POST /pages and DELETE /pages/{id}).
8
12
  *
9
13
  * @license MIT
10
14
  */
11
15
  import type { ClientPool } from '../../sites/client-pool.js';
12
16
  import { type AnyToolDefinition } from '../tool-builder.js';
17
+ /**
18
+ * Render-context descriptor emitted by the page builders (Wave-16 #33-C).
19
+ *
20
+ * Gives the calling agent the page's template lineage, locale, and origin
21
+ * site in one place so it does not need a second round-trip to reason
22
+ * about where/how a page renders. `site_url` is always populated from the
23
+ * resolved site; `parent_template_id` and `locale` are `null` when the
24
+ * builder cannot reach them (rather than absent) so the shape is stable
25
+ * for consumers.
26
+ */
27
+ export interface RenderContext {
28
+ readonly parent_template_id: string | null;
29
+ readonly locale: string | null;
30
+ readonly site_url: string;
31
+ }
32
+ /**
33
+ * Build the {@link RenderContext} from the data reachable in a page
34
+ * builder. Pure: no I/O, no `any`. Missing `parentTemplateId` / `locale`
35
+ * collapse to `null`.
36
+ */
37
+ export declare function buildRenderContext(input: {
38
+ siteUrl: string;
39
+ parentTemplateId?: string | null;
40
+ locale?: string | null;
41
+ }): RenderContext;
13
42
  export declare function buildPagesTools(pool: ClientPool): readonly AnyToolDefinition[];
14
43
  //# sourceMappingURL=builders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/pages/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AA8B5B,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,iBAAiB,EAAE,CAoI9E"}
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/tools/pages/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAK7D,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAsC5B;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,aAAa,CAMhB;AAyCD,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,iBAAiB,EAAE,CAqM9E"}