@elastic/isomer-sdk 0.0.0 → 0.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 (492) hide show
  1. package/LICENSE.txt +93 -0
  2. package/NOTICE.txt +1861 -0
  3. package/README.md +69 -0
  4. package/THIRD_PARTY_LICENSES.md +957 -0
  5. package/dist/author/authored_fields.d.ts +153 -0
  6. package/dist/author/authored_fields.d.ts.map +1 -0
  7. package/dist/author/authored_fields.js +227 -0
  8. package/dist/author/authored_fields.js.map +1 -0
  9. package/dist/author/authoring_input.d.ts +7 -0
  10. package/dist/author/authoring_input.d.ts.map +1 -0
  11. package/dist/author/authoring_input.js +60 -0
  12. package/dist/author/authoring_input.js.map +1 -0
  13. package/dist/author/authoring_model.d.ts +27 -0
  14. package/dist/author/authoring_model.d.ts.map +1 -0
  15. package/dist/author/authoring_model.js +98 -0
  16. package/dist/author/authoring_model.js.map +1 -0
  17. package/dist/author/declarations.d.ts +13 -0
  18. package/dist/author/declarations.d.ts.map +1 -0
  19. package/dist/author/declarations.js +277 -0
  20. package/dist/author/declarations.js.map +1 -0
  21. package/dist/author/index.d.ts +7 -0
  22. package/dist/author/index.d.ts.map +1 -0
  23. package/dist/author/index.js +12 -0
  24. package/dist/author/index.js.map +1 -0
  25. package/dist/author/jsx.d.ts +21 -0
  26. package/dist/author/jsx.d.ts.map +1 -0
  27. package/dist/author/jsx.js +20 -0
  28. package/dist/author/jsx.js.map +1 -0
  29. package/dist/author/jsx_shim.d.ts +117 -0
  30. package/dist/author/jsx_shim.d.ts.map +1 -0
  31. package/dist/author/jsx_shim.js +270 -0
  32. package/dist/author/jsx_shim.js.map +1 -0
  33. package/dist/author/prompt.d.ts +58 -0
  34. package/dist/author/prompt.d.ts.map +1 -0
  35. package/dist/author/prompt.js +148 -0
  36. package/dist/author/prompt.js.map +1 -0
  37. package/dist/author/schema_to_typescript.d.ts +37 -0
  38. package/dist/author/schema_to_typescript.d.ts.map +1 -0
  39. package/dist/author/schema_to_typescript.js +286 -0
  40. package/dist/author/schema_to_typescript.js.map +1 -0
  41. package/dist/cjs/author/authored_fields.js +233 -0
  42. package/dist/cjs/author/authored_fields.js.map +1 -0
  43. package/dist/cjs/author/authoring_input.js +64 -0
  44. package/dist/cjs/author/authoring_input.js.map +1 -0
  45. package/dist/cjs/author/authoring_model.js +104 -0
  46. package/dist/cjs/author/authoring_model.js.map +1 -0
  47. package/dist/cjs/author/declarations.js +281 -0
  48. package/dist/cjs/author/declarations.js.map +1 -0
  49. package/dist/cjs/author/index.js +25 -0
  50. package/dist/cjs/author/index.js.map +1 -0
  51. package/dist/cjs/author/jsx.js +24 -0
  52. package/dist/cjs/author/jsx.js.map +1 -0
  53. package/dist/cjs/author/jsx_shim.js +276 -0
  54. package/dist/cjs/author/jsx_shim.js.map +1 -0
  55. package/dist/cjs/author/prompt.js +153 -0
  56. package/dist/cjs/author/prompt.js.map +1 -0
  57. package/dist/cjs/author/schema_to_typescript.js +295 -0
  58. package/dist/cjs/author/schema_to_typescript.js.map +1 -0
  59. package/dist/cjs/composition/action_event.js +9 -0
  60. package/dist/cjs/composition/action_event.js.map +1 -0
  61. package/dist/cjs/composition/body_node_base.js +112 -0
  62. package/dist/cjs/composition/body_node_base.js.map +1 -0
  63. package/dist/cjs/composition/composition.js +9 -0
  64. package/dist/cjs/composition/composition.js.map +1 -0
  65. package/dist/cjs/composition/error.js +73 -0
  66. package/dist/cjs/composition/error.js.map +1 -0
  67. package/dist/cjs/composition/index.js +32 -0
  68. package/dist/cjs/composition/index.js.map +1 -0
  69. package/dist/cjs/composition/map_nodes.js +85 -0
  70. package/dist/cjs/composition/map_nodes.js.map +1 -0
  71. package/dist/cjs/composition/named_color.js +20 -0
  72. package/dist/cjs/composition/named_color.js.map +1 -0
  73. package/dist/cjs/composition/node.js +9 -0
  74. package/dist/cjs/composition/node.js.map +1 -0
  75. package/dist/cjs/composition/one_line.js +23 -0
  76. package/dist/cjs/composition/one_line.js.map +1 -0
  77. package/dist/cjs/composition/structured_value.js +21 -0
  78. package/dist/cjs/composition/structured_value.js.map +1 -0
  79. package/dist/cjs/composition/validation_error.js +40 -0
  80. package/dist/cjs/composition/validation_error.js.map +1 -0
  81. package/dist/cjs/define/frame.js +31 -0
  82. package/dist/cjs/define/frame.js.map +1 -0
  83. package/dist/cjs/define/index.js +31 -0
  84. package/dist/cjs/define/index.js.map +1 -0
  85. package/dist/cjs/define/markdown_content.js +12 -0
  86. package/dist/cjs/define/markdown_content.js.map +1 -0
  87. package/dist/cjs/define/primitive_example.js +26 -0
  88. package/dist/cjs/define/primitive_example.js.map +1 -0
  89. package/dist/cjs/define/primitive_icon.js +17 -0
  90. package/dist/cjs/define/primitive_icon.js.map +1 -0
  91. package/dist/cjs/define/primitive_module.js +118 -0
  92. package/dist/cjs/define/primitive_module.js.map +1 -0
  93. package/dist/cjs/define/slack_assets.js +9 -0
  94. package/dist/cjs/define/slack_assets.js.map +1 -0
  95. package/dist/cjs/define/slack_blocks.js +9 -0
  96. package/dist/cjs/define/slack_blocks.js.map +1 -0
  97. package/dist/cjs/define/zod_format.js +122 -0
  98. package/dist/cjs/define/zod_format.js.map +1 -0
  99. package/dist/cjs/define/zod_helpers.js +26 -0
  100. package/dist/cjs/define/zod_helpers.js.map +1 -0
  101. package/dist/cjs/entries/html.js +12 -0
  102. package/dist/cjs/entries/html.js.map +1 -0
  103. package/dist/cjs/entries/index.js +80 -0
  104. package/dist/cjs/entries/index.js.map +1 -0
  105. package/dist/cjs/entries/markdown.js +14 -0
  106. package/dist/cjs/entries/markdown.js.map +1 -0
  107. package/dist/cjs/entries/react.js +20 -0
  108. package/dist/cjs/entries/react.js.map +1 -0
  109. package/dist/cjs/entries/slack.js +25 -0
  110. package/dist/cjs/entries/slack.js.map +1 -0
  111. package/dist/cjs/entries/text.js +12 -0
  112. package/dist/cjs/entries/text.js.map +1 -0
  113. package/dist/cjs/pack/capabilities.js +40 -0
  114. package/dist/cjs/pack/capabilities.js.map +1 -0
  115. package/dist/cjs/pack/compose.js +59 -0
  116. package/dist/cjs/pack/compose.js.map +1 -0
  117. package/dist/cjs/pack/enhancements.js +65 -0
  118. package/dist/cjs/pack/enhancements.js.map +1 -0
  119. package/dist/cjs/pack/index.js +18 -0
  120. package/dist/cjs/pack/index.js.map +1 -0
  121. package/dist/cjs/pack/primitive_pack.js +97 -0
  122. package/dist/cjs/pack/primitive_pack.js.map +1 -0
  123. package/dist/cjs/package.json +3 -0
  124. package/dist/cjs/render/anchors.js +167 -0
  125. package/dist/cjs/render/anchors.js.map +1 -0
  126. package/dist/cjs/render/context_view.js +54 -0
  127. package/dist/cjs/render/context_view.js.map +1 -0
  128. package/dist/cjs/render/format_display_value.js +143 -0
  129. package/dist/cjs/render/format_display_value.js.map +1 -0
  130. package/dist/cjs/render/format_number.js +46 -0
  131. package/dist/cjs/render/format_number.js.map +1 -0
  132. package/dist/cjs/render/html/enhancements.js +30 -0
  133. package/dist/cjs/render/html/enhancements.js.map +1 -0
  134. package/dist/cjs/render/html/envelope.js +218 -0
  135. package/dist/cjs/render/html/envelope.js.map +1 -0
  136. package/dist/cjs/render/html/index.js +12 -0
  137. package/dist/cjs/render/html/index.js.map +1 -0
  138. package/dist/cjs/render/index.js +25 -0
  139. package/dist/cjs/render/index.js.map +1 -0
  140. package/dist/cjs/render/layout_check.js +133 -0
  141. package/dist/cjs/render/layout_check.js.map +1 -0
  142. package/dist/cjs/render/markdown/builder.js +195 -0
  143. package/dist/cjs/render/markdown/builder.js.map +1 -0
  144. package/dist/cjs/render/markdown/envelope.js +33 -0
  145. package/dist/cjs/render/markdown/envelope.js.map +1 -0
  146. package/dist/cjs/render/markdown/format.js +208 -0
  147. package/dist/cjs/render/markdown/format.js.map +1 -0
  148. package/dist/cjs/render/markdown/index.js +15 -0
  149. package/dist/cjs/render/markdown/index.js.map +1 -0
  150. package/dist/cjs/render/measure_dom.js +61 -0
  151. package/dist/cjs/render/measure_dom.js.map +1 -0
  152. package/dist/cjs/render/payload.js +13 -0
  153. package/dist/cjs/render/payload.js.map +1 -0
  154. package/dist/cjs/render/primitive_dispatch.js +173 -0
  155. package/dist/cjs/render/primitive_dispatch.js.map +1 -0
  156. package/dist/cjs/render/react/content.js +44 -0
  157. package/dist/cjs/render/react/content.js.map +1 -0
  158. package/dist/cjs/render/react/enhancements.js +32 -0
  159. package/dist/cjs/render/react/enhancements.js.map +1 -0
  160. package/dist/cjs/render/react/index.js +15 -0
  161. package/dist/cjs/render/react/index.js.map +1 -0
  162. package/dist/cjs/render/slack/assets.js +45 -0
  163. package/dist/cjs/render/slack/assets.js.map +1 -0
  164. package/dist/cjs/render/slack/blocks.js +80 -0
  165. package/dist/cjs/render/slack/blocks.js.map +1 -0
  166. package/dist/cjs/render/slack/envelope.js +551 -0
  167. package/dist/cjs/render/slack/envelope.js.map +1 -0
  168. package/dist/cjs/render/slack/format.js +225 -0
  169. package/dist/cjs/render/slack/format.js.map +1 -0
  170. package/dist/cjs/render/slack/index.js +30 -0
  171. package/dist/cjs/render/slack/index.js.map +1 -0
  172. package/dist/cjs/render/slack/markdown_content.js +409 -0
  173. package/dist/cjs/render/slack/markdown_content.js.map +1 -0
  174. package/dist/cjs/render/text/envelope.js +21 -0
  175. package/dist/cjs/render/text/envelope.js.map +1 -0
  176. package/dist/cjs/render/text/index.js +12 -0
  177. package/dist/cjs/render/text/index.js.map +1 -0
  178. package/dist/cjs/testing/conformance.js +312 -0
  179. package/dist/cjs/testing/conformance.js.map +1 -0
  180. package/dist/cjs/testing/icon.js +248 -0
  181. package/dist/cjs/testing/icon.js.map +1 -0
  182. package/dist/cjs/testing/index.js +18 -0
  183. package/dist/cjs/testing/index.js.map +1 -0
  184. package/dist/cjs/testing/registration.js +142 -0
  185. package/dist/cjs/testing/registration.js.map +1 -0
  186. package/dist/cjs/validate/authoring_schema.js +312 -0
  187. package/dist/cjs/validate/authoring_schema.js.map +1 -0
  188. package/dist/cjs/validate/composition_schema.js +135 -0
  189. package/dist/cjs/validate/composition_schema.js.map +1 -0
  190. package/dist/cjs/validate/index.js +53 -0
  191. package/dist/cjs/validate/index.js.map +1 -0
  192. package/dist/cjs/validate/input_budget.js +156 -0
  193. package/dist/cjs/validate/input_budget.js.map +1 -0
  194. package/dist/cjs/validate/json_schema.js +72 -0
  195. package/dist/cjs/validate/json_schema.js.map +1 -0
  196. package/dist/cjs/validate/node_issues.js +65 -0
  197. package/dist/cjs/validate/node_issues.js.map +1 -0
  198. package/dist/cjs/validate/url.js +116 -0
  199. package/dist/cjs/validate/url.js.map +1 -0
  200. package/dist/cjs/validate/validation.js +165 -0
  201. package/dist/cjs/validate/validation.js.map +1 -0
  202. package/dist/cjs/validate/value_schemas.js +53 -0
  203. package/dist/cjs/validate/value_schemas.js.map +1 -0
  204. package/dist/composition/action_event.d.ts +13 -0
  205. package/dist/composition/action_event.d.ts.map +1 -0
  206. package/dist/composition/action_event.js +8 -0
  207. package/dist/composition/action_event.js.map +1 -0
  208. package/dist/composition/body_node_base.d.ts +72 -0
  209. package/dist/composition/body_node_base.d.ts.map +1 -0
  210. package/dist/composition/body_node_base.js +104 -0
  211. package/dist/composition/body_node_base.js.map +1 -0
  212. package/dist/composition/composition.d.ts +71 -0
  213. package/dist/composition/composition.d.ts.map +1 -0
  214. package/dist/composition/composition.js +8 -0
  215. package/dist/composition/composition.js.map +1 -0
  216. package/dist/composition/error.d.ts +61 -0
  217. package/dist/composition/error.d.ts.map +1 -0
  218. package/dist/composition/error.js +69 -0
  219. package/dist/composition/error.js.map +1 -0
  220. package/dist/composition/index.d.ts +11 -0
  221. package/dist/composition/index.d.ts.map +1 -0
  222. package/dist/composition/index.js +14 -0
  223. package/dist/composition/index.js.map +1 -0
  224. package/dist/composition/map_nodes.d.ts +16 -0
  225. package/dist/composition/map_nodes.d.ts.map +1 -0
  226. package/dist/composition/map_nodes.js +81 -0
  227. package/dist/composition/map_nodes.js.map +1 -0
  228. package/dist/composition/named_color.d.ts +9 -0
  229. package/dist/composition/named_color.d.ts.map +1 -0
  230. package/dist/composition/named_color.js +17 -0
  231. package/dist/composition/named_color.js.map +1 -0
  232. package/dist/composition/node.d.ts +11 -0
  233. package/dist/composition/node.d.ts.map +1 -0
  234. package/dist/composition/node.js +8 -0
  235. package/dist/composition/node.js.map +1 -0
  236. package/dist/composition/one_line.d.ts +7 -0
  237. package/dist/composition/one_line.d.ts.map +1 -0
  238. package/dist/composition/one_line.js +17 -0
  239. package/dist/composition/one_line.js.map +1 -0
  240. package/dist/composition/structured_value.d.ts +27 -0
  241. package/dist/composition/structured_value.d.ts.map +1 -0
  242. package/dist/composition/structured_value.js +18 -0
  243. package/dist/composition/structured_value.js.map +1 -0
  244. package/dist/composition/validation_error.d.ts +33 -0
  245. package/dist/composition/validation_error.d.ts.map +1 -0
  246. package/dist/composition/validation_error.js +35 -0
  247. package/dist/composition/validation_error.js.map +1 -0
  248. package/dist/define/frame.d.ts +155 -0
  249. package/dist/define/frame.d.ts.map +1 -0
  250. package/dist/define/frame.js +27 -0
  251. package/dist/define/frame.js.map +1 -0
  252. package/dist/define/index.d.ts +10 -0
  253. package/dist/define/index.d.ts.map +1 -0
  254. package/dist/define/index.js +13 -0
  255. package/dist/define/index.js.map +1 -0
  256. package/dist/define/markdown_content.d.ts +15 -0
  257. package/dist/define/markdown_content.d.ts.map +1 -0
  258. package/dist/define/markdown_content.js +9 -0
  259. package/dist/define/markdown_content.js.map +1 -0
  260. package/dist/define/primitive_example.d.ts +30 -0
  261. package/dist/define/primitive_example.d.ts.map +1 -0
  262. package/dist/define/primitive_example.js +21 -0
  263. package/dist/define/primitive_example.js.map +1 -0
  264. package/dist/define/primitive_icon.d.ts +11 -0
  265. package/dist/define/primitive_icon.d.ts.map +1 -0
  266. package/dist/define/primitive_icon.js +14 -0
  267. package/dist/define/primitive_icon.js.map +1 -0
  268. package/dist/define/primitive_module.d.ts +435 -0
  269. package/dist/define/primitive_module.d.ts.map +1 -0
  270. package/dist/define/primitive_module.js +112 -0
  271. package/dist/define/primitive_module.js.map +1 -0
  272. package/dist/define/slack_assets.d.ts +28 -0
  273. package/dist/define/slack_assets.d.ts.map +1 -0
  274. package/dist/define/slack_assets.js +8 -0
  275. package/dist/define/slack_assets.js.map +1 -0
  276. package/dist/define/slack_blocks.d.ts +234 -0
  277. package/dist/define/slack_blocks.d.ts.map +1 -0
  278. package/dist/define/slack_blocks.js +8 -0
  279. package/dist/define/slack_blocks.js.map +1 -0
  280. package/dist/define/zod_format.d.ts +33 -0
  281. package/dist/define/zod_format.d.ts.map +1 -0
  282. package/dist/define/zod_format.js +114 -0
  283. package/dist/define/zod_format.js.map +1 -0
  284. package/dist/define/zod_helpers.d.ts +10 -0
  285. package/dist/define/zod_helpers.d.ts.map +1 -0
  286. package/dist/define/zod_helpers.js +22 -0
  287. package/dist/define/zod_helpers.js.map +1 -0
  288. package/dist/entries/html.d.ts +3 -0
  289. package/dist/entries/html.d.ts.map +1 -0
  290. package/dist/entries/html.js +8 -0
  291. package/dist/entries/html.js.map +1 -0
  292. package/dist/entries/index.d.ts +6 -0
  293. package/dist/entries/index.d.ts.map +1 -0
  294. package/dist/entries/index.js +12 -0
  295. package/dist/entries/index.js.map +1 -0
  296. package/dist/entries/markdown.d.ts +3 -0
  297. package/dist/entries/markdown.d.ts.map +1 -0
  298. package/dist/entries/markdown.js +8 -0
  299. package/dist/entries/markdown.js.map +1 -0
  300. package/dist/entries/react.d.ts +5 -0
  301. package/dist/entries/react.d.ts.map +1 -0
  302. package/dist/entries/react.js +11 -0
  303. package/dist/entries/react.js.map +1 -0
  304. package/dist/entries/slack.d.ts +2 -0
  305. package/dist/entries/slack.d.ts.map +1 -0
  306. package/dist/entries/slack.js +8 -0
  307. package/dist/entries/slack.js.map +1 -0
  308. package/dist/entries/text.d.ts +2 -0
  309. package/dist/entries/text.d.ts.map +1 -0
  310. package/dist/entries/text.js +8 -0
  311. package/dist/entries/text.js.map +1 -0
  312. package/dist/pack/capabilities.d.ts +41 -0
  313. package/dist/pack/capabilities.d.ts.map +1 -0
  314. package/dist/pack/capabilities.js +36 -0
  315. package/dist/pack/capabilities.js.map +1 -0
  316. package/dist/pack/compose.d.ts +24 -0
  317. package/dist/pack/compose.d.ts.map +1 -0
  318. package/dist/pack/compose.js +55 -0
  319. package/dist/pack/compose.js.map +1 -0
  320. package/dist/pack/enhancements.d.ts +65 -0
  321. package/dist/pack/enhancements.d.ts.map +1 -0
  322. package/dist/pack/enhancements.js +59 -0
  323. package/dist/pack/enhancements.js.map +1 -0
  324. package/dist/pack/index.d.ts +5 -0
  325. package/dist/pack/index.d.ts.map +1 -0
  326. package/dist/pack/index.js +11 -0
  327. package/dist/pack/index.js.map +1 -0
  328. package/dist/pack/primitive_pack.d.ts +164 -0
  329. package/dist/pack/primitive_pack.d.ts.map +1 -0
  330. package/dist/pack/primitive_pack.js +92 -0
  331. package/dist/pack/primitive_pack.js.map +1 -0
  332. package/dist/render/anchors.d.ts +82 -0
  333. package/dist/render/anchors.d.ts.map +1 -0
  334. package/dist/render/anchors.js +153 -0
  335. package/dist/render/anchors.js.map +1 -0
  336. package/dist/render/context_view.d.ts +10 -0
  337. package/dist/render/context_view.d.ts.map +1 -0
  338. package/dist/render/context_view.js +49 -0
  339. package/dist/render/context_view.js.map +1 -0
  340. package/dist/render/format_display_value.d.ts +20 -0
  341. package/dist/render/format_display_value.d.ts.map +1 -0
  342. package/dist/render/format_display_value.js +137 -0
  343. package/dist/render/format_display_value.js.map +1 -0
  344. package/dist/render/format_number.d.ts +9 -0
  345. package/dist/render/format_number.d.ts.map +1 -0
  346. package/dist/render/format_number.js +42 -0
  347. package/dist/render/format_number.js.map +1 -0
  348. package/dist/render/html/enhancements.d.ts +10 -0
  349. package/dist/render/html/enhancements.d.ts.map +1 -0
  350. package/dist/render/html/enhancements.js +25 -0
  351. package/dist/render/html/enhancements.js.map +1 -0
  352. package/dist/render/html/envelope.d.ts +182 -0
  353. package/dist/render/html/envelope.d.ts.map +1 -0
  354. package/dist/render/html/envelope.js +214 -0
  355. package/dist/render/html/envelope.js.map +1 -0
  356. package/dist/render/html/index.d.ts +3 -0
  357. package/dist/render/html/index.d.ts.map +1 -0
  358. package/dist/render/html/index.js +8 -0
  359. package/dist/render/html/index.js.map +1 -0
  360. package/dist/render/index.d.ts +6 -0
  361. package/dist/render/index.d.ts.map +1 -0
  362. package/dist/render/index.js +11 -0
  363. package/dist/render/index.js.map +1 -0
  364. package/dist/render/layout_check.d.ts +43 -0
  365. package/dist/render/layout_check.d.ts.map +1 -0
  366. package/dist/render/layout_check.js +129 -0
  367. package/dist/render/layout_check.js.map +1 -0
  368. package/dist/render/markdown/builder.d.ts +46 -0
  369. package/dist/render/markdown/builder.d.ts.map +1 -0
  370. package/dist/render/markdown/builder.js +190 -0
  371. package/dist/render/markdown/builder.js.map +1 -0
  372. package/dist/render/markdown/envelope.d.ts +20 -0
  373. package/dist/render/markdown/envelope.d.ts.map +1 -0
  374. package/dist/render/markdown/envelope.js +29 -0
  375. package/dist/render/markdown/envelope.js.map +1 -0
  376. package/dist/render/markdown/format.d.ts +10 -0
  377. package/dist/render/markdown/format.d.ts.map +1 -0
  378. package/dist/render/markdown/format.js +202 -0
  379. package/dist/render/markdown/format.js.map +1 -0
  380. package/dist/render/markdown/index.d.ts +3 -0
  381. package/dist/render/markdown/index.d.ts.map +1 -0
  382. package/dist/render/markdown/index.js +9 -0
  383. package/dist/render/markdown/index.js.map +1 -0
  384. package/dist/render/measure_dom.d.ts +10 -0
  385. package/dist/render/measure_dom.d.ts.map +1 -0
  386. package/dist/render/measure_dom.js +57 -0
  387. package/dist/render/measure_dom.js.map +1 -0
  388. package/dist/render/payload.d.ts +16 -0
  389. package/dist/render/payload.d.ts.map +1 -0
  390. package/dist/render/payload.js +9 -0
  391. package/dist/render/payload.js.map +1 -0
  392. package/dist/render/primitive_dispatch.d.ts +72 -0
  393. package/dist/render/primitive_dispatch.d.ts.map +1 -0
  394. package/dist/render/primitive_dispatch.js +169 -0
  395. package/dist/render/primitive_dispatch.js.map +1 -0
  396. package/dist/render/react/content.d.ts +40 -0
  397. package/dist/render/react/content.d.ts.map +1 -0
  398. package/dist/render/react/content.js +39 -0
  399. package/dist/render/react/content.js.map +1 -0
  400. package/dist/render/react/enhancements.d.ts +15 -0
  401. package/dist/render/react/enhancements.d.ts.map +1 -0
  402. package/dist/render/react/enhancements.js +28 -0
  403. package/dist/render/react/enhancements.js.map +1 -0
  404. package/dist/render/react/index.d.ts +3 -0
  405. package/dist/render/react/index.d.ts.map +1 -0
  406. package/dist/render/react/index.js +9 -0
  407. package/dist/render/react/index.js.map +1 -0
  408. package/dist/render/slack/assets.d.ts +16 -0
  409. package/dist/render/slack/assets.d.ts.map +1 -0
  410. package/dist/render/slack/assets.js +40 -0
  411. package/dist/render/slack/assets.js.map +1 -0
  412. package/dist/render/slack/blocks.d.ts +72 -0
  413. package/dist/render/slack/blocks.d.ts.map +1 -0
  414. package/dist/render/slack/blocks.js +77 -0
  415. package/dist/render/slack/blocks.js.map +1 -0
  416. package/dist/render/slack/envelope.d.ts +52 -0
  417. package/dist/render/slack/envelope.d.ts.map +1 -0
  418. package/dist/render/slack/envelope.js +547 -0
  419. package/dist/render/slack/envelope.js.map +1 -0
  420. package/dist/render/slack/format.d.ts +70 -0
  421. package/dist/render/slack/format.d.ts.map +1 -0
  422. package/dist/render/slack/format.js +209 -0
  423. package/dist/render/slack/format.js.map +1 -0
  424. package/dist/render/slack/index.d.ts +6 -0
  425. package/dist/render/slack/index.d.ts.map +1 -0
  426. package/dist/render/slack/index.js +12 -0
  427. package/dist/render/slack/index.js.map +1 -0
  428. package/dist/render/slack/markdown_content.d.ts +17 -0
  429. package/dist/render/slack/markdown_content.d.ts.map +1 -0
  430. package/dist/render/slack/markdown_content.js +404 -0
  431. package/dist/render/slack/markdown_content.js.map +1 -0
  432. package/dist/render/text/envelope.d.ts +15 -0
  433. package/dist/render/text/envelope.d.ts.map +1 -0
  434. package/dist/render/text/envelope.js +17 -0
  435. package/dist/render/text/envelope.js.map +1 -0
  436. package/dist/render/text/index.d.ts +2 -0
  437. package/dist/render/text/index.d.ts.map +1 -0
  438. package/dist/render/text/index.js +8 -0
  439. package/dist/render/text/index.js.map +1 -0
  440. package/dist/testing/conformance.d.ts +145 -0
  441. package/dist/testing/conformance.d.ts.map +1 -0
  442. package/dist/testing/conformance.js +303 -0
  443. package/dist/testing/conformance.js.map +1 -0
  444. package/dist/testing/icon.d.ts +11 -0
  445. package/dist/testing/icon.d.ts.map +1 -0
  446. package/dist/testing/icon.js +244 -0
  447. package/dist/testing/icon.js.map +1 -0
  448. package/dist/testing/index.d.ts +4 -0
  449. package/dist/testing/index.d.ts.map +1 -0
  450. package/dist/testing/index.js +10 -0
  451. package/dist/testing/index.js.map +1 -0
  452. package/dist/testing/registration.d.ts +32 -0
  453. package/dist/testing/registration.d.ts.map +1 -0
  454. package/dist/testing/registration.js +105 -0
  455. package/dist/testing/registration.js.map +1 -0
  456. package/dist/validate/authoring_schema.d.ts +33 -0
  457. package/dist/validate/authoring_schema.d.ts.map +1 -0
  458. package/dist/validate/authoring_schema.js +306 -0
  459. package/dist/validate/authoring_schema.js.map +1 -0
  460. package/dist/validate/composition_schema.d.ts +80 -0
  461. package/dist/validate/composition_schema.d.ts.map +1 -0
  462. package/dist/validate/composition_schema.js +127 -0
  463. package/dist/validate/composition_schema.js.map +1 -0
  464. package/dist/validate/index.d.ts +9 -0
  465. package/dist/validate/index.d.ts.map +1 -0
  466. package/dist/validate/index.js +15 -0
  467. package/dist/validate/index.js.map +1 -0
  468. package/dist/validate/input_budget.d.ts +35 -0
  469. package/dist/validate/input_budget.d.ts.map +1 -0
  470. package/dist/validate/input_budget.js +151 -0
  471. package/dist/validate/input_budget.js.map +1 -0
  472. package/dist/validate/json_schema.d.ts +32 -0
  473. package/dist/validate/json_schema.d.ts.map +1 -0
  474. package/dist/validate/json_schema.js +68 -0
  475. package/dist/validate/json_schema.js.map +1 -0
  476. package/dist/validate/node_issues.d.ts +12 -0
  477. package/dist/validate/node_issues.d.ts.map +1 -0
  478. package/dist/validate/node_issues.js +61 -0
  479. package/dist/validate/node_issues.js.map +1 -0
  480. package/dist/validate/url.d.ts +50 -0
  481. package/dist/validate/url.d.ts.map +1 -0
  482. package/dist/validate/url.js +107 -0
  483. package/dist/validate/url.js.map +1 -0
  484. package/dist/validate/validation.d.ts +95 -0
  485. package/dist/validate/validation.d.ts.map +1 -0
  486. package/dist/validate/validation.js +157 -0
  487. package/dist/validate/validation.js.map +1 -0
  488. package/dist/validate/value_schemas.d.ts +53 -0
  489. package/dist/validate/value_schemas.d.ts.map +1 -0
  490. package/dist/validate/value_schemas.js +50 -0
  491. package/dist/validate/value_schemas.js.map +1 -0
  492. package/package.json +119 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive_module.js","sourceRoot":"","sources":["../../../src/define/primitive_module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,6BAAsD;AAGtD,kEAIuC;AACvC,gDAAuE;AASvE,6CAAsD;AACtD,+CAA+C;AAgP/C;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG;IAC/B,OAAO;CACkC,CAAC;AAwL5C,oFAAoF;AAC7E,MAAM,kBAAkB,GAAG,CAChC,MAAuB,EACvB,IAAa,EACb,IAAY,EACZ,MAAyB,EACnB,EAAE;IACR,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAA,4BAAe,EAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B;AAEF,kEAAkE;AACrD,QAAA,gBAAgB,GAAG,IAAA,4BAAc,EAAC,4BAA4B,CAAC,CAAC;AAE7E,yFAAyF;AAC5E,QAAA,sBAAsB,GAAG,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C,CAAC,CAAC,QAAQ,CACtC,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { ReactNode } from 'react';\nimport { z, type ZodObject, type ZodType } from 'zod';\n\nimport type { ActionEventRef } from '../composition/action_event';\nimport {\n type ChildNodeRef,\n SURFACE_NAMES,\n type SurfaceName,\n} from '../composition/body_node_base';\nimport { ISOMER_ERROR_CODES, IsomerError } from '../composition/error';\nimport type { PrimitiveNode } from '../composition/node';\nimport type { ValidationError } from '../composition/validation_error';\n\nimport type { MarkdownContent } from './markdown_content';\nimport type { PrimitiveExample } from './primitive_example';\nimport type { PrimitiveIcon } from './primitive_icon';\nimport type { SlackAssetCollector } from './slack_assets';\nimport type { SlackBlock } from './slack_blocks';\nimport { formatZodIssues, oneOf } from './zod_format';\nimport { requiredString } from './zod_helpers';\n\nexport type { PrimitiveNode };\n\n/**\n * A primitive's entry in the catalog the authoring prompt is built from.\n *\n * Written for the model rather than for a developer: `useWhen` and `avoidWhen`\n * are what steer it away from reaching for the wrong primitive. `name` is the\n * one host-facing field, and the prompt never prints it.\n */\nexport interface PrimitiveCatalogEntry {\n type: string;\n /** Short name a host shows for the primitive, e.g. `Stat group`. Absent means the host derives one from `type`. */\n name?: string;\n /** One line on what the primitive is for, in the model's voice. */\n purpose: string;\n /** Situations that call for this primitive. Phrase each as a user intent, not a shape. */\n useWhen: string[];\n /** Situations that look like a fit but are not, naming the primitive to reach for instead. */\n avoidWhen: string[];\n /** A node literal the authoring prompt inlines under this primitive. */\n example: unknown;\n}\n\n/** A style a renderer asks for by name, resolved to a class by the host's adapter. */\nexport interface StyleHandle {\n /** Stable lookup key. The adapter's map is keyed on this. */\n key: string;\n /** Debug-facing label, which an adapter may fold into a generated class name. */\n readableName: string;\n}\n\n/** Dotted path into a pack's theme tokens, e.g. `colors.text.subdued`. */\nexport type ThemeTokenPath = string;\n\n/**\n * The sdk's own render context, and {@link DefaultPackTypes.context}.\n *\n * A pack with real theme tokens or a richer style-handle type declares its\n * own context in its {@link PackTypes}; {@link StyledRenderContext} is the\n * sdk's own extension. The bag is what lets a pack narrow without\n * re-declaring everything that mentions a context.\n */\nexport interface PrimitiveRenderContext {\n /**\n * The progressive enhancements this render may assume, by id. A set rather\n * than a field per feature so adding an enhancement costs no plumbing:\n * containers forward the whole context, and a renderer asks\n * `context.enhancements?.has('tableSort')`.\n *\n * Empty or absent is the baseline every host can render, so a renderer must\n * still answer the question on its own. See `docs/rendering.md`.\n */\n enhancements?: ReadonlySet<string>;\n /** Turns on `nodeAnchor` outside an HTML surface render, on the React and `snapshot` surfaces; inside one, the surface decides. */\n anchors?: boolean;\n /** Raises an interaction for the host to route. Absent means render non-interactively. */\n onEvent?: (event: ActionEventRef) => void;\n}\n\n/**\n * The render-context argument, optional only when omitting it is sound.\n *\n * The sdk's own {@link PrimitiveRenderContext} has no required field, so `{}`\n * is a complete value and a caller may leave it out. A pack that narrows the\n * context with a required member makes the argument mandatory.\n */\nexport type ReactContextArg<TContext> =\n Record<string, never> extends TContext\n ? [context?: TContext]\n : [context: TContext];\n\n/**\n * {@link PrimitiveRenderContext} plus the CSS-in-JS hooks an HTML style adapter\n * supplies. A pack that styles differently uses its own `TContext` instead.\n */\nexport interface StyledRenderContext extends PrimitiveRenderContext {\n /** Resolves handles to a `className`. Absent means the host supplies no styling. */\n resolveClassName?: (...handles: StyleHandle[]) => string;\n /** Resolves a theme token to a CSS variable reference. Absent means inline the literal value. */\n cssVarRef?: (path: ThemeTokenPath) => `var(--${string})`;\n}\n\n/** Passed to a primitive's style collector so it can vary CSS by layout mode. */\nexport interface PrimitiveStyleCollectionContext {\n /** The render fills its container rather than sitting at a fixed width. */\n fluid?: boolean;\n}\n\n/** A pack's collected styles, opaque to the SDK. */\nexport type PrimitiveStyleCollector = object;\n\n/**\n * The types a pack binds once and writes every primitive against: the palette\n * its frames supply, the context its `react` renderers receive, the collector\n * its `collectStyles` hooks mutate, and the Slack payload and collector types.\n *\n * Extend {@link DefaultPackTypes} and narrow only what the pack needs:\n *\n * ```ts\n * interface SlidesPackTypes extends DefaultPackTypes {\n * theme: SlideTheme;\n * context: SlideRenderContext;\n * }\n * ```\n */\nexport interface PackTypes {\n theme: unknown;\n context: unknown;\n collector: PrimitiveStyleCollector;\n slackBlock: unknown;\n slackCollector: unknown;\n}\n\n/** {@link PackTypes} as the sdk itself binds them, and the default everywhere. */\nexport interface DefaultPackTypes extends PackTypes {\n theme: unknown;\n context: PrimitiveRenderContext;\n collector: PrimitiveStyleCollector;\n slackBlock: SlackBlock;\n slackCollector: SlackAssetCollector;\n}\n\n/**\n * Each surface's renderer signature: the env bag it receives beyond the node,\n * and what it returns.\n *\n * Written out per surface rather than derived through an indexed access. A bag\n * is additive: a new extra on a surface is not an arity break. {@link Renderer}\n * indexes this table for the dispatcher cast; {@link Renderers} does not.\n */\nexport interface SurfaceMap<T extends PackTypes = DefaultPackTypes> {\n react: {\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /**\n * The frame's resolved palette, when this render is reached through the\n * `snapshot` surface. A bare `react`/`html` render has no {@link Frame} to\n * resolve one from, so it is absent there — a pack that needs a\n * literal color outside `snapshot` still goes through `context`.\n */\n theme?: T['theme'];\n };\n output: ReactNode;\n };\n /**\n * Identical to `react`, and served by the same renderer: an image backend\n * lays out the pack's DOM tree and stylesheet rather than a second tree\n * authored for it. The surface stays separate so a node can be hidden from\n * snapshots alone, and so a {@link Frame} has something to draw inside.\n */\n snapshot: {\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /** The frame's resolved palette for this render's mode; see `react.env.theme`. */\n theme?: T['theme'];\n };\n output: ReactNode;\n };\n text: {\n env: {\n scope: RenderScope<T>;\n };\n output: string;\n };\n /** Content built with `md`, escaped where it lands; authored Markdown source goes through `md.authored`. */\n markdown: {\n env: {\n scope: RenderScope<T>;\n };\n output: MarkdownContent;\n };\n /**\n * Returns one payload or several, so a primitive need not wrap a single\n * payload in an array.\n */\n slack: {\n env: {\n collector?: T['slackCollector'];\n scope: RenderScope<T>;\n };\n output: T['slackBlock'] | readonly T['slackBlock'][];\n };\n}\n\n/**\n * The dispatcher a renderer is given so a container can recurse into a child\n * owned by another pack. Erased to {@link PrimitiveNode}: a heterogeneous\n * inventory has no single node type to name.\n *\n * Passed as `scope` on every renderer's env bag. The dispatcher's own named\n * methods stay positional.\n */\nexport interface RenderScope<T extends PackTypes = DefaultPackTypes> {\n readonly definitions: readonly AnyPrimitiveDefinition[];\n /** Throws for an unknown node type; a missing primitive is a bug, not a degradation. */\n getDefinition(node: PrimitiveNode): AnyPrimitiveDefinition;\n /** `undefined` when the node is hidden from `surface`, `sanitize` drops it, or its primitive declares no renderer for `surface`. */\n renderOn<S extends SurfaceName>(\n surface: S,\n node: PrimitiveNode,\n extras: Omit<SurfaceMap<T>[S]['env'], 'scope'>\n ): SurfaceMap<T>[S]['output'] | undefined;\n renderReact(node: PrimitiveNode, context?: T['context']): ReactNode;\n collectStyles(\n node: PrimitiveNode,\n styles: PrimitiveStyleCollector,\n context: PrimitiveStyleCollectionContext\n ): void;\n renderText(node: PrimitiveNode): string;\n renderMarkdown(node: PrimitiveNode): string;\n /** A child as content, for a container building with `md`. */\n renderMarkdownContent(node: PrimitiveNode): MarkdownContent;\n /** Empty when the node is hidden from `slack`, `sanitize` drops it, or its renderer returns nothing; a node with no `slack` renderer degrades through its markdown. */\n renderSlack(\n node: PrimitiveNode,\n collector?: T['slackCollector']\n ): readonly T['slackBlock'][];\n /** `0` when the node is hidden from `snapshot` or its primitive declares no `metrics.snapshotHeight`. */\n estimateSnapshotHeight(node: PrimitiveNode): number;\n /** Appends schema failures under `path` to `errors`, each naming `node`'s type. */\n validate(node: PrimitiveNode, path: string, errors: ValidationError[]): void;\n}\n\n/**\n * One surface's renderer for one node type, per {@link SurfaceMap}.\n *\n * Indexes the env bag. Do not use this to type the renderers map: the\n * written-out signatures on {@link Renderers} are what keep the bags checked\n * per surface.\n */\nexport type Renderer<\n TNode extends PrimitiveNode,\n S extends SurfaceName,\n T extends PackTypes = DefaultPackTypes,\n> = (node: TNode, env: SurfaceMap<T>[S]['env']) => SurfaceMap<T>[S]['output'];\n\n/**\n * The surface a pack may declare beyond the mandatory three.\n *\n * Only `slack`, and even that stays optional per primitive: the dispatcher\n * converts the mandatory markdown to Block Kit, so a missing Slack renderer\n * degrades rather than disappearing. `snapshot` is not here because no primitive\n * implements it — the surface reuses `react`.\n */\nexport const OPTIONAL_SURFACES = [\n 'slack',\n] as const satisfies readonly SurfaceName[];\n\n/** One of the {@link OPTIONAL_SURFACES}. */\nexport type OptionalSurface = (typeof OPTIONAL_SURFACES)[number];\n\n/**\n * One renderer per surface a primitive implements.\n *\n * `react`, `text`, and `markdown` are always required: those three are what\n * make \"every composition degrades\" true. `react` serves the `snapshot` surface\n * too, so targeting images costs a primitive nothing.\n *\n * `slack` is declared method-style deliberately: method parameters are checked\n * bivariantly, which is what lets a pack narrow the collector's node type.\n */\nexport interface Renderers<\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n> {\n react(\n node: TNode,\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /** See {@link SurfaceMap.react}'s `env.theme`. */\n theme?: T['theme'];\n }\n ): ReactNode;\n text(\n node: TNode,\n env: {\n scope: RenderScope<T>;\n }\n ): string;\n markdown(\n node: TNode,\n env: {\n scope: RenderScope<T>;\n }\n ): MarkdownContent;\n slack?(\n node: TNode,\n env: {\n collector?: T['slackCollector'];\n scope: RenderScope<T>;\n }\n ): T['slackBlock'] | readonly T['slackBlock'][];\n}\n\n/**\n * Measurements a frame can ask of a node before drawing it.\n *\n * `snapshotHeight` is optional. The height estimate is `0` when it is missing, so\n * a frame that sums node heights sizes short.\n */\nexport interface PrimitiveMetrics<TNode extends PrimitiveNode> {\n /** The node's drawn height in pixels at the frame's width. */\n snapshotHeight?: (node: TNode) => number;\n}\n\n/**\n * Every primitive's schema is an object schema, because {@link definePrimitive}\n * extends it with `id` and `surfaces` and the composition builds a\n * `z.discriminatedUnion('type', …)` over them. Typed as `ZodObject` rather\n * than `ZodType<unknown>` so a union or intersection schema is a compile\n * error at the definition, not a runtime failure at the first `.extend()`.\n * Zod 4 types `z.object().superRefine(…)` as a `ZodObject` and preserves the\n * refinement through `.extend()`, so top-level refinements are unaffected.\n */\nexport type PrimitiveSchema = ZodObject;\n\n/**\n * The child-ref shape a primitive definition's own `children` returns.\n *\n * {@link ChildNodeRef} stays erased (`node: unknown`) because\n * `createChildNodeWalker` mixes children from every primitive type in the\n * runtime into one map and cannot name a single node type for them. A single\n * definition has no such excuse: its `children` should not type-check\n * against `unknown` and let something that is not a {@link PrimitiveNode} —\n * `null`, for instance — silently disappear from every tree walk.\n */\nexport interface PrimitiveChildRef extends ChildNodeRef {\n node: PrimitiveNode;\n}\n\n/**\n * One primitive: its node type, schema, catalog entry, and a renderer per\n * surface. The unit of vocabulary, and what {@link definePrimitive} takes.\n *\n * `T` is the pack's {@link PackTypes}, bound once with\n * {@link definePrimitiveFor} so each primitive names only `TNode`.\n */\nexport interface PrimitiveDefinition<\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n> {\n /** The node's discriminant, and the key this primitive occupies in an inventory. */\n type: TNode['type'];\n /** How the authoring prompt describes this primitive to the model. */\n catalog: PrimitiveCatalogEntry;\n /** Host-facing glyph, never shown to the model. Absent means the host supplies its own. */\n icon?: PrimitiveIcon;\n /**\n * Driven by the conformance harness, bare or named; read them with\n * `exampleNodes` or `primitiveExamples`. The catalog `example` is what the\n * prompt shows.\n */\n examples: readonly (TNode | PrimitiveExample<TNode>)[];\n /**\n * This primitive on its own. A container declares\n * {@link PrimitiveDefinition.schemaFor} as well, and uses\n * {@link unresolvedBodyNodeSchema} in the child slot here.\n */\n schema: TSchema;\n /**\n * A container's schema, bound to the body-node union of the composition it is\n * being built into.\n *\n * Declaring the shape and letting each composition supply its own union is\n * what lets one primitive appear in two runtimes with different inventories:\n * `z.lazy` memoizes per instance, and an instance built here belongs to\n * exactly one union.\n */\n schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;\n /** One function per surface; `react` serves `snapshot` as well. */\n renderers: Renderers<TNode, T>;\n /** Sizing a frame can ask for before drawing. Absent means it cannot be measured. */\n metrics?: PrimitiveMetrics<TNode>;\n /**\n * Render-time URL trust, the second of the two layers in `validate/url.ts`.\n *\n * Returning `null` drops the node. Applied even to an unvalidated node, so a\n * renderer invoked directly still cannot emit an unsafe URL.\n */\n sanitize?: (node: TNode) => TNode | null;\n /**\n * Nested nodes, for containers, in the order the `react` renderer draws\n * them; `findNodeElementPairs` relies on it. Absent means a leaf.\n */\n children?: (node: TNode) => readonly PrimitiveChildRef[];\n /**\n * True when this node produces surface output of its own, not only via\n * {@link PrimitiveDefinition.children}. A non-empty `children` result is\n * otherwise the complete source of rendered content, so a hybrid container\n * that still owns string fields returns true to keep rendering when every\n * nested node is hidden from the surface.\n */\n hasOwnContent?: (node: TNode) => boolean;\n /** Contributes this node's CSS by mutating `styles`, once per node per render. */\n collectStyles?: (\n node: TNode,\n env: { styles: T['collector']; context: PrimitiveStyleCollectionContext }\n ) => void;\n}\n\n/**\n * {@link PrimitiveDefinition} with every type parameter erased, and the form an\n * inventory is stored in.\n *\n * A heterogeneous pack has no single `TNode` to be generic over, so the\n * renderers degrade to `unknown` here.\n *\n * Each field carries the same contract as its {@link PrimitiveDefinition}\n * counterpart; only the types are erased.\n */\nexport interface AnyPrimitiveDefinition {\n type: string;\n catalog: PrimitiveCatalogEntry;\n icon?: PrimitiveIcon;\n examples: readonly (PrimitiveNode | PrimitiveExample)[];\n schema: PrimitiveSchema;\n schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;\n renderers: Record<'react' | 'text' | 'markdown', unknown> &\n Partial<Record<'slack', unknown>>;\n metrics?: {\n snapshotHeight?: unknown;\n };\n sanitize?: unknown;\n children?: unknown;\n hasOwnContent?: unknown;\n collectStyles?: unknown;\n}\n\n/** Parses `node` against `schema`, appending path-prefixed messages to `errors`. */\nexport const validateWithSchema = (\n schema: PrimitiveSchema,\n node: unknown,\n path: string,\n errors: ValidationError[]\n): void => {\n const result = schema.safeParse(node, { reportInput: true });\n if (!result.success) {\n errors.push(...formatZodIssues(result.error.issues, path));\n }\n};\n\n/** The `id` every node may carry, unique within a composition. */\nexport const bodyNodeIdSchema = requiredString('must be a non-empty string');\n\n/** The `surfaces` allowlist on a node. Absent means every surface; empty is rejected. */\nexport const bodyNodeSurfacesSchema = z\n .array(\n z.enum(SURFACE_NAMES, {\n error: () => oneOf(SURFACE_NAMES),\n })\n )\n .min(1, { error: 'must contain at least one surface' });\n\n/**\n * The child slot in a container's standalone {@link PrimitiveDefinition.schema},\n * where no body-node union is available.\n *\n * Deliberately permissive rather than `z.unknown()`: it still rejects a child\n * that is not a node at all, which is the error worth catching without an\n * inventory. Anything that depends on *which* types are legal — the validator,\n * the parser, the JSON Schema projection — goes through\n * {@link PrimitiveDefinition.schemaFor} and sees the real union.\n */\nexport const unresolvedBodyNodeSchema = z.looseObject({\n type: requiredString('must be a non-empty string'),\n});\n\n/**\n * Declares one primitive, extending its schema with the `id` and `surfaces`\n * fields every node carries, and closing it to unknown keys so a node is held\n * to the same rule as the composition root and the JSON Schema an agent reads.\n * A schema with its own catchall (`z.looseObject`) keeps it.\n *\n * A pack normally calls the form {@link definePrimitiveFor} binds to its own\n * {@link PackTypes}, so each primitive names only `TNode`.\n */\nexport const definePrimitive = <\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n>(\n definition: PrimitiveDefinition<TNode, T, TSchema>\n): PrimitiveDefinition<TNode, T, WithNodeFields<TSchema>> => {\n const { schemaFor } = definition;\n return {\n ...definition,\n schema: withNodeFields(definition.schema),\n // Both forms get the node fields, or a container would accept `id` and\n // `surfaces` standalone and reject them inside a composition.\n ...(schemaFor\n ? {\n schemaFor: (bodyNodeSchema: ZodType<unknown>) =>\n withNodeFields(schemaFor(bodyNodeSchema)),\n }\n : {}),\n };\n};\n\n/**\n * {@link definePrimitive} bound to one pack's {@link PackTypes}.\n *\n * ```ts\n * const define = definePrimitiveFor<SlidesPackTypes>();\n * export const note = define({ type: 'note', … });\n * ```\n */\nexport const definePrimitiveFor =\n <T extends PackTypes>() =>\n <\n TNode extends PrimitiveNode,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n >(\n definition: PrimitiveDefinition<TNode, T, TSchema>\n ): PrimitiveDefinition<TNode, T, WithNodeFields<TSchema>> =>\n definePrimitive<TNode, T, TSchema>(definition);\n\n/**\n * `.extend()` on a generic `ZodObject` widens the shape to `any`, so the\n * return type is rebuilt from `TSchema`'s shape. The brand on a field schema\n * stays on that same object at runtime.\n */\nexport type WithNodeFields<TSchema extends PrimitiveSchema> =\n TSchema extends ZodObject<infer Shape>\n ? ZodObject<\n Shape & {\n id: ReturnType<typeof bodyNodeIdSchema.optional>;\n surfaces: ReturnType<typeof bodyNodeSurfacesSchema.optional>;\n }\n >\n : PrimitiveSchema;\n\n// Marks the field schemas `definePrimitive` adds. A schema derived from a\n// defined one shares them by reference, and `Symbol.for` matches across ESM and\n// CommonJS copies of the SDK.\nconst NODE_FIELD = Symbol.for('elastic.isomer.node_field');\n\nconst nodeField = <T extends ZodType>(schema: T): T =>\n Object.defineProperty(schema, NODE_FIELD, { value: true });\n\nconst NODE_FIELDS = {\n id: nodeField(bodyNodeIdSchema.optional()),\n surfaces: nodeField(bodyNodeSurfacesSchema.optional()),\n};\n\nconst isNodeField = (schema: unknown): boolean => {\n let current = schema;\n while (current && typeof current === 'object') {\n if (Object.hasOwn(current, NODE_FIELD)) return true;\n const { def } = current as {\n def?: { type?: string; innerType?: unknown };\n };\n if (def?.type !== 'optional') return false;\n current = def.innerType;\n }\n return false;\n};\n\nconst withNodeFields = <TSchema extends PrimitiveSchema>(\n schema: TSchema\n): WithNodeFields<TSchema> => {\n const reserved = Object.keys(NODE_FIELDS).find(\n (field) =>\n Object.hasOwn(schema.shape, field) && !isNodeField(schema.shape[field])\n );\n if (reserved) {\n throw new IsomerError(\n ISOMER_ERROR_CODES.RESERVED_NODE_FIELD,\n `definePrimitive: a primitive schema cannot declare \\`${reserved}\\`; every body node has it.`\n );\n }\n const extended = schema.extend(NODE_FIELDS);\n return (\n schema.def.catchall === undefined ? extended.strict() : extended\n ) as WithNodeFields<TSchema>;\n};\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=slack_assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack_assets.js","sourceRoot":"","sources":["../../../src/define/slack_assets.ts"],"names":[],"mappings":";AAAA;;;;;GAKG","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { PrimitiveNode } from '../composition/node';\n\n/**\n * One image the host must upload before the message can be posted.\n *\n * The renderer is pure, so it emits `ref` as a placeholder and the host swaps\n * in Slack's file id once the upload lands.\n */\nexport interface SlackAssetRequest<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n /** Placeholder the render emits, which the host replaces with Slack's file id. */\n ref: string;\n /** The node to draw as an image, to be rendered on the `snapshot` surface. */\n node: TNode;\n /** Accessible description, required because Slack rejects an image block without one. */\n altText: string;\n}\n\n/**\n * Accumulates the {@link SlackAssetRequest}s a render produced.\n *\n * Opt-in: without a collector, a node that cannot draw inline degrades to text\n * instead, so default output stays safe for callers that cannot upload files.\n */\nexport interface SlackAssetCollector<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n /** Reserves a placeholder `ref` for `node` and records the request. */\n allocate(node: TNode, altText: string): string;\n /** In allocation order, so a host can upload and swap refs in one pass. */\n readonly requests: readonly SlackAssetRequest<TNode>[];\n}\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=slack_blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack_blocks.js","sourceRoot":"","sources":["../../../src/define/slack_blocks.ts"],"names":[],"mappings":";AAAA;;;;;GAKG","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\n// Slack surface output types for SurfaceMap. Not wire format.\n//\n// Message-surface Block Kit only (channel/DM posts). Field names and shapes\n// match Slack's JSON so output can go to `chat.postMessage`. Fields are\n// commented only where this subset departs from the published contract, or\n// where Slack's behavior is not evident from the name.\n//\n// References:\n// https://api.slack.com/reference/block-kit/blocks\n// https://api.slack.com/reference/block-kit/composition-objects\n// https://api.slack.com/reference/block-kit/block-elements\n\nexport interface SlackPlainTextObject {\n type: 'plain_text';\n text: string;\n emoji?: boolean;\n}\n\nexport interface SlackMrkdwnTextObject {\n type: 'mrkdwn';\n text: string;\n /** When true, Slack skips auto-linking URLs, channels, and users. Defaults to false. */\n verbatim?: boolean;\n}\n\nexport type SlackTextObject = SlackPlainTextObject | SlackMrkdwnTextObject;\n\nexport type SlackHeaderLevel = 1 | 2 | 3 | 4;\n\nexport interface SlackHeaderBlock {\n type: 'header';\n block_id?: string;\n text: SlackPlainTextObject;\n /** H1–H4 sizing. Accepted on message, modal, and Home tab surfaces. */\n level?: SlackHeaderLevel;\n}\n\nexport interface SlackSectionBlock {\n type: 'section';\n block_id?: string;\n text?: SlackTextObject;\n fields?: SlackMrkdwnTextObject[];\n accessory?: SlackSectionAccessory;\n}\n\nexport interface SlackDividerBlock {\n type: 'divider';\n block_id?: string;\n}\n\n/**\n * Inline image used inside `context` blocks and as a `section` accessory.\n * Distinct from the block-level {@link SlackImageBlock}.\n */\nexport interface SlackImageElement {\n type: 'image';\n image_url: string;\n alt_text: string;\n}\n\nexport interface SlackContextBlock {\n type: 'context';\n block_id?: string;\n elements: Array<SlackTextObject | SlackImageElement>;\n}\n\nexport interface SlackButtonElement {\n type: 'button';\n text: SlackPlainTextObject;\n url?: string;\n value?: string;\n action_id?: string;\n style?: 'primary' | 'danger';\n}\n\n/**\n * Reference to a file already uploaded to Slack.\n *\n * `id` and `url` are Slack's published fields. `ref` is not: a render cannot\n * upload, so it emits a placeholder the host swaps for Slack's file id once\n * the upload lands. See `SlackAssetCollector`.\n */\nexport interface SlackFileReference {\n id?: string;\n url?: string;\n ref?: string;\n}\n\n/**\n * Block-level image. `image_url` requires a publicly hosted URL; `slack_file`\n * references a file uploaded to Slack first, which is the only VPN-safe path.\n */\nexport interface SlackImageBlock {\n type: 'image';\n block_id?: string;\n alt_text: string;\n image_url?: string;\n slack_file?: SlackFileReference;\n title?: SlackPlainTextObject;\n}\n\n/** `video` block, matching Slack's JSON contract exactly. */\nexport interface SlackVideoBlock {\n type: 'video';\n block_id?: string;\n title: SlackPlainTextObject;\n title_url?: string;\n video_url: string;\n thumbnail_url: string;\n alt_text: string;\n description?: SlackPlainTextObject;\n author_name?: string;\n provider_name?: string;\n provider_icon_url?: string;\n}\n\nexport interface SlackRichTextStyle {\n bold?: boolean;\n italic?: boolean;\n strike?: boolean;\n code?: boolean;\n}\n\nexport interface SlackRichTextText {\n type: 'text';\n text: string;\n style?: SlackRichTextStyle;\n}\n\nexport interface SlackRichTextLink {\n type: 'link';\n url: string;\n text?: string;\n style?: SlackRichTextStyle;\n}\n\nexport type SlackTagColor =\n | 'gray'\n | 'brown'\n | 'purple'\n | 'indigo'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red';\n\nexport interface SlackRichTextTag {\n type: 'tag';\n text: string;\n color?: SlackTagColor;\n style?: SlackRichTextStyle;\n}\n\nexport type SlackRichTextInline =\n SlackRichTextText | SlackRichTextLink | SlackRichTextTag;\n\nexport interface SlackRichTextSection {\n type: 'rich_text_section';\n elements: SlackRichTextInline[];\n}\n\nexport interface SlackRichTextList {\n type: 'rich_text_list';\n style: 'bullet' | 'ordered';\n indent?: number;\n /** Added to an ordered list's first number, which is otherwise 1. */\n offset?: number;\n border?: number;\n elements: SlackRichTextSection[];\n}\n\nexport interface SlackRichTextPreformatted {\n type: 'rich_text_preformatted';\n border?: number;\n elements: SlackRichTextInline[];\n}\n\nexport interface SlackRichTextQuote {\n type: 'rich_text_quote';\n border?: number;\n elements: SlackRichTextInline[];\n}\n\nexport type SlackRichTextBlockElement =\n | SlackRichTextSection\n | SlackRichTextList\n | SlackRichTextPreformatted\n | SlackRichTextQuote;\n\nexport interface SlackRichTextBlock {\n type: 'rich_text';\n block_id?: string;\n elements: SlackRichTextBlockElement[];\n}\n\n/** The option shape shared by every menu, select, checkbox, and radio element. */\nexport interface SlackOptionObject {\n text: SlackTextObject;\n value: string;\n description?: SlackPlainTextObject;\n /** Only honored inside an `overflow` element. */\n url?: string;\n}\n\nexport interface SlackOptionGroup {\n label: SlackPlainTextObject;\n options: SlackOptionObject[];\n}\n\nexport interface SlackOverflowElement {\n type: 'overflow';\n action_id: string;\n options: SlackOptionObject[];\n}\n\nexport interface SlackStaticSelectElement {\n type: 'static_select';\n action_id: string;\n placeholder?: SlackPlainTextObject;\n options?: SlackOptionObject[];\n option_groups?: SlackOptionGroup[];\n initial_option?: SlackOptionObject;\n}\n\nexport interface SlackMultiStaticSelectElement {\n type: 'multi_static_select';\n action_id: string;\n placeholder?: SlackPlainTextObject;\n options: SlackOptionObject[];\n initial_options?: SlackOptionObject[];\n max_selected_items?: number;\n}\n\nexport interface SlackRadioButtonsElement {\n type: 'radio_buttons';\n action_id: string;\n options: SlackOptionObject[];\n initial_option?: SlackOptionObject;\n}\n\nexport interface SlackCheckboxesElement {\n type: 'checkboxes';\n action_id: string;\n options: SlackOptionObject[];\n initial_options?: SlackOptionObject[];\n}\n\n/** Elements Slack permits inside an `actions` block. */\nexport type SlackActionElement =\n | SlackButtonElement\n | SlackOverflowElement\n | SlackStaticSelectElement\n | SlackMultiStaticSelectElement\n | SlackRadioButtonsElement\n | SlackCheckboxesElement;\n\n/** Elements Slack permits as a `section.accessory`. */\nexport type SlackSectionAccessory =\n | SlackButtonElement\n | SlackImageElement\n | SlackOverflowElement\n | SlackStaticSelectElement\n | SlackMultiStaticSelectElement\n | SlackRadioButtonsElement\n | SlackCheckboxesElement;\n\nexport interface SlackActionsBlock {\n type: 'actions';\n block_id?: string;\n elements: SlackActionElement[];\n}\n\n/** A plain table cell. Strings and numbers use this; see {@link SlackTableCell}. */\nexport interface SlackRawTextElement {\n type: 'raw_text';\n text: string;\n}\n\n/**\n * One table cell. Badge and toned values need the `rich_text` form so a `tag`\n * or bold run can sit inside the grid.\n */\nexport type SlackTableCell = SlackRawTextElement | SlackRichTextBlock;\n\n/**\n * Per-column behavior, positional: entry N configures column N.\n *\n * Trailing columns without an entry keep Slack's defaults (left-aligned, no\n * wrapping), and a `null` entry skips a column.\n */\nexport interface SlackTableColumnSetting {\n align?: 'left' | 'center' | 'right';\n is_wrapped?: boolean;\n}\n\n/**\n * Native `table` block, whose first row renders as the header.\n *\n * Cells, rows, and columns are capped by Slack; see `SLACK_LIMITS`.\n * https://docs.slack.dev/reference/block-kit/blocks/table-block\n */\nexport interface SlackTableBlock {\n type: 'table';\n block_id?: string;\n rows: SlackTableCell[][];\n column_settings?: Array<SlackTableColumnSetting | null>;\n}\n\n/** Every block this renderer emits, and what a `slack` renderer returns. */\nexport type SlackBlock =\n | SlackHeaderBlock\n | SlackSectionBlock\n | SlackDividerBlock\n | SlackImageBlock\n | SlackVideoBlock\n | SlackContextBlock\n | SlackActionsBlock\n | SlackRichTextBlock\n | SlackTableBlock;\n"]}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.formatZodIssues = exports.oneOf = exports.declaredFieldsNote = exports.formatZodIssue = exports.formatPath = void 0;
10
+ const one_line_1 = require("../composition/one_line");
11
+ /**
12
+ * Builds a `body[3].items[0].label` style path from a Zod issue path. Empty
13
+ * when the issue is at the schema root.
14
+ */
15
+ const formatPath = (segments, basePath = '') => {
16
+ let result = basePath;
17
+ segments.forEach((segment) => {
18
+ if (typeof segment === 'number') {
19
+ result += `[${segment}]`;
20
+ }
21
+ else {
22
+ const text = String(segment);
23
+ result += result ? `.${text}` : text;
24
+ }
25
+ });
26
+ return result;
27
+ };
28
+ exports.formatPath = formatPath;
29
+ /**
30
+ * Converts one Zod issue into a {@link ValidationError}.
31
+ *
32
+ * Schemas encode only the predicate (`must contain at least one bar`), so the
33
+ * path stays separate. Missing required fields, enum issues, and unknown keys
34
+ * are worded centrally, which is what keeps per-schema messages from restating
35
+ * that boilerplate.
36
+ *
37
+ * Parse with `{ reportInput: true }`: Zod 4 omits `input` from an issue
38
+ * otherwise, and a wrong type would then read as a missing field.
39
+ */
40
+ const formatZodIssue = (issue, basePath = '') => {
41
+ const path = (0, exports.formatPath)(issue.path, basePath);
42
+ if (isMissingRequired(issue)) {
43
+ return { path, message: 'is required' };
44
+ }
45
+ if (issue.code === 'invalid_value' && Array.isArray(issue.values)) {
46
+ return { path, message: (0, exports.oneOf)(issue.values) };
47
+ }
48
+ if (issue.code === 'unrecognized_keys') {
49
+ return {
50
+ path,
51
+ message: `has unrecognized key(s): ${issue.keys.map(one_line_1.nameText).join(', ')}`,
52
+ };
53
+ }
54
+ if (issue.code === 'invalid_union') {
55
+ const { options } = issue;
56
+ if (Array.isArray(options)) {
57
+ return { path, message: (0, exports.oneOf)(options) };
58
+ }
59
+ }
60
+ // Zod's own size wording (`Too small: expected string to have >=1
61
+ // characters`) is rewritten; a schema's custom message is left alone.
62
+ if (issue.code === 'too_small' && issue.message.startsWith('Too small')) {
63
+ return {
64
+ path,
65
+ message: sizeMessage('at least', issue.origin, issue.minimum),
66
+ };
67
+ }
68
+ if (issue.code === 'too_big' && issue.message.startsWith('Too big')) {
69
+ return {
70
+ path,
71
+ message: sizeMessage('at most', issue.origin, issue.maximum),
72
+ };
73
+ }
74
+ return { path, message: issue.message };
75
+ };
76
+ exports.formatZodIssue = formatZodIssue;
77
+ /** Fields every node takes, which {@link declaredFieldsNote} leaves out. */
78
+ const COMMON_NODE_FIELDS = new Set(['type', 'id', 'surfaces']);
79
+ /** What an unknown-key error on a node of `schema` adds: the fields that node declares. */
80
+ const declaredFieldsNote = ({ shape }) => {
81
+ const declared = Object.keys(shape).filter((key) => !COMMON_NODE_FIELDS.has(key));
82
+ return declared.length === 0
83
+ ? 'it declares no fields'
84
+ : `its fields are ${declared.map(one_line_1.nameText).join(', ')}`;
85
+ };
86
+ exports.declaredFieldsNote = declaredFieldsNote;
87
+ /** `must be one of: a, b`, each string option spelled as {@link nameText} spells it. */
88
+ const oneOf = (options) => `must be one of: ${options
89
+ .map((option) => typeof option === 'string' ? (0, one_line_1.nameText)(option) : String(option))
90
+ .join(', ')}`;
91
+ exports.oneOf = oneOf;
92
+ const sizeMessage = (bound, origin, limit) => {
93
+ if (origin === 'string') {
94
+ return bound === 'at least' && limit === 1
95
+ ? 'must not be empty'
96
+ : `must be ${bound} ${limit} characters`;
97
+ }
98
+ if (origin === 'array' || origin === 'set') {
99
+ return bound === 'at least' && limit === 1
100
+ ? 'must not be empty'
101
+ : `must have ${bound} ${limit} items`;
102
+ }
103
+ return `must be ${bound} ${limit}`;
104
+ };
105
+ const isMissingRequired = (issue) => {
106
+ if (issue.code !== 'invalid_type') {
107
+ return false;
108
+ }
109
+ const { input } = issue;
110
+ return input === undefined;
111
+ };
112
+ /**
113
+ * Zod issues as {@link ValidationError}s, in order, each path under `basePath`.
114
+ *
115
+ * Missing required fields, enum issues, and unknown keys are worded centrally,
116
+ * so a schema's own messages state only the predicate. Parse with
117
+ * `{ reportInput: true }`: Zod 4 omits `input` from an issue otherwise, and a
118
+ * wrong type would then read as a missing field.
119
+ */
120
+ const formatZodIssues = (issues, basePath = '') => issues.map((issue) => (0, exports.formatZodIssue)(issue, basePath));
121
+ exports.formatZodIssues = formatZodIssues;
122
+ //# sourceMappingURL=zod_format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod_format.js","sourceRoot":"","sources":["../../../src/define/zod_format.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIH,sDAAmD;AAGnD;;;GAGG;AACI,MAAM,UAAU,GAAG,CACxB,QAAoC,EACpC,QAAQ,GAAG,EAAE,EACL,EAAE;IACV,IAAI,MAAM,GAAG,QAAQ,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,IAAI,IAAI,OAAO,GAAG,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7B,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACvC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAdW,QAAA,UAAU,cAcrB;AAEF;;;;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,MAAM,CAAC,CAC/D;KACA,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AALL,QAAA,KAAK,SAKA;AAElB,MAAM,WAAW,GAAG,CAClB,KAA6B,EAC7B,MAAc,EACd,KAAsB,EACd,EAAE;IACV,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,CAAC;YACxC,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,WAAW,KAAK,IAAI,KAAK,aAAa,CAAC;IAC7C,CAAC;IACD,IAAI,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QAC3C,OAAO,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,CAAC;YACxC,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,aAAa,KAAK,IAAI,KAAK,QAAQ,CAAC;IAC1C,CAAC;IACD,OAAO,WAAW,KAAK,IAAI,KAAK,EAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAqB,EAAW,EAAE;IAC3D,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,GAAG,KAA4B,CAAC;IAC/C,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC,CAAC;AAEF;;;;;;;GAOG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAqC,EACrC,QAAQ,GAAG,EAAE,EACM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,sBAAc,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAHlE,QAAA,eAAe,mBAGmD","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { core, ZodObject } from 'zod';\n\nimport { nameText } from '../composition/one_line';\nimport type { ValidationError } from '../composition/validation_error';\n\n/**\n * Builds a `body[3].items[0].label` style path from a Zod issue path. Empty\n * when the issue is at the schema root.\n */\nexport const formatPath = (\n segments: ReadonlyArray<PropertyKey>,\n basePath = ''\n): string => {\n let result = basePath;\n segments.forEach((segment) => {\n if (typeof segment === 'number') {\n result += `[${segment}]`;\n } else {\n const text = String(segment);\n result += result ? `.${text}` : text;\n }\n });\n return result;\n};\n\n/**\n * Converts one Zod issue into a {@link ValidationError}.\n *\n * Schemas encode only the predicate (`must contain at least one bar`), so the\n * path stays separate. Missing required fields, enum issues, and unknown keys\n * are worded centrally, which is what keeps per-schema messages from restating\n * that boilerplate.\n *\n * Parse with `{ reportInput: true }`: Zod 4 omits `input` from an issue\n * otherwise, and a wrong type would then read as a missing field.\n */\nexport const formatZodIssue = (\n issue: core.$ZodIssue,\n basePath = ''\n): ValidationError => {\n const path = formatPath(issue.path, basePath);\n\n if (isMissingRequired(issue)) {\n return { path, message: 'is required' };\n }\n\n if (issue.code === 'invalid_value' && Array.isArray(issue.values)) {\n return { path, message: oneOf(issue.values) };\n }\n\n if (issue.code === 'unrecognized_keys') {\n return {\n path,\n message: `has unrecognized key(s): ${issue.keys.map(nameText).join(', ')}`,\n };\n }\n\n if (issue.code === 'invalid_union') {\n const { options } = issue as { options?: unknown };\n if (Array.isArray(options)) {\n return { path, message: oneOf(options) };\n }\n }\n\n // Zod's own size wording (`Too small: expected string to have >=1\n // characters`) is rewritten; a schema's custom message is left alone.\n if (issue.code === 'too_small' && issue.message.startsWith('Too small')) {\n return {\n path,\n message: sizeMessage('at least', issue.origin, issue.minimum),\n };\n }\n if (issue.code === 'too_big' && issue.message.startsWith('Too big')) {\n return {\n path,\n message: sizeMessage('at most', issue.origin, issue.maximum),\n };\n }\n\n return { path, message: issue.message };\n};\n\n/** Fields every node takes, which {@link declaredFieldsNote} leaves out. */\nconst COMMON_NODE_FIELDS = new Set(['type', 'id', 'surfaces']);\n\n/** What an unknown-key error on a node of `schema` adds: the fields that node declares. */\nexport const declaredFieldsNote = ({ shape }: ZodObject): string => {\n const declared = Object.keys(shape).filter(\n (key) => !COMMON_NODE_FIELDS.has(key)\n );\n return declared.length === 0\n ? 'it declares no fields'\n : `its fields are ${declared.map(nameText).join(', ')}`;\n};\n\n/** `must be one of: a, b`, each string option spelled as {@link nameText} spells it. */\nexport const oneOf = (options: readonly unknown[]): string =>\n `must be one of: ${options\n .map((option) =>\n typeof option === 'string' ? nameText(option) : String(option)\n )\n .join(', ')}`;\n\nconst sizeMessage = (\n bound: 'at least' | 'at most',\n origin: string,\n limit: number | bigint\n): string => {\n if (origin === 'string') {\n return bound === 'at least' && limit === 1\n ? 'must not be empty'\n : `must be ${bound} ${limit} characters`;\n }\n if (origin === 'array' || origin === 'set') {\n return bound === 'at least' && limit === 1\n ? 'must not be empty'\n : `must have ${bound} ${limit} items`;\n }\n return `must be ${bound} ${limit}`;\n};\n\nconst isMissingRequired = (issue: core.$ZodIssue): boolean => {\n if (issue.code !== 'invalid_type') {\n return false;\n }\n const { input } = issue as { input?: unknown };\n return input === undefined;\n};\n\n/**\n * Zod issues as {@link ValidationError}s, in order, each path under `basePath`.\n *\n * Missing required fields, enum issues, and unknown keys are worded centrally,\n * so a schema's own messages state only the predicate. Parse with\n * `{ reportInput: true }`: Zod 4 omits `input` from an issue otherwise, and a\n * wrong type would then read as a missing field.\n */\nexport const formatZodIssues = (\n issues: ReadonlyArray<core.$ZodIssue>,\n basePath = ''\n): ValidationError[] => issues.map((issue) => formatZodIssue(issue, basePath));\n"]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.z = exports.requiredString = void 0;
10
+ const zod_1 = require("zod");
11
+ Object.defineProperty(exports, "z", { enumerable: true, get: function () { return zod_1.z; } });
12
+ /**
13
+ * A non-empty string.
14
+ *
15
+ * `message` is the suffix `formatZodIssue` prepends a path to, so phrase
16
+ * it as a predicate (`must be a hex color`), not a sentence.
17
+ */
18
+ const requiredString = (message = 'is required') => zod_1.z
19
+ // Only a missing or non-string value takes `message`; a check chained on
20
+ // later, such as `.max()`, keeps its own wording.
21
+ .string({
22
+ error: (issue) => (issue.code === 'invalid_type' ? message : undefined),
23
+ })
24
+ .min(1, { error: message });
25
+ exports.requiredString = requiredString;
26
+ //# sourceMappingURL=zod_helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod_helpers.js","sourceRoot":"","sources":["../../../src/define/zod_helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAwB;AAiBf,kFAjBA,OAAC,OAiBA;AAfV;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAAC,OAAO,GAAG,aAAa,EAAE,EAAE,CACxD,OAAC;IACC,yEAAyE;IACzE,kDAAkD;KACjD,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;CACxE,CAAC;KACD,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAPnB,QAAA,cAAc,kBAOK","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport { z } from 'zod';\n\n/**\n * A non-empty string.\n *\n * `message` is the suffix `formatZodIssue` prepends a path to, so phrase\n * it as a predicate (`must be a hex color`), not a sentence.\n */\nexport const requiredString = (message = 'is required') =>\n z\n // Only a missing or non-string value takes `message`; a check chained on\n // later, such as `.max()`, keeps its own wording.\n .string({\n error: (issue) => (issue.code === 'invalid_type' ? message : undefined),\n })\n .min(1, { error: message });\n\nexport { z };\n"]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.renderHTMLWithDispatcher = void 0;
10
+ var html_1 = require("../render/html");
11
+ Object.defineProperty(exports, "renderHTMLWithDispatcher", { enumerable: true, get: function () { return html_1.renderHTMLWithDispatcher; } });
12
+ //# sourceMappingURL=html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/entries/html.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCASwB;AADtB,gHAAA,wBAAwB,OAAA","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type EnhancementDefinition,\n type HTMLDispatcherRenderOptions,\n type HTMLEnhancementScope,\n type HTMLRenderDispatcher,\n type HTMLRenderOptions,\n type HTMLRenderResult,\n type HTMLStyleAdapter,\n renderHTMLWithDispatcher,\n} from '../render/html';\nexport {\n type ReactContentDispatcher,\n type ReactContentOptions,\n} from '../render/react';\n"]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.buildCompositionJsonSchema = exports.buildAuthoringJsonSchema = exports.authoringSchemaSubset = exports.assetUrl = exports.NAVIGATION_HREF_RULE = exports.NAVIGATION_HREF_MESSAGE = exports.MAX_INPUT_VALUES = exports.MAX_INPUT_DEPTH = exports.MAX_INPUT_CHARACTERS = exports.BLOCKED_HREF = exports.ASSET_URL_RULE = exports.ASSET_URL_MESSAGE = exports.withoutAnchors = exports.withNodeAnchors = exports.rawDisplayValue = exports.nodeAnchor = exports.layoutRoom = exports.isStructuredValue = exports.formatDisplayValue = exports.createPrimitiveDispatcher = exports.checkLayout = exports.NODE_ANCHOR_ATTRIBUTE = exports.LAYOUT_ROOM_ATTRIBUTE = exports.scopeScript = exports.describeCapabilities = exports.definePrimitivePack = exports.composePacks = exports.z = exports.unresolvedBodyNodeSchema = exports.requiredString = exports.primitiveExamples = exports.formatZodIssues = exports.exampleNodes = exports.definePrimitiveFor = exports.definePrimitive = exports.bindFrame = exports.OPTIONAL_SURFACES = exports.ICON_VARS = exports.someBodyNode = exports.mapCompositionNodes = exports.isVisibleOnSurface = exports.IsomerError = exports.formatValidationError = exports.createChildNodeWalker = exports.CompositionValidationError = exports.SURFACE_NAMES = exports.STRUCTURED_VALUE_FORMATS = exports.ISOMER_ERROR_CODES = exports.BODY_NODE_SURFACES = exports.ALL_NAMED_COLORS = void 0;
10
+ exports.warningsForSurface = exports.structuredValueSchema = exports.sanitizeNavigationHref = exports.sanitizeAssetUrl = exports.renderThemeSchema = exports.navigationHref = exports.namedColorSchema = exports.isInputRefusal = exports.getCompositionSchemaForDefinitions = exports.displayValueSchema = exports.createCompositionValidator = exports.createCompositionParser = exports.compositionToRender = exports.checkInputBudget = void 0;
11
+ var composition_1 = require("../composition");
12
+ Object.defineProperty(exports, "ALL_NAMED_COLORS", { enumerable: true, get: function () { return composition_1.ALL_NAMED_COLORS; } });
13
+ Object.defineProperty(exports, "BODY_NODE_SURFACES", { enumerable: true, get: function () { return composition_1.BODY_NODE_SURFACES; } });
14
+ Object.defineProperty(exports, "ISOMER_ERROR_CODES", { enumerable: true, get: function () { return composition_1.ISOMER_ERROR_CODES; } });
15
+ Object.defineProperty(exports, "STRUCTURED_VALUE_FORMATS", { enumerable: true, get: function () { return composition_1.STRUCTURED_VALUE_FORMATS; } });
16
+ Object.defineProperty(exports, "SURFACE_NAMES", { enumerable: true, get: function () { return composition_1.SURFACE_NAMES; } });
17
+ Object.defineProperty(exports, "CompositionValidationError", { enumerable: true, get: function () { return composition_1.CompositionValidationError; } });
18
+ Object.defineProperty(exports, "createChildNodeWalker", { enumerable: true, get: function () { return composition_1.createChildNodeWalker; } });
19
+ Object.defineProperty(exports, "formatValidationError", { enumerable: true, get: function () { return composition_1.formatValidationError; } });
20
+ Object.defineProperty(exports, "IsomerError", { enumerable: true, get: function () { return composition_1.IsomerError; } });
21
+ Object.defineProperty(exports, "isVisibleOnSurface", { enumerable: true, get: function () { return composition_1.isVisibleOnSurface; } });
22
+ Object.defineProperty(exports, "mapCompositionNodes", { enumerable: true, get: function () { return composition_1.mapCompositionNodes; } });
23
+ Object.defineProperty(exports, "someBodyNode", { enumerable: true, get: function () { return composition_1.someBodyNode; } });
24
+ var define_1 = require("../define");
25
+ Object.defineProperty(exports, "ICON_VARS", { enumerable: true, get: function () { return define_1.ICON_VARS; } });
26
+ Object.defineProperty(exports, "OPTIONAL_SURFACES", { enumerable: true, get: function () { return define_1.OPTIONAL_SURFACES; } });
27
+ Object.defineProperty(exports, "bindFrame", { enumerable: true, get: function () { return define_1.bindFrame; } });
28
+ Object.defineProperty(exports, "definePrimitive", { enumerable: true, get: function () { return define_1.definePrimitive; } });
29
+ Object.defineProperty(exports, "definePrimitiveFor", { enumerable: true, get: function () { return define_1.definePrimitiveFor; } });
30
+ Object.defineProperty(exports, "exampleNodes", { enumerable: true, get: function () { return define_1.exampleNodes; } });
31
+ Object.defineProperty(exports, "formatZodIssues", { enumerable: true, get: function () { return define_1.formatZodIssues; } });
32
+ Object.defineProperty(exports, "primitiveExamples", { enumerable: true, get: function () { return define_1.primitiveExamples; } });
33
+ Object.defineProperty(exports, "requiredString", { enumerable: true, get: function () { return define_1.requiredString; } });
34
+ Object.defineProperty(exports, "unresolvedBodyNodeSchema", { enumerable: true, get: function () { return define_1.unresolvedBodyNodeSchema; } });
35
+ Object.defineProperty(exports, "z", { enumerable: true, get: function () { return define_1.z; } });
36
+ var pack_1 = require("../pack");
37
+ Object.defineProperty(exports, "composePacks", { enumerable: true, get: function () { return pack_1.composePacks; } });
38
+ Object.defineProperty(exports, "definePrimitivePack", { enumerable: true, get: function () { return pack_1.definePrimitivePack; } });
39
+ Object.defineProperty(exports, "describeCapabilities", { enumerable: true, get: function () { return pack_1.describeCapabilities; } });
40
+ Object.defineProperty(exports, "scopeScript", { enumerable: true, get: function () { return pack_1.scopeScript; } });
41
+ var render_1 = require("../render");
42
+ Object.defineProperty(exports, "LAYOUT_ROOM_ATTRIBUTE", { enumerable: true, get: function () { return render_1.LAYOUT_ROOM_ATTRIBUTE; } });
43
+ Object.defineProperty(exports, "NODE_ANCHOR_ATTRIBUTE", { enumerable: true, get: function () { return render_1.NODE_ANCHOR_ATTRIBUTE; } });
44
+ Object.defineProperty(exports, "checkLayout", { enumerable: true, get: function () { return render_1.checkLayout; } });
45
+ Object.defineProperty(exports, "createPrimitiveDispatcher", { enumerable: true, get: function () { return render_1.createPrimitiveDispatcher; } });
46
+ Object.defineProperty(exports, "formatDisplayValue", { enumerable: true, get: function () { return render_1.formatDisplayValue; } });
47
+ Object.defineProperty(exports, "isStructuredValue", { enumerable: true, get: function () { return render_1.isStructuredValue; } });
48
+ Object.defineProperty(exports, "layoutRoom", { enumerable: true, get: function () { return render_1.layoutRoom; } });
49
+ Object.defineProperty(exports, "nodeAnchor", { enumerable: true, get: function () { return render_1.nodeAnchor; } });
50
+ Object.defineProperty(exports, "rawDisplayValue", { enumerable: true, get: function () { return render_1.rawDisplayValue; } });
51
+ Object.defineProperty(exports, "withNodeAnchors", { enumerable: true, get: function () { return render_1.withNodeAnchors; } });
52
+ Object.defineProperty(exports, "withoutAnchors", { enumerable: true, get: function () { return render_1.withoutAnchors; } });
53
+ var validate_1 = require("../validate");
54
+ Object.defineProperty(exports, "ASSET_URL_MESSAGE", { enumerable: true, get: function () { return validate_1.ASSET_URL_MESSAGE; } });
55
+ Object.defineProperty(exports, "ASSET_URL_RULE", { enumerable: true, get: function () { return validate_1.ASSET_URL_RULE; } });
56
+ Object.defineProperty(exports, "BLOCKED_HREF", { enumerable: true, get: function () { return validate_1.BLOCKED_HREF; } });
57
+ Object.defineProperty(exports, "MAX_INPUT_CHARACTERS", { enumerable: true, get: function () { return validate_1.MAX_INPUT_CHARACTERS; } });
58
+ Object.defineProperty(exports, "MAX_INPUT_DEPTH", { enumerable: true, get: function () { return validate_1.MAX_INPUT_DEPTH; } });
59
+ Object.defineProperty(exports, "MAX_INPUT_VALUES", { enumerable: true, get: function () { return validate_1.MAX_INPUT_VALUES; } });
60
+ Object.defineProperty(exports, "NAVIGATION_HREF_MESSAGE", { enumerable: true, get: function () { return validate_1.NAVIGATION_HREF_MESSAGE; } });
61
+ Object.defineProperty(exports, "NAVIGATION_HREF_RULE", { enumerable: true, get: function () { return validate_1.NAVIGATION_HREF_RULE; } });
62
+ Object.defineProperty(exports, "assetUrl", { enumerable: true, get: function () { return validate_1.assetUrl; } });
63
+ Object.defineProperty(exports, "authoringSchemaSubset", { enumerable: true, get: function () { return validate_1.authoringSchemaSubset; } });
64
+ Object.defineProperty(exports, "buildAuthoringJsonSchema", { enumerable: true, get: function () { return validate_1.buildAuthoringJsonSchema; } });
65
+ Object.defineProperty(exports, "buildCompositionJsonSchema", { enumerable: true, get: function () { return validate_1.buildCompositionJsonSchema; } });
66
+ Object.defineProperty(exports, "checkInputBudget", { enumerable: true, get: function () { return validate_1.checkInputBudget; } });
67
+ Object.defineProperty(exports, "compositionToRender", { enumerable: true, get: function () { return validate_1.compositionToRender; } });
68
+ Object.defineProperty(exports, "createCompositionParser", { enumerable: true, get: function () { return validate_1.createCompositionParser; } });
69
+ Object.defineProperty(exports, "createCompositionValidator", { enumerable: true, get: function () { return validate_1.createCompositionValidator; } });
70
+ Object.defineProperty(exports, "displayValueSchema", { enumerable: true, get: function () { return validate_1.displayValueSchema; } });
71
+ Object.defineProperty(exports, "getCompositionSchemaForDefinitions", { enumerable: true, get: function () { return validate_1.getCompositionSchemaForDefinitions; } });
72
+ Object.defineProperty(exports, "isInputRefusal", { enumerable: true, get: function () { return validate_1.isInputRefusal; } });
73
+ Object.defineProperty(exports, "namedColorSchema", { enumerable: true, get: function () { return validate_1.namedColorSchema; } });
74
+ Object.defineProperty(exports, "navigationHref", { enumerable: true, get: function () { return validate_1.navigationHref; } });
75
+ Object.defineProperty(exports, "renderThemeSchema", { enumerable: true, get: function () { return validate_1.renderThemeSchema; } });
76
+ Object.defineProperty(exports, "sanitizeAssetUrl", { enumerable: true, get: function () { return validate_1.sanitizeAssetUrl; } });
77
+ Object.defineProperty(exports, "sanitizeNavigationHref", { enumerable: true, get: function () { return validate_1.sanitizeNavigationHref; } });
78
+ Object.defineProperty(exports, "structuredValueSchema", { enumerable: true, get: function () { return validate_1.structuredValueSchema; } });
79
+ Object.defineProperty(exports, "warningsForSurface", { enumerable: true, get: function () { return validate_1.warningsForSurface; } });
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entries/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,8CA6BwB;AAZtB,+GAAA,gBAAgB,OAAA;AAChB,iHAAA,kBAAkB,OAAA;AAClB,iHAAA,kBAAkB,OAAA;AAClB,uHAAA,wBAAwB,OAAA;AACxB,4GAAA,aAAa,OAAA;AACb,yHAAA,0BAA0B,OAAA;AAC1B,oHAAA,qBAAqB,OAAA;AACrB,oHAAA,qBAAqB,OAAA;AACrB,0GAAA,WAAW,OAAA;AACX,iHAAA,kBAAkB,OAAA;AAClB,kHAAA,mBAAmB,OAAA;AACnB,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,kCAAkC,OAAA;AAClC,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,8GAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type ActionEventRef,\n type BodyNodeBase,\n type ChildNodeRef,\n type ChildNodeWalker,\n type Composition,\n type CompositionMeta,\n type DisplayValue,\n type IsomerErrorCode,\n type NamedColor,\n type NamedColorPalette,\n type PrimitiveNode,\n type RenderTheme,\n type StructuredValue,\n type StructuredValueFormat,\n type SurfaceName,\n type ValidationError,\n ALL_NAMED_COLORS,\n BODY_NODE_SURFACES,\n ISOMER_ERROR_CODES,\n STRUCTURED_VALUE_FORMATS,\n SURFACE_NAMES,\n CompositionValidationError,\n createChildNodeWalker,\n formatValidationError,\n IsomerError,\n isVisibleOnSurface,\n mapCompositionNodes,\n someBodyNode,\n} from '../composition';\nexport {\n type AnyPrimitiveDefinition,\n type BoundFrame,\n type DefaultPackTypes,\n type ExampleNode,\n type Frame,\n type FrameBody,\n type FrameComposition,\n type FrameDispatcher,\n type FrameHeader,\n type FrameViewport,\n type NormalizedPrimitiveExample,\n type OptionalSurface,\n type PackTypes,\n type PrimitiveCatalogEntry,\n type PrimitiveChildRef,\n type PrimitiveDefinition,\n type PrimitiveExample,\n type PrimitiveIcon,\n type PrimitiveMetrics,\n type PrimitiveRenderContext,\n type PrimitiveSchema,\n type PrimitiveStyleCollectionContext,\n type PrimitiveStyleCollector,\n type ReactContextArg,\n type Renderer,\n type Renderers,\n type RenderScope,\n type StyledRenderContext,\n type StyleHandle,\n type SurfaceMap,\n type ThemePair,\n type ThemeTokenPath,\n type WithNodeFields,\n ICON_VARS,\n OPTIONAL_SURFACES,\n bindFrame,\n definePrimitive,\n definePrimitiveFor,\n exampleNodes,\n formatZodIssues,\n primitiveExamples,\n requiredString,\n unresolvedBodyNodeSchema,\n z,\n} from '../define';\nexport {\n type AnyPrimitivePack,\n type CapabilitySources,\n type ComposedPacks,\n type EnhancementDefinition,\n type HostCapabilities,\n type PackAuthoringOptions,\n type PackStyleAdapter,\n type PrimitiveGroup,\n type PrimitivePack,\n type PrimitivePackInput,\n type SurfaceSupport,\n composePacks,\n definePrimitivePack,\n describeCapabilities,\n scopeScript,\n} from '../pack';\nexport {\n type FormatDisplayValueOptions,\n type LayoutBox,\n type LayoutFinding,\n type LayoutRect,\n type PayloadMeasurement,\n type PrimitiveDispatcher,\n type PrimitiveDispatcherOptions,\n LAYOUT_ROOM_ATTRIBUTE,\n NODE_ANCHOR_ATTRIBUTE,\n checkLayout,\n createPrimitiveDispatcher,\n formatDisplayValue,\n isStructuredValue,\n layoutRoom,\n nodeAnchor,\n rawDisplayValue,\n withNodeAnchors,\n withoutAnchors,\n} from '../render';\nexport {\n type AuthoringJsonSchemaOptions,\n type CheckedComposition,\n type CheckedValidationResult,\n type CompositionJsonSchemaOptions,\n type CompositionSchemaOptions,\n type CompositionValidatorOptions,\n type InputBudget,\n type InputBudgetCheck,\n type ParsedComposition,\n type UrlSchemaOptions,\n type ValidationErrorMode,\n type ValidationResult,\n type ValidationWarning,\n ASSET_URL_MESSAGE,\n ASSET_URL_RULE,\n BLOCKED_HREF,\n MAX_INPUT_CHARACTERS,\n MAX_INPUT_DEPTH,\n MAX_INPUT_VALUES,\n NAVIGATION_HREF_MESSAGE,\n NAVIGATION_HREF_RULE,\n assetUrl,\n authoringSchemaSubset,\n buildAuthoringJsonSchema,\n buildCompositionJsonSchema,\n checkInputBudget,\n compositionToRender,\n createCompositionParser,\n createCompositionValidator,\n displayValueSchema,\n getCompositionSchemaForDefinitions,\n isInputRefusal,\n namedColorSchema,\n navigationHref,\n renderThemeSchema,\n sanitizeAssetUrl,\n sanitizeNavigationHref,\n structuredValueSchema,\n warningsForSurface,\n} from '../validate';\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.serializeMarkdown = exports.renderMarkdownEnvelope = exports.md = void 0;
10
+ var markdown_1 = require("../render/markdown");
11
+ Object.defineProperty(exports, "md", { enumerable: true, get: function () { return markdown_1.md; } });
12
+ Object.defineProperty(exports, "renderMarkdownEnvelope", { enumerable: true, get: function () { return markdown_1.renderMarkdownEnvelope; } });
13
+ Object.defineProperty(exports, "serializeMarkdown", { enumerable: true, get: function () { return markdown_1.serializeMarkdown; } });
14
+ //# sourceMappingURL=markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/entries/markdown.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AASH,+CAM4B;AAH1B,8FAAA,EAAE,OAAA;AACF,kHAAA,sBAAsB,OAAA;AACtB,6GAAA,iBAAiB,OAAA","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type MarkdownBlock,\n type MarkdownContent,\n type MarkdownInline,\n type MarkdownInlineInput,\n} from '../define';\n\nexport {\n type MarkdownEnvelopeDispatcher,\n type MarkdownEnvelopeOptions,\n md,\n renderMarkdownEnvelope,\n serializeMarkdown,\n} from '../render/markdown';\n"]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.wrapCompositionContent = exports.renderCompositionContent = exports.applyEnhancements = exports.measureDom = exports.findNodeElementPairs = exports.runEnhancementScript = void 0;
10
+ var enhancements_1 = require("../pack/enhancements");
11
+ Object.defineProperty(exports, "runEnhancementScript", { enumerable: true, get: function () { return enhancements_1.runEnhancementScript; } });
12
+ var anchors_1 = require("../render/anchors");
13
+ Object.defineProperty(exports, "findNodeElementPairs", { enumerable: true, get: function () { return anchors_1.findNodeElementPairs; } });
14
+ var measure_dom_1 = require("../render/measure_dom");
15
+ Object.defineProperty(exports, "measureDom", { enumerable: true, get: function () { return measure_dom_1.measureDom; } });
16
+ var react_1 = require("../render/react");
17
+ Object.defineProperty(exports, "applyEnhancements", { enumerable: true, get: function () { return react_1.applyEnhancements; } });
18
+ Object.defineProperty(exports, "renderCompositionContent", { enumerable: true, get: function () { return react_1.renderCompositionContent; } });
19
+ Object.defineProperty(exports, "wrapCompositionContent", { enumerable: true, get: function () { return react_1.wrapCompositionContent; } });
20
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/entries/react.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,qDAA4D;AAAnD,oHAAA,oBAAoB,OAAA;AAC7B,6CAAyD;AAAhD,+GAAA,oBAAoB,OAAA;AAC7B,qDAAmD;AAA1C,yGAAA,UAAU,OAAA;AACnB,yCAOyB;AAHvB,0GAAA,iBAAiB,OAAA;AACjB,iHAAA,wBAAwB,OAAA;AACxB,+GAAA,sBAAsB,OAAA","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport { runEnhancementScript } from '../pack/enhancements';\nexport { findNodeElementPairs } from '../render/anchors';\nexport { measureDom } from '../render/measure_dom';\nexport {\n type CompositionWrapperOptions,\n type ReactContentDispatcher,\n type ReactContentOptions,\n applyEnhancements,\n renderCompositionContent,\n wrapCompositionContent,\n} from '../render/react';\n"]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.strike = exports.slackLinkUrl = exports.renderSlackEnvelope = exports.markdownContentToSlackBlocks = exports.link = exports.italic = exports.isSlackReachableImageUrl = exports.escapeMrkdwn = exports.createSlackAssetCollector = exports.codeBlock = exports.code = exports.clampSlackText = exports.bold = exports.SLACK_LIMITS = void 0;
10
+ var slack_1 = require("../render/slack");
11
+ Object.defineProperty(exports, "SLACK_LIMITS", { enumerable: true, get: function () { return slack_1.SLACK_LIMITS; } });
12
+ Object.defineProperty(exports, "bold", { enumerable: true, get: function () { return slack_1.bold; } });
13
+ Object.defineProperty(exports, "clampSlackText", { enumerable: true, get: function () { return slack_1.clampSlackText; } });
14
+ Object.defineProperty(exports, "code", { enumerable: true, get: function () { return slack_1.code; } });
15
+ Object.defineProperty(exports, "codeBlock", { enumerable: true, get: function () { return slack_1.codeBlock; } });
16
+ Object.defineProperty(exports, "createSlackAssetCollector", { enumerable: true, get: function () { return slack_1.createSlackAssetCollector; } });
17
+ Object.defineProperty(exports, "escapeMrkdwn", { enumerable: true, get: function () { return slack_1.escapeMrkdwn; } });
18
+ Object.defineProperty(exports, "isSlackReachableImageUrl", { enumerable: true, get: function () { return slack_1.isSlackReachableImageUrl; } });
19
+ Object.defineProperty(exports, "italic", { enumerable: true, get: function () { return slack_1.italic; } });
20
+ Object.defineProperty(exports, "link", { enumerable: true, get: function () { return slack_1.link; } });
21
+ Object.defineProperty(exports, "markdownContentToSlackBlocks", { enumerable: true, get: function () { return slack_1.markdownContentToSlackBlocks; } });
22
+ Object.defineProperty(exports, "renderSlackEnvelope", { enumerable: true, get: function () { return slack_1.renderSlackEnvelope; } });
23
+ Object.defineProperty(exports, "slackLinkUrl", { enumerable: true, get: function () { return slack_1.slackLinkUrl; } });
24
+ Object.defineProperty(exports, "strike", { enumerable: true, get: function () { return slack_1.strike; } });
25
+ //# sourceMappingURL=slack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack.js","sourceRoot":"","sources":["../../../src/entries/slack.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yCA4DyB;AAdvB,qGAAA,YAAY,OAAA;AACZ,6FAAA,IAAI,OAAA;AACJ,uGAAA,cAAc,OAAA;AACd,6FAAA,IAAI,OAAA;AACJ,kGAAA,SAAS,OAAA;AACT,kHAAA,yBAAyB,OAAA;AACzB,qGAAA,YAAY,OAAA;AACZ,iHAAA,wBAAwB,OAAA;AACxB,+FAAA,MAAM,OAAA;AACN,6FAAA,IAAI,OAAA;AACJ,qHAAA,4BAA4B,OAAA;AAC5B,4GAAA,mBAAmB,OAAA;AACnB,qGAAA,YAAY,OAAA;AACZ,+FAAA,MAAM,OAAA","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type SlackActionElement,\n type SlackActionsBlock,\n type SlackAssetCollector,\n type SlackAssetRequest,\n type SlackBlock,\n type SlackButtonElement,\n type SlackCheckboxesElement,\n type SlackContextBlock,\n type SlackDividerBlock,\n type SlackEnvelopeDispatcher,\n type SlackEnvelopeOptions,\n type SlackEnvelopeResult,\n type SlackFileReference,\n type SlackHeaderBlock,\n type SlackHeaderLevel,\n type SlackImageBlock,\n type SlackImageElement,\n type SlackMrkdwnTextObject,\n type SlackMultiStaticSelectElement,\n type SlackOptionGroup,\n type SlackOptionObject,\n type SlackOverflowElement,\n type SlackPlainTextObject,\n type SlackRadioButtonsElement,\n type SlackRawTextElement,\n type SlackRichTextBlock,\n type SlackRichTextBlockElement,\n type SlackRichTextInline,\n type SlackRichTextLink,\n type SlackRichTextList,\n type SlackRichTextPreformatted,\n type SlackRichTextQuote,\n type SlackRichTextSection,\n type SlackRichTextStyle,\n type SlackRichTextTag,\n type SlackRichTextText,\n type SlackSectionAccessory,\n type SlackSectionBlock,\n type SlackStaticSelectElement,\n type SlackTableBlock,\n type SlackTableCell,\n type SlackTableColumnSetting,\n type SlackTagColor,\n type SlackTextObject,\n type SlackVideoBlock,\n SLACK_LIMITS,\n bold,\n clampSlackText,\n code,\n codeBlock,\n createSlackAssetCollector,\n escapeMrkdwn,\n isSlackReachableImageUrl,\n italic,\n link,\n markdownContentToSlackBlocks,\n renderSlackEnvelope,\n slackLinkUrl,\n strike,\n} from '../render/slack';\n"]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.renderTextEnvelope = void 0;
10
+ var text_1 = require("../render/text");
11
+ Object.defineProperty(exports, "renderTextEnvelope", { enumerable: true, get: function () { return text_1.renderTextEnvelope; } });
12
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/entries/text.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAIwB;AADtB,0GAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type TextEnvelopeDispatcher,\n type TextEnvelopeOptions,\n renderTextEnvelope,\n} from '../render/text';\n"]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0; you may not use this file except in compliance with the Elastic License
6
+ * 2.0.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.describeCapabilities = void 0;
10
+ /** The one surface whose output is not itself a shippable format. */
11
+ const SNAPSHOT = 'snapshot';
12
+ /**
13
+ * Reports the primitive types, surfaces, and formats a set of packs supports.
14
+ *
15
+ * `surfaces` is passed rather than derived because only the caller knows which
16
+ * exist. Every surface but `snapshot` is also a format; `formats` adds the ones
17
+ * no surface produces on its own, so a `png` is reported only when a host
18
+ * registers the rasterizer that writes it.
19
+ */
20
+ const describeCapabilities = (packs, { surfaces, formats = [] }) => {
21
+ const enhancementIds = packs.flatMap((pack) => pack.enhancements.map((definition) => definition.id));
22
+ const definitions = packs.flatMap((pack) => pack.primitives);
23
+ return {
24
+ primitives: definitions.map(({ type }) => type),
25
+ surfaces: [...surfaces],
26
+ formats: [...new Set([...surfaces, ...formats])].filter((format) => format !== SNAPSHOT),
27
+ support: Object.fromEntries(definitions.map((definition) => [
28
+ definition.type,
29
+ Object.fromEntries(surfaces.map((surface) => [surface, supportOn(definition, surface)])),
30
+ ])),
31
+ ...(enhancementIds.length > 0
32
+ ? {
33
+ enhancements: Object.fromEntries(enhancementIds.map((id) => [id, true])),
34
+ }
35
+ : {}),
36
+ };
37
+ };
38
+ exports.describeCapabilities = describeCapabilities;
39
+ const supportOn = ({ renderers }, surface) => surface === 'slack' && renderers.slack === undefined ? 'fallback' : 'native';
40
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/pack/capabilities.ts"],"names":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CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CACvC;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,oBAAoB,wBA8B/B;AAEF,MAAM,SAAS,GAAG,CAChB,EAAE,SAAS,EAA0B,EACrC,OAAe,EACC,EAAE,CAClB,OAAO,KAAK,OAAO,IAAI,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\n// What a host can render, reported from packs rather than asserted by hand.\n//\n// Lives in the sdk so both the assembly layer and a pack import it from the\n// same place; a pack must not have to depend on the assembly layer for it.\n\nimport type { AnyPrimitiveDefinition } from '../define/primitive_module';\n\nimport type { AnyPrimitivePack } from './primitive_pack';\n\n/** `native` renders through the primitive's own renderer, `fallback` through another surface's (Slack via markdown). */\nexport type SurfaceSupport = 'native' | 'fallback';\n\n/**\n * What a runtime or a pack supports. Enhancement ids are open strings: each\n * pack declares its own on {@link PrimitivePack.enhancements}, and a runtime\n * reports the union.\n */\nexport interface HostCapabilities<TEnhancement extends string = string> {\n /** Primitive `type` values that can be dispatched. */\n primitives: string[];\n /** Surfaces that render, e.g. `html`, `slack`, `snapshot`. */\n surfaces: string[];\n /** Formats the host can ship, e.g. `html`, `slack`, `png`. Never `snapshot`, which only a rasterizer turns into a format. */\n formats: string[];\n /**\n * How each of `surfaces` renders each primitive, keyed by `type` then surface.\n * `slack` is `fallback` for a primitive with no `slack` renderer; every other\n * surface renders from `react`, `text`, or `markdown`, which are required.\n */\n support: Record<string, Record<string, SurfaceSupport>>;\n /** Progressive enhancements the packs declare, by id, which an HTML or React render may request. */\n enhancements?: Partial<Record<TEnhancement, boolean>>;\n}\n\n/** What {@link describeCapabilities} reports beyond the packs themselves. */\nexport interface CapabilitySources {\n /** The surfaces the caller built; `snapshot` exists only when a host supplied a frame. */\n surfaces: readonly string[];\n /** Formats produced outside the surfaces, such as a rasterizer's `png`. */\n formats?: readonly string[];\n}\n\n/** The one surface whose output is not itself a shippable format. */\nconst SNAPSHOT = 'snapshot';\n\n/**\n * Reports the primitive types, surfaces, and formats a set of packs supports.\n *\n * `surfaces` is passed rather than derived because only the caller knows which\n * exist. Every surface but `snapshot` is also a format; `formats` adds the ones\n * no surface produces on its own, so a `png` is reported only when a host\n * registers the rasterizer that writes it.\n */\nexport const describeCapabilities = (\n packs: readonly AnyPrimitivePack[],\n { surfaces, formats = [] }: CapabilitySources\n): HostCapabilities => {\n const enhancementIds = packs.flatMap((pack) =>\n pack.enhancements.map((definition) => definition.id)\n );\n const definitions = packs.flatMap((pack) => pack.primitives);\n return {\n primitives: definitions.map(({ type }) => type),\n surfaces: [...surfaces],\n formats: [...new Set([...surfaces, ...formats])].filter(\n (format) => format !== SNAPSHOT\n ),\n support: Object.fromEntries(\n definitions.map((definition) => [\n definition.type,\n Object.fromEntries(\n surfaces.map((surface) => [surface, supportOn(definition, surface)])\n ),\n ])\n ),\n ...(enhancementIds.length > 0\n ? {\n enhancements: Object.fromEntries(\n enhancementIds.map((id) => [id, true])\n ),\n }\n : {}),\n };\n};\n\nconst supportOn = (\n { renderers }: AnyPrimitiveDefinition,\n surface: string\n): SurfaceSupport =>\n surface === 'slack' && renderers.slack === undefined ? 'fallback' : 'native';\n"]}