@argusvane/datum-form-test 0.0.0-stage → 0.1.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 (552) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +26 -0
  3. package/README.md +52 -2
  4. package/bin/datum-form-test.mjs +11 -0
  5. package/dist/bundle-size.txt +3 -0
  6. package/dist/cli.mjs +3 -0
  7. package/dist/datum-form-test.LICENSE.txt +510 -0
  8. package/dist/index.mjs +68728 -0
  9. package/dist/types/engine/form-engine/agent/builder/agent-texts-en.d.ts +53 -0
  10. package/dist/types/engine/form-engine/builder/controller/builder-controller.d.ts +2534 -0
  11. package/dist/types/engine/form-engine/builder/controller/dependents.d.ts +122 -0
  12. package/dist/types/engine/form-engine/builder/controller/language-edits.d.ts +48 -0
  13. package/dist/types/engine/form-engine/builder/controller/simulated-options.d.ts +20 -0
  14. package/dist/types/engine/form-engine/builder/controller/translation-rules.d.ts +71 -0
  15. package/dist/types/engine/form-engine/builder/controller/try-submission.d.ts +45 -0
  16. package/dist/types/engine/form-engine/builder/data/data-loader.d.ts +6 -0
  17. package/dist/types/engine/form-engine/builder/data/data-model-import.d.ts +119 -0
  18. package/dist/types/engine/form-engine/builder/data/data-model-plan.d.ts +52 -0
  19. package/dist/types/engine/form-engine/builder/data/data-surface.d.ts +139 -0
  20. package/dist/types/engine/form-engine/builder/data/data-texts-en.d.ts +205 -0
  21. package/dist/types/engine/form-engine/builder/data/schema-rows.d.ts +56 -0
  22. package/dist/types/engine/form-engine/builder/data-model/compare.d.ts +37 -0
  23. package/dist/types/engine/form-engine/builder/data-model/data-model.d.ts +113 -0
  24. package/dist/types/engine/form-engine/builder/data-model/example.d.ts +6 -0
  25. package/dist/types/engine/form-engine/builder/data-model/from-form.d.ts +43 -0
  26. package/dist/types/engine/form-engine/builder/data-model/from-json-schema.d.ts +22 -0
  27. package/dist/types/engine/form-engine/builder/data-model/from-sample.d.ts +13 -0
  28. package/dist/types/engine/form-engine/builder/data-model/generate.d.ts +101 -0
  29. package/dist/types/engine/form-engine/builder/data-model/index.d.ts +10 -0
  30. package/dist/types/engine/form-engine/builder/data-model/mapping.d.ts +26 -0
  31. package/dist/types/engine/form-engine/builder/data-model/read-input.d.ts +39 -0
  32. package/dist/types/engine/form-engine/builder/data-model/to-json-schema.d.ts +10 -0
  33. package/dist/types/engine/form-engine/builder/definition-budget.d.ts +27 -0
  34. package/dist/types/engine/form-engine/builder/drag-drop/html5-drag-drop.d.ts +57 -0
  35. package/dist/types/engine/form-engine/builder/drag-drop/move-legality.d.ts +23 -0
  36. package/dist/types/engine/form-engine/builder/drag-drop/move-texts-en.d.ts +22 -0
  37. package/dist/types/engine/form-engine/builder/drag-drop/move-ui.d.ts +72 -0
  38. package/dist/types/engine/form-engine/builder/form-tests/tests-accept.d.ts +18 -0
  39. package/dist/types/engine/form-engine/builder/form-tests/tests-add-step.d.ts +51 -0
  40. package/dist/types/engine/form-engine/builder/form-tests/tests-completions.d.ts +66 -0
  41. package/dist/types/engine/form-engine/builder/form-tests/tests-coverage.d.ts +32 -0
  42. package/dist/types/engine/form-engine/builder/form-tests/tests-editor-loader.d.ts +10 -0
  43. package/dist/types/engine/form-engine/builder/form-tests/tests-editor-texts-en.d.ts +72 -0
  44. package/dist/types/engine/form-engine/builder/form-tests/tests-editor.d.ts +50 -0
  45. package/dist/types/engine/form-engine/builder/form-tests/tests-model.d.ts +422 -0
  46. package/dist/types/engine/form-engine/builder/form-tests/tests-panel-styles.d.ts +8 -0
  47. package/dist/types/engine/form-engine/builder/form-tests/tests-panel-texts-en.d.ts +174 -0
  48. package/dist/types/engine/form-engine/builder/form-tests/tests-record.d.ts +55 -0
  49. package/dist/types/engine/form-engine/builder/form-tests/tests-rename.d.ts +93 -0
  50. package/dist/types/engine/form-engine/builder/form-tests/tests-rules.d.ts +42 -0
  51. package/dist/types/engine/form-engine/builder/form-tests/tests-runner.d.ts +2 -0
  52. package/dist/types/engine/form-engine/builder/form-tests/tests-scaffold.d.ts +13 -0
  53. package/dist/types/engine/form-engine/builder/form-tests/tests-textarea.d.ts +88 -0
  54. package/dist/types/engine/form-engine/builder/form-tests/tests-texts-en.d.ts +222 -0
  55. package/dist/types/engine/form-engine/builder/form-tests/tests-words.d.ts +12 -0
  56. package/dist/types/engine/form-engine/builder/formula/feel-functions.d.ts +98 -0
  57. package/dist/types/engine/form-engine/builder/formula/feel-print.d.ts +47 -0
  58. package/dist/types/engine/form-engine/builder/formula/formula-editor-loader.d.ts +16 -0
  59. package/dist/types/engine/form-engine/builder/formula/formula-editor-styles.d.ts +19 -0
  60. package/dist/types/engine/form-engine/builder/formula/formula-editor.d.ts +104 -0
  61. package/dist/types/engine/form-engine/builder/formula/formula-fields.d.ts +44 -0
  62. package/dist/types/engine/form-engine/builder/formula/formula-textarea.d.ts +75 -0
  63. package/dist/types/engine/form-engine/builder/formula/formula-texts-en.d.ts +18 -0
  64. package/dist/types/engine/form-engine/builder/formula/rename.d.ts +98 -0
  65. package/dist/types/engine/form-engine/builder/history/command-history.d.ts +31 -0
  66. package/dist/types/engine/form-engine/builder/history/form-steps-on-page.d.ts +104 -0
  67. package/dist/types/engine/form-engine/builder/history/rename-step.d.ts +68 -0
  68. package/dist/types/engine/form-engine/builder/index.d.ts +48 -0
  69. package/dist/types/engine/form-engine/builder/journey-designer/journey-authoring-texts-en.d.ts +20 -0
  70. package/dist/types/engine/form-engine/builder/journey-designer/journey-authoring.d.ts +119 -0
  71. package/dist/types/engine/form-engine/builder/journey-designer/journey-builder-mode.d.ts +385 -0
  72. package/dist/types/engine/form-engine/builder/journey-designer/journey-catalog.d.ts +212 -0
  73. package/dist/types/engine/form-engine/builder/journey-designer/journey-checks.d.ts +175 -0
  74. package/dist/types/engine/form-engine/builder/journey-designer/journey-components.d.ts +183 -0
  75. package/dist/types/engine/form-engine/builder/journey-designer/journey-config-rename.d.ts +43 -0
  76. package/dist/types/engine/form-engine/builder/journey-designer/journey-designer-panels.d.ts +67 -0
  77. package/dist/types/engine/form-engine/builder/journey-designer/journey-designer.d.ts +296 -0
  78. package/dist/types/engine/form-engine/builder/journey-designer/journey-finding-words.d.ts +30 -0
  79. package/dist/types/engine/form-engine/builder/journey-designer/journey-findings.d.ts +74 -0
  80. package/dist/types/engine/form-engine/builder/journey-designer/journey-from-form.d.ts +89 -0
  81. package/dist/types/engine/form-engine/builder/journey-designer/journey-mode-loader.d.ts +19 -0
  82. package/dist/types/engine/form-engine/builder/journey-designer/journey-mode-model.d.ts +100 -0
  83. package/dist/types/engine/form-engine/builder/journey-designer/journey-preview-texts-en.d.ts +28 -0
  84. package/dist/types/engine/form-engine/builder/journey-designer/journey-preview.d.ts +163 -0
  85. package/dist/types/engine/form-engine/builder/journey-designer/journey-references.d.ts +104 -0
  86. package/dist/types/engine/form-engine/builder/journey-designer/journey-texts-en.d.ts +151 -0
  87. package/dist/types/engine/form-engine/builder/journey-designer/journey-texts.d.ts +51 -0
  88. package/dist/types/engine/form-engine/builder/journey-designer/journey-tree.d.ts +139 -0
  89. package/dist/types/engine/form-engine/builder/journey-designer/journey-try-map.d.ts +49 -0
  90. package/dist/types/engine/form-engine/builder/journey-designer/step-canvas-adapter.d.ts +253 -0
  91. package/dist/types/engine/form-engine/builder/journey-designer/step-history.d.ts +71 -0
  92. package/dist/types/engine/form-engine/builder/journey-designer/step-review.d.ts +79 -0
  93. package/dist/types/engine/form-engine/builder/journey-designer/step-view.d.ts +75 -0
  94. package/dist/types/engine/form-engine/builder/journey-map/journey-map-layout.d.ts +135 -0
  95. package/dist/types/engine/form-engine/builder/journey-map/journey-map-model.d.ts +346 -0
  96. package/dist/types/engine/form-engine/builder/journey-map/journey-map-preferences.d.ts +30 -0
  97. package/dist/types/engine/form-engine/builder/journey-map/journey-map-styles.d.ts +32 -0
  98. package/dist/types/engine/form-engine/builder/journey-map/journey-map-svg.d.ts +17 -0
  99. package/dist/types/engine/form-engine/builder/journey-map/journey-map-texts-en.d.ts +138 -0
  100. package/dist/types/engine/form-engine/builder/journey-map/journey-map.d.ts +138 -0
  101. package/dist/types/engine/form-engine/builder/languages/engine-texts.d.ts +19 -0
  102. package/dist/types/engine/form-engine/builder/languages/exchange.d.ts +199 -0
  103. package/dist/types/engine/form-engine/builder/languages/languages-cells.d.ts +106 -0
  104. package/dist/types/engine/form-engine/builder/languages/languages-exchange-dialog.d.ts +58 -0
  105. package/dist/types/engine/form-engine/builder/languages/languages-exchange-texts-en.d.ts +101 -0
  106. package/dist/types/engine/form-engine/builder/languages/languages-loader.d.ts +7 -0
  107. package/dist/types/engine/form-engine/builder/languages/languages-model.d.ts +180 -0
  108. package/dist/types/engine/form-engine/builder/languages/languages-surface.d.ts +418 -0
  109. package/dist/types/engine/form-engine/builder/languages/languages-texts-en.d.ts +174 -0
  110. package/dist/types/engine/form-engine/builder/logic/builder-texts.d.ts +1127 -0
  111. package/dist/types/engine/form-engine/builder/logic/coverage.d.ts +86 -0
  112. package/dist/types/engine/form-engine/builder/logic/index.d.ts +5 -0
  113. package/dist/types/engine/form-engine/builder/logic/logic-journey-host.d.ts +92 -0
  114. package/dist/types/engine/form-engine/builder/logic/logic-loader.d.ts +7 -0
  115. package/dist/types/engine/form-engine/builder/logic/logic-model.d.ts +158 -0
  116. package/dist/types/engine/form-engine/builder/logic/logic-surface.d.ts +359 -0
  117. package/dist/types/engine/form-engine/builder/logic/logic-texts-en.d.ts +216 -0
  118. package/dist/types/engine/form-engine/builder/logic/logic-types.d.ts +183 -0
  119. package/dist/types/engine/form-engine/builder/overview/overview-loader.d.ts +7 -0
  120. package/dist/types/engine/form-engine/builder/overview/overview-surface.d.ts +84 -0
  121. package/dist/types/engine/form-engine/builder/overview/overview-texts-en.d.ts +27 -0
  122. package/dist/types/engine/form-engine/builder/palette/command-palette.d.ts +46 -0
  123. package/dist/types/engine/form-engine/builder/palette/palette-filter.d.ts +37 -0
  124. package/dist/types/engine/form-engine/builder/palette/palette-loader.d.ts +6 -0
  125. package/dist/types/engine/form-engine/builder/palette/palette-texts-en.d.ts +18 -0
  126. package/dist/types/engine/form-engine/builder/pdf-designer/layout-bindings.d.ts +13 -0
  127. package/dist/types/engine/form-engine/builder/pdf-designer/layout-catalog.d.ts +108 -0
  128. package/dist/types/engine/form-engine/builder/pdf-designer/layout-conditions.d.ts +172 -0
  129. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-builder-mode.d.ts +406 -0
  130. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-canvas-adapters.d.ts +55 -0
  131. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer-chunk.d.ts +13 -0
  132. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer-loader.d.ts +10 -0
  133. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer-panels.d.ts +89 -0
  134. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-designer.d.ts +95 -0
  135. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-layout-texts.d.ts +86 -0
  136. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-mode-loader.d.ts +17 -0
  137. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-mode-model.d.ts +88 -0
  138. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-panel-styles.d.ts +1 -0
  139. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-template-designer.d.ts +139 -0
  140. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-template-source.d.ts +22 -0
  141. package/dist/types/engine/form-engine/builder/pdf-designer/pdf-texts-en.d.ts +405 -0
  142. package/dist/types/engine/form-engine/builder/pdf-designer/template-mode.d.ts +186 -0
  143. package/dist/types/engine/form-engine/builder/pdf-designer/template-pages.d.ts +57 -0
  144. package/dist/types/engine/form-engine/builder/popover-place.d.ts +14 -0
  145. package/dist/types/engine/form-engine/builder/preview/builder-preview-runtime.d.ts +284 -0
  146. package/dist/types/engine/form-engine/builder/print/print-breaks.d.ts +46 -0
  147. package/dist/types/engine/form-engine/builder/print/print-loader.d.ts +6 -0
  148. package/dist/types/engine/form-engine/builder/print/print-preview.d.ts +121 -0
  149. package/dist/types/engine/form-engine/builder/print/print-samples.d.ts +43 -0
  150. package/dist/types/engine/form-engine/builder/print/print-settings-model.d.ts +138 -0
  151. package/dist/types/engine/form-engine/builder/print/print-styles.d.ts +1 -0
  152. package/dist/types/engine/form-engine/builder/print/print-surface.d.ts +284 -0
  153. package/dist/types/engine/form-engine/builder/print/print-texts-en.d.ts +104 -0
  154. package/dist/types/engine/form-engine/builder/property-editor/component-editor-context.d.ts +8 -0
  155. package/dist/types/engine/form-engine/builder/property-editor/component-json.d.ts +83 -0
  156. package/dist/types/engine/form-engine/builder/property-editor/condition-words.d.ts +26 -0
  157. package/dist/types/engine/form-engine/builder/property-editor/css-classes.d.ts +84 -0
  158. package/dist/types/engine/form-engine/builder/property-editor/editor-composer.d.ts +9 -0
  159. package/dist/types/engine/form-engine/builder/property-editor/inspector-model.d.ts +376 -0
  160. package/dist/types/engine/form-engine/builder/property-editor/rule-source.d.ts +8 -0
  161. package/dist/types/engine/form-engine/builder/property-editor/rules-model.d.ts +179 -0
  162. package/dist/types/engine/form-engine/builder/tree-editor/nested-tree-view.d.ts +43 -0
  163. package/dist/types/engine/form-engine/builder/tree-editor/slot-constraints.d.ts +17 -0
  164. package/dist/types/engine/form-engine/builder/tree-editor/tree-editor.d.ts +185 -0
  165. package/dist/types/engine/form-engine/builder/web-component/assistants-settings.d.ts +43 -0
  166. package/dist/types/engine/form-engine/builder/web-component/builder-chrome-panel.d.ts +179 -0
  167. package/dist/types/engine/form-engine/builder/web-component/builder-features.d.ts +97 -0
  168. package/dist/types/engine/form-engine/builder/web-component/builder-form-fields-panel.d.ts +42 -0
  169. package/dist/types/engine/form-engine/builder/web-component/builder-modes.d.ts +704 -0
  170. package/dist/types/engine/form-engine/builder/web-component/builder-outline.d.ts +24 -0
  171. package/dist/types/engine/form-engine/builder/web-component/builder-panels.d.ts +1872 -0
  172. package/dist/types/engine/form-engine/builder/web-component/builder-shared.d.ts +917 -0
  173. package/dist/types/engine/form-engine/builder/web-component/builder-tests-panel.d.ts +454 -0
  174. package/dist/types/engine/form-engine/builder/web-component/builder-theme-registry.d.ts +36 -0
  175. package/dist/types/engine/form-engine/builder/web-component/builder-variables-panel.d.ts +158 -0
  176. package/dist/types/engine/form-engine/builder/web-component/canvas-hooks.d.ts +53 -0
  177. package/dist/types/engine/form-engine/builder/web-component/chrome-panel-loader.d.ts +17 -0
  178. package/dist/types/engine/form-engine/builder/web-component/default-builder-element.d.ts +2012 -0
  179. package/dist/types/engine/form-engine/builder/web-component/definition-size.d.ts +12 -0
  180. package/dist/types/engine/form-engine/builder/web-component/dialog-frame.d.ts +36 -0
  181. package/dist/types/engine/form-engine/builder/web-component/formula-settings.d.ts +31 -0
  182. package/dist/types/engine/form-engine/builder/web-component/host-control-styles.d.ts +38 -0
  183. package/dist/types/engine/form-engine/builder/web-component/json-viewer-loader.d.ts +18 -0
  184. package/dist/types/engine/form-engine/builder/web-component/json-viewer.d.ts +38 -0
  185. package/dist/types/engine/form-engine/builder/web-component/modal-place.d.ts +55 -0
  186. package/dist/types/engine/form-engine/builder/web-component/palette-glyphs.d.ts +14 -0
  187. package/dist/types/engine/form-engine/builder/web-component/panel-memory.d.ts +68 -0
  188. package/dist/types/engine/form-engine/builder/web-component/phone-menu.d.ts +67 -0
  189. package/dist/types/engine/form-engine/builder/web-component/phone-styles.d.ts +30 -0
  190. package/dist/types/engine/form-engine/builder/web-component/remote-images.d.ts +25 -0
  191. package/dist/types/engine/form-engine/builder/web-component/sheet-gestures.d.ts +59 -0
  192. package/dist/types/engine/form-engine/builder/web-component/starter-submit.d.ts +14 -0
  193. package/dist/types/engine/form-engine/builder/web-component/studio-dark-theme.d.ts +22 -0
  194. package/dist/types/engine/form-engine/builder/web-component/studio-tokens.d.ts +46 -0
  195. package/dist/types/engine/form-engine/builder/web-component/surface-sheet.d.ts +31 -0
  196. package/dist/types/engine/form-engine/builder/web-component/tests-panel-loader.d.ts +17 -0
  197. package/dist/types/engine/form-engine/builder/web-component/toolbar-roving.d.ts +21 -0
  198. package/dist/types/engine/form-engine/builder/web-component/try-it-types.d.ts +262 -0
  199. package/dist/types/engine/form-engine/builder/web-component/try-it.d.ts +85 -0
  200. package/dist/types/engine/form-engine/builder/web-component/try-texts-en.d.ts +64 -0
  201. package/dist/types/engine/form-engine/builder/web-component/variables-panel-loader.d.ts +17 -0
  202. package/dist/types/engine/form-engine/core/accessibility/accessibility-semantics.d.ts +51 -0
  203. package/dist/types/engine/form-engine/core/accessibility/keyboard-navigation.d.ts +8 -0
  204. package/dist/types/engine/form-engine/core/crypto/sha256.d.ts +18 -0
  205. package/dist/types/engine/form-engine/core/errors/error-navigation.d.ts +14 -0
  206. package/dist/types/engine/form-engine/core/errors/form-error.d.ts +32 -0
  207. package/dist/types/engine/form-engine/core/events/event-bus.d.ts +18 -0
  208. package/dist/types/engine/form-engine/core/events/event-types.d.ts +236 -0
  209. package/dist/types/engine/form-engine/core/events/hooks.d.ts +107 -0
  210. package/dist/types/engine/form-engine/core/expressions/compile.d.ts +565 -0
  211. package/dist/types/engine/form-engine/core/expressions/condition-shape.d.ts +11 -0
  212. package/dist/types/engine/form-engine/core/expressions/definition-structure.d.ts +329 -0
  213. package/dist/types/engine/form-engine/core/expressions/expression.d.ts +102 -0
  214. package/dist/types/engine/form-engine/core/expressions/formula-types.d.ts +114 -0
  215. package/dist/types/engine/form-engine/core/expressions/formula.d.ts +150 -0
  216. package/dist/types/engine/form-engine/core/expressions/function-docs.d.ts +13 -0
  217. package/dist/types/engine/form-engine/core/expressions/function-table.d.ts +396 -0
  218. package/dist/types/engine/form-engine/core/expressions/inspect.d.ts +292 -0
  219. package/dist/types/engine/form-engine/core/form-tests/form-test-lint.d.ts +28 -0
  220. package/dist/types/engine/form-engine/core/form-tests/form-test-parse.d.ts +200 -0
  221. package/dist/types/engine/form-engine/core/form-tests/form-test-read.d.ts +11 -0
  222. package/dist/types/engine/form-engine/core/form-tests/form-test-run.d.ts +58 -0
  223. package/dist/types/engine/form-engine/core/form-tests/form-test-types.d.ts +413 -0
  224. package/dist/types/engine/form-engine/core/form-tests/index.d.ts +7 -0
  225. package/dist/types/engine/form-engine/core/index.d.ts +75 -0
  226. package/dist/types/engine/form-engine/core/journey/journey-diagnostics.d.ts +249 -0
  227. package/dist/types/engine/form-engine/core/journey/journey-flow.d.ts +77 -0
  228. package/dist/types/engine/form-engine/core/journey/journey-path.d.ts +213 -0
  229. package/dist/types/engine/form-engine/core/journey/journey-server-check.d.ts +66 -0
  230. package/dist/types/engine/form-engine/core/journey/journey-shared.d.ts +39 -0
  231. package/dist/types/engine/form-engine/core/journey/journey-types.d.ts +246 -0
  232. package/dist/types/engine/form-engine/core/journey/presentation.d.ts +163 -0
  233. package/dist/types/engine/form-engine/core/journey/worked-out-text.d.ts +10 -0
  234. package/dist/types/engine/form-engine/core/localization/form-texts.d.ts +283 -0
  235. package/dist/types/engine/form-engine/core/localization/locale-documents.d.ts +74 -0
  236. package/dist/types/engine/form-engine/core/localization/localized-text.d.ts +21 -0
  237. package/dist/types/engine/form-engine/core/localization/supported-locales.d.ts +49 -0
  238. package/dist/types/engine/form-engine/core/localization/translations.d.ts +312 -0
  239. package/dist/types/engine/form-engine/core/localization/validation-messages.d.ts +120 -0
  240. package/dist/types/engine/form-engine/core/schema/agent-tools-setting.d.ts +5 -0
  241. package/dist/types/engine/form-engine/core/schema/answer-kinds.d.ts +92 -0
  242. package/dist/types/engine/form-engine/core/schema/button-group.d.ts +24 -0
  243. package/dist/types/engine/form-engine/core/schema/button.d.ts +75 -0
  244. package/dist/types/engine/form-engine/core/schema/collection.d.ts +29 -0
  245. package/dist/types/engine/form-engine/core/schema/component-classes.d.ts +26 -0
  246. package/dist/types/engine/form-engine/core/schema/component-kinds.d.ts +76 -0
  247. package/dist/types/engine/form-engine/core/schema/contracts.d.ts +614 -0
  248. package/dist/types/engine/form-engine/core/schema/control-hints.d.ts +45 -0
  249. package/dist/types/engine/form-engine/core/schema/data-grid.d.ts +138 -0
  250. package/dist/types/engine/form-engine/core/schema/data-source-capability.d.ts +20 -0
  251. package/dist/types/engine/form-engine/core/schema/file-upload.d.ts +114 -0
  252. package/dist/types/engine/form-engine/core/schema/form-chrome.d.ts +301 -0
  253. package/dist/types/engine/form-engine/core/schema/grid.d.ts +88 -0
  254. package/dist/types/engine/form-engine/core/schema/image.d.ts +19 -0
  255. package/dist/types/engine/form-engine/core/schema/inline-options.d.ts +69 -0
  256. package/dist/types/engine/form-engine/core/schema/journey.d.ts +336 -0
  257. package/dist/types/engine/form-engine/core/schema/legend-mark.d.ts +10 -0
  258. package/dist/types/engine/form-engine/core/schema/length-limits.d.ts +33 -0
  259. package/dist/types/engine/form-engine/core/schema/pattern-validity.d.ts +2 -0
  260. package/dist/types/engine/form-engine/core/schema/pdf-layout-read.d.ts +508 -0
  261. package/dist/types/engine/form-engine/core/schema/pdf-layout-table.d.ts +25 -0
  262. package/dist/types/engine/form-engine/core/schema/pdf-layout.d.ts +224 -0
  263. package/dist/types/engine/form-engine/core/schema/pdf-renditions.d.ts +46 -0
  264. package/dist/types/engine/form-engine/core/schema/pdf-signature-configuration.d.ts +6 -0
  265. package/dist/types/engine/form-engine/core/schema/print.d.ts +76 -0
  266. package/dist/types/engine/form-engine/core/schema/signature.d.ts +13 -0
  267. package/dist/types/engine/form-engine/core/schema/static-html.d.ts +44 -0
  268. package/dist/types/engine/form-engine/core/schema/steps.d.ts +28 -0
  269. package/dist/types/engine/form-engine/core/schema/types.d.ts +186 -0
  270. package/dist/types/engine/form-engine/core/schema/validate-on-setting.d.ts +16 -0
  271. package/dist/types/engine/form-engine/core/state/answer-shape.d.ts +28 -0
  272. package/dist/types/engine/form-engine/core/state/effective-state.d.ts +42 -0
  273. package/dist/types/engine/form-engine/core/state/form-state.d.ts +160 -0
  274. package/dist/types/engine/form-engine/core/state/hidden-value-policy.d.ts +34 -0
  275. package/dist/types/engine/form-engine/core/state/host-context.d.ts +24 -0
  276. package/dist/types/engine/form-engine/core/state/semantic-state.d.ts +19 -0
  277. package/dist/types/engine/form-engine/core/state/submittable-fold.d.ts +460 -0
  278. package/dist/types/engine/form-engine/core/submission/canonical-submission.d.ts +62 -0
  279. package/dist/types/engine/form-engine/core/submission/envelope-completeness.d.ts +20 -0
  280. package/dist/types/engine/form-engine/core/submission/form-notice.d.ts +43 -0
  281. package/dist/types/engine/form-engine/core/submission/jcs.d.ts +20 -0
  282. package/dist/types/engine/form-engine/core/submission/signing.d.ts +110 -0
  283. package/dist/types/engine/form-engine/core/submission/submission-file.d.ts +34 -0
  284. package/dist/types/engine/form-engine/core/submission/submission-handler.d.ts +25 -0
  285. package/dist/types/engine/form-engine/core/submission/submission-modes.d.ts +11 -0
  286. package/dist/types/engine/form-engine/core/submission/webauthn-assertion.d.ts +41 -0
  287. package/dist/types/engine/form-engine/core/text/placeholders.d.ts +20 -0
  288. package/dist/types/engine/form-engine/core/text/spreadsheet-cell.d.ts +14 -0
  289. package/dist/types/engine/form-engine/core/tree/component-id.d.ts +14 -0
  290. package/dist/types/engine/form-engine/core/tree/component-path.d.ts +6 -0
  291. package/dist/types/engine/form-engine/core/tree/component-tree.d.ts +60 -0
  292. package/dist/types/engine/form-engine/core/tree/data-scope.d.ts +151 -0
  293. package/dist/types/engine/form-engine/core/tree/nesting.d.ts +10 -0
  294. package/dist/types/engine/form-engine/core/tree/prototype-names.d.ts +6 -0
  295. package/dist/types/engine/form-engine/data/client/client-data-source-runtime.d.ts +7 -0
  296. package/dist/types/engine/form-engine/data/client/registered-client-data-source-runtime.d.ts +6 -0
  297. package/dist/types/engine/form-engine/data/host/data-source-set.d.ts +46 -0
  298. package/dist/types/engine/form-engine/data/index.d.ts +9 -0
  299. package/dist/types/engine/form-engine/data/providers/data-source-provider-registry.d.ts +11 -0
  300. package/dist/types/engine/form-engine/data/providers/registered-data-source-runtime.d.ts +10 -0
  301. package/dist/types/engine/form-engine/data/providers/remote-data-source-provider.d.ts +30 -0
  302. package/dist/types/engine/form-engine/data/providers/static-data-source-provider.d.ts +20 -0
  303. package/dist/types/engine/form-engine/data/server/registered-server-data-source-runtime.d.ts +6 -0
  304. package/dist/types/engine/form-engine/data/server/server-data-source-runtime.d.ts +7 -0
  305. package/dist/types/engine/form-engine/index.d.ts +29 -0
  306. package/dist/types/engine/form-engine/persistence/core/draft-compatibility.d.ts +22 -0
  307. package/dist/types/engine/form-engine/persistence/core/draft-store.d.ts +96 -0
  308. package/dist/types/engine/form-engine/persistence/file-draft/draft-file.d.ts +3 -0
  309. package/dist/types/engine/form-engine/persistence/index.d.ts +7 -0
  310. package/dist/types/engine/form-engine/persistence/indexeddb/indexeddb-draft-store.d.ts +15 -0
  311. package/dist/types/engine/form-engine/persistence/local-storage/browser-local-draft-store.d.ts +22 -0
  312. package/dist/types/engine/form-engine/persistence/local-storage/in-memory-draft-store.d.ts +8 -0
  313. package/dist/types/engine/form-engine/persistence/server/server-draft-store.d.ts +15 -0
  314. package/dist/types/engine/form-engine/plugins/component-adapters.d.ts +66 -0
  315. package/dist/types/engine/form-engine/plugins/index.d.ts +4 -0
  316. package/dist/types/engine/form-engine/plugins/lifecycle/plugin-lifecycle.d.ts +11 -0
  317. package/dist/types/engine/form-engine/plugins/manifest/load-plugin-manifest.d.ts +23 -0
  318. package/dist/types/engine/form-engine/plugins/platform/plugin-platform.d.ts +81 -0
  319. package/dist/types/engine/form-engine/registry/capabilities/drawing-capabilities.d.ts +52 -0
  320. package/dist/types/engine/form-engine/registry/capabilities/field-capabilities.d.ts +205 -0
  321. package/dist/types/engine/form-engine/registry/components/component-registry.d.ts +9 -0
  322. package/dist/types/engine/form-engine/registry/data-sources/data-source-registry.d.ts +9 -0
  323. package/dist/types/engine/form-engine/registry/engine-component-types.d.ts +20 -0
  324. package/dist/types/engine/form-engine/registry/engine-version.d.ts +5 -0
  325. package/dist/types/engine/form-engine/registry/formula-functions/formula-function-registry.d.ts +33 -0
  326. package/dist/types/engine/form-engine/registry/index.d.ts +13 -0
  327. package/dist/types/engine/form-engine/registry/kinds.d.ts +83 -0
  328. package/dist/types/engine/form-engine/registry/pdf/pdf-rendition-registry.d.ts +15 -0
  329. package/dist/types/engine/form-engine/registry/plugins/plugin-registry.d.ts +14 -0
  330. package/dist/types/engine/form-engine/registry/submission/submission-handler-registry.d.ts +7 -0
  331. package/dist/types/engine/form-engine/registry/validators/validator-registry.d.ts +6 -0
  332. package/dist/types/engine/form-engine/registry/version-range.d.ts +15 -0
  333. package/dist/types/engine/form-engine/registry/versioned-theme-registry.d.ts +30 -0
  334. package/dist/types/engine/form-engine/registry/versioning.d.ts +5 -0
  335. package/dist/types/engine/form-engine/render/core/component-model.d.ts +292 -0
  336. package/dist/types/engine/form-engine/render/core/component-options.d.ts +58 -0
  337. package/dist/types/engine/form-engine/render/core/css-rules.d.ts +68 -0
  338. package/dist/types/engine/form-engine/render/core/error-accessibility.d.ts +23 -0
  339. package/dist/types/engine/form-engine/render/core/error-summary.d.ts +62 -0
  340. package/dist/types/engine/form-engine/render/core/error-wording.d.ts +104 -0
  341. package/dist/types/engine/form-engine/render/core/escape-html.d.ts +2 -0
  342. package/dist/types/engine/form-engine/render/core/file-storage.d.ts +59 -0
  343. package/dist/types/engine/form-engine/render/core/host-data-sources.d.ts +44 -0
  344. package/dist/types/engine/form-engine/render/core/journey-render-kit-default.d.ts +5 -0
  345. package/dist/types/engine/form-engine/render/core/journey-render-kit-eager.d.ts +10 -0
  346. package/dist/types/engine/form-engine/render/core/journey-render-kit-factory.d.ts +13 -0
  347. package/dist/types/engine/form-engine/render/core/journey-render-kit.d.ts +61 -0
  348. package/dist/types/engine/form-engine/render/core/journey-render.d.ts +132 -0
  349. package/dist/types/engine/form-engine/render/core/journey-review-kit-eager.d.ts +9 -0
  350. package/dist/types/engine/form-engine/render/core/journey-review-kit.d.ts +33 -0
  351. package/dist/types/engine/form-engine/render/core/journey-review.d.ts +134 -0
  352. package/dist/types/engine/form-engine/render/core/presentation-tree.d.ts +374 -0
  353. package/dist/types/engine/form-engine/render/core/print-options.d.ts +89 -0
  354. package/dist/types/engine/form-engine/render/core/render-contracts.d.ts +7 -0
  355. package/dist/types/engine/form-engine/render/core/render-orchestrator.d.ts +139 -0
  356. package/dist/types/engine/form-engine/render/core/render-policy.d.ts +52 -0
  357. package/dist/types/engine/form-engine/render/core/runtime-render-bridge.d.ts +154 -0
  358. package/dist/types/engine/form-engine/render/core/scalar-text.d.ts +10 -0
  359. package/dist/types/engine/form-engine/render/core/tab-slots.d.ts +25 -0
  360. package/dist/types/engine/form-engine/render/core/token-style-vars.d.ts +45 -0
  361. package/dist/types/engine/form-engine/render/icons/builtin-icons.d.ts +24 -0
  362. package/dist/types/engine/form-engine/render/icons/icon-names.d.ts +67 -0
  363. package/dist/types/engine/form-engine/render/icons/icon-set.d.ts +102 -0
  364. package/dist/types/engine/form-engine/render/index.d.ts +68 -0
  365. package/dist/types/engine/form-engine/render/live/announcer.d.ts +10 -0
  366. package/dist/types/engine/form-engine/render/live/assets-feature.d.ts +12 -0
  367. package/dist/types/engine/form-engine/render/live/assets-policy.d.ts +6 -0
  368. package/dist/types/engine/form-engine/render/live/assets.d.ts +109 -0
  369. package/dist/types/engine/form-engine/render/live/binding-registry.d.ts +46 -0
  370. package/dist/types/engine/form-engine/render/live/buttons.d.ts +12 -0
  371. package/dist/types/engine/form-engine/render/live/chrome.d.ts +15 -0
  372. package/dist/types/engine/form-engine/render/live/component-text.d.ts +10 -0
  373. package/dist/types/engine/form-engine/render/live/contract.d.ts +1267 -0
  374. package/dist/types/engine/form-engine/render/live/data-grid.d.ts +51 -0
  375. package/dist/types/engine/form-engine/render/live/datum/buttons.d.ts +44 -0
  376. package/dist/types/engine/form-engine/render/live/datum/choice-fields.d.ts +8 -0
  377. package/dist/types/engine/form-engine/render/live/datum/chrome-files.d.ts +43 -0
  378. package/dist/types/engine/form-engine/render/live/datum/chrome.d.ts +49 -0
  379. package/dist/types/engine/form-engine/render/live/datum/container-kit.d.ts +66 -0
  380. package/dist/types/engine/form-engine/render/live/datum/containers.d.ts +25 -0
  381. package/dist/types/engine/form-engine/render/live/datum/content.d.ts +5 -0
  382. package/dist/types/engine/form-engine/render/live/datum/css.d.ts +40 -0
  383. package/dist/types/engine/form-engine/render/live/datum/date.d.ts +66 -0
  384. package/dist/types/engine/form-engine/render/live/datum/default-tokens.d.ts +30 -0
  385. package/dist/types/engine/form-engine/render/live/datum/field-scaffold.d.ts +131 -0
  386. package/dist/types/engine/form-engine/render/live/datum/file.d.ts +6 -0
  387. package/dist/types/engine/form-engine/render/live/datum/frames.d.ts +33 -0
  388. package/dist/types/engine/form-engine/render/live/datum/grid.d.ts +26 -0
  389. package/dist/types/engine/form-engine/render/live/datum/groups.d.ts +45 -0
  390. package/dist/types/engine/form-engine/render/live/datum/icons.d.ts +18 -0
  391. package/dist/types/engine/form-engine/render/live/datum/leaf-kit.d.ts +17 -0
  392. package/dist/types/engine/form-engine/render/live/datum/month-names.d.ts +2 -0
  393. package/dist/types/engine/form-engine/render/live/datum/notice.d.ts +25 -0
  394. package/dist/types/engine/form-engine/render/live/datum/options.d.ts +133 -0
  395. package/dist/types/engine/form-engine/render/live/datum/page.d.ts +13 -0
  396. package/dist/types/engine/form-engine/render/live/datum/parts.d.ts +120 -0
  397. package/dist/types/engine/form-engine/render/live/datum/signature.d.ts +25 -0
  398. package/dist/types/engine/form-engine/render/live/datum/steps.d.ts +30 -0
  399. package/dist/types/engine/form-engine/render/live/datum/summary.d.ts +26 -0
  400. package/dist/types/engine/form-engine/render/live/datum/tabs.d.ts +23 -0
  401. package/dist/types/engine/form-engine/render/live/datum/text-fields.d.ts +7 -0
  402. package/dist/types/engine/form-engine/render/live/datum/tokens.d.ts +1030 -0
  403. package/dist/types/engine/form-engine/render/live/error-target.d.ts +12 -0
  404. package/dist/types/engine/form-engine/render/live/field-preview.d.ts +22 -0
  405. package/dist/types/engine/form-engine/render/live/fields.d.ts +26 -0
  406. package/dist/types/engine/form-engine/render/live/files.d.ts +20 -0
  407. package/dist/types/engine/form-engine/render/live/form-notices.d.ts +17 -0
  408. package/dist/types/engine/form-engine/render/live/guards.d.ts +37 -0
  409. package/dist/types/engine/form-engine/render/live/journey-page.d.ts +45 -0
  410. package/dist/types/engine/form-engine/render/live/journey-review.d.ts +50 -0
  411. package/dist/types/engine/form-engine/render/live/lit.d.ts +48 -0
  412. package/dist/types/engine/form-engine/render/live/look-classes.d.ts +27 -0
  413. package/dist/types/engine/form-engine/render/live/media-labels.d.ts +16 -0
  414. package/dist/types/engine/form-engine/render/live/mount.d.ts +450 -0
  415. package/dist/types/engine/form-engine/render/live/notices.d.ts +3 -0
  416. package/dist/types/engine/form-engine/render/live/readonly-sizing.d.ts +14 -0
  417. package/dist/types/engine/form-engine/render/live/renderer.d.ts +12 -0
  418. package/dist/types/engine/form-engine/render/live/sources.d.ts +4 -0
  419. package/dist/types/engine/form-engine/render/live/steps.d.ts +6 -0
  420. package/dist/types/engine/form-engine/render/live/summary.d.ts +33 -0
  421. package/dist/types/engine/form-engine/render/live/tabs.d.ts +8 -0
  422. package/dist/types/engine/form-engine/render/live/tooltips.d.ts +30 -0
  423. package/dist/types/engine/form-engine/render/pdf/default-layout.d.ts +51 -0
  424. package/dist/types/engine/form-engine/render/pdf/pdf-abi.d.ts +819 -0
  425. package/dist/types/engine/form-engine/render/pdf/pdf-agent-signer.d.ts +92 -0
  426. package/dist/types/engine/form-engine/render/pdf/pdf-attachments.d.ts +76 -0
  427. package/dist/types/engine/form-engine/render/pdf/pdf-components.d.ts +282 -0
  428. package/dist/types/engine/form-engine/render/pdf/pdf-designer-styles.d.ts +12 -0
  429. package/dist/types/engine/form-engine/render/pdf/pdf-document.d.ts +412 -0
  430. package/dist/types/engine/form-engine/render/pdf/pdf-layout-selection.d.ts +54 -0
  431. package/dist/types/engine/form-engine/render/pdf/pdf-pages.d.ts +25 -0
  432. package/dist/types/engine/form-engine/render/pdf/pdf-provider.d.ts +219 -0
  433. package/dist/types/engine/form-engine/render/pdf/pdf-render-mode.d.ts +2 -0
  434. package/dist/types/engine/form-engine/render/pdf/pdf-render-model.d.ts +124 -0
  435. package/dist/types/engine/form-engine/render/pdf/pdf-renditions.d.ts +160 -0
  436. package/dist/types/engine/form-engine/render/pdf/pdf-service.d.ts +161 -0
  437. package/dist/types/engine/form-engine/render/pdf/pdf-signer.d.ts +26 -0
  438. package/dist/types/engine/form-engine/render/pdf/pdf-template-components.d.ts +168 -0
  439. package/dist/types/engine/form-engine/render/pdf/pdf-template-constants.d.ts +14 -0
  440. package/dist/types/engine/form-engine/render/pdf/pdf-template.d.ts +84 -0
  441. package/dist/types/engine/form-engine/render/pdf/pdf-text-addresses.d.ts +20 -0
  442. package/dist/types/engine/form-engine/render/pdf/pdf-theme-defaults.d.ts +410 -0
  443. package/dist/types/engine/form-engine/render/pdf/pdf-theme-registry.d.ts +25 -0
  444. package/dist/types/engine/form-engine/render/pdf/pdf-theme.d.ts +91 -0
  445. package/dist/types/engine/form-engine/render/pdf/pdf-values.d.ts +47 -0
  446. package/dist/types/engine/form-engine/render/pdf/standard-renditions.d.ts +33 -0
  447. package/dist/types/engine/form-engine/render/pdf/template-text.d.ts +52 -0
  448. package/dist/types/engine/form-engine/render/print/answer-text.d.ts +3 -0
  449. package/dist/types/engine/form-engine/render/print/basic.d.ts +18 -0
  450. package/dist/types/engine/form-engine/render/print/datum.d.ts +2 -0
  451. package/dist/types/engine/form-engine/render/print/document.d.ts +65 -0
  452. package/dist/types/engine/form-engine/render/print/field-answer.d.ts +47 -0
  453. package/dist/types/engine/form-engine/render/print/index.d.ts +12 -0
  454. package/dist/types/engine/form-engine/render/print/model.d.ts +346 -0
  455. package/dist/types/engine/form-engine/render/print/safe-html.d.ts +41 -0
  456. package/dist/types/engine/form-engine/render/print/slot-text.d.ts +30 -0
  457. package/dist/types/engine/form-engine/render/print/theme.d.ts +86 -0
  458. package/dist/types/engine/form-engine/render/react/interactive-renderer.d.ts +9 -0
  459. package/dist/types/engine/form-engine/render/readonly/readonly-renderer.d.ts +12 -0
  460. package/dist/types/engine/form-engine/render/web-component/custom-element-base.d.ts +3 -0
  461. package/dist/types/engine/form-engine/render/web-component/form-features.d.ts +76 -0
  462. package/dist/types/engine/form-engine/render/web-component/form-host-element.d.ts +310 -0
  463. package/dist/types/engine/form-engine/render/web-component/form-renderer-element.d.ts +846 -0
  464. package/dist/types/engine/form-engine/render/web-component/locale-select-element.d.ts +24 -0
  465. package/dist/types/engine/form-engine/render/web-component/pdf-download.d.ts +75 -0
  466. package/dist/types/engine/form-engine/render/web-component/print-frame.d.ts +85 -0
  467. package/dist/types/engine/form-engine/render/web-component/print-pipeline.d.ts +11 -0
  468. package/dist/types/engine/form-engine/render/web-component/print-policy.d.ts +2 -0
  469. package/dist/types/engine/form-engine/render/web-component/submission-download.d.ts +47 -0
  470. package/dist/types/engine/form-engine/render/web-component/typed-answers.d.ts +26 -0
  471. package/dist/types/engine/form-engine/render/webauthn/assertion.d.ts +69 -0
  472. package/dist/types/engine/form-engine/render/webauthn/authenticator-data.d.ts +21 -0
  473. package/dist/types/engine/form-engine/render/webauthn/errors.d.ts +30 -0
  474. package/dist/types/engine/form-engine/render/webauthn/registration-verify.d.ts +44 -0
  475. package/dist/types/engine/form-engine/render/webauthn/registration.d.ts +77 -0
  476. package/dist/types/engine/form-engine/render/webauthn/signal.d.ts +27 -0
  477. package/dist/types/engine/form-engine/render/webauthn/signing-provider.d.ts +70 -0
  478. package/dist/types/engine/form-engine/rules/dependencies/calculation-cycle.d.ts +25 -0
  479. package/dist/types/engine/form-engine/rules/dependencies/dependency-extractor.d.ts +9 -0
  480. package/dist/types/engine/form-engine/rules/dependencies/dependency-graph.d.ts +26 -0
  481. package/dist/types/engine/form-engine/rules/evaluator/evaluator.d.ts +209 -0
  482. package/dist/types/engine/form-engine/rules/evaluator/functions-date.d.ts +26 -0
  483. package/dist/types/engine/form-engine/rules/evaluator/functions-list.d.ts +28 -0
  484. package/dist/types/engine/form-engine/rules/evaluator/functions-number.d.ts +6 -0
  485. package/dist/types/engine/form-engine/rules/evaluator/functions-text.d.ts +23 -0
  486. package/dist/types/engine/form-engine/runtime/browser/collection-runtime.d.ts +34 -0
  487. package/dist/types/engine/form-engine/runtime/browser/draft-read.d.ts +27 -0
  488. package/dist/types/engine/form-engine/runtime/browser/form-runtime.d.ts +1470 -0
  489. package/dist/types/engine/form-engine/runtime/browser/form-test-runtime-driver.d.ts +83 -0
  490. package/dist/types/engine/form-engine/runtime/browser/journey/journey-action.d.ts +42 -0
  491. package/dist/types/engine/form-engine/runtime/browser/journey/journey-navigation.d.ts +200 -0
  492. package/dist/types/engine/form-engine/runtime/browser/journey/journey-presentation-overlay.d.ts +69 -0
  493. package/dist/types/engine/form-engine/runtime/browser/journey/journey-server-checks.d.ts +89 -0
  494. package/dist/types/engine/form-engine/runtime/browser/journey-engine-eager.d.ts +11 -0
  495. package/dist/types/engine/form-engine/runtime/browser/journey-engine.d.ts +462 -0
  496. package/dist/types/engine/form-engine/runtime/browser/path-validation-runs.d.ts +91 -0
  497. package/dist/types/engine/form-engine/runtime/browser/runtime-orchestrator.d.ts +530 -0
  498. package/dist/types/engine/form-engine/runtime/browser/submission-key.d.ts +12 -0
  499. package/dist/types/engine/form-engine/runtime/index.d.ts +8 -0
  500. package/dist/types/engine/form-engine/validation/core/error-store.d.ts +70 -0
  501. package/dist/types/engine/form-engine/validation/core/field-constraints.d.ts +293 -0
  502. package/dist/types/engine/form-engine/validation/core/test-vectors.d.ts +20 -0
  503. package/dist/types/engine/form-engine/validation/core/validation-pipeline.d.ts +65 -0
  504. package/dist/types/engine/form-engine/validation/parity/browser-adapter.d.ts +4 -0
  505. package/dist/types/engine/form-engine/validation/parity/formula-function-parity.d.ts +27 -0
  506. package/dist/types/engine/form-engine/validation/parity/index.d.ts +7 -0
  507. package/dist/types/engine/form-engine/validation/parity/parity-runner.d.ts +21 -0
  508. package/dist/types/engine/form-engine/validation/parity/runtime-adapter.d.ts +9 -0
  509. package/dist/types/engine/form-engine/validation/parity/server-adapter.d.ts +7 -0
  510. package/dist/types/engine/form-engine/validation/parity/vectors.d.ts +28 -0
  511. package/dist/types/engine/form-engine/validation/parity/wasm-adapter.d.ts +9 -0
  512. package/dist/types/engine/form-engine/validation/server/server-validation.d.ts +49 -0
  513. package/dist/types/engine/form-engine/validation/wasm/form-test-kernel-driver.d.ts +95 -0
  514. package/dist/types/engine/form-engine/validation/wasm/in-process-host.d.ts +56 -0
  515. package/dist/types/engine/form-engine/validation/wasm/portable-kernel.d.ts +1926 -0
  516. package/dist/types/engine/form-engine/validation/wasm/portable-options.d.ts +282 -0
  517. package/dist/types/engine/form-engine/validation/wasm/wasm-validation-host.d.ts +429 -0
  518. package/dist/types/engine/form-engine/verification/gate-inputs.d.ts +26 -0
  519. package/dist/types/engine/form-engine/verification/release-gates.d.ts +32 -0
  520. package/dist/types/engine/form-engine/verification/telemetry-bridge.d.ts +15 -0
  521. package/dist/types/engine/form-engine/verification/telemetry-sinks.d.ts +13 -0
  522. package/dist/types/engine/form-engine/verification/telemetry.d.ts +29 -0
  523. package/dist/types/packages/form-test/src/api.d.ts +75 -0
  524. package/dist/types/packages/form-test/src/args.d.ts +27 -0
  525. package/dist/types/packages/form-test/src/cli.d.ts +10 -0
  526. package/dist/types/packages/form-test/src/coverage.d.ts +11 -0
  527. package/dist/types/packages/form-test/src/drivers.d.ts +23 -0
  528. package/dist/types/packages/form-test/src/exit-codes.d.ts +17 -0
  529. package/dist/types/packages/form-test/src/index.d.ts +28 -0
  530. package/dist/types/packages/form-test/src/load.d.ts +25 -0
  531. package/dist/types/packages/form-test/src/parity.d.ts +14 -0
  532. package/dist/types/packages/form-test/src/report/json.d.ts +7 -0
  533. package/dist/types/packages/form-test/src/report/junit.d.ts +14 -0
  534. package/dist/types/packages/form-test/src/report/markdown.d.ts +14 -0
  535. package/dist/types/packages/form-test/src/report/model.d.ts +137 -0
  536. package/dist/types/packages/form-test/src/report/schema.d.ts +449 -0
  537. package/dist/types/packages/form-test/src/report/words.d.ts +48 -0
  538. package/dist/types/packages/form-test/src/run.d.ts +15 -0
  539. package/dist/types/packages/form-test/src/version.d.ts +3 -0
  540. package/dist/types/packages/form-test/src/vitest.d.ts +43 -0
  541. package/dist/types/packages/quickjs-wasm-host/src/fresh-sandbox-host.d.ts +70 -0
  542. package/dist/types/packages/quickjs-wasm-host/src/heap-recycle.d.ts +44 -0
  543. package/dist/types/packages/quickjs-wasm-host/src/index.d.ts +4 -0
  544. package/dist/types/packages/quickjs-wasm-host/src/program-host.d.ts +179 -0
  545. package/dist/types/packages/quickjs-wasm-host/src/quickjs-wasm-host-adapter.d.ts +218 -0
  546. package/dist/types/packages/quickjs-wasm-host/src/sandbox-program.d.ts +108 -0
  547. package/dist/vitest.mjs +189 -0
  548. package/fixtures/clock.json +35 -0
  549. package/fixtures/failing.datum-test +2 -0
  550. package/fixtures/main.datum-test +17 -0
  551. package/fixtures/main.json +435 -0
  552. package/package.json +93 -4
@@ -0,0 +1,1926 @@
1
+ import type { Expression, FormulaErrorPolicy } from "../../core/expressions/expression.js";
2
+ import type { FormulaFunctionSignature, FormulaProblem } from "../../core/expressions/formula-types.js";
3
+ import { type DefinitionInspectResponse, type InspectedPath } from "../../core/expressions/inspect.js";
4
+ import type { ComponentNode, FormDefinition } from "../../core/schema/types.js";
5
+ import type { ValidationContext, ValidationLog, ValidationLogEntry, ValidationLogLevel, ValidationLogThreshold, ValidationResult } from "../../core/schema/contracts.js";
6
+ import type { Journey } from "../../core/schema/journey.js";
7
+ import type { JourneyOwnership, JourneyTrace } from "../../core/journey/journey-types.js";
8
+ import type { FormTestAction, FormTestGiven, FormTestProblem, FormTestRefusal, FormTestScenario, FormTestScenarioResult, FormTestScenarioStatus, FormTestSkipReason, FormTestSnapshot, FormTestSnapshotError, FormTestStartError, FormTestStepResult, FormTestValue } from "../../core/form-tests/form-test-types.js";
9
+ import { type EffectiveNodeState, type SemanticNodeState } from "../../core/state/effective-state.js";
10
+ import { type KernelFoldResult } from "../../core/state/submittable-fold.js";
11
+ import { type RuleEvaluationContext } from "../../rules/evaluator/evaluator.js";
12
+ import { type KernelOptionSnapshot } from "./portable-options.js";
13
+ import type { WasmSubmissionOutcome, WasmUnknownFieldsMode, WasmValidationError } from "./wasm-validation-host.js";
14
+ /**
15
+ * The portable validation kernel — the "core WASM".
16
+ *
17
+ * Everything in this module runs in two places from the same source: directly in-process
18
+ * (the reference `InProcessWasmHostAdapter`, `in-process-host.ts`) and inside a QuickJS/WASM
19
+ * sandbox, where the QuickJS adapter splices these functions' `Function.prototype.toString()`
20
+ * output into one evaluated program. That dual life imposes hard constraints on this file:
21
+ *
22
+ * - **Runtime imports only of spliced functions.** Type-only imports are erased and safe. A
23
+ * value import is allowed only for a function that is itself spliced into the program — the
24
+ * engine modules the kernel shares with the browser runtime: the expression
25
+ * evaluator (`rules/evaluator/evaluator.ts`), the semantic-state readers
26
+ * (`core/state/semantic-state.ts`), `computeEffectiveNodeState`, the submittable fold
27
+ * (`core/state/submittable-fold.ts`), the journey path engine
28
+ * (`core/journey/journey-path.ts`) and its shared helpers (`core/journey/journey-shared.ts`,
29
+ * spliced through the path engine's list), the number and date predicates
30
+ * (`core/schema/answer-kinds.ts`) and, for the `test` op, the form-test
31
+ * parser and judge (`core/form-tests/`). Each follows these same rules and lists its functions
32
+ * for {@link PORTABLE_KERNEL_FUNCTIONS}; anything else imported would leave a dangling
33
+ * reference inside the sandbox.
34
+ * - **Top-level `function` declarations only** (no arrow consts, no classes) so hoisting makes
35
+ * composition order-irrelevant and every cross-reference resolves by declared name.
36
+ * - **Kernel functions may reference only each other and standard globals** (`JSON`,
37
+ * `Object`, `Array`, `RegExp`) — no module constants. Every function any of them references
38
+ * must be listed in {@link PORTABLE_KERNEL_FUNCTIONS} or the sandbox program will not
39
+ * evaluate, and every name there is unique and prefixed (`kernel*`, `journey*`), so splicing
40
+ * several modules into one scope cannot shadow anything.
41
+ * - **No locale-sensitive or nondeterministic APIs** — key ordering uses code-unit
42
+ * comparison, never `localeCompare` (ICU collation differs between QuickJS and V8, and the
43
+ * ABI requires byte-identical serialization from every host).
44
+ * - **No inherited members read as data.** Records keyed by component ids or submitted keys
45
+ * are built without a prototype (`Object.create(null)`), and records handed in are read
46
+ * through `kernelOwn`, so a key such as `constructor`, `toString` or `__proto__` behaves like
47
+ * any other. What leaves the kernel — the values validators see, the outcome — is an
48
+ * ordinary object again, spread so that an own `__proto__` key stays a key.
49
+ *
50
+ * **Formulas, the clock and run scopes.** The definition a context carries
51
+ * may write its rules as formulas; {@link runKernel} compiles it into a copy with every formula
52
+ * a tree (`kernelCompileDefinition`, `core/expressions/compile.ts`, whose parser and readers are
53
+ * spliced in through `FORMULA_FUNCTIONS` and `COMPILE_FUNCTIONS`) and reads the copy. The
54
+ * context's objects are never changed: a server hands the kernel the definition it stores and
55
+ * hashes. Every rule reader here reads a compiled rule through `kernelCompiledRule` and skips
56
+ * what this side does not apply through `kernelRuleSkipped` (`core/state/submittable-fold.ts`):
57
+ * a rule reading `host.`, one scoped to the browser, one reading the clock when the context
58
+ * gave no `today`. The day, the plugins' formula functions and the parser's signatures reach
59
+ * every rule context through a {@link KernelEvaluation}.
60
+ *
61
+ * The kernel deliberately re-implements the engine logic it must not import: the data-scope
62
+ * value-path derivation, data keys included (`core/tree/data-scope.ts`), the
63
+ * field-constraint semantics
64
+ * (`validation/core/field-constraints.ts`), the file-field readings behind them
65
+ * (`core/schema/file-upload.ts`), and the rules-driven semantic state the browser's
66
+ * `RulesSemanticStateResolver` resolves (`runtime/browser/runtime-orchestrator.ts`).
67
+ * `engine/tests/portable-kernel.test.ts` and `engine/tests/journey-kernel.test.ts` hold the
68
+ * readings identical.
69
+ */
70
+ /** One error in the ABI error contract: code + parameters + field mapping. Never prose. */
71
+ export type KernelValidationError = ValidationResult["errors"][number];
72
+ /**
73
+ * What the kernel does with submitted keys the schema does not define — a per-run choice
74
+ * carried in the serialized context (`WasmSubmissionContext.unknownFields`), so any host
75
+ * can set it at submission time:
76
+ * - `"strip"` (default): silently dropped; the returned `values` are schema-bounded.
77
+ * - `"keep"`: passed through untouched; the caller accepts unknown keys in the submission.
78
+ * - `"reject"`: each unknown key blocks the run with an `unknown_field` contract error
79
+ * (`parameters.field` names the key; no `componentId`/`path` — there is no component).
80
+ */
81
+ export type KernelUnknownFieldsMode = "strip" | "keep" | "reject";
82
+ /** What a kernel validator is handed: the context, the schema, and the run log to write to. */
83
+ export type KernelValidatorContext = ValidationContext & {
84
+ form?: ComponentNode;
85
+ log: ValidationLog;
86
+ };
87
+ /** A deterministic validator run by the kernel: plain function, context in, errors out. */
88
+ export type KernelValidator = (context: KernelValidatorContext) => ValidationResult;
89
+ /** The run log as the kernel keeps it: the entries so far, and how many the cap dropped. */
90
+ export interface KernelLog extends ValidationLog {
91
+ entries: ValidationLogEntry[];
92
+ dropped: number;
93
+ write(level: ValidationLogLevel, message: string, data?: unknown): void;
94
+ }
95
+ /** What the kernel hands back across the ABI: the error contract, plus the sanitized values
96
+ * when nothing blocked, plus the run log when it kept anything. `values` is what the form
97
+ * submitted **minus any key the schema does not define, minus the answers of hidden
98
+ * components whose value behaviour excludes them** (a cleared one comes back `undefined`,
99
+ * which serialization drops), **with each calculation it could reproduce as it worked it
100
+ * out**, every answer as JSON carries it (a `NaN` as `null`) — the caller must treat it as
101
+ * the submission, not the raw input. */
102
+ export interface KernelOutcome {
103
+ errors: KernelValidationError[];
104
+ /**
105
+ * The delivered keys the form defines that the judged values leave out (hidden answers the
106
+ * fold withheld), in the delivered order. Present, possibly empty, when the context set
107
+ * `reportFold` and the fold ran; absent without the flag and from a refused definition.
108
+ */
109
+ withheld?: string[];
110
+ /**
111
+ * The components whose errors {@link kernelErrorPassesFold} can drop (not validated, or
112
+ * requiredness not applying), by id; a component not listed passes every error. Present only when there is one and the fold ran.
113
+ */
114
+ effectiveState?: Record<string, EffectiveNodeState>;
115
+ /** The judged values of a run that blocked, which carries no `values`. */
116
+ submittable?: Record<string, unknown>;
117
+ /** The journey's path, when the context carried a journey. */
118
+ trace?: NonNullable<KernelFoldResult["trace"]>;
119
+ values?: Record<string, unknown>;
120
+ logs?: ValidationLogEntry[];
121
+ /**
122
+ * The value paths whose answers were worked out in the browser and are kept as sent:
123
+ * held to the form's rules like any answer, but not reproduced here.
124
+ * In document order; see {@link kernelClientDerived}. Present only when there is one, and
125
+ * whether or not the run blocked — it describes the answers judged, which a host may keep
126
+ * either way.
127
+ */
128
+ clientDerived?: string[];
129
+ /**
130
+ * The form components in scope for the journey page the context named (`context.page`), in
131
+ * document order — what a host scopes a page's check by without working placement
132
+ * out itself ({@link kernelPageComponentIds}). Present whenever the context names a page and
133
+ * carries a usable journey, empty for a page that places nothing.
134
+ */
135
+ pageComponentIds?: string[];
136
+ /**
137
+ * The components whose server-side rules or calculation read the clock (`today()`, `age()`),
138
+ * in document order: what the verdict turned on the day for, or was left
139
+ * unevaluated for lack of one. Present only when there is one, blocked or not.
140
+ */
141
+ clockDependent?: string[];
142
+ /**
143
+ * The components whose `server` or `server-secret` rules this run applied, in document
144
+ * order: rules the browser never ran. Present only when there is one, blocked or not.
145
+ */
146
+ serverRules?: string[];
147
+ /**
148
+ * The components whose own `visibleWhen` this run could not replay, in document order: it
149
+ * reads `host.`, is scoped to the browser, or reads the clock when the context gave no day. Such a component, and everything under it, is treated as hidden for
150
+ * requiredness ({@link kernelFoldRelaxUnreplayable}): the server never demands an answer the
151
+ * browser may have hidden. Present only when there is one, blocked or not.
152
+ */
153
+ visibilitySkipped?: string[];
154
+ /**
155
+ * The flat value index of `values`: one row per answer, built from the same
156
+ * sanitized object, so an answer stripped or withheld is not indexed
157
+ * ({@link kernelValueIndex}). Present whenever `values` is.
158
+ */
159
+ index?: KernelIndexRow[];
160
+ /**
161
+ * The context's `document` as canonical text, every key sorted by code unit: the
162
+ * document as sent, not the values the run returns. Present only when the context carried
163
+ * one, blocked or not ({@link kernelDocumentDigest}).
164
+ */
165
+ canonical?: string;
166
+ /** SHA-256, lowercase hex, of the UTF-8 bytes of `canonical`. Present exactly when `canonical` is. */
167
+ digest?: string;
168
+ }
169
+ /**
170
+ * One row of a run's value index: `path` is the submitted key with its entry
171
+ * indexes taken out, `delta` those indexes joined with `.` (and, for an item of a list of
172
+ * scalars, its position), `value` the answer as the values hold it.
173
+ */
174
+ export interface KernelIndexRow {
175
+ path: string;
176
+ delta: string;
177
+ value: unknown;
178
+ }
179
+ /**
180
+ * What one run evaluates rules with beyond the answers: the host's calendar day
181
+ * (`today()`, `age()`; absent, a clock-reading rule is skipped as a `host.` read is) and the
182
+ * plugins' formula functions, on every rule context the kernel builds.
183
+ */
184
+ export interface KernelEvaluation {
185
+ today?: string;
186
+ /**
187
+ * The values `host.` reads, as the server supplied them (`context.hostContext`): a plain record.
188
+ * Present, every rule reading `host.` is evaluated against it, a key it lacks reading as no
189
+ * answer; absent, such a rule is skipped ({@link kernelRuleSkipped}).
190
+ */
191
+ hostContext?: Record<string, unknown>;
192
+ /** The run's compiled `matches` patterns: one plain object every rule context shares. */
193
+ regexCache?: Record<string, unknown>;
194
+ functions?: Record<string, (args: unknown[]) => unknown>;
195
+ /**
196
+ * The rule being evaluated now, `rules:<componentId>:<key>` (`journey:<id>` for a journey
197
+ * condition), set by the kernel before each evaluation ({@link kernelMarkRule}) so a plugin
198
+ * function that throws can be named with its rule. Written only, never read by
199
+ * a rule.
200
+ */
201
+ where?: string;
202
+ /**
203
+ * The ids of the components whose `rules.value` did not parse, so the compiled tree has no
204
+ * rule for them. Their sent value is kept and taken on trust: listed in
205
+ * `unreproduced`, hence in `clientDerived`.
206
+ */
207
+ unparsedCalculations?: string[];
208
+ /**
209
+ * Where a formula function says what it did not do (a size cap tripped, a plugin's result
210
+ * dropped): the run's log, one line per message. Set by the run, passed on to every rule
211
+ * context as `warn`.
212
+ */
213
+ warn?: (message: string) => void;
214
+ }
215
+ /**
216
+ * A definition prepared for running: everything a run reads of it that does
217
+ * not depend on the answers. The compile (`root`, `journey`, the problems and warnings it
218
+ * found, the calculations whose formula did not parse) is worked out when the object is made
219
+ * ({@link kernelPrepareDefinition}); the indexes the readers build over the tree (`derived`:
220
+ * the tree index, value paths, ids by path, the allowlist of key shapes, row fields and lists,
221
+ * collection owners) are worked out the first time a reader asks for one
222
+ * ({@link kernelPreparedGet}), so a run that never reaches a reader never pays for it, and a
223
+ * reader that throws does so at the point that reads it. Plain data the kernel built, no host
224
+ * handle, no function: it lives as long as the host's {@link KernelPreparedCache}, which may
225
+ * be the sandbox context itself, and no reader writes to it after it is made.
226
+ */
227
+ export interface KernelPrepared {
228
+ /** The compiled root: every formula a tree, the authored definition untouched. */
229
+ root: ComponentNode;
230
+ /** The journey as the run reads it: the compiled copy when one was given, else what was given. */
231
+ journey: unknown;
232
+ /** What the compile could not parse or resolve, in the compile's order (the run judges them by its policy). */
233
+ problems: FormulaProblem[];
234
+ /** Findings that never refuse a run (a condition that is no yes-or-no). */
235
+ warnings: FormulaProblem[];
236
+ /** The ids of the components whose `rules.value` did not parse. */
237
+ unparsedCalculations: string[];
238
+ /** The formula-error word the object was prepared under (part of its cache key). */
239
+ policy: string;
240
+ /** The risky-pattern word the object was prepared under (part of its cache key). */
241
+ risky: unknown;
242
+ /** The indexes over `root`, each filled by its first reader; prototype-free. */
243
+ derived: Record<string, unknown>;
244
+ }
245
+ /** One prepared definition in a {@link KernelPreparedCache}, with the text it was keyed by. */
246
+ export interface KernelPreparedEntry {
247
+ key: string;
248
+ prepared: KernelPrepared;
249
+ /** The cache's clock when the entry was last used: the smallest is the one dropped. */
250
+ used: number;
251
+ }
252
+ /**
253
+ * The prepared definitions a host remembers between runs, least recently used dropped first.
254
+ * Plain data a host (or the sandbox program, on its global) creates once with
255
+ * {@link kernelCreatePreparedCache}: the kernel keeps no state of its own between runs.
256
+ * `hits` and `misses` count lookups, for the host's diagnostics and the parity tests.
257
+ */
258
+ export interface KernelPreparedCache {
259
+ entries: KernelPreparedEntry[];
260
+ /** The most definitions kept. */
261
+ capacity: number;
262
+ /** The most key text kept, in characters, over every entry: a bound on the memory a cache holds. */
263
+ maxChars: number;
264
+ clock: number;
265
+ hits: number;
266
+ misses: number;
267
+ /** The signature list the last key was built for, its length then, and its key part. */
268
+ signatureList?: FormulaFunctionSignature[];
269
+ signatureCount: number;
270
+ signatureKey: string;
271
+ }
272
+ /** An empty {@link KernelPreparedCache}: `capacity` definitions at most, and at most `maxChars` characters of key text. */
273
+ export declare function kernelCreatePreparedCache(capacity: number, maxChars: number): KernelPreparedCache;
274
+ /**
275
+ * The compile of a definition and what a run takes from it ({@link KernelPrepared}). The
276
+ * journey is wrapped as the browser reads its journeys (`{ journeys: [journey] }`), so a page
277
+ * or route `when` is compiled alike on both sides. Pure: the definition and the journey are
278
+ * never changed, and the same inputs give the same object.
279
+ */
280
+ export declare function kernelPrepareDefinition(form: ComponentNode, journey: unknown, pdf: unknown, policyWord: string, riskyWord: unknown, signatures: FormulaFunctionSignature[]): KernelPrepared;
281
+ /**
282
+ * The key a prepared definition is remembered by: the formula-error word, the risky-pattern
283
+ * word, the parser's signatures (name and argument counts, sorted by name) and the exact JSON
284
+ * text of the form, the journey and the PDF layouts. Equal keys mean equal inputs to the
285
+ * compile, so a hit is the object a miss would have built. The text is not re-sorted: the same
286
+ * definition written with its members in another order is another entry (a miss, never a wrong
287
+ * answer). Hosts hand the kernel data that came through JSON; a definition that cannot be
288
+ * written as JSON text (a cycle, a BigInt) gets no key, and its run prepares its own.
289
+ */
290
+ export declare function kernelPreparedKey(cache: KernelPreparedCache, form: unknown, journey: unknown, pdf: unknown, policyWord: string, riskyWord: unknown, signatures: FormulaFunctionSignature[]): string | undefined;
291
+ /** The prepared definition a key names, marked as just used; `undefined` (and a miss counted) when the cache has none. */
292
+ export declare function kernelPreparedLookup(cache: KernelPreparedCache, key: string): KernelPrepared | undefined;
293
+ /**
294
+ * Remembers a prepared definition under its key, dropping the least recently used until the
295
+ * cache is within its capacity and its key-text bound. A key longer than the whole bound is not
296
+ * kept. Written so that a run cut short in the middle (the sandbox's deadline) leaves a cache
297
+ * that is merely smaller or larger than intended, never one that answers wrongly: the counts
298
+ * are worked out from the entries each time, not kept.
299
+ */
300
+ export declare function kernelPreparedStore(cache: KernelPreparedCache, key: string, prepared: KernelPrepared): void;
301
+ /**
302
+ * Cuts a prepared definition loose from the objects it was compiled from. The compile shares
303
+ * every node it does not rewrite with the definition the run was handed, and a plugin validator
304
+ * is handed that definition (`context.form`): a validator that wrote to it would change what the
305
+ * next run of the same definition reads. So the run that built a prepared object, when
306
+ * validators are about to run, swaps in private copies first (frozen ones, as the values a
307
+ * validator is handed are: no reader writes to the tree, so a write would be a bug, and it fails
308
+ * rather than leaks). Every index built over the shared nodes is dropped with them (rebuilt on
309
+ * demand over the copies). A later run is handed a new definition of its own, which shares
310
+ * nothing with the cached one.
311
+ */
312
+ export declare function kernelPreparedIsolate(prepared: KernelPrepared): void;
313
+ /**
314
+ * An index over a prepared definition's tree, worked out by `build` the first time any reader
315
+ * asks for `slot` and read back after. With no prepared object, or one made for another root,
316
+ * it is just `build()`: the readers give the same answer with or without one, which is why a
317
+ * hit cannot change an outcome. The answer is shared, so a reader must not write to it (the
318
+ * `riskyPatterns` slot is a memo of verdicts that fills as patterns are met, and is the one
319
+ * exception).
320
+ */
321
+ /**
322
+ * The part of a prepared slot's name that tells one `kinds` map from another: `""` for no map,
323
+ * else the map's JSON text, so an index read through the map is never shared with a run that
324
+ * hands another (a map that cannot be written as JSON is its own text, `"\u0000?"`, and is read
325
+ * per run as data the kernel ignores anyway).
326
+ */
327
+ export declare function kernelKindsSlot(kinds: unknown): string;
328
+ export declare function kernelPreparedGet<T>(prepared: KernelPrepared | undefined, root: ComponentNode, slot: string, build: () => T): T;
329
+ /**
330
+ * The run log: what validators write to as `context.log`, and the kernel for its
331
+ * own steps. Entries at or above the threshold are kept in order, up to a cap of 200, and
332
+ * travel back in the outcome for the host to forward to a logger of its own; below the
333
+ * threshold a call costs one comparison. The default threshold is `warn`, so a run that
334
+ * behaves records nothing and the outcome carries no log. Plain data only — the
335
+ * sandbox has no clock, so no timestamps; the host stamps the batch — and no stacks, so the
336
+ * same run yields the same log on every engine.
337
+ */
338
+ export declare function kernelCreateLog(threshold: unknown): KernelLog;
339
+ /** The entries a run kept, with one closing warning when the cap dropped any. */
340
+ export declare function kernelFinishLog(log: KernelLog): ValidationLogEntry[];
341
+ /** Recursive code-unit key sort. The one canonical ordering for every ABI payload. */
342
+ export declare function kernelSortKeys(input: unknown): unknown;
343
+ /** Byte-stable JSON: the sandbox serializes its own outcome with this, so the output is
344
+ * ABI-canonical no matter which host ran it. One recursive writer: keys sorted by code unit,
345
+ * leaves written by JSON.stringify, no intermediate copy; byte-identical to
346
+ * `JSON.stringify(kernelSortKeys(input))`. */
347
+ export declare function kernelStableStringify(input: unknown): string;
348
+ /**
349
+ * The UTF-8 bytes of a string as a binary string, one character per byte (each code below 256),
350
+ * as `TextEncoder` writes them: a surrogate pair as one four-byte sequence, a lone surrogate as
351
+ * U+FFFD. The sandbox has no `TextEncoder`; `encodeURIComponent` is the specification's own
352
+ * UTF-8 encoder, native on every engine, and `unescape` turns its `%XX` escapes back into
353
+ * single characters, so a long document encodes at native speed. `encodeURIComponent` refuses a
354
+ * lone surrogate, which a canonical string from `JSON.stringify` never holds (it escapes them):
355
+ * such text has each one replaced with U+FFFD first, as `TextEncoder` does.
356
+ */
357
+ export declare function kernelUtf8Binary(text: string): string;
358
+ /**
359
+ * SHA-256 (FIPS 180-4) of a binary string (one byte per character, `charCodeAt(i) & 0xff`), as
360
+ * lowercase hex: the digest a run returns for the document it was sent. Plain 32-bit
361
+ * integer arithmetic, so it reads the same on every engine; `core/crypto/sha256.ts` is the
362
+ * engine's own, kept apart because its round constants are a module constant the sandbox
363
+ * program could not carry. Here they are built inside the function. Whole blocks are read
364
+ * from the input in place and only the padded tail is built; every intermediate stays a 32-bit
365
+ * integer (`| 0`), which QuickJS keeps unboxed. Inside QuickJS it hashes about 1 MB a second,
366
+ * which counts against a run's time budget: a document carrying a large attachment needs a
367
+ * host budget to match.
368
+ */
369
+ export declare function kernelSha256Hex(binary: string): string;
370
+ /**
371
+ * What a run says of the document a host received: its canonical text, every key
372
+ * sorted by code unit ({@link kernelStableStringify}), and the SHA-256 hex of that text's UTF-8
373
+ * bytes. The host stores both and never serializes the document itself, so every host and the
374
+ * browser name one record by one digest.
375
+ */
376
+ export declare function kernelDocumentDigest(document: unknown): {
377
+ canonical: string;
378
+ digest: string;
379
+ };
380
+ export declare function kernelConfigurationOf(node: ComponentNode): Record<string, unknown>;
381
+ /** Mirrors `isDataScopeContainer` (core/tree/data-scope.ts). */
382
+ export declare function kernelIsDataScopeContainer(node: ComponentNode): boolean;
383
+ /** Mirrors `isValidDataKey` (core/tree/data-scope.ts): the path-segment grammar, not digits alone. */
384
+ export declare function kernelIsValidDataKey(value: unknown): boolean;
385
+ /** Mirrors `dataKeyOf`: a node's own segment in the data — its valid data key, else its id. */
386
+ export declare function kernelDataKeyOf(node: ComponentNode): string;
387
+ /** Mirrors `collectionPathOf`: where a repeating section's entries live, as written; else nothing. */
388
+ export declare function kernelCollectionPathOf(node: ComponentNode): string | undefined;
389
+ /**
390
+ * A node's own enumerable keys copied onto a new plain object, `skip` left out. Each key is
391
+ * defined, not assigned, so an own `__proto__` key stays a key, as an object spread keeps it.
392
+ */
393
+ export declare function kernelGridCopy(from: Record<string, unknown>, skip: string[]): Record<string, unknown>;
394
+ /**
395
+ * Whether a node is a data grid {@link kernelNormalizeDataGrid} binds: one with no collection
396
+ * binding. Mirrors `normalizeDataGrids` (core/schema/data-grid.ts), for a grid whose id is a
397
+ * text: one with any other id (a definition `check` refuses) is left as it is, a group holding
398
+ * no data, since a collection read off a non-text id is no key the run can walk.
399
+ */
400
+ export declare function kernelDataGridNeedsNormal(node: unknown): boolean;
401
+ /**
402
+ * The kernel's mirror of the binding `normalizeDataGrids` gives a grid (core/schema/data-grid.ts)
403
+ * for a node {@link kernelDataGridNeedsNormal} names: its rows live at its id. A new
404
+ * object; nothing handed in is changed.
405
+ */
406
+ export declare function kernelNormalizeDataGrid(node: ComponentNode): ComponentNode;
407
+ /**
408
+ * Whether any data grid in the tree needs {@link kernelNormalizeDataGrid}: one pass with an
409
+ * explicit stack, no deeper than one level past the depth the run accepts (a deeper tree is
410
+ * refused before it is read, and a cycle a host's objects might hold ends there).
411
+ */
412
+ export declare function kernelDataGridsPending(root: unknown): boolean;
413
+ /**
414
+ * The kernel's mirror of `normalizeDataGrids` (core/schema/data-grid.ts): every data
415
+ * grid in the tree bound to a collection. Applied to `context.form` at the top of
416
+ * {@link runKernel}, before anything walks the definition, so the run reads a grid's rows where
417
+ * the browser does, and by the `inspect` op's paths and the `check` op. Returns the root handed in when nothing needed rewriting;
418
+ * otherwise a copy that shares every subtree it did not change, the definition handed in never
419
+ * changed. Walked with an explicit stack (children before their parent), no deeper than one
420
+ * level past the depth the run accepts, so a tree of any depth cannot exhaust the sandbox's stack.
421
+ */
422
+ export declare function kernelNormalizeDataGrids(root: ComponentNode): ComponentNode;
423
+ /** The most rows a grid's bounds may name: `DATA_GRID_ROWS_CAP` (core/schema/data-grid.ts), a function the program can splice. */
424
+ export declare function kernelDataGridRowsCap(): number;
425
+ /**
426
+ * A data grid's row-count bounds as `dataGridSettingsOf` reads them (core/schema/data-grid.ts):
427
+ * `minRows` a whole number from 0 (a fraction floored, past the cap read as the cap,
428
+ * anything else 0); `maxRows` the same, absent (or unreadable) for no bound, and never below
429
+ * `minRows`.
430
+ */
431
+ export declare function kernelDataGridRowBounds(node: ComponentNode): {
432
+ min: number;
433
+ max: number | undefined;
434
+ };
435
+ /**
436
+ * A data grid's bounds once its formulas have spoken: `resolveDataGridRowBounds`
437
+ * (core/schema/data-grid.ts) in the kernel's shape, over the fixed bounds
438
+ * {@link kernelDataGridRowBounds} read. A formula's value that is a finite whole number from 0
439
+ * wins (one past the cap read as the cap); anything else leaves the fixed bound in force. A
440
+ * maximum below the resolved minimum reads as the minimum. A test holds the two equal.
441
+ */
442
+ export declare function kernelResolveDataGridRowBounds(fixed: {
443
+ min: number;
444
+ max: number | undefined;
445
+ }, formula: {
446
+ min?: unknown;
447
+ max?: unknown;
448
+ } | undefined): {
449
+ min: number;
450
+ max: number | undefined;
451
+ };
452
+ /**
453
+ * Mirrors `buildValuePaths`: component id -> the path its own control reads and writes, each
454
+ * data-scoping container above it adding its segment (its data key, else its id).
455
+ */
456
+ export declare function kernelValuePaths(root: ComponentNode): Record<string, string>;
457
+ /**
458
+ * Every key shape the schema defines — the sanitization allowlist — with `[]` where an entry
459
+ * index goes. Mirrors `buildValuePaths` (root excluded: the form root holds no value) for the
460
+ * nodes that claim a place in the data ({@link kernelClaimsData}): a field, a data-scoping
461
+ * container, a repeating section. A node that holds no data — a button, static HTML, an image, a
462
+ * signature, a fieldset or any other plain group — defines no key, so a submitted key spelled
463
+ * like its id is not taken as known.
464
+ * One addition: a repeating section's entries are known where they live — at its collection
465
+ * path as written, whatever container sits above it, as the runtime and the PDF read them
466
+ * — and only there. The section itself is `items` (its entries as one list); a
467
+ * field of an entry is `items[].name`, keyed within the entry as `buildRowKeys` keys it, so a
468
+ * section nested in another is `lines[].qty` at its own collection path, as the runtime keeps
469
+ * it. A row field submitted as `items[0].name` has the shape `items[].name`
470
+ * ({@link kernelKeyShape}).
471
+ *
472
+ * A data grid is a repeating section: its rows are entries at its collection path
473
+ * and its children are the fields of one entry, read here as any section's are. A grid with no
474
+ * binding is bound at its id before anything walks the definition
475
+ * ({@link kernelNormalizeDataGrids}), so no case of its own is needed.
476
+ */
477
+ export declare function kernelKnownKeyShapes(root: ComponentNode): Record<string, true>;
478
+ /**
479
+ * Every value path the schema defines, entry indexes left out: {@link kernelKnownKeyShapes}
480
+ * with a row field's `items[].name` read as `items.name`. Not the allowlist, which holds
481
+ * where an index goes.
482
+ */
483
+ export declare function kernelKnownValuePaths(root: ComponentNode): Record<string, true>;
484
+ /**
485
+ * A submitted key's shape as {@link kernelKnownKeyShapes} writes it: each entry index —
486
+ * digits with no leading zero, as the runtime writes them (`[0]`, `[12]`) — as `[]`.
487
+ * `undefined` for a key with any other bracket in it (`[01]`, `[-1]`, `[x]`, `[]`, a stray
488
+ * `[` or `]`), which no schema defines. Where an index may stand is the allowlist's to say, so
489
+ * `province[0]`, `items.name`, `items[0][1].name` and `items[0].name[2]` take shapes it does
490
+ * not hold.
491
+ */
492
+ export declare function kernelKeyShape(key: string): string | undefined;
493
+ /**
494
+ * What one run remembers about the keys it is handed, shared by the row flattening, the
495
+ * partition and the fold (all read the same keys): each key's shape ({@link kernelKeyShapeOnce})
496
+ * and whether the schema defines it ({@link kernelDefinesKey}). Both records are prototype-free
497
+ * and belong to the run: a key's answer never depends on anything else.
498
+ */
499
+ export interface KernelKeyMemo {
500
+ defined: Record<string, boolean>;
501
+ shapes: Record<string, string | false>;
502
+ }
503
+ /**
504
+ * {@link kernelKeyShape} asked once per key of a run: `shapes` (prototype-free, one per run)
505
+ * remembers each answer, `false` for a key with no shape. The row flattening and the partition
506
+ * read the same keys, so they share one.
507
+ */
508
+ export declare function kernelKeyShapeOnce(shapes: Record<string, string | false>, key: string): string | undefined;
509
+ /**
510
+ * Whether the schema defines a submitted key: its shape ({@link kernelKeyShape}) is one the
511
+ * allowlist ({@link kernelKnownKeyShapes}) holds. What {@link kernelPartitionValues} keeps, and
512
+ * what the fold's rules, the journey and a PDF layout's `when` may read.
513
+ * `memo` remembers the answer per key; `shapes` the key's shape ({@link kernelKeyShapeOnce}).
514
+ */
515
+ export declare function kernelDefinesKey(knownShapes: Record<string, true>, key: string, memo?: Record<string, boolean>, shapes?: Record<string, string | false>): boolean;
516
+ /**
517
+ * Collapses collection indexes so `items[2].name` reads as `items.name` — for naming the
518
+ * component an error's path belongs to. The allowlist reads a key's exact shape instead
519
+ * ({@link kernelKeyShape}).
520
+ */
521
+ export declare function kernelNormalizePath(key: string): string;
522
+ /**
523
+ * The keys whose answer is a list of rows: each repeating section's collection path,
524
+ * a data grid's among them, as written, found by the walk
525
+ * {@link kernelKnownKeyShapes} takes (a path written with brackets is none, and a section with
526
+ * one hides its subtree). No prototype.
527
+ */
528
+ export declare function kernelRowListPaths(root: ComponentNode): Record<string, true>;
529
+ /**
530
+ * The key shapes ({@link kernelKeyShape}) of the data-scoping containers that hold no answer of
531
+ * their own: a container's key only leads on to the keys of what it holds, so nothing posted at
532
+ * it is a value. The walk {@link kernelKnownKeyShapes} takes; a shape
533
+ * some other node also claims (a field sharing the container's data key) is left out, as it may
534
+ * hold an answer. No prototype.
535
+ */
536
+ export declare function kernelContainerKeys(root: ComponentNode): Record<string, true>;
537
+ /**
538
+ * Rows posted whole, read as the flat keys the runtime writes. A section's entries
539
+ * (a data grid's rows among them) travel as `items[0].sku`, one key per answer; a
540
+ * host or a hand-made submission may post them instead as one list at the collection path
541
+ * (`items: [{ sku: "A-1" }]`), which the allowlist would keep as one answer, the PDF would
542
+ * read as rows and the index would store as one row. So, before the allowlist reads anything,
543
+ * a list of plain objects at such a key becomes the flat keys (`items[0].sku`), in place: each
544
+ * row's key is appended to `items[i]`, and a plain object under a key that leads to known
545
+ * keys (a data-scoping container in the entry, `addr: { city }`) is read the same way, a
546
+ * level at a time, while one that does not (a checkboxes answer) is the answer. The same goes
547
+ * for such an object posted at a container's key among the values themselves (`addr: { city }`
548
+ * is read as `addr.city`); a key sent flat beside it wins (`superseded`), and an
549
+ * object nested past 16 levels, which cannot be read as keys and is not an answer, is not
550
+ * stored (`unreadable`, and in `unknownKeys`). Every reader then sees one shape. A key the rows spell that the schema does not define is left for
551
+ * `unknownFields`, like any other. When flat keys for the same list are sent too
552
+ * (`items[0].sku` beside `items`), they win and the list is dropped (`superseded`). A value
553
+ * at such a key that is not a list of plain objects is not rows at all: it is listed in
554
+ * `malformed`, kept in place, and its key is treated as one the schema does not define. An
555
+ * empty list is no rows and becomes no key.
556
+ */
557
+ export declare function kernelFlattenRows(values: Record<string, unknown>, root: ComponentNode, prepared?: KernelPrepared, shapes?: Record<string, string | false>): {
558
+ values: Record<string, unknown>;
559
+ malformed: string[];
560
+ superseded: string[];
561
+ unreadable: string[];
562
+ emptyRows: string[];
563
+ filledRows: string[];
564
+ };
565
+ /**
566
+ * Splits submitted values into the keys the schema defines (in their original order) and
567
+ * the keys it does not. What happens to the unknown keys is the caller's
568
+ * {@link KernelUnknownFieldsMode} decision. A key is known only in a shape the schema
569
+ * defines: an entry index straight after a repeating section's collection path, exactly one,
570
+ * followed by a field of the entry, and nowhere else. `province[0]` beside a plain
571
+ * `province`, `items.name` without its index, `items[0][1].name` and `items[0].name[2]` are
572
+ * unknown like any other key, although taking their indexes out would leave a known path.
573
+ * Rows posted whole are read as flat keys first ({@link kernelFlattenRows}): a list
574
+ * of row objects at a collection path is split into `items[0].sku` keys
575
+ * in its place, a list beside flat keys of its own is dropped (`superseded`), and a value
576
+ * there that is not a list of row objects is unknown (`malformed`, and in `unknownKeys`).
577
+ * A row posted as `{}` has no key but is a present row: its entry (`items[2]`) is listed in
578
+ * `emptyRows` for the field constraints.
579
+ */
580
+ export declare function kernelPartitionValues(values: Record<string, unknown>, root: ComponentNode, prepared?: KernelPrepared, keyMemo?: KernelKeyMemo): {
581
+ known: Record<string, unknown>;
582
+ unknownKeys: string[];
583
+ superseded: string[];
584
+ emptyRows: string[];
585
+ };
586
+ /**
587
+ * The validated-data guarantee in its default form: any submitted key the schema does not
588
+ * define is silently dropped. Known keys pass through untouched, in their original order.
589
+ */
590
+ export declare function kernelSanitizeValues(values: Record<string, unknown>, root: ComponentNode): Record<string, unknown>;
591
+ /**
592
+ * The tree as the fold walks it: every node id root first in document (pre-)order, as the
593
+ * browser orchestrator walks it, each node by id, and each child's parent. The records have
594
+ * no prototype, so an id or a submitted key such as `constructor` never reads an inherited
595
+ * member. A run refuses a tree whose parents would loop, or that holds a node of no shape,
596
+ * before it gets here (`kernelComponentTreeFault`); for any other caller the index skips what is
597
+ * not a node and never records a parent that would close a loop (the earlier parent stays), so
598
+ * every walk up the parents ends.
599
+ */
600
+ export declare function kernelTreeIndex(root: ComponentNode): {
601
+ order: string[];
602
+ nodeById: Record<string, ComponentNode>;
603
+ parentOf: Record<string, string>;
604
+ };
605
+ /**
606
+ * Mirrors `holdsData` with its default reading of valueless types (core/tree/data-scope.ts):
607
+ * a value-bearing field, a data-scoping container or a repeating section (a data grid is one)
608
+ * claims a place in the data; a group (anything with a children map, or a grouping type) and a
609
+ * component that carries no answer (a button, static HTML, an image, a signature) claim none.
610
+ * The leaf reading — a component holding an answer of its own — is the fold's
611
+ * `kernelFoldHoldsOwnAnswer`, which also gates `requiredWhen`, so the two cannot
612
+ * drift.
613
+ */
614
+ export declare function kernelClaimsData(node: ComponentNode): boolean;
615
+ /**
616
+ * Mirrors `buildComponentIdsByPath`: value path -> the ids of the components whose answer is
617
+ * stored there, in document order. What the fold re-keys values by, so a rule reads
618
+ * `billing_street` wherever its answer is stored. No prototype, for the same reason as
619
+ * {@link kernelTreeIndex}: the fold looks submitted keys up in it.
620
+ */
621
+ export declare function kernelComponentIdsByPath(root: ComponentNode, valuePaths?: Record<string, string>): Record<string, string[]>;
622
+ /**
623
+ * The flat value index of a run's sanitized values: one row per answer, the shape a
624
+ * host stores for search and views. `path` is the key with every entry index (`[0]`) taken
625
+ * out, `delta` those indexes joined with `.` (empty for a key with none), `value` the answer
626
+ * as the values hold it. A list whose items are all scalars or `null` gives one row per item,
627
+ * the item's position appended to `delta` (`tags` at `["a","b"]` gives deltas `0` and `1`; an
628
+ * empty list gives no row); any other object or list is one row, as is. A key holding
629
+ * `undefined` is no answer (JSON drops it) and gives no row, and a list item holding
630
+ * `undefined` reads as `null`, as JSON writes it. Rows follow the keys in the order the
631
+ * serialized values list them ({@link kernelSortKeys}), so the index and `values` read alike.
632
+ */
633
+ export declare function kernelValueIndex(values: Record<string, unknown>): KernelIndexRow[];
634
+ /**
635
+ * Every value path the kernel reads for a definition (the `inspect` op's `paths`), one
636
+ * entry per component in document order, the form root left out: the path the component's
637
+ * data sits at with entry indexes left out (`items.sku`, as {@link kernelValueIndex} writes a
638
+ * row's `path`), its id and type, and whether it holds data ({@link kernelClaimsData}, the
639
+ * engine's `holdsData`: a button, static HTML, an image, a signature and a plain group hold
640
+ * none, and are listed with the path they would have). Walked exactly as
641
+ * {@link kernelKnownKeyShapes} walks the allowlist, with the same expressions, so the paths
642
+ * that hold data are {@link kernelKnownValuePaths}, no more and no fewer: data keys,
643
+ * data-scoping containers, and a repeating section's entries at its collection path as written
644
+ * (`collection` names it, on the section and on every component inside one entry). A data grid
645
+ * is listed as such a section: its children are the fields of one entry, and the
646
+ * tree is read through {@link kernelNormalizeDataGrids} first, so a grid with no binding is
647
+ * listed at its id, as the run reads it. A section whose
648
+ * collection path is written with brackets has no known keys and is left out with its subtree. An id
649
+ * that is not a string is read as the allowlist reads it (`String(id)`). A journey page's own
650
+ * nodes hold no form value and are not listed; the form fields they place are, here.
651
+ * Walked with an explicit stack, so a tree of any depth is read. The allowlist cannot read a
652
+ * child that is not an object at all (it has no id), so that child is skipped here, and a slot
653
+ * that is not a list too.
654
+ */
655
+ export declare function kernelDefinitionPaths(authored: ComponentNode): InspectedPath[];
656
+ /**
657
+ * Names the rule about to be evaluated on the run's evaluation: `rules:<id>:<key>`.
658
+ * A plugin function that throws while it runs is recorded against this name, so a refusal
659
+ * under `formulaErrors: "fail"` can say which rule it was. No evaluation, no name.
660
+ */
661
+ export declare function kernelMarkRule(evaluation: KernelEvaluation | undefined, componentId: string, key: string): void;
662
+ /**
663
+ * The rule context the browser's orchestrator builds for a node (`contextOver` +
664
+ * `ruleContext`, runtime/browser/runtime-orchestrator.ts), over one view of the answers keyed
665
+ * both ways: form values keyed by component id, the node's own answer at its value path, and
666
+ * each ancestor's answer keyed by the ancestor's id, nearest first. The host context only when
667
+ * the server supplied one (`evaluation.hostContext`); without it, no rule reading `host.` gets
668
+ * this far. One builder for every rule the kernel evaluates —
669
+ * {@link kernelResolveSemanticState} and {@link kernelRuleRequired} — so their readings cannot
670
+ * drift.
671
+ */
672
+ export declare function kernelRuleContext(node: ComponentNode, idValues: Record<string, unknown>, pathValues: Record<string, unknown>, pathOf: Record<string, string>, parentOf: Record<string, string>, evaluation?: KernelEvaluation): RuleEvaluationContext;
673
+ /**
674
+ * Mirrors `RulesSemanticStateResolver` (runtime/browser/runtime-orchestrator.ts): the node's
675
+ * configuration flags, then its `visibleWhen` / `enabledWhen` / `readonlyWhen` over the same
676
+ * rule context the browser builds ({@link kernelRuleContext}).
677
+ *
678
+ * One difference, by necessity: a rule that reads a `host.` path is left unevaluated, and the
679
+ * node keeps its configured state for that rule, unless the server supplied a host context of its
680
+ * own (`evaluation.hostContext`), which the rule then reads. Without one the server cannot
681
+ * reproduce such a rule; the journey diagnostics warn about it
682
+ * (`rule.reads-host`). The same skip (`kernelRuleSkipped`) covers a rule scoped to the
683
+ * browser (`run: "browser"`), which the author asked the server not to replay, and one reading
684
+ * the clock when the context gave no day; a rule scoped to the server is applied here and
685
+ * nowhere else.
686
+ */
687
+ export declare function kernelResolveSemanticState(node: ComponentNode, idValues: Record<string, unknown>, pathValues: Record<string, unknown>, pathOf: Record<string, string>, parentOf: Record<string, string>, evaluation?: KernelEvaluation): SemanticNodeState;
688
+ /**
689
+ * Whether a node's `rules.requiredWhen` holds over the settled view: the fold's
690
+ * `ruleRequired`, over the same context as the browser's (`kernelRuleContext`). A rule that
691
+ * reads `host.` is `false` here: the server has no host context, and requiredness is `required`
692
+ * OR the rule, so a server that cannot evaluate the rule is never stricter than the browser
693
+ * that can. The builder says so under the rule (the Rules tab's note), and so do the journey
694
+ * diagnostics (`rule.reads-host`) for a form that has a journey — a form without one gets no
695
+ * diagnostic for it. Called only where the fold reads the rule at all (`kernelFoldRequired`).
696
+ * A rule scoped to the browser, or reading the clock with no day given, is `false` here for
697
+ * the same reason (`kernelRuleSkipped`); a rule scoped to the server is enforced here alone,
698
+ * the author's opt-out of that reading for one rule.
699
+ */
700
+ export declare function kernelRuleRequired(node: ComponentNode, idValues: Record<string, unknown>, pathValues: Record<string, unknown>, pathOf: Record<string, string>, parentOf: Record<string, string>, evaluation?: KernelEvaluation): boolean;
701
+ /**
702
+ * Whether a node's `rules.validWhen` holds over the settled view: the fold's
703
+ * `ruleValid`, over the same context as the browser's (`kernelRuleContext`). Holds only for a
704
+ * yes-or-no `true`: `false`, no answer, and a rule whose plugin function threw (it reads
705
+ * `undefined`) do not, so the answer is refused, the fail-closed reading. A rule this side skips
706
+ * (`kernelRuleSkipped`: scoped to the browser, reading `host.`, reading the clock with no day
707
+ * given) holds here, a lenient reading: a server that cannot evaluate a check is never
708
+ * stricter than the browser that can. A rule scoped to the server is enforced here alone.
709
+ */
710
+ export declare function kernelRuleValid(node: ComponentNode, idValues: Record<string, unknown>, pathValues: Record<string, unknown>, pathOf: Record<string, string>, parentOf: Record<string, string>, evaluation?: KernelEvaluation): boolean;
711
+ /**
712
+ * What a data grid's `rules.minRows` or `rules.maxRows` (`key`) comes to over the settled view:
713
+ * the fold's `ruleRowBound`, evaluated form-scoped over the same context as every
714
+ * rule of the node ({@link kernelRuleContext}). `undefined`, so the fixed bound stands, for a
715
+ * rule this side skips ({@link kernelRuleSkipped}: scoped to the browser, reading `host.`,
716
+ * reading the clock with no day given) and for one whose plugin function threw; a rule scoped
717
+ * to the server is applied here alone. The fold never asks for a rule reading `row.`.
718
+ */
719
+ export declare function kernelRuleRowBound(node: ComponentNode, key: "minRows" | "maxRows", idValues: Record<string, unknown>, pathValues: Record<string, unknown>, pathOf: Record<string, string>, parentOf: Record<string, string>, evaluation?: KernelEvaluation): unknown;
720
+ /**
721
+ * Mirrors the collection owners the browser orchestrator builds: collection path -> the
722
+ * repeating section whose entries live there (`collectionPathOf`; a data grid is one),
723
+ * first in document order. What the fold judges a key no component owns by
724
+ * (`KernelFoldInput.collectionOwners`): an entry's keys follow their section, so a
725
+ * hidden-and-excluded or off-path one no longer submits them, and they steer no rule.
726
+ */
727
+ export declare function kernelCollectionOwners(index: {
728
+ order: string[];
729
+ nodeById: Record<string, ComponentNode>;
730
+ }): Record<string, string>;
731
+ /**
732
+ * Whether an unanswered read of a calculation might have been an answer the browser held and
733
+ * the submission left out, so the server cannot tell "the person
734
+ * left it empty" from "the browser read it and withheld it". Only then is the calculation taken
735
+ * on trust. `read` names a component by id. It is a withheld read when it names no data-holding
736
+ * component of this form (a `host.` path, a repeating section's collection, an entry's `row.`
737
+ * field, a name nothing owns), when the component sits in a repeating section, when a journey
738
+ * runs (a page the path skips drops its answers, by default excluded), or when the component can
739
+ * be hidden (`hidden`, or a `visibleWhen`, on it or an ancestor) and does not say a hidden answer is
740
+ * kept and sent (`hiddenValueBehavior: "retain"`; by default it is left out of the submission). A component the journey's path
741
+ * is known to skip (`offPath`, the fold's own placement of it) is no
742
+ * longer a maybe: withheld for certain, its read is the empty operand; one on the path is judged
743
+ * as a form without a journey judges it. Any other component, optional
744
+ * or required, never hidden or one whose hidden answer is retained, is an input the browser
745
+ * would have sent had it held an answer: its absence is the person's, and the calculation is
746
+ * worked out over the empty operand, as the browser worked it out.
747
+ */
748
+ export declare function kernelReadMayBeWithheld(read: string, index: {
749
+ order: string[];
750
+ nodeById: Record<string, ComponentNode>;
751
+ parentOf: Record<string, string>;
752
+ }, journeyed: boolean, offPath?: Record<string, true>): boolean;
753
+ /**
754
+ * The calculations (`rules.value`) worked out again from what was submitted, before the fold
755
+ * reads them: the browser's `RuntimeOrchestrator.runValueRules`, defaults aside. A
756
+ * calculated answer is not one the person gave. Taken as sent, a forged one could hide a
757
+ * required field or skip a page (`age` sent as 40 beside a `birth_year` of 2015). So each
758
+ * calculation is evaluated in document order over the answers as they stand, to a bounded
759
+ * fixpoint, and its result laid over the submitted one: the fold, the conditions, the checks
760
+ * and the returned values all read the server's own result.
761
+ *
762
+ * A calculation keeps its submitted value where the server cannot reproduce the browser's:
763
+ * - it reads `host.` and the server supplied no host context (with one, it is worked out against
764
+ * it, a key the context lacks reading as no answer); or its `run` is `browser` — the author
765
+ * asked the server not to replay it; or it reads the clock and the context gave no day
766
+ * (`kernelRuleSkipped`);
767
+ * - one of its reads comes back `undefined` and the answer might have been withheld
768
+ * ({@link kernelReadMayBeWithheld}) — an answer the server was not sent, maybe one the browser
769
+ * read while it was hidden and excluded (calculations read the stored answers). A read that
770
+ * cannot have been withheld (an optional input never hidden, or one whose hidden answer is
771
+ * retained) is the person's own empty answer, and the calculation is worked out over it as
772
+ * the browser worked it out (omitting an optional input cannot turn a forged
773
+ * result into a trusted one). A read of another calculation this side works out is answered all the same: its answer is
774
+ * whatever this side worked out, no answer included (arithmetic over a missing operand or by
775
+ * zero is `undefined`, never `NaN`), so `coalesce(ratio, 0)` is reproduced over a `ratio` that
776
+ * came to nothing;
777
+ * - it is, or sits inside, a repeating section — entries are not computed one by one here.
778
+ *
779
+ * A calculation on a node that holds no data (a button, static HTML, a plain group) is not
780
+ * worked out at all: such a node defines no key ({@link kernelKnownKeyShapes}), so
781
+ * there is nowhere in the returned values for its result.
782
+ *
783
+ * Defaults (`rules.defaultValue`) are the person's starting answers and are not recomputed. A
784
+ * result that serializes as the submitted value does leaves the submitted one in place, so an
785
+ * honest submission comes back exactly as it was sent. Every read is as the envelope carries it
786
+ * (`kernelJsonValue`): a calculation that came to no answer is no key, and reads as `undefined`
787
+ * in the next, here and in the browser alike (an older browser's `null` for it, JSON's spelling
788
+ * of the `NaN` arithmetic once made, is worked out again to no key). `recalculated` lists the
789
+ * value paths whose answer changed, in document order; the records are prototype-free.
790
+ *
791
+ * `unreproduced` lists the value paths of the calculations kept as sent while a value
792
+ * was there — one that reads `host.`, one a read of which came back unanswered in the last
793
+ * pass — in document order: answers worked out in the browser that this side took on trust
794
+ * ({@link kernelClientDerived}). A kept `null` (an older browser's spelling of a
795
+ * calculation that came to nothing) is no value.
796
+ *
797
+ * A calculation on a field of a repeating section is worked out entry by entry:
798
+ * for each entry the values carry (`items[0].sku`, {@link kernelRowIndexes}) its
799
+ * rule is evaluated with `row.` reading that entry's answers (keyed as the entry keys them,
800
+ * `address.city` under a container), `rowIndex()` the entry's 1-based position among those
801
+ * submitted and `rowCount()` how many there are, and its result laid over the entry's own key,
802
+ * so a forged `items[0].total` is replaced. A result in `recalculated`, an entry's calculation
803
+ * taken on trust (it reads `host.`, runs in the browser, or reads an answer the entry lacks) in
804
+ * `unreproduced`, both by the entry's key. An aggregate over the whole section
805
+ * (`sum(items.total)`) names no answer here and is kept as sent. The entries are
806
+ * read from the values as they came, so an entry a calculation alone would create does not
807
+ * exist: an entry is one the person submitted a field of.
808
+ */
809
+ export declare function kernelRecomputeCalculations(root: ComponentNode, values: Record<string, unknown>, index: {
810
+ order: string[];
811
+ nodeById: Record<string, ComponentNode>;
812
+ parentOf: Record<string, string>;
813
+ }, pathOf: Record<string, string>, idsByPath: Record<string, string[]>, evaluation?: KernelEvaluation, journeyed?: boolean, prepared?: KernelPrepared, offPath?: Record<string, true>): {
814
+ values: Record<string, unknown>;
815
+ recalculated: string[];
816
+ unreproduced: string[];
817
+ converged: boolean;
818
+ cycle?: string[];
819
+ /** Every path a worked-out calculation reads; absent when there is none. */
820
+ reads?: Record<string, true>;
821
+ /** True when the last pass kept a calculation as sent because a read came back unanswered. */
822
+ deferred?: boolean;
823
+ /** The value paths this side worked out (a calculation whose reads were all answered); absent when there is none. */
824
+ workedOut?: Record<string, true>;
825
+ };
826
+ /** The fold over a submission, with what the kernel worked out for itself before it. */
827
+ export interface KernelSubmissionFold extends KernelFoldResult {
828
+ /** Value paths whose calculation came out other than submitted, in document order. */
829
+ recalculated: string[];
830
+ /** False when the calculations did not settle within their bound (a cycle among them). */
831
+ calculationsConverged: boolean;
832
+ /** When they did not settle, the calculations that feed one another (a cycle ends where it began) or are still moving. */
833
+ calculationCycle?: string[];
834
+ /** The components their `requiredWhen`, not their flag, made required, in document order. */
835
+ requiredByRule: string[];
836
+ /**
837
+ * Value paths of the submitted answers that were worked out in the browser and are kept as
838
+ * sent ({@link kernelClientDerived}), in document order; empty when there is none.
839
+ */
840
+ clientDerived: string[];
841
+ /** The journey's ownership — what each page places — when there is a journey. */
842
+ ownership?: JourneyOwnership;
843
+ /**
844
+ * The components whose server-side rules or calculation read the clock, in
845
+ * document order: a rule the server applies (`run` both or server) that names `today()` or
846
+ * `age()`, whether or not a day was given; empty when there is none.
847
+ */
848
+ clockDependent: string[];
849
+ /**
850
+ * The components whose `server` or `server-secret` rules this fold applied, in
851
+ * document order: a state rule, a required rule read where the fold reads one, a calculation
852
+ * worked out here; empty when there is none.
853
+ */
854
+ serverRules: string[];
855
+ /**
856
+ * The components whose own `visibleWhen` this side could not replay, in
857
+ * document order: such a component and its descendants are treated as hidden for requiredness
858
+ * ({@link kernelFoldRelaxUnreplayable}); empty when there is none.
859
+ */
860
+ visibilitySkipped: string[];
861
+ }
862
+ /**
863
+ * The answers a submission carries that were worked out in the browser and that this side
864
+ * kept as sent, as value paths in document order:
865
+ *
866
+ * 1. the target of each worked-out value in use (`ownership.workedOutOf`) whose answer is
867
+ * submitted — its page on the path, or its answer kept off it by `offPathValues: "retain"` —
868
+ * computed by the browser from a presentation's own fields, which are never sent, so no
869
+ * server can work it out again;
870
+ * 2. each calculation kept unrecomputed while a value was there (`unreproduced`, from
871
+ * {@link kernelRecomputeCalculations}) and still submitted;
872
+ * 3. each calculation that reads one of these, directly or through another calculation: its
873
+ * result is worked out here, but from an answer taken on trust.
874
+ *
875
+ * Only a submitted answer is listed — the list describes the judged values — but one the fold
876
+ * withheld still counts as what a calculation read: a result worked out from an answer taken
877
+ * on trust is listed whether or not that answer is itself submitted (a target on a page the
878
+ * path skips, say, that a calculation on no page reads).
879
+ *
880
+ * Every one of them is still held to the form's own rules — required, format, plugin checks —
881
+ * like any answer; the list says which of the judged values a host should not read as verified
882
+ * arithmetic. An alias is never listed: its answer is the person's. A `null` or withheld
883
+ * answer is not a value. A calculation inside a repeating section is listed by an entry's key
884
+ * (`items[0].total`) when that entry's was kept as sent; one that reads
885
+ * such an answer is not followed through. The kernel reads no own node's rule and no worked-out value's expression for this:
886
+ * only which form fields a presentation says it works out.
887
+ */
888
+ export declare function kernelClientDerived(ownership: JourneyOwnership | undefined, fold: {
889
+ submittable: Record<string, unknown>;
890
+ }, unreproduced: readonly string[], index: {
891
+ order: string[];
892
+ nodeById: Record<string, ComponentNode>;
893
+ parentOf: Record<string, string>;
894
+ }, pathOf: Record<string, string>, idsByPath: Record<string, string[]>): string[];
895
+ /**
896
+ * The form components in scope for one page of a journey, in document order: those
897
+ * the page lists, with their subtrees, and those its own nodes reference, fill or work out
898
+ * — the same ownership the path is worked out with. What a page's check answers
899
+ * for: a host keeps the errors on these components, and those on no component at all bar
900
+ * `journey.exit`. The submissions service works the same list out in-process (`pageScope`);
901
+ * a host with no engine of its own asks for it with `context.page`. Never an own node's id:
902
+ * no error this side raises names one.
903
+ */
904
+ export declare function kernelPageComponentIds(ownership: JourneyOwnership, pageId: string): string[];
905
+ /**
906
+ * The ids of the pages any of whose routes' `when` reads the clock (`today()`, `age()`), in
907
+ * page order. A day-less run refuses a journey with any (`journey.clockDependent`).
908
+ */
909
+ export declare function kernelJourneyClockPages(journey: Journey): string[];
910
+ /**
911
+ * The submittable fold (`core/state/submittable-fold.ts`) over what was submitted:
912
+ * the calculations worked out again ({@link kernelRecomputeCalculations}), the tree indexed the
913
+ * kernel's way, a repeating section's entries judged by the section
914
+ * ({@link kernelCollectionOwners}), rules resolved by {@link kernelResolveSemanticState}, each
915
+ * `requiredWhen` by {@link kernelRuleRequired}, and, with a journey, the path worked
916
+ * out from the values — never taken from the client. The browser runs the same fold over the
917
+ * same answers, so both land on the same states, the same requiredness and the same
918
+ * submittable values. The answers are read as the envelope carries them (`kernelJsonAnswers`),
919
+ * so values handed in-process — never through JSON — judge as the sandbox's would; the rules,
920
+ * the journey and the calculations read only the keys the schema defines
921
+ * ({@link kernelDefinesKey}), whatever the unknown-field mode kept. So under `keep` a key the
922
+ * schema does not define — an own answer's `@` key, one spelled like a button's or a
923
+ * fieldset's id — is stored as sent and read by nothing: the verdict is `strip`'s.
924
+ */
925
+ export declare function kernelFoldSubmission(root: ComponentNode, values: Record<string, unknown>, journey: Journey | undefined, evaluation?: KernelEvaluation, prepared?: KernelPrepared, keyMemo?: KernelKeyMemo): KernelSubmissionFold;
926
+ /**
927
+ * Whether an object entry of a journey page — a node the presentation owns, with everything
928
+ * under it — has a usable shape: exactly what `validateJourneyShape`
929
+ * (`core/schema/journey.ts`) finds nothing wrong with, so the browser drops a journey here
930
+ * refused. Every node is a record with a non-empty string `type`. A reference
931
+ * (`journey-field`) names its form component in `configuration.componentId` and holds no
932
+ * children. Any other node has a non-empty string `id`; its `configuration` and `rules` are
933
+ * absent or records; its `configuration.fills` is absent or a non-empty string; its `children`
934
+ * are absent or a record of lists of nodes. A worked-out value (`journey-value`) names its
935
+ * target in `configuration.to`, carries a rule source in `configuration.value` (a formula
936
+ * string, a tree, or the object form: never evaluated here) and holds no children.
937
+ *
938
+ * The shape only. Whether an id clashes, a type is allowed or a target exists is for the
939
+ * usability rules (`journeyOwnNodeUsable`, `journeyTargetUsable`), which ignore a node on both
940
+ * sides rather than refuse the journey. Walked with a stack of its own, not recursion: a page
941
+ * nested a thousand deep must not exhaust the sandbox's call stack.
942
+ */
943
+ export declare function kernelIsPresentationNode(entry: unknown): boolean;
944
+ /**
945
+ * Whether `value` is usable as a journey: exactly the shape `validateJourneyShape`
946
+ * (`core/schema/journey.ts`) accepts, which is what the browser's `readJourneys` keeps. A
947
+ * host may build `context.journey` itself rather than read it from the definition, and a
948
+ * journey the browser would drop must not run here either: a page whose `components` is not a
949
+ * list of ids and nodes would otherwise be emptied and its required fields waved through, and a
950
+ * page that carries a `when` of its own (pages have none) would walk a path its author did not
951
+ * write. A page entry is a component id (a string) or a node the presentation owns
952
+ * ({@link kernelIsPresentationNode}). {@link runKernel} reads it over the compiled copy, as the
953
+ * browser's `readJourneys` does: a route `when` the compile could not read is gone from the copy
954
+ * and reported as a formula problem, so this check never sees it, and `journey.invalid` is left
955
+ * to the shapes the compile keeps as they are. Kernel-shaped: the literals are spelled inline.
956
+ */
957
+ export declare function kernelIsJourney(value: unknown): value is Journey;
958
+ /**
959
+ * Mirrors `FormRuntime`'s `errorPassesHiddenPolicy`: an error on a component the fold says is
960
+ * not validated is dropped, and so is a required-coded one where requiredness does not apply.
961
+ * Errors naming no component, or one the form does not have, pass.
962
+ *
963
+ * One kind of error on an unvalidated component passes: a field-constraints check on
964
+ * the shape of an answer — `minLength`, `maxLength`, `pattern`, `maxFileSize`, `fileType`, and
965
+ * a number or date that is not one (`number`, `date`), a text that is not a string
966
+ * (`text`), a file answer that is no attachment (`file`) and an attachment whose size is
967
+ * unusable or contradicts its bytes (`fileSize`, `file.sizeMismatch`) — when the answer is still
968
+ * submitted (`submitValue`, and not cleared). Hiding a component relaxes "required", not the
969
+ * format of an answer the submission carries.
970
+ */
971
+ export declare function kernelErrorPassesFold(error: KernelValidationError, effective: Record<string, EffectiveNodeState>): boolean;
972
+ /**
973
+ * Where a text lives in a definition's `translations`, as `TextAddress`
974
+ * (core/localization/translations.ts) names it: a kind (`form`, `components`, `chrome`,
975
+ * `journeys`, `pdf`, `texts`), the owner's id (none for `form`), then the property segments, never an index.
976
+ */
977
+ export interface KernelTextAddress {
978
+ kind: string;
979
+ owner?: string | undefined;
980
+ path: readonly string[];
981
+ }
982
+ /**
983
+ * Mirrors `isSafeSegment` (core/localization/translations.ts): a key the
984
+ * translations map may hold, a non-empty string that is not `__proto__`, `constructor` or
985
+ * `prototype`. The kernel carries its own copy, as it carries every reading it shares with the
986
+ * browser: the sandbox program splices the kernel's functions, not the localization modules.
987
+ */
988
+ export declare function kernelIsSafeSegment(segment: unknown): boolean;
989
+ /**
990
+ * Mirrors `matchLocaleKey` (core/localization/translations.ts): which of the map's locale keys
991
+ * serves `locale`, the whole tag (`exact`) or its primary subtag (none when the tag is already
992
+ * primary). Tags compare case-insensitively with `_` read as `-`; a key spelled exactly as asked
993
+ * wins over another spelling of the same tag; an unsafe key is never one.
994
+ */
995
+ export declare function kernelTranslationLocaleKey(map: Record<string, unknown>, locale: string, exact: boolean): string | undefined;
996
+ /**
997
+ * Mirrors `mapText` (core/localization/translations.ts): the text of the entry `{ text, source }`
998
+ * at `keys` under the map's locale `key`, read by own properties only (an option valued
999
+ * `toString` is not the method); an empty text is no text.
1000
+ */
1001
+ export declare function kernelTranslationText(map: Record<string, unknown>, key: string | undefined, keys: readonly string[]): string | undefined;
1002
+ /**
1003
+ * Mirrors `catalogText` (core/localization/translations.ts): the host catalog's string at `keys`
1004
+ * under its locale `key`, read by own properties only. A catalog leaf is a plain string (the map's
1005
+ * entries are `{ text, source }`); an empty string is no text.
1006
+ */
1007
+ export declare function kernelCatalogText(catalog: Record<string, unknown>, key: string | undefined, keys: readonly string[]): string | undefined;
1008
+ /**
1009
+ * Mirrors `resolveText` (core/localization/translations.ts) over the run
1010
+ * context's two sources, in the browser's order: the host `catalog`'s exact locale, the definition's
1011
+ * `translations` exact locale, the catalog's primary subtag, the map's primary subtag, then
1012
+ * `defaultText`. So `fr` serves `fr-CA`, but the map's own `fr-CA` beats a catalog's `fr`. The
1013
+ * catalog is the optional run-context key `catalog`, absent when the host
1014
+ * has none: the map alone. A source that is not a record
1015
+ * is skipped (its rungs read as no text), an address with an unknown kind, an unsafe owner or
1016
+ * segment, or no path, is read as no translation: the default, never a throw.
1017
+ */
1018
+ export declare function kernelResolveText(defaultText: string, address: KernelTextAddress, locale: string, translations: unknown, catalog?: unknown): string;
1019
+ /** Mirrors `compilePattern`: anchored, unicode, `null` for an uncompilable source. The kernel
1020
+ * logs such a pattern as a definition problem where it checks the component and, under
1021
+ * `formulaErrors: "fail"`, fails the check closed ({@link kernelRunFieldConstraints}), as the
1022
+ * browser's stage does under the same word; `check` reports it (`component.pattern.invalid`). */
1023
+ export declare function kernelCompilePattern(source: string): RegExp | null;
1024
+ /** Mirrors `readLengthLimits` (core/schema/length-limits.ts): floored, at least one, and
1025
+ * neither when the minimum exceeds the maximum. `null` stands in for "no limit" because the
1026
+ * value crosses no ABI and the kernel avoids `undefined` in object shapes. */
1027
+ export declare function kernelReadLengthLimits(configuration: Record<string, unknown>): {
1028
+ minLength: number | null;
1029
+ maxLength: number | null;
1030
+ };
1031
+ /** Mirrors `countCharacters`: Unicode code points, untrimmed. */
1032
+ export declare function kernelCountCharacters(value: string): number;
1033
+ /** Mirrors `readAcceptTokens` (core/schema/file-upload.ts): lower-cased, de-duplicated,
1034
+ * extension or MIME tokens only. */
1035
+ export declare function kernelReadAcceptTokens(raw: unknown): string[];
1036
+ /** Mirrors the limits `readFileUploadConfiguration` reads: `maxFileSizeMb` to bytes (`null`
1037
+ * for none, as the length limits do) and the accept tokens. And the count: a
1038
+ * single-file field (`multiple` not `true`) holds one file, a multi-file one `maxFiles` (a
1039
+ * whole number of 1 or more, floored) else 100, the cap a list is held to when the author
1040
+ * set none. */
1041
+ export declare function kernelReadFileLimits(configuration: Record<string, unknown>): {
1042
+ maxFileSize: number | null;
1043
+ accept: string[];
1044
+ maxFiles: number;
1045
+ };
1046
+ /** Mirrors `readFileAttachments` / `isFileAttachment`: the attachment envelope every storage
1047
+ * kind records, from a single value or a list. */
1048
+ export declare function kernelFileAttachments(value: unknown): Array<{
1049
+ storage: string;
1050
+ name: string;
1051
+ type: string;
1052
+ size: number;
1053
+ }>;
1054
+ /** Mirrors `matchesAccept`: extension against the name's end, `type/*` against the MIME
1055
+ * type's start, a full MIME token exactly; no tokens admits everything. */
1056
+ export declare function kernelMatchesAccept(file: {
1057
+ name: string;
1058
+ type: string;
1059
+ }, accept: string[]): boolean;
1060
+ /**
1061
+ * The byte length base64 text decodes to, counted over the payload characters only: whitespace
1062
+ * (line wraps, CRLF) and `=` padding are not bytes, and a `data:...,` prefix is not payload
1063
+ * (wrapped base64 from an honest client is not a size lie).
1064
+ */
1065
+ export declare function kernelBase64DecodedLength(data: string): number;
1066
+ /** The most errors one run reports; past it the list is cut and ends with `errors.truncated`. */
1067
+ export declare function kernelErrorCap(): number;
1068
+ /** Mirrors `formatFileSize`: `512 B`, `12 KB`, `1.5 MB` — arithmetic only, no locale. */
1069
+ export declare function kernelFormatFileSize(bytes: number): string;
1070
+ /**
1071
+ * The fields inside a repeating section: component id -> `collection`, the
1072
+ * section's collection path as written, and `suffix`, where the field's answer sits within an
1073
+ * entry (`.name`, `.address.city` under a data-scoping container inside the entry), so row `n`
1074
+ * keeps it at `collection[n]` + `suffix`. Walked as {@link kernelKnownKeyShapes} walks the
1075
+ * allowlist: a section nested in another keeps its own collection path and starts its own
1076
+ * suffixes, a section whose path is written with brackets defines nothing, and only a node
1077
+ * holding an answer of its own is listed ({@link kernelFoldHoldsOwnAnswer}). No prototype.
1078
+ */
1079
+ export declare function kernelRowFields(root: ComponentNode): Record<string, {
1080
+ collection: string;
1081
+ suffix: string;
1082
+ }>;
1083
+ /**
1084
+ * A key as an entry's answer: `collection[n].rest` for a collection in
1085
+ * `collections` (a record keyed by collection path), `n` digits with no leading zero as the
1086
+ * runtime writes them, `rest` the field's place within the entry (`name`, `address.city`). The
1087
+ * parts, else `undefined` for any other key: no listed collection, another bracket before the
1088
+ * index, no field after it.
1089
+ */
1090
+ export declare function kernelRowKeyParts(key: string, collections: Record<string, true>): {
1091
+ collection: string;
1092
+ digits: string;
1093
+ rest: string;
1094
+ } | undefined;
1095
+ /**
1096
+ * The entries each repeating section holds in `values`: collection path -> the
1097
+ * entry indexes some key carries ({@link kernelRowKeyParts}), ascending and each once. An
1098
+ * entry exists as soon as one of its fields is submitted. One pass over the keys. No prototype.
1099
+ */
1100
+ export declare function kernelRowIndexes(values: Record<string, unknown>, collections: Record<string, true>): Record<string, number[]>;
1101
+ /**
1102
+ * Each entry's answers as a rule's `row.` scope reads them: collection path ->
1103
+ * entry index (as text) -> the entry's answers keyed within the entry (`name`,
1104
+ * `address.city`), each as the envelope carries it ({@link kernelJsonValue}), an answer
1105
+ * holding `undefined` left out. One pass over the keys. No prototype at any level.
1106
+ */
1107
+ export declare function kernelRowValues(values: Record<string, unknown>, collections: Record<string, true>): Record<string, Record<string, Record<string, unknown>>>;
1108
+ /**
1109
+ * The schema-declared constraints (`required` / `minLength` / `maxLength` / `pattern`),
1110
+ * enforced with the exact semantics of `createFieldConstraintsStage` — one error per field,
1111
+ * in that precedence — but reported as the sandbox's own stage (`stage: "field-constraints"`,
1112
+ * `source: "wasm"`). This is why a form with only standard constraints needs no wasm plugin:
1113
+ * the core kernel already validates it.
1114
+ *
1115
+ * A `number` or `date` component's non-empty answer that is not one raises `number` / `date`, before its length and pattern, through the browser's own predicate
1116
+ * (`kernelAnswerKindCode`). What only the browser's controls know — a date typed in part, a
1117
+ * number box the browser could not read — never reaches here: those answers arrive empty.
1118
+ * Beside them: a `text` or `textarea` answer that is not a string —
1119
+ * a number, a boolean, a list (an empty one included), an object — raises `text`, so a length
1120
+ * limit or a pattern cannot be dodged by another JSON type; a valid number or date answer
1121
+ * outside the component's declared `min` / `max` raises `number.min` / `number.max` /
1122
+ * `date.min` / `date.max` (bounds inclusive, `parameters.min` or `parameters.max` the bound),
1123
+ * before its length and pattern; and a `file` answer is held to its shape and count.
1124
+ *
1125
+ * A file answer holds attachments, each an object with a non-empty `storage`, a `name`, a
1126
+ * `type` and a finite `size`. One that is not (a bare string, an object missing a
1127
+ * key or with one of the wrong type, a list with such an item) raises `file`, and the limits
1128
+ * are not applied to it. More attachments than the field takes raises `fileCount`
1129
+ * (`parameters.count` and `parameters.maxFiles`): one for a field that is not `multiple`, else
1130
+ * `maxFiles`, else 100 ({@link kernelReadFileLimits}). Only then the size and type of each.
1131
+ *
1132
+ * The fields of a repeating section are held per entry: each entry the
1133
+ * values carry (`items[0].sku`, {@link kernelRowIndexes}) is checked at its own key, which the
1134
+ * error's `path` names, with the component's id. A `required` field is reported only for the
1135
+ * entries missing it, and a section with no entry reports nothing. The field's state in
1136
+ * `effective` is the component's, the same for every entry (the fold does not fold entry by
1137
+ * entry); `requiredWhen` is still not read inside a section.
1138
+ *
1139
+ * With `effective` (the fold's states), a required component where requiredness does not
1140
+ * apply is not reported empty, and a component whose state skips validation is held only to
1141
+ * the shape of an answer it still submits — length, pattern, file size and type, never
1142
+ * `required`: what the browser's `errorPassesHiddenPolicy` filter leaves of the same
1143
+ * stage's errors. A cleared or excluded answer is not in `values`, so it has no shape to check.
1144
+ * A node `effective` does not know is checked as usual.
1145
+ *
1146
+ * With `requiredBy` (the fold's `required`), a component is required when the record
1147
+ * says so (its `configuration.required` tick, or its `requiredWhen` held over the settled view,
1148
+ * which the fold has already joined; a component the fold set aside is not) — gated by
1149
+ * `requiredApplies` alike. A component the record lacks, or no record at all, keeps the flag
1150
+ * alone: what a caller holding no fold gets, as the browser's stage without `requiredComponents`.
1151
+ *
1152
+ * With `options.invalidBy` (the fold's `invalid`), a component it names is
1153
+ * refused with `rule` (no parameters) for a non-empty answer that nothing above refused, after
1154
+ * every other check of the field, and never for an answer held only to its shape. Without it, no
1155
+ * `rule` is raised, as the browser's stage without `invalidComponents`.
1156
+ *
1157
+ * Two readings the kernel makes beyond the browser's stage, both on this side only. An
1158
+ * attachment whose declared `size` is negative or not an integer is refused (`fileSize`,
1159
+ * `parameters.file` and `parameters.size`): no honest client declares one, and the envelope
1160
+ * guard alone would make the answer yield nothing, leaving the limits unchecked. A
1161
+ * `pattern` that does not compile is an authoring mistake, not the person's: it is written to
1162
+ * `options.log` at `warn` once per component checked (`pattern does not compile`, data
1163
+ * `componentId` and `pattern`), and the check is skipped as the browser skips it, except under
1164
+ * `options.formulaErrors: "fail"`, where a non-empty answer fails it closed (`pattern`, with
1165
+ * `parameters.invalid: true`). A pattern of a catastrophic shape (`kernelRegexRisky`: a repeat of a
1166
+ * repeat, a repeated back-reference) is that same kind of definition problem (log `pattern is risky`,
1167
+ * `parameters.risky: true` as well when failed closed) and is never run, unless `options.riskyPatterns`
1168
+ * is `"allow"`. Without `options` the kernel reads as the browser's stage.
1169
+ *
1170
+ * A failed pattern carries the field's own `patternMessage` as `parameters.message`, worded for
1171
+ * `locale` through `options.catalog` and `options.translations` at `components › <id> › patternMessage`
1172
+ * (catalog first, as in the browser);
1173
+ * a `patternMessage` that is not a string is no message.
1174
+ */
1175
+ export declare function kernelRunFieldConstraints(root: ComponentNode, values: Record<string, unknown>, locale: string, effective?: Record<string, EffectiveNodeState>, requiredBy?: Record<string, boolean>, options?: {
1176
+ log?: KernelLog;
1177
+ formulaErrors?: FormulaErrorPolicy;
1178
+ riskyPatterns?: string | undefined;
1179
+ prepared?: KernelPrepared | undefined;
1180
+ invalidBy?: Record<string, boolean> | undefined;
1181
+ /** Rows posted as `{}` ({@link kernelFlattenRows}): present rows with no key. */
1182
+ emptyRows?: string[] | undefined;
1183
+ /** What each grid's bound formulas came to (the fold's `rowBounds`). */
1184
+ rowBoundsBy?: Record<string, {
1185
+ min?: unknown;
1186
+ max?: unknown;
1187
+ }> | undefined;
1188
+ /** The definition's `translations`, which word a field's `patternMessage` for `locale`. */
1189
+ translations?: unknown;
1190
+ /** The host's translation catalog: read before the map under the same tag. */
1191
+ catalog?: unknown;
1192
+ /**
1193
+ * The definition's `kinds` map (type -> engine base type, `core/schema/component-kinds.ts`):
1194
+ * a component of a type it names is checked as its base. Read tolerantly.
1195
+ */
1196
+ kinds?: unknown;
1197
+ }): KernelValidationError[];
1198
+ /**
1199
+ * A deep, frozen copy of `value`: what a plugin validator is handed as
1200
+ * `context.values`. A validator is a judge, not a writer: whatever it does to its copy (it may
1201
+ * try, and under strict mode a write to a frozen object throws, which fails the validator
1202
+ * closed) the answers the run stores are the fold's. Walked with an explicit stack, so a
1203
+ * deeply nested answer cannot exhaust the sandbox's call stack; keys are defined, not assigned,
1204
+ * so an own `__proto__` key stays a key. Only enumerable own properties are copied (what JSON
1205
+ * carries).
1206
+ */
1207
+ export declare function kernelFrozenCopy(value: unknown): unknown;
1208
+ /**
1209
+ * A validator's `errors` list copied as plain data, every level, in one pass that reads each
1210
+ * member once: lists by index into fresh lists (never through the plugin's own `map`, which a
1211
+ * list subclass can turn into anything with `Symbol.species`), records by their own enumerable
1212
+ * keys into fresh records, anything else as it is. `undefined` when the list nests deeper than
1213
+ * 32 levels or holds more than 100,000 lists, records and members in all: such an answer (a
1214
+ * parameter that holds itself, a chain hundreds of levels deep) is no answer the run can write
1215
+ * out, and is read as unusable, failing closed, rather than overflow the stack writing it.
1216
+ * Explicit stack.
1217
+ */
1218
+ export declare function kernelValidatorErrorsCopy(listed: unknown[]): unknown[] | undefined;
1219
+ /**
1220
+ * What is wrong with a plugin validator's answer, or `undefined` when it is usable: an object, not a promise, whose `errors` is a list of records that each carry a
1221
+ * string `code`. A validator that cannot answer is no pass; the run fails as a validator that
1222
+ * will not run does (`validator_unavailable` in the service, `wasm.execution_error` in the
1223
+ * browser).
1224
+ */
1225
+ export declare function kernelValidatorFault(result: unknown): string | undefined;
1226
+ /**
1227
+ * The kernel entry point: partition unknown fields per `context.unknownFields` -> fold ->
1228
+ * schema constraints -> plugin validators -> outcome. `context.form` is the schema root.
1229
+ *
1230
+ * The fold ({@link kernelFoldSubmission}) resolves every component's rules over
1231
+ * the submittable view, as the browser runtime does, and with `context.journey` works out the
1232
+ * path from the values and folds everything off it to hidden. Before it, the calculations are
1233
+ * worked out again from what was sent, so a forged calculated answer steers nothing. Its states
1234
+ * decide what is checked: a hidden component is validated and required only as its
1235
+ * hidden-behaviour policy says — though an answer it still submits keeps its format checks —
1236
+ * a path that ends at an exit page is refused (`journey.exit`), and a fold that does not settle
1237
+ * is refused (`fold.unsettled`). Its `required` record decides which empty answers
1238
+ * are refused: a component's `required` flag OR its `requiredWhen` holding over the settled
1239
+ * view, a rule reading `host.` never counting here. Its submittable values are what validators
1240
+ * see and what comes back as `values`, only when no blocking error was found. This applies
1241
+ * to every form, not only journeys: a field hidden by its own rule (or by a
1242
+ * hidden ancestor) stops being required here, as in the browser, a field
1243
+ * whose `requiredWhen` holds is required here as in the browser, and a hidden answer its value
1244
+ * behaviour excludes is dropped.
1245
+ *
1246
+ * Validator-authored errors pass through untouched — the kernel adds, it does not rewrite —
1247
+ * except that one on a component the fold does not validate is dropped, as the browser drops
1248
+ * it (`errorPassesHiddenPolicy`). Each step writes to the run log (`context.logLevel` sets
1249
+ * what is kept), and so may the validators through `context.log`; what was kept
1250
+ * comes back as `logs`.
1251
+ *
1252
+ * **Presentations.** A journey's page may hold nodes the presentation owns.
1253
+ * The kernel places through them — a form field a page references, fills or works out counts
1254
+ * as asked on that page (`journeyOwnership`) — and otherwise knows nothing of them: it reads
1255
+ * none of their rules and no worked-out value's expression, and their answers are not form
1256
+ * values. A key an own field's answer would travel under (`@<presentation>.<id>`) is a key the
1257
+ * schema does not define, like any other: `unknownFields` decides it, and honest browsers
1258
+ * never send one. Two things come back beside the verdict. `clientDerived` lists the value
1259
+ * paths of the judged answers that were worked out in the browser and kept as sent
1260
+ * ({@link kernelClientDerived}); each is still held to the form's rules. With `context.page`
1261
+ * naming a page of the journey, `pageComponentIds` lists the form components in scope for it
1262
+ * ({@link kernelPageComponentIds}), so a host can keep a page's check to that page; the
1263
+ * verdict itself is the whole submission's either way.
1264
+ *
1265
+ * **Formulas.** Before anything reads a rule, the definition and the
1266
+ * journey are compiled into copies with every formula a tree (`kernelCompileDefinition`);
1267
+ * the context's own objects are never changed, since a server hands over the definition it
1268
+ * stores and hashes. `signatures` is what the parser checks a call against: the built-in
1269
+ * table's plus the wired plugins' (the kernel cannot read the table itself: it is data the
1270
+ * sandbox program is not spliced with); a caller that passes none parses against the built-ins
1271
+ * alone (`kernelBuiltInFunctionSignatures`), so a plugin's function is reported.
1272
+ * `context.formulaErrors`, else the form's own `root.configuration.formulaErrors`, else `fail`, says what a problem
1273
+ * costs: one `formula.invalid` error each and no judging at all (no fold, no constraints, no
1274
+ * validators), or, under the explicit opt-in `warn`, a log line each (`kernelFormulaPolicy`).
1275
+ * A clean compile logs nothing, so a run
1276
+ * over a form without formulas says what it always said. `context.today` is the day the
1277
+ * rules read (`today()`, `age()`), checked to be a real calendar date (else warned about and
1278
+ * treated as absent); `functions` are the plugins' formula functions, on every rule context.
1279
+ * Two more optional outcome keys, each only when non-empty: `clockDependent` and `serverRules`.
1280
+ * The journey's shape is checked after the compile, on the compiled copy, as the browser
1281
+ * checks its own: a page or route `when` of a shape no reader accepts is a formula problem
1282
+ * under the policy on both sides, and `journey.invalid` names only a shape the compile leaves
1283
+ * as it found it ({@link kernelIsJourney}).
1284
+ *
1285
+ * **The document and the index.** `context.document` is the delivered document as
1286
+ * the host received it (an envelope, or a signed wrapper), not rewritten: the outcome then
1287
+ * carries its canonical text and SHA-256 digest ({@link kernelDocumentDigest}), whatever the
1288
+ * verdict, so a host stores both and never serializes a document itself. Both are worked out
1289
+ * first, before the compile, the fold and the validators, and validators never see the
1290
+ * document (it is left out of their context), so nothing the run does can change what they
1291
+ * name. The verdict never reads it; the answers judged are `context.values`. A validator that
1292
+ * throws blocks the run with `validator.failed` (`parameters.validator`, its 1-based position;
1293
+ * the message goes to the log at `error`) instead of ending it, so the outcome still comes back. Whenever `values` comes back, `index`
1294
+ * comes with it: the same object as one row per answer ({@link kernelValueIndex}).
1295
+ *
1296
+ * **Choice answers.** Once the fold has settled the values that will be stored, every
1297
+ * choice answer among them is held to its options (`kernelCheckOptions`,
1298
+ * `portable-options.ts`): inline options from the definition, a data source's from
1299
+ * `context.optionSnapshot`, a source absent from the snapshot refused (`option.sourceUnavailable`), the answer's shape
1300
+ * always. A refusal is an `option.notAllowed` error and stands on a hidden component too.
1301
+ */
1302
+ export declare function runKernel(context: ValidationContext & {
1303
+ form?: ComponentNode;
1304
+ unknownFields?: KernelUnknownFieldsMode;
1305
+ logLevel?: ValidationLogThreshold;
1306
+ journey?: Journey;
1307
+ page?: string;
1308
+ today?: string;
1309
+ /** The values `host.` reads, supplied by the server (never the browser's); see {@link KernelEvaluation.hostContext}. */
1310
+ hostContext?: unknown;
1311
+ formulaErrors?: FormulaErrorPolicy;
1312
+ riskyPatterns?: string;
1313
+ reportFold?: boolean;
1314
+ document?: unknown;
1315
+ optionSnapshot?: KernelOptionSnapshot;
1316
+ /** The definition's `translations`: read tolerantly, only to word messages. */
1317
+ translations?: unknown;
1318
+ /**
1319
+ * The host's translation catalog (shape: locale, kind, owner, property, string
1320
+ * leaves): read tolerantly, before the map under the same tag.
1321
+ * Absent when the host has none.
1322
+ */
1323
+ catalog?: unknown;
1324
+ /**
1325
+ * The definition's `kinds` map (type -> engine base type, `core/schema/component-kinds.ts`):
1326
+ * the field constraints and the option check read a type it names as its base. Read
1327
+ * tolerantly: anything that is not a record of strings naming engine types maps nothing.
1328
+ */
1329
+ kinds?: unknown;
1330
+ }, validators: readonly KernelValidator[], functions?: Record<string, (args: unknown[]) => unknown>, signatures?: FormulaFunctionSignature[], cache?: KernelPreparedCache): KernelOutcome;
1331
+ /** The definition read once per driver: the compiled tree and the indexes every helper looks things up in. */
1332
+ export interface FormTestServerIndex {
1333
+ order: string[];
1334
+ nodeById: Record<string, ComponentNode>;
1335
+ parentOf: Record<string, string>;
1336
+ /** Collection path -> `true`, for every repeating section (a data grid among them). */
1337
+ lists: Record<string, true>;
1338
+ /** Collection path -> the section's id. */
1339
+ collections: Record<string, string>;
1340
+ /** A row field's key shape (`items[].qty`) -> its id. */
1341
+ rowShapes: Record<string, string>;
1342
+ /** Value path -> the ids whose answer is stored there. */
1343
+ idsByPath: Record<string, string[]>;
1344
+ /** The ids of the row fields (the values of `rowShapes`), so a bare row key can be told from a field of the form. */
1345
+ entryFields: Record<string, true>;
1346
+ }
1347
+ /** The answers the driver holds: flat value-path keys, and each section's rows as row objects keyed within the row. */
1348
+ export interface FormTestServerAnswers {
1349
+ flat: Record<string, unknown>;
1350
+ rows: Record<string, Array<Record<string, unknown>>>;
1351
+ }
1352
+ /** Where the scenario stands on its journey, as the runtime's journey state keeps it. */
1353
+ export interface FormTestServerNavigation {
1354
+ page: string | undefined;
1355
+ completed: string[];
1356
+ /** The Check answers page a Change link left (`JourneyState.returnTo`), until it is reached or the person moves another way. */
1357
+ returnTo?: string | undefined;
1358
+ }
1359
+ /** The kernel's reading of the tree, built once: the compiled root's index, the row fields and the collections. */
1360
+ export declare function kernelFormTestServerIndex(root: ComponentNode): FormTestServerIndex;
1361
+ /**
1362
+ * The component that owns a value path, as the kernel keys answers to components: a row
1363
+ * field's key by its shape (`items[0].qty` is `items[].qty`, the entry index taken out as
1364
+ * `kernelKeyShape` takes it), a collection path by its section, any other path by the first
1365
+ * component whose answer is stored there.
1366
+ */
1367
+ export declare function kernelFormTestServerComponentIdOf(index: FormTestServerIndex, path: string): string | undefined;
1368
+ export declare function kernelFormTestServerAnswers(): FormTestServerAnswers;
1369
+ /** A key written as an own data property, so a key spelled `__proto__` stays a key. */
1370
+ export declare function kernelFormTestServerPut(record: Record<string, unknown>, key: string, value: unknown): void;
1371
+ /**
1372
+ * A `given host.<name> = value` written into the host context the runs are given: a dotted name
1373
+ * nests (`host.org.unit` is `{ org: { unit } }`), a part that holds no record yet is made one,
1374
+ * as the browser's driver builds its runtime's context.
1375
+ */
1376
+ export declare function kernelFormTestServerHostValue(into: Record<string, unknown>, name: string, value: FormTestValue): void;
1377
+ /**
1378
+ * An answer as the kernel reads a component of `type`: a list given to a `checkboxes` field is
1379
+ * the object of booleans that field stores, one per option as the renderer stores it
1380
+ * (`` over the options `a`, `b` is `{ a: true, b: false }`), since the kernel's shape check
1381
+ * refuses a list there; a picked value outside `offered` is ticked too. Everything
1382
+ * else as written. `offered` is the field's inline options, or what a `given options for` gave
1383
+ * its source; absent, only the picked values are stored.
1384
+ */
1385
+ export declare function kernelFormTestServerAnswerFor(type: string | undefined, value: FormTestValue, offered?: string[]): unknown;
1386
+ /**
1387
+ * Whether a form test's `set` of `value` on a component of `type` is refused as `value.notScalar`:
1388
+ * a list written to a built-in type whose control holds one value (a text box, a text area, a
1389
+ * number or date control, a select, a radio group, a lone checkbox), which the runtime's write
1390
+ * refuses (`SCALAR_ANSWER_TYPES` in core/state/answer-shape.ts). A checkbox group, a file, a
1391
+ * plugin's type and an unknown path take the value as written.
1392
+ */
1393
+ export declare function kernelFormTestServerNotScalar(type: string | undefined, value: FormTestValue): boolean;
1394
+ /**
1395
+ * The first cell of the row an `add row … with` would make (row `at` of `collection`) that
1396
+ * {@link kernelFormTestServerNotScalar} refuses, as its path (`items[2].sku`); `undefined` when
1397
+ * the row takes every cell. The runtime's add refuses such a cell as its write does, so the
1398
+ * drivers refuse the add before any row is made, as they refuse the `set`. `typeOf` is the type
1399
+ * of the component that owns a path, as each driver resolves it.
1400
+ */
1401
+ export declare function kernelFormTestServerRowNotScalar(collection: string, at: number, values: Record<string, FormTestValue> | undefined, typeOf: (path: string) => string | undefined): string | undefined;
1402
+ /**
1403
+ * The options a `checkboxes` node offers a form test: the inline ones, or the ones a
1404
+ * `given options for` gave its source when `optionSnapshot` holds them; `undefined` for any other
1405
+ * node or a group with neither, so only the picked values are stored.
1406
+ */
1407
+ export declare function kernelFormTestServerOffered(node: ComponentNode | undefined, optionSnapshot: unknown): string[] | undefined;
1408
+ /**
1409
+ * The cells of the row an `add row … with` would make (row `at` of `collection`), each as the
1410
+ * control would store it: `answerFor` turns the cell at its path (`items[2].tags`) and the value
1411
+ * as written into the answer a `set` of that cell stores (a list on a checkbox group becomes the
1412
+ * group's record). The one place the add and the set agree on a cell, for every driver.
1413
+ */
1414
+ export declare function kernelFormTestServerRowAnswers(collection: string, at: number, values: Record<string, FormTestValue> | undefined, answerFor: (path: string, value: FormTestValue) => unknown): Record<string, unknown> | undefined;
1415
+ /** The rows of `collection`, made when it has none. */
1416
+ export declare function kernelFormTestServerRowsOf(answers: FormTestServerAnswers, collection: string): Array<Record<string, unknown>>;
1417
+ /**
1418
+ * Writes an answer: a row field's into its row (rows up to the index made when absent, as the
1419
+ * runtime adds rows for a write past the last one), any other at its path. `undefined` clears.
1420
+ * False, with nothing written, for a row past those held at or past `limit` (the most rows the
1421
+ * collection takes, {@link kernelFormTestServerRowLimit}; absent, the cap every collection is
1422
+ * drawn to): a one-line step must not build more rows than a person could add, and never
1423
+ * hundreds of thousands. A caller that knows the grid's bound passes it and words the refusal.
1424
+ */
1425
+ export declare function kernelFormTestServerWrite(answers: FormTestServerAnswers, lists: Record<string, true>, path: string, value: unknown, limit?: number): boolean;
1426
+ /** Adds a row at the end of `collection`, holding `values` keyed within the row. False when `collection` is no section's. */
1427
+ export declare function kernelFormTestServerAddRow(answers: FormTestServerAnswers, lists: Record<string, true>, collection: string, values: Record<string, unknown> | undefined): boolean;
1428
+ /** Removes row `index` of `collection`, the later rows moving up as the runtime's do. False when there is no such row. */
1429
+ export declare function kernelFormTestServerRemoveRow(answers: FormTestServerAnswers, lists: Record<string, true>, collection: string, index: number): boolean;
1430
+ /**
1431
+ * The rows a data grid opens with, as `dataGridSettingsOf` reads them: `initialRows`
1432
+ * (one when absent or unusable) kept within the grid's bounds. Any other component opens with
1433
+ * none. The runtime seeds these before the first run, so a scenario's first row count is theirs.
1434
+ */
1435
+ export declare function kernelFormTestServerInitialRows(node: ComponentNode): number;
1436
+ /** Gives every data grid its opening rows, each empty (posted as `{}`, which the kernel counts as a row). */
1437
+ export declare function kernelFormTestServerSeedRows(answers: FormTestServerAnswers, index: FormTestServerIndex): void;
1438
+ /**
1439
+ * The most rows a collection may hold: a data grid's maximum, else the cap every collection is
1440
+ * drawn to (as `assertRowRoom`). A grid's `rules.maxRows` formula, once evaluated over the
1441
+ * current answers (`rowBounds`, the fold's), overrules the fixed bound as `checkRows` has it
1442
+ * (`kernelResolveDataGridRowBounds`): the browser's add reads the resolved bound too.
1443
+ */
1444
+ export declare function kernelFormTestServerRowLimit(index: FormTestServerIndex, collection: string, rowBounds?: Record<string, {
1445
+ min?: unknown;
1446
+ max?: unknown;
1447
+ }>): number;
1448
+ /** Whether one more row fits in `collection`. A path that is no collection has room: the add itself refuses it. */
1449
+ export declare function kernelFormTestServerRowRoom(answers: FormTestServerAnswers, index: FormTestServerIndex, collection: string, rowBounds?: Record<string, {
1450
+ min?: unknown;
1451
+ max?: unknown;
1452
+ }>): boolean;
1453
+ /**
1454
+ * Whether the section at `collection` lets a person add (or remove) rows, as the runtime reads
1455
+ * its row operations: a data grid's `canAdd` / `canRemove` (on unless `false`), any other
1456
+ * repeating section's `collection.operations.add` / `.remove` (on unless `false`).
1457
+ */
1458
+ export declare function kernelFormTestServerAllows(index: FormTestServerIndex, collection: string, operation: "add" | "remove"): boolean;
1459
+ /**
1460
+ * Why a row action is turned down, as the refusal the runner records (`refused` is the reason,
1461
+ * `params` what it is about), or `undefined` when the action may go ahead. The reasons and
1462
+ * their order are the runtime's: the path must be a repeating section's collection
1463
+ * (`unknownCollection`), then the operation allowed (`operations.add` / `operations.remove`),
1464
+ * then, adding, the most rows not passed (`rows.max`), or, removing, the row there
1465
+ * (`rowOutOfRange`). `rowIndex` is the row a removal names.
1466
+ */
1467
+ export declare function kernelFormTestServerRowRefusal(answers: FormTestServerAnswers, index: FormTestServerIndex, collection: string, operation: "add" | "remove", rowIndex: number, rowBounds?: Record<string, {
1468
+ min?: unknown;
1469
+ max?: unknown;
1470
+ }>): {
1471
+ refused: string;
1472
+ params: Record<string, unknown>;
1473
+ } | undefined;
1474
+ /**
1475
+ * The page a refused submit takes the person to (the runtime's `revealErrorPage`): the earliest
1476
+ * page on the path that places a component holding an error that blocks, an error placed by its
1477
+ * component, else by its value path's. `undefined` when no such page stands on the path (an
1478
+ * error on no page, off the path or the form's own moves nothing).
1479
+ */
1480
+ export declare function kernelFormTestServerRevealPage(errors: WasmValidationError[], index: FormTestServerIndex, pagesOf: Record<string, string[]> | undefined, trace: JourneyTrace | undefined): string | undefined;
1481
+ /**
1482
+ * Whether the page shown is a review page (`kind: "review"`) the path takes: a send refused there
1483
+ * stays there (the runtime's `revealErrorPage`), so the page lists the errors itself.
1484
+ */
1485
+ export declare function kernelFormTestServerOnReview(journey: Journey | undefined, pageId: string | undefined, trace: JourneyTrace | undefined): boolean;
1486
+ /**
1487
+ * The values a run is handed: every flat answer, and each section with rows as its list of row
1488
+ * objects at its collection path (each an ordinary object, as JSON builds them). A section with
1489
+ * no rows sends nothing, which is no rows.
1490
+ */
1491
+ export declare function kernelFormTestServerValues(answers: FormTestServerAnswers): Record<string, unknown>;
1492
+ /** Row counts by collection path, every section of the form listed (none is `0`). */
1493
+ export declare function kernelFormTestServerRowCounts(answers: FormTestServerAnswers, lists: Record<string, true>): Record<string, number>;
1494
+ /** Whether an error stops a move or a submission: one with no severity, or `error`. */
1495
+ export declare function kernelFormTestServerBlocking(error: {
1496
+ severity?: string | undefined;
1497
+ }): boolean;
1498
+ export declare function kernelFormTestServerAnyBlocking(errors: ReadonlyArray<{
1499
+ severity?: string | undefined;
1500
+ }>): boolean;
1501
+ /**
1502
+ * A page's check, kept to the page: the errors on the components the kernel places
1503
+ * on it (`pageComponentIds`), and those on no component bar `journey.exit` (the exit is the
1504
+ * path's verdict, not the page's). `undefined` ids (a program that cannot scope) keep every error.
1505
+ */
1506
+ export declare function kernelFormTestServerPageErrors(errors: WasmValidationError[], pageComponentIds: string[] | undefined): WasmValidationError[];
1507
+ /**
1508
+ * The errors on show once a page's check comes back: those it found replace whatever stood on
1509
+ * the page's components and on no component, as the runtime's page validation replaces the
1510
+ * errors within the page; the rest stand.
1511
+ */
1512
+ export declare function kernelFormTestServerKeepShown(shown: WasmValidationError[], found: WasmValidationError[], pageComponentIds: string[] | undefined): WasmValidationError[];
1513
+ /** Whether a blocking error on show stands on one of `componentIds`: what a deferred page's Continue reads. */
1514
+ export declare function kernelFormTestServerShownBlocks(shown: WasmValidationError[], componentIds: string[] | undefined): boolean;
1515
+ /**
1516
+ * The journey a scenario runs, as the runtime selects it (`resolveJourneySelection`): `none`
1517
+ * is the whole form; an id names one of the definition's journeys or is refused
1518
+ * (`scenario.unknownJourney`); absent, the definition's own choice (`defaultJourneyId`,
1519
+ * then the first; `opensAs` is the host's page choice and does not stop a test). The journey is returned as authored: the kernel
1520
+ * compiles it.
1521
+ */
1522
+ export declare function kernelFormTestServerSelectJourney(configuration: unknown, given: string | undefined): {
1523
+ journey: Journey | undefined;
1524
+ error?: FormTestStartError;
1525
+ };
1526
+ /** The page ids of a journey in its declared order. */
1527
+ export declare function kernelFormTestServerPageOrder(journey: Journey | undefined): string[];
1528
+ /** A page of the journey by id, as authored. */
1529
+ export declare function kernelFormTestServerPage(journey: Journey | undefined, pageId: string | undefined): Journey["pages"][number] | undefined;
1530
+ /** Whether Continue on `page` moves on unchecked (`validation.continue: "defer"`, the page's own over the journey's). */
1531
+ export declare function kernelFormTestServerDeferred(journey: Journey | undefined, page: Journey["pages"][number] | undefined): boolean;
1532
+ /**
1533
+ * After the answers moved: completed pages kept to the path, and a page the path no longer
1534
+ * takes giving way to the last page before it (in the journey's order) that it does take,
1535
+ * else its first page — the runtime's `reconcile`. A journey with no page on the path keeps
1536
+ * where it stands.
1537
+ */
1538
+ export declare function kernelFormTestServerReconcile(navigation: FormTestServerNavigation, trace: JourneyTrace | undefined, order: string[]): void;
1539
+ /** Where Continue goes from `page` when nothing blocks: the next page on the path, else nowhere (the last page submits, an exit page stops). */
1540
+ export declare function kernelFormTestServerNextPage(trace: JourneyTrace | undefined, page: string | undefined): string | undefined;
1541
+ /** Where Back goes: the page before on the path, else nowhere. */
1542
+ export declare function kernelFormTestServerBackPage(trace: JourneyTrace | undefined, page: string | undefined): string | undefined;
1543
+ /** Marks a page completed, once. */
1544
+ export declare function kernelFormTestServerComplete(navigation: FormTestServerNavigation, page: string): void;
1545
+ /**
1546
+ * Where Continue goes from the page a Change link opened, and Back from one completed before the
1547
+ * Change (the runtime's `journeyReturning`): the first page on the path not completed (the page
1548
+ * shown left out), else the Check answers page. `undefined` when no return holds: none recorded,
1549
+ * the page shown is the review page, or the path no longer takes a review page by that id.
1550
+ */
1551
+ export declare function kernelFormTestServerReturning(journey: Journey | undefined, trace: JourneyTrace | undefined, navigation: FormTestServerNavigation): string | undefined;
1552
+ /** Shows `target`: the return target of a Change link goes with any move but one that keeps it, and on reaching the review page. */
1553
+ export declare function kernelFormTestServerMove(navigation: FormTestServerNavigation, target: string, keepReturn: boolean): void;
1554
+ /** The earliest page on the path that holds the component (the runtime's `view.pageOf`), else nowhere. */
1555
+ export declare function kernelFormTestServerPageOf(pagesOf: Record<string, string[]> | undefined, trace: JourneyTrace | undefined, id: string | undefined): string | undefined;
1556
+ /**
1557
+ * A Change link of the Check answers page the scenario stands on (`change <path>`, with `id` the
1558
+ * component the path names): opens the step that asks it and records the return, or answers the
1559
+ * coded refusal the runtime driver gives for the same case.
1560
+ */
1561
+ export declare function kernelFormTestServerChange(journey: Journey | undefined, navigation: FormTestServerNavigation, trace: JourneyTrace | undefined, pagesOf: Record<string, string[]> | undefined, id: string | undefined, path: string): {
1562
+ refused: string;
1563
+ params?: Record<string, unknown>;
1564
+ } | undefined;
1565
+ /**
1566
+ * The run's answers as the kernel's fold reads them: the allowlist's known keys (or, under
1567
+ * `keep`, the rows flattened and everything else kept), as `runKernel` partitions them before
1568
+ * it folds.
1569
+ */
1570
+ export declare function kernelFormTestServerFoldValues(prepared: KernelPrepared, values: Record<string, unknown>, unknownFields: WasmUnknownFieldsMode | undefined): Record<string, unknown>;
1571
+ /**
1572
+ * The evaluation a run builds for its rules (`runKernel`): the day, the host context the
1573
+ * scenario's `host.` givens make (absent when it gives none, so a rule reading `host.` is
1574
+ * skipped as on a server with no context), the plugins' functions, the shared pattern cache
1575
+ * refusing risky patterns.
1576
+ */
1577
+ export declare function kernelFormTestServerEvaluation(prepared: KernelPrepared, today: string | undefined, functions: Record<string, (args: unknown[]) => unknown> | undefined, hostContext?: Record<string, unknown>): KernelEvaluation;
1578
+ /**
1579
+ * Each component's requiredness after the hidden-required policy: the fold's `required` (its
1580
+ * flag or its `requiredWhen`, relaxed where the server cannot replay a visibility) where the
1581
+ * effective state lets requiredness apply.
1582
+ */
1583
+ export declare function kernelFormTestServerRequired(fold: KernelSubmissionFold, effective: Record<string, EffectiveNodeState>): Record<string, boolean>;
1584
+ /**
1585
+ * The effective state of every component: the fold's, with the outcome's `effectiveState` laid
1586
+ * over it where the outcome lists a component (the run's own word). The outcome lists
1587
+ * only the components whose errors the hidden policy can drop, so the rest come from the fold.
1588
+ */
1589
+ export declare function kernelFormTestServerEffective(fold: KernelSubmissionFold, reported: Record<string, EffectiveNodeState> | undefined): Record<string, EffectiveNodeState>;
1590
+ /**
1591
+ * The skip reason a rule this side leaves unevaluated earns: `host.` when it reads the host
1592
+ * context (whatever its scope) and the scenario gave no `host.` value (`hostKnown` false),
1593
+ * `browser` when it is scoped to the browser, else the clock when no day was given. A rule
1594
+ * that is none of those is `host`, the reason nothing else fits.
1595
+ */
1596
+ export declare function kernelFormTestServerSkipReason(source: unknown, expression: Expression, today: string | undefined, hostKnown?: boolean): FormTestSkipReason;
1597
+ /** `reasons[id] = reason` unless a reason stands there; a secret one always wins. True when the record changed. */
1598
+ export declare function kernelFormTestServerMark(reasons: Record<string, FormTestSkipReason>, id: string, reason: FormTestSkipReason): boolean;
1599
+ /**
1600
+ * The component a rule's read names, for the closure over reads: the read is an id (a scope
1601
+ * word, `row.` or `ancestor.`, taken off), else a value path some component stores. A `host.`
1602
+ * read is no component.
1603
+ */
1604
+ export declare function kernelFormTestServerReadId(index: FormTestServerIndex, path: string): string | undefined;
1605
+ /** Marks every component under `id` with `reason`; true when any mark was new. */
1606
+ export declare function kernelFormTestServerMarkUnder(index: FormTestServerIndex, reasons: Record<string, FormTestSkipReason>, id: string, reason: FormTestSkipReason): boolean;
1607
+ /**
1608
+ * Closes the marks over rule reads: a component whose rule reads a marked component is judged
1609
+ * on data this side does not have either, so it earns the same reason (a `visibleWhen` read
1610
+ * takes its descendants with it, as an own skipped visibility does). Repeated until nothing new
1611
+ * is marked, bounded by the number of components.
1612
+ */
1613
+ export declare function kernelFormTestServerCloseReads(index: FormTestServerIndex, reasons: Record<string, FormTestSkipReason>): void;
1614
+ /** The reason of the first marked component a rule source reads (a route's `when`), else `undefined`. */
1615
+ export declare function kernelFormTestServerReadsReason(source: unknown, index: FormTestServerIndex, reasons: Record<string, FormTestSkipReason>): FormTestSkipReason | undefined;
1616
+ /**
1617
+ * Marks what a journey's path decides over a component this side could not replay. A route that
1618
+ * reads a marked component decides which page follows, so every later page is marked. Returns the first reason found, which is also the reason the path itself
1619
+ * is not this side's (`traceUnreplayable`: the page, the path, what was withheld or submitted),
1620
+ * or `undefined` when no journey runs or no condition reads a marked component.
1621
+ */
1622
+ export declare function kernelFormTestServerMarkTrace(journey: Journey | undefined, index: FormTestServerIndex, ownership: JourneyOwnership | undefined, reasons: Record<string, FormTestSkipReason>): FormTestSkipReason | undefined;
1623
+ /** Marks the components a page places with `reason`. */
1624
+ export declare function kernelFormTestServerMarkPage(ownership: JourneyOwnership | undefined, pageId: string, reason: FormTestSkipReason, reasons: Record<string, FormTestSkipReason>): void;
1625
+ /** Whether a component can decide a verdict: it is required, or has a `requiredWhen` or a `validWhen` that could refuse its answer. */
1626
+ export declare function kernelFormTestServerCanRefuse(node: ComponentNode): boolean;
1627
+ /**
1628
+ * The components whose rules this side could not replay, with the reason an expectation on
1629
+ * them skips. From the outcome: `visibilitySkipped` (an own `visibleWhen` reading `host.`,
1630
+ * scoped to the browser, or reading the clock with no day; the components under it inherit
1631
+ * the reason, since the kernel relaxes their requiredness with it), `clockDependent` when no
1632
+ * day was given, `clientDerived` (a calculation kept as sent, which the server could not
1633
+ * reproduce), and `serverRules` for a component whose applied rule is `server-secret`
1634
+ * (`unreplayable.secret`: no driver may judge it). The outcome names no
1635
+ * component whose `requiredWhen`, `validWhen`, `enabledWhen` or `readonlyWhen` it skipped, so
1636
+ * those are read from the compiled definition with the kernel's own `kernelRuleSkipped`.
1637
+ * `hostKnown`: the run was given a host context (the scenario's `host.` givens), so a rule
1638
+ * reading `host.` was evaluated against it and earns no mark of its own.
1639
+ */
1640
+ export declare function kernelFormTestServerUnreplayable(index: FormTestServerIndex, outcome: WasmSubmissionOutcome, today: string | undefined, hostKnown?: boolean): Record<string, FormTestSkipReason>;
1641
+ /**
1642
+ * The reason the run's verdict is not wholly this side's, when a rule it left unevaluated could
1643
+ * have decided it. A verdict is the sum of every field's required and valid checks, and
1644
+ * `expect refused` / `expect accepted` / `expect no errors` name no field, so the field skip
1645
+ * cannot cover them: any component the marks reach (its own skipped `requiredWhen` or
1646
+ * `validWhen`; a skipped visibility, its own or a container's, which the kernel answers by
1647
+ * relaxing requiredness; a calculation kept as sent; a rule reading one of those) that can
1648
+ * refuse an answer (it is required, or has a `requiredWhen` or `validWhen`) names the reason,
1649
+ * the first in document order. A server-secret mark is not one: the kernel applies that rule, and
1650
+ * its field is skipped by its `unreplayable.secret` mark alone. Failing that, a journey path this side cannot
1651
+ * draw ({@link kernelFormTestServerTraceReason}) decides which pages' fields count.
1652
+ */
1653
+ export declare function kernelFormTestServerVerdictReason(index: FormTestServerIndex, reasons: Record<string, FormTestSkipReason>, traceReason: FormTestSkipReason | undefined): FormTestSkipReason | undefined;
1654
+ /** An outcome error as a snapshot carries it: the field mapping and the code, the message worded by the caller. */
1655
+ export declare function kernelFormTestServerSnapshotError(error: WasmValidationError, message: string | undefined): FormTestSnapshotError;
1656
+ /** The kernel driver's server half, spliced into the sandbox program for the `test` op. */
1657
+ export declare const FORM_TEST_KERNEL_DRIVER_FUNCTIONS: readonly ((...args: never[]) => unknown)[];
1658
+ /** One source the op parses: a definition entry (its `id`) or the request's sidecar text (no id). */
1659
+ export interface FormTestOpSource {
1660
+ id?: string;
1661
+ text: string;
1662
+ }
1663
+ /** What the scenarios of one `test` request share: the definition read once, as each kernel driver reads it. */
1664
+ export interface FormTestOpShared {
1665
+ definition: FormDefinition;
1666
+ /** The root with every data grid bound, as the run reads it. */
1667
+ authored: ComponentNode;
1668
+ /** The root as the wire carries it (keys in code-unit order), for every run's context. */
1669
+ wireForm: unknown;
1670
+ /** The definition's `translations` as the wire carries them, for every run's context; absent when it has none. */
1671
+ wireTranslations: unknown;
1672
+ /** The definition's `kinds` map as the wire carries it, for every run's context; absent when it has none. */
1673
+ wireKinds: unknown;
1674
+ policy: string;
1675
+ /** The request's own `formulaErrors` word, handed to every run; absent, the form's own policy. */
1676
+ formulaErrors: string | undefined;
1677
+ signatures: FormulaFunctionSignature[];
1678
+ functions: Record<string, (args: unknown[]) => unknown> | undefined;
1679
+ /** The plugin functions' names, which a layout's `when` may call beside the built-ins. */
1680
+ pluginNames: string[];
1681
+ validators: readonly KernelValidator[];
1682
+ cache: KernelPreparedCache;
1683
+ base: KernelPrepared;
1684
+ index: FormTestServerIndex;
1685
+ readsClock: boolean;
1686
+ locales: string[];
1687
+ problems: FormulaProblem[];
1688
+ /**
1689
+ * The message catalogs by locale ({@link kernelFormTestOpCatalogsFor}), filled as snapshots ask:
1690
+ * a form's messages are worded through its `translations` for the locale they are shown in.
1691
+ */
1692
+ catalogs: Record<string, {
1693
+ catalogs: Record<string, Record<string, string> | undefined>;
1694
+ root: Record<string, string> | undefined;
1695
+ }>;
1696
+ layouts: Record<string, unknown>[];
1697
+ }
1698
+ /** One scenario's walk: the kernel driver's closure as a record. */
1699
+ export interface FormTestOpState {
1700
+ shared: FormTestOpShared;
1701
+ prepared: KernelPrepared;
1702
+ answers: FormTestServerAnswers;
1703
+ navigation: FormTestServerNavigation;
1704
+ journey: Journey | undefined;
1705
+ wireJourney: unknown;
1706
+ foldJourney: Journey | undefined;
1707
+ pageOrder: string[];
1708
+ today: string | undefined;
1709
+ /** What the scenario's `host.` givens make, the runs' `hostContext`; absent when it gives none. */
1710
+ hostContext: Record<string, unknown> | undefined;
1711
+ /** {@link FormTestOpState.hostContext} as the wire carries it. */
1712
+ wireHostContext: unknown;
1713
+ locale: string;
1714
+ optionSnapshot: KernelOptionSnapshot | undefined;
1715
+ wireOptions: unknown;
1716
+ shown: WasmValidationError[];
1717
+ verdict: "accepted" | "refused" | undefined;
1718
+ submitted: Record<string, unknown> | undefined;
1719
+ withheld: string[] | undefined;
1720
+ last: {
1721
+ outcome: WasmSubmissionOutcome;
1722
+ values: Record<string, unknown>;
1723
+ } | undefined;
1724
+ }
1725
+ /** The most UTF-8 bytes of test text one request may carry: 256 KiB. */
1726
+ export declare function kernelFormTestOpMaxBytes(): number;
1727
+ /** The most scenarios one request may run. */
1728
+ export declare function kernelFormTestOpMaxScenarios(): number;
1729
+ /** The most statements one scenario may hold: the runner's `FORM_TEST_MAX_STEPS`, a literal here because the kernel reads no module constant (the tests pin the two). */
1730
+ export declare function kernelFormTestOpMaxSteps(): number;
1731
+ /** The length of `text` in UTF-8 bytes, a lone surrogate counted as the replacement character it encodes to. */
1732
+ export declare function kernelFormTestOpUtf8Bytes(text: string): number;
1733
+ /**
1734
+ * The definition's own test entries, read as `readFormTests` reads them: a missing or malformed
1735
+ * `tests` is none, an entry needs a non-empty string `id` and a string `source`, and a repeated
1736
+ * id is dropped (the first wins).
1737
+ */
1738
+ export declare function kernelFormTestOpEntries(definition: FormDefinition): FormTestOpSource[];
1739
+ /** A parse problem as the report carries it: the problem, and the entry it is in when it came from the definition. */
1740
+ export declare function kernelFormTestOpProblem(problem: FormTestProblem, id: string | undefined): Record<string, unknown>;
1741
+ /**
1742
+ * Every source parsed alone, as the builder's panel (one entry, one block) and the CLI (a
1743
+ * sidecar source) read them. A definition entry with problems, no block, or a second block runs
1744
+ * nothing; a name an earlier entry took is a `duplicateName` problem and the entry still runs.
1745
+ * The sidecar text runs nothing when it has a problem. Scenarios come back in source order.
1746
+ */
1747
+ export declare function kernelFormTestOpParse(sources: FormTestOpSource[], sidecar: boolean, signatures: FormulaFunctionSignature[]): {
1748
+ scenarios: Array<{
1749
+ id?: string;
1750
+ scenario: FormTestScenario;
1751
+ }>;
1752
+ problems: Record<string, unknown>[];
1753
+ };
1754
+ /** The engine's English validation messages (`DEFAULT_VALIDATION_MESSAGES`), as a literal the kernel can read. */
1755
+ export declare function kernelFormTestOpMessagesEn(): Record<string, string>;
1756
+ /** The codes the engine raises itself (`ENGINE_VALIDATION_CODES`), which it words over a raiser's message. */
1757
+ export declare function kernelFormTestOpEngineCodes(): string[];
1758
+ /** The codes a field's declared limits raise, whose own message outranks the engine's (`HOST_WORDED_CODES`). */
1759
+ export declare function kernelFormTestOpHostWordedCodes(): string[];
1760
+ /**
1761
+ * `defaultValidationMessage` with no language pack (the kernel holds no binding): the
1762
+ * definition's `texts` translation of the engine's sentence for `code` in `locale`
1763
+ * (`texts › messages › <code>`, through {@link kernelResolveText}), else the English; `undefined`
1764
+ * for a code the engine does not word.
1765
+ */
1766
+ export declare function kernelFormTestOpDefaultMessage(code: string, locale: string, translations?: unknown): string | undefined;
1767
+ /** What a limit's code says with no parameters to fill its template (`PARAMETERLESS_WORDING`). */
1768
+ export declare function kernelFormTestOpParameterless(code: string): string | undefined;
1769
+ /** `interpolate`: `{name}` tokens filled from the parameters, a string or number only; any other token kept as written. */
1770
+ export declare function kernelFormTestOpInterpolate(message: string, parameters: Record<string, unknown> | undefined): string;
1771
+ /**
1772
+ * `readValidationMessages` with its `translate` (core/localization/validation-messages.ts): a
1773
+ * configuration's `messages` map, its string entries under a non-blank code, each
1774
+ * worded for `locale` through the definition's `translations` at the message's address — the
1775
+ * form's own (`form › messages › code`) on the root, where `ownerId` is absent, else
1776
+ * `components › ownerId › messages › code` — then the field's `patternMessage` standing in for
1777
+ * `pattern` when the map has no entry of its own, worded at `components › ownerId ›
1778
+ * patternMessage` (on the root it stays as authored, as the browser leaves it).
1779
+ */
1780
+ export declare function kernelFormTestOpOwnMessages(configuration: unknown, ownerId: string | undefined, locale: string, translations: unknown): Record<string, string> | undefined;
1781
+ /**
1782
+ * Each component's catalog as the renderer layers it (`messageCatalogs` in the driver), worded
1783
+ * for `locale`: its own over its containers' over the form's, walked in document order with an
1784
+ * explicit stack. The root's messages are the form's own (no owner id), every other node's its
1785
+ * component's. A repeated id keeps the last one walked, as a map set in that order does.
1786
+ */
1787
+ export declare function kernelFormTestOpCatalogs(root: ComponentNode, locale: string, translations: unknown): Record<string, Record<string, string> | undefined>;
1788
+ /**
1789
+ * The catalogs for `locale`, worked out the first time a snapshot asks for that locale and kept
1790
+ * on the shared state (a scenario may switch locale; every scenario reads the same definition):
1791
+ * each component's layered catalog, and the root's own for an error that names no component.
1792
+ */
1793
+ export declare function kernelFormTestOpCatalogsFor(shared: FormTestOpShared, locale: string): {
1794
+ catalogs: Record<string, Record<string, string> | undefined>;
1795
+ root: Record<string, string> | undefined;
1796
+ };
1797
+ /**
1798
+ * `resolveValidationMessage`: the catalog's entry (already worded for the locale), the engine's
1799
+ * wording (the definition's `texts` translation of it in `translations`, else the English), the
1800
+ * raiser's message, in the engine's order for the code.
1801
+ */
1802
+ export declare function kernelFormTestOpMessage(error: WasmValidationError, catalog: Record<string, string> | undefined, locale: string, translations?: unknown): string;
1803
+ /** The locales the form offers, as `setLocale` checks a request against them (`supportedLocaleCodes`): codes trimmed, blanks dropped. */
1804
+ export declare function kernelFormTestOpLocales(localization: unknown): string[];
1805
+ /** Whether a finite number (`Number.isFinite`, no coercion). */
1806
+ export declare function kernelFormTestOpFinite(value: unknown): boolean;
1807
+ /**
1808
+ * Whether a PDF layout is one the renderer's reader keeps (`validatePdfLayout`), read as far as
1809
+ * the kernel needs to choose one: an id, a generated layout's `pdf-document` root and rendition
1810
+ * map, a template layout's source, field mappings and areas. A malformed `conformance`,
1811
+ * `attachments` or `signature` block, which the reader also refuses, is not read here.
1812
+ */
1813
+ export declare function kernelFormTestOpLayoutUsable(layout: unknown): boolean;
1814
+ /**
1815
+ * Whether a layout condition's tree is one the evaluator can run all the way down
1816
+ * (`isEvaluableExpression`, a plugin's call accepted as `withPluginCallsMasked` accepts it), walked
1817
+ * with an explicit stack.
1818
+ */
1819
+ export declare function kernelFormTestOpEvaluable(expression: unknown, builtins: string[], pluginNames: string[]): boolean;
1820
+ /**
1821
+ * The PDF layout the answers choose (`selectPdfLayoutForValues`): the first usable
1822
+ * layout whose `when` holds over the answers keyed by component id (the schema's keys only, read
1823
+ * as JSON carries them), else the declared default, else the first; `undefined` when the form
1824
+ * declares none.
1825
+ */
1826
+ export declare function kernelFormTestOpLayout(shared: FormTestOpShared, byPath: Record<string, unknown>, today: string | undefined, builtins: string[]): string | undefined;
1827
+ /** A JSON value as the wire carries it: keys in code-unit order, `undefined` dropped, as the ABI serialises a context and an outcome. */
1828
+ export declare function kernelFormTestOpWire(value: unknown): unknown;
1829
+ /** What every scenario of the request reads, worked out once: the kernel driver's setup. */
1830
+ export declare function kernelFormTestOpShare(definition: FormDefinition, formulaErrors: unknown, signatures: FormulaFunctionSignature[], functions: Record<string, (args: unknown[]) => unknown> | undefined, validators: readonly KernelValidator[]): FormTestOpShared;
1831
+ /** A fresh walk for one scenario, as a new kernel driver starts. */
1832
+ export declare function kernelFormTestOpState(shared: FormTestOpShared): FormTestOpState;
1833
+ /** A kernel run over the current answers, the context and the outcome crossing JSON as they cross the ABI; `page` asks for a page's scope. */
1834
+ export declare function kernelFormTestOpRun(state: FormTestOpState, page: string | undefined): {
1835
+ outcome: WasmSubmissionOutcome;
1836
+ values: Record<string, unknown>;
1837
+ };
1838
+ /** The last run, made again when the answers moved since. */
1839
+ export declare function kernelFormTestOpCurrent(state: FormTestOpState): {
1840
+ outcome: WasmSubmissionOutcome;
1841
+ values: Record<string, unknown>;
1842
+ };
1843
+ /** After an answer changed: the run is stale, and with a journey the page and completed pages follow the new path. */
1844
+ export declare function kernelFormTestOpAnswersChanged(state: FormTestOpState): void;
1845
+ /** A page's check: the run, the errors it keeps to the page, and the errors on show replaced within the page. */
1846
+ export declare function kernelFormTestOpCheckPage(state: FormTestOpState, page: string): {
1847
+ blocks: boolean;
1848
+ trace: JourneyTrace | undefined;
1849
+ withheld: string[] | undefined;
1850
+ };
1851
+ /** The kernel's fold over answers as the run takes them (the same normalise, partition, day and functions). */
1852
+ export declare function kernelFormTestOpFold(state: FormTestOpState, values: Record<string, unknown>): KernelSubmissionFold;
1853
+ /** What a data grid's bound formulas come to over the answers as they stand, when the grid at `collection` has one. */
1854
+ export declare function kernelFormTestOpRowBounds(state: FormTestOpState, collection: string): Record<string, {
1855
+ min?: unknown;
1856
+ max?: unknown;
1857
+ }> | undefined;
1858
+ /** The givens, checked in the order written: the kernel driver's `start`. */
1859
+ export declare function kernelFormTestOpStart(state: FormTestOpState, givens: FormTestGiven[]): undefined | {
1860
+ error: FormTestStartError;
1861
+ params?: Record<string, unknown>;
1862
+ } | {
1863
+ skip: FormTestSkipReason;
1864
+ };
1865
+ /** One action, as the kernel driver performs it; a row action the form turns down comes back as a coded refusal. */
1866
+ export declare function kernelFormTestOpPerform(state: FormTestOpState, action: FormTestAction): FormTestRefusal | undefined;
1867
+ /** The snapshot an expectation is judged on: the kernel driver's `snapshot`, its messages worded and its layout chosen in the kernel. */
1868
+ export declare function kernelFormTestOpSnapshot(state: FormTestOpState, builtins: string[]): FormTestSnapshot;
1869
+ /**
1870
+ * What a scenario's steps come to (the runner's `scenarioOutcome`): any failed step fails it,
1871
+ * else any error makes it an error, else one whose every expectation skipped is skipped with the
1872
+ * first skip's code, else it passed.
1873
+ */
1874
+ export declare function kernelFormTestOpOutcome(steps: FormTestStepResult[]): {
1875
+ status: FormTestScenarioStatus;
1876
+ reason?: string;
1877
+ };
1878
+ /** A thrown value as the runner words it (`messageOf`). */
1879
+ export declare function kernelFormTestOpThrown(error: unknown): string;
1880
+ /**
1881
+ * One scenario walked as `runFormTestScenario` walks it over a fresh kernel driver: `skip` first,
1882
+ * then the givens, then each statement in order, one snapshot serving a run of expectations and
1883
+ * taken again after the next action. A row action the form refuses ends the walk as
1884
+ * `action.refused`; anything that throws ends it as `action.failed` or `snapshot.failed`.
1885
+ */
1886
+ export declare function kernelFormTestOpScenario(scenario: FormTestScenario, shared: FormTestOpShared, builtins: string[]): FormTestScenarioResult;
1887
+ /**
1888
+ * The `test` op: a form's tests run on the kernel's reading.
1889
+ * `tests` is sidecar text (one or more `test` blocks); absent (or `null`), the definition's own
1890
+ * `tests.scenarios` are run, one block per entry. The answer lists every scenario (its entry's
1891
+ * `id`, its name, its header line, what it came to and its steps, the runner's shape), the
1892
+ * counts, and every parse problem. Refused as `invalid_request`: `tests` that is not text, more
1893
+ * than 256 KiB of test text (the sidecar, or the entries together), more than 200 scenarios, a
1894
+ * scenario of more than 1,000 statements; and, before any of those is read, a definition past a
1895
+ * size cap (`where: "definition"`, `limit`: `kernelInspectDefinition` gates first). No clock: a form that reads the day needs `given today`
1896
+ * in each scenario (`scenario.clockUnset`). `functions` and `validators` are the host's plugins,
1897
+ * as a run gets them; without them a plugin's rule reads as the run would read it unwired.
1898
+ */
1899
+ export declare function kernelFormTestOp(request: Record<string, unknown>, definition: FormDefinition, signatures: FormulaFunctionSignature[], builtins: string[] | undefined, functions?: Record<string, (args: unknown[]) => unknown>, validators?: readonly KernelValidator[]): DefinitionInspectResponse;
1900
+ /**
1901
+ * The per-request introspection entry: the sandbox program's `__datum_inspect` and
1902
+ * the in-process adapter's `inspect` both call this over the parsed request, with the same
1903
+ * parser signatures the run gets (the built-ins' plus the wired plugins') and the built-ins'
1904
+ * names so the inventory can tell a plugin function apart. Answers one of
1905
+ * `public` / `check` / `inspect` ({@link kernelInspectDefinition}), or an `abi_mismatch` /
1906
+ * `invalid_request` error; never throws, so a host always gets JSON back. Pure and
1907
+ * deterministic: no clock, no randomness, the definition handed in never changed. The `inspect`
1908
+ * answer lists every value path the kernel reads ({@link kernelDefinitionPaths}). It also answers
1909
+ * `test` ({@link kernelFormTestOp}),
1910
+ * which runs the form's tests over the kernel's own run: `functions` and `validators` are the
1911
+ * host's plugins as a run gets them, so a scenario over a plugin's rule is judged as a
1912
+ * submission would be. A host that passes neither runs the tests as an unwired program would.
1913
+ */
1914
+ export declare function kernelRunInspect(request: unknown, signatures?: FormulaFunctionSignature[], builtins?: string[], functions?: Record<string, (args: unknown[]) => unknown>, validators?: readonly KernelValidator[]): DefinitionInspectResponse;
1915
+ /** {@link kernelRunInspect} under the name the hosts call it by, beside {@link runKernel}. */
1916
+ export declare const runInspect: typeof kernelRunInspect;
1917
+ /**
1918
+ * The complete kernel, in composition order, for adapters that evaluate it as source.
1919
+ * Every function above must be here, and every function they call from the modules the
1920
+ * kernel shares with the browser runtime: the sandbox program is exactly these declarations
1921
+ * spliced into one scope, and a missing entry is an unresolved reference at eval time.
1922
+ * Built by a call marked pure: a bundle that never reads the list (the PDF program, the form
1923
+ * and builder bundles) drops it, and with it every function only the sandbox program needs
1924
+ * (the `check` pass among them).
1925
+ */
1926
+ export declare const PORTABLE_KERNEL_FUNCTIONS: readonly ((...args: never[]) => unknown)[];