@haneinfo/report-engine 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (516) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +946 -2
  3. package/agent-guide.md +49 -0
  4. package/dist/client/reportPdf.d.ts +15 -0
  5. package/dist/client/reportPdf.d.ts.map +1 -0
  6. package/dist/client/reportPdf.js +47 -0
  7. package/dist/client/reportPdf.js.map +1 -0
  8. package/dist/compiler/bandLayout.d.ts +7 -0
  9. package/dist/compiler/bandLayout.d.ts.map +1 -0
  10. package/dist/compiler/bandLayout.js +65 -0
  11. package/dist/compiler/bandLayout.js.map +1 -0
  12. package/dist/compiler/bandPipeline.d.ts +12 -0
  13. package/dist/compiler/bandPipeline.d.ts.map +1 -0
  14. package/dist/compiler/bandPipeline.js +47 -0
  15. package/dist/compiler/bandPipeline.js.map +1 -0
  16. package/dist/compiler/evaluator.d.ts +7 -0
  17. package/dist/compiler/evaluator.d.ts.map +1 -0
  18. package/dist/compiler/evaluator.js +13 -0
  19. package/dist/compiler/evaluator.js.map +1 -0
  20. package/dist/compiler/formatters.d.ts +3 -0
  21. package/dist/compiler/formatters.d.ts.map +1 -0
  22. package/dist/compiler/formatters.js +121 -0
  23. package/dist/compiler/formatters.js.map +1 -0
  24. package/dist/compiler/grouping.d.ts +16 -0
  25. package/dist/compiler/grouping.d.ts.map +1 -0
  26. package/dist/compiler/grouping.js +55 -0
  27. package/dist/compiler/grouping.js.map +1 -0
  28. package/dist/compiler/pdfCompiler.d.ts +9 -0
  29. package/dist/compiler/pdfCompiler.d.ts.map +1 -0
  30. package/dist/compiler/pdfCompiler.js +82 -0
  31. package/dist/compiler/pdfCompiler.js.map +1 -0
  32. package/dist/components/data/DataSourceEditor.d.ts +2 -0
  33. package/dist/components/data/DataSourceEditor.d.ts.map +1 -0
  34. package/dist/components/data/DataSourceEditor.js +80 -0
  35. package/dist/components/data/DataSourceEditor.js.map +1 -0
  36. package/dist/components/designer/BandCanvas.d.ts +4 -0
  37. package/dist/components/designer/BandCanvas.d.ts.map +1 -0
  38. package/dist/components/designer/BandCanvas.js +630 -0
  39. package/dist/components/designer/BandCanvas.js.map +1 -0
  40. package/dist/components/designer/Navbar.d.ts +3 -0
  41. package/dist/components/designer/Navbar.d.ts.map +1 -0
  42. package/dist/components/designer/Navbar.js +93 -0
  43. package/dist/components/designer/Navbar.js.map +1 -0
  44. package/dist/components/designer/PropertyPanel.d.ts +3 -0
  45. package/dist/components/designer/PropertyPanel.d.ts.map +1 -0
  46. package/dist/components/designer/PropertyPanel.js +65 -0
  47. package/dist/components/designer/PropertyPanel.js.map +1 -0
  48. package/dist/components/designer/Toolbox.d.ts +3 -0
  49. package/dist/components/designer/Toolbox.d.ts.map +1 -0
  50. package/dist/components/designer/Toolbox.js +236 -0
  51. package/dist/components/designer/Toolbox.js.map +1 -0
  52. package/dist/components/designer/properties/BandPropertiesSection.d.ts +12 -0
  53. package/dist/components/designer/properties/BandPropertiesSection.d.ts.map +1 -0
  54. package/dist/components/designer/properties/BandPropertiesSection.js +30 -0
  55. package/dist/components/designer/properties/BandPropertiesSection.js.map +1 -0
  56. package/dist/components/designer/properties/ColorPickerField.d.ts +14 -0
  57. package/dist/components/designer/properties/ColorPickerField.d.ts.map +1 -0
  58. package/dist/components/designer/properties/ColorPickerField.js +10 -0
  59. package/dist/components/designer/properties/ColorPickerField.js.map +1 -0
  60. package/dist/components/designer/properties/ConditionalPrintSection.d.ts +6 -0
  61. package/dist/components/designer/properties/ConditionalPrintSection.d.ts.map +1 -0
  62. package/dist/components/designer/properties/ConditionalPrintSection.js +112 -0
  63. package/dist/components/designer/properties/ConditionalPrintSection.js.map +1 -0
  64. package/dist/components/designer/properties/ControlSpecificInspector.d.ts +11 -0
  65. package/dist/components/designer/properties/ControlSpecificInspector.d.ts.map +1 -0
  66. package/dist/components/designer/properties/ControlSpecificInspector.js +52 -0
  67. package/dist/components/designer/properties/ControlSpecificInspector.js.map +1 -0
  68. package/dist/components/designer/properties/FieldSelectInput.d.ts +14 -0
  69. package/dist/components/designer/properties/FieldSelectInput.d.ts.map +1 -0
  70. package/dist/components/designer/properties/FieldSelectInput.js +13 -0
  71. package/dist/components/designer/properties/FieldSelectInput.js.map +1 -0
  72. package/dist/components/designer/properties/GeometrySection.d.ts +9 -0
  73. package/dist/components/designer/properties/GeometrySection.d.ts.map +1 -0
  74. package/dist/components/designer/properties/GeometrySection.js +9 -0
  75. package/dist/components/designer/properties/GeometrySection.js.map +1 -0
  76. package/dist/components/designer/properties/GlobalReportSettings.d.ts +3 -0
  77. package/dist/components/designer/properties/GlobalReportSettings.d.ts.map +1 -0
  78. package/dist/components/designer/properties/GlobalReportSettings.js +37 -0
  79. package/dist/components/designer/properties/GlobalReportSettings.js.map +1 -0
  80. package/dist/components/designer/properties/TypographySection.d.ts +10 -0
  81. package/dist/components/designer/properties/TypographySection.d.ts.map +1 -0
  82. package/dist/components/designer/properties/TypographySection.js +41 -0
  83. package/dist/components/designer/properties/TypographySection.js.map +1 -0
  84. package/dist/components/diagnostics/ReportPreflightPanel.d.ts +2 -0
  85. package/dist/components/diagnostics/ReportPreflightPanel.d.ts.map +1 -0
  86. package/dist/components/diagnostics/ReportPreflightPanel.js +39 -0
  87. package/dist/components/diagnostics/ReportPreflightPanel.js.map +1 -0
  88. package/dist/components/formula/CalculatedFieldsPanel.d.ts +2 -0
  89. package/dist/components/formula/CalculatedFieldsPanel.d.ts.map +1 -0
  90. package/dist/components/formula/CalculatedFieldsPanel.js +79 -0
  91. package/dist/components/formula/CalculatedFieldsPanel.js.map +1 -0
  92. package/dist/components/formula/ControlFormulaEditor.d.ts +7 -0
  93. package/dist/components/formula/ControlFormulaEditor.d.ts.map +1 -0
  94. package/dist/components/formula/ControlFormulaEditor.js +31 -0
  95. package/dist/components/formula/ControlFormulaEditor.js.map +1 -0
  96. package/dist/components/formula/FormulaEditor.d.ts +16 -0
  97. package/dist/components/formula/FormulaEditor.d.ts.map +1 -0
  98. package/dist/components/formula/FormulaEditor.js +93 -0
  99. package/dist/components/formula/FormulaEditor.js.map +1 -0
  100. package/dist/components/formula/useFormulaData.d.ts +8 -0
  101. package/dist/components/formula/useFormulaData.d.ts.map +1 -0
  102. package/dist/components/formula/useFormulaData.js +25 -0
  103. package/dist/components/formula/useFormulaData.js.map +1 -0
  104. package/dist/components/parameters/ParameterEditor.d.ts +3 -0
  105. package/dist/components/parameters/ParameterEditor.d.ts.map +1 -0
  106. package/dist/components/parameters/ParameterEditor.js +123 -0
  107. package/dist/components/parameters/ParameterEditor.js.map +1 -0
  108. package/dist/components/parameters/ParameterPanel.d.ts +6 -0
  109. package/dist/components/parameters/ParameterPanel.d.ts.map +1 -0
  110. package/dist/components/parameters/ParameterPanel.js +172 -0
  111. package/dist/components/parameters/ParameterPanel.js.map +1 -0
  112. package/dist/components/schema/SchemaViewer.d.ts +3 -0
  113. package/dist/components/schema/SchemaViewer.d.ts.map +1 -0
  114. package/dist/components/schema/SchemaViewer.js +61 -0
  115. package/dist/components/schema/SchemaViewer.js.map +1 -0
  116. package/dist/components/ui/badge.d.ts +7 -0
  117. package/dist/components/ui/badge.d.ts.map +1 -0
  118. package/dist/components/ui/badge.js +7 -0
  119. package/dist/components/ui/badge.js.map +1 -0
  120. package/dist/components/ui/badgeVariants.d.ts +4 -0
  121. package/dist/components/ui/badgeVariants.d.ts.map +1 -0
  122. package/dist/components/ui/badgeVariants.js +15 -0
  123. package/dist/components/ui/badgeVariants.js.map +1 -0
  124. package/dist/components/ui/button.d.ts +7 -0
  125. package/dist/components/ui/button.d.ts.map +1 -0
  126. package/dist/components/ui/button.js +9 -0
  127. package/dist/components/ui/button.js.map +1 -0
  128. package/dist/components/ui/buttonVariants.d.ts +5 -0
  129. package/dist/components/ui/buttonVariants.d.ts.map +1 -0
  130. package/dist/components/ui/buttonVariants.js +24 -0
  131. package/dist/components/ui/buttonVariants.js.map +1 -0
  132. package/dist/components/ui/checkbox.d.ts +5 -0
  133. package/dist/components/ui/checkbox.d.ts.map +1 -0
  134. package/dist/components/ui/checkbox.js +9 -0
  135. package/dist/components/ui/checkbox.js.map +1 -0
  136. package/dist/components/ui/date-input.d.ts +7 -0
  137. package/dist/components/ui/date-input.d.ts.map +1 -0
  138. package/dist/components/ui/date-input.js +41 -0
  139. package/dist/components/ui/date-input.js.map +1 -0
  140. package/dist/components/ui/input.d.ts +7 -0
  141. package/dist/components/ui/input.d.ts.map +1 -0
  142. package/dist/components/ui/input.js +10 -0
  143. package/dist/components/ui/input.js.map +1 -0
  144. package/dist/components/ui/label.d.ts +6 -0
  145. package/dist/components/ui/label.d.ts.map +1 -0
  146. package/dist/components/ui/label.js +7 -0
  147. package/dist/components/ui/label.js.map +1 -0
  148. package/dist/components/ui/native-select.d.ts +3 -0
  149. package/dist/components/ui/native-select.d.ts.map +1 -0
  150. package/dist/components/ui/native-select.js +8 -0
  151. package/dist/components/ui/native-select.js.map +1 -0
  152. package/dist/components/viewer/ReportViewer.d.ts +2 -0
  153. package/dist/components/viewer/ReportViewer.d.ts.map +1 -0
  154. package/dist/components/viewer/ReportViewer.js +103 -0
  155. package/dist/components/viewer/ReportViewer.js.map +1 -0
  156. package/dist/constants/labels.d.ts +14 -0
  157. package/dist/constants/labels.d.ts.map +1 -0
  158. package/dist/constants/labels.js +53 -0
  159. package/dist/constants/labels.js.map +1 -0
  160. package/dist/controls/barcodeUtils.d.ts +27 -0
  161. package/dist/controls/barcodeUtils.d.ts.map +1 -0
  162. package/dist/controls/barcodeUtils.js +93 -0
  163. package/dist/controls/barcodeUtils.js.map +1 -0
  164. package/dist/controls/pdfRegistry.d.ts +10 -0
  165. package/dist/controls/pdfRegistry.d.ts.map +1 -0
  166. package/dist/controls/pdfRegistry.js +204 -0
  167. package/dist/controls/pdfRegistry.js.map +1 -0
  168. package/dist/controls/plugins/BarcodeControl.d.ts +3 -0
  169. package/dist/controls/plugins/BarcodeControl.d.ts.map +1 -0
  170. package/dist/controls/plugins/BarcodeControl.js +34 -0
  171. package/dist/controls/plugins/BarcodeControl.js.map +1 -0
  172. package/dist/controls/plugins/CheckBoxControl.d.ts +3 -0
  173. package/dist/controls/plugins/CheckBoxControl.d.ts.map +1 -0
  174. package/dist/controls/plugins/CheckBoxControl.js +34 -0
  175. package/dist/controls/plugins/CheckBoxControl.js.map +1 -0
  176. package/dist/controls/plugins/ExpressionControl.d.ts +3 -0
  177. package/dist/controls/plugins/ExpressionControl.d.ts.map +1 -0
  178. package/dist/controls/plugins/ExpressionControl.js +28 -0
  179. package/dist/controls/plugins/ExpressionControl.js.map +1 -0
  180. package/dist/controls/plugins/FieldControl.d.ts +3 -0
  181. package/dist/controls/plugins/FieldControl.d.ts.map +1 -0
  182. package/dist/controls/plugins/FieldControl.js +30 -0
  183. package/dist/controls/plugins/FieldControl.js.map +1 -0
  184. package/dist/controls/plugins/ImageControl.d.ts +3 -0
  185. package/dist/controls/plugins/ImageControl.d.ts.map +1 -0
  186. package/dist/controls/plugins/ImageControl.js +29 -0
  187. package/dist/controls/plugins/ImageControl.js.map +1 -0
  188. package/dist/controls/plugins/LabelControl.d.ts +3 -0
  189. package/dist/controls/plugins/LabelControl.d.ts.map +1 -0
  190. package/dist/controls/plugins/LabelControl.js +32 -0
  191. package/dist/controls/plugins/LabelControl.js.map +1 -0
  192. package/dist/controls/plugins/LineControl.d.ts +3 -0
  193. package/dist/controls/plugins/LineControl.d.ts.map +1 -0
  194. package/dist/controls/plugins/LineControl.js +31 -0
  195. package/dist/controls/plugins/LineControl.js.map +1 -0
  196. package/dist/controls/plugins/PanelControl.d.ts +3 -0
  197. package/dist/controls/plugins/PanelControl.d.ts.map +1 -0
  198. package/dist/controls/plugins/PanelControl.js +35 -0
  199. package/dist/controls/plugins/PanelControl.js.map +1 -0
  200. package/dist/controls/plugins/QRCodeControl.d.ts +3 -0
  201. package/dist/controls/plugins/QRCodeControl.d.ts.map +1 -0
  202. package/dist/controls/plugins/QRCodeControl.js +43 -0
  203. package/dist/controls/plugins/QRCodeControl.js.map +1 -0
  204. package/dist/controls/plugins/SubReportControl.d.ts +3 -0
  205. package/dist/controls/plugins/SubReportControl.d.ts.map +1 -0
  206. package/dist/controls/plugins/SubReportControl.js +58 -0
  207. package/dist/controls/plugins/SubReportControl.js.map +1 -0
  208. package/dist/controls/registry.d.ts +18 -0
  209. package/dist/controls/registry.d.ts.map +1 -0
  210. package/dist/controls/registry.js +59 -0
  211. package/dist/controls/registry.js.map +1 -0
  212. package/dist/controls/styleUtils.d.ts +11 -0
  213. package/dist/controls/styleUtils.d.ts.map +1 -0
  214. package/dist/controls/styleUtils.js +63 -0
  215. package/dist/controls/styleUtils.js.map +1 -0
  216. package/dist/controls/types.d.ts +31 -0
  217. package/dist/controls/types.d.ts.map +1 -0
  218. package/dist/controls/types.js +2 -0
  219. package/dist/controls/types.js.map +1 -0
  220. package/dist/data/schema.d.ts +10 -0
  221. package/dist/data/schema.d.ts.map +1 -0
  222. package/dist/data/schema.js +117 -0
  223. package/dist/data/schema.js.map +1 -0
  224. package/dist/data/schemaField.d.ts +3 -0
  225. package/dist/data/schemaField.d.ts.map +1 -0
  226. package/dist/data/schemaField.js +9 -0
  227. package/dist/data/schemaField.js.map +1 -0
  228. package/dist/designer/DesignerView.d.ts +5 -0
  229. package/dist/designer/DesignerView.d.ts.map +1 -0
  230. package/dist/designer/DesignerView.js +51 -0
  231. package/dist/designer/DesignerView.js.map +1 -0
  232. package/dist/designer/EditorToolbar.d.ts +4 -0
  233. package/dist/designer/EditorToolbar.d.ts.map +1 -0
  234. package/dist/designer/EditorToolbar.js +23 -0
  235. package/dist/designer/EditorToolbar.js.map +1 -0
  236. package/dist/designer/ReportDesigner.d.ts +21 -0
  237. package/dist/designer/ReportDesigner.d.ts.map +1 -0
  238. package/dist/designer/ReportDesigner.js +98 -0
  239. package/dist/designer/ReportDesigner.js.map +1 -0
  240. package/dist/designer/ReportViewer.d.ts +5 -0
  241. package/dist/designer/ReportViewer.d.ts.map +1 -0
  242. package/dist/designer/ReportViewer.js +7 -0
  243. package/dist/designer/ReportViewer.js.map +1 -0
  244. package/dist/designer/parameterDateTime.d.ts +4 -0
  245. package/dist/designer/parameterDateTime.d.ts.map +1 -0
  246. package/dist/designer/parameterDateTime.js +15 -0
  247. package/dist/designer/parameterDateTime.js.map +1 -0
  248. package/dist/designer/previewData.d.ts +21 -0
  249. package/dist/designer/previewData.d.ts.map +1 -0
  250. package/dist/designer/previewData.js +85 -0
  251. package/dist/designer/previewData.js.map +1 -0
  252. package/dist/designer/services.d.ts +28 -0
  253. package/dist/designer/services.d.ts.map +1 -0
  254. package/dist/designer/services.js +8 -0
  255. package/dist/designer/services.js.map +1 -0
  256. package/dist/formula/engine.d.ts +23 -0
  257. package/dist/formula/engine.d.ts.map +1 -0
  258. package/dist/formula/engine.js +310 -0
  259. package/dist/formula/engine.js.map +1 -0
  260. package/dist/formula/parser.d.ts +5 -0
  261. package/dist/formula/parser.d.ts.map +1 -0
  262. package/dist/formula/parser.js +197 -0
  263. package/dist/formula/parser.js.map +1 -0
  264. package/dist/formula/presentation.d.ts +9 -0
  265. package/dist/formula/presentation.d.ts.map +1 -0
  266. package/dist/formula/presentation.js +40 -0
  267. package/dist/formula/presentation.js.map +1 -0
  268. package/dist/formula/registry.d.ts +83 -0
  269. package/dist/formula/registry.d.ts.map +1 -0
  270. package/dist/formula/registry.js +365 -0
  271. package/dist/formula/registry.js.map +1 -0
  272. package/dist/formula/report.d.ts +23 -0
  273. package/dist/formula/report.d.ts.map +1 -0
  274. package/dist/formula/report.js +400 -0
  275. package/dist/formula/report.js.map +1 -0
  276. package/dist/formula/types.d.ts +119 -0
  277. package/dist/formula/types.d.ts.map +1 -0
  278. package/dist/formula/types.js +27 -0
  279. package/dist/formula/types.js.map +1 -0
  280. package/dist/formula/values.d.ts +17 -0
  281. package/dist/formula/values.d.ts.map +1 -0
  282. package/dist/formula/values.js +125 -0
  283. package/dist/formula/values.js.map +1 -0
  284. package/dist/i18n/config.d.ts +5 -0
  285. package/dist/i18n/config.d.ts.map +1 -0
  286. package/dist/i18n/config.js +7 -0
  287. package/dist/i18n/config.js.map +1 -0
  288. package/dist/i18n/index.d.ts +18 -0
  289. package/dist/i18n/index.d.ts.map +1 -0
  290. package/dist/i18n/index.js +26 -0
  291. package/dist/i18n/index.js.map +1 -0
  292. package/dist/i18n/messages/en.d.ts +3 -0
  293. package/dist/i18n/messages/en.d.ts.map +1 -0
  294. package/dist/i18n/messages/en.js +420 -0
  295. package/dist/i18n/messages/en.js.map +1 -0
  296. package/dist/i18n/messages/index.d.ts +5 -0
  297. package/dist/i18n/messages/index.d.ts.map +1 -0
  298. package/dist/i18n/messages/index.js +7 -0
  299. package/dist/i18n/messages/index.js.map +1 -0
  300. package/dist/i18n/messages/zh-TW.d.ts +425 -0
  301. package/dist/i18n/messages/zh-TW.d.ts.map +1 -0
  302. package/dist/i18n/messages/zh-TW.js +420 -0
  303. package/dist/i18n/messages/zh-TW.js.map +1 -0
  304. package/dist/inspector/layoutInspector.d.ts +22 -0
  305. package/dist/inspector/layoutInspector.d.ts.map +1 -0
  306. package/dist/inspector/layoutInspector.js +317 -0
  307. package/dist/inspector/layoutInspector.js.map +1 -0
  308. package/dist/inspector/measureBand.d.ts +4 -0
  309. package/dist/inspector/measureBand.d.ts.map +1 -0
  310. package/dist/inspector/measureBand.js +19 -0
  311. package/dist/inspector/measureBand.js.map +1 -0
  312. package/dist/lib/required.d.ts +3 -0
  313. package/dist/lib/required.d.ts.map +1 -0
  314. package/dist/lib/required.js +7 -0
  315. package/dist/lib/required.js.map +1 -0
  316. package/dist/lib/utils.d.ts +3 -0
  317. package/dist/lib/utils.d.ts.map +1 -0
  318. package/dist/lib/utils.js +6 -0
  319. package/dist/lib/utils.js.map +1 -0
  320. package/dist/mcp/changeTools.d.ts +294 -0
  321. package/dist/mcp/changeTools.d.ts.map +1 -0
  322. package/dist/mcp/changeTools.js +262 -0
  323. package/dist/mcp/changeTools.js.map +1 -0
  324. package/dist/mcp/contracts.d.ts +53 -0
  325. package/dist/mcp/contracts.d.ts.map +1 -0
  326. package/dist/mcp/contracts.js +2 -0
  327. package/dist/mcp/contracts.js.map +1 -0
  328. package/dist/mcp/formulaTools.d.ts +13 -0
  329. package/dist/mcp/formulaTools.d.ts.map +1 -0
  330. package/dist/mcp/formulaTools.js +148 -0
  331. package/dist/mcp/formulaTools.js.map +1 -0
  332. package/dist/mcp/index.d.ts +3 -0
  333. package/dist/mcp/index.d.ts.map +1 -0
  334. package/dist/mcp/index.js +42 -0
  335. package/dist/mcp/index.js.map +1 -0
  336. package/dist/mcp/results.d.ts +24 -0
  337. package/dist/mcp/results.d.ts.map +1 -0
  338. package/dist/mcp/results.js +97 -0
  339. package/dist/mcp/results.js.map +1 -0
  340. package/dist/mcp/server.d.ts +9 -0
  341. package/dist/mcp/server.d.ts.map +1 -0
  342. package/dist/mcp/server.js +417 -0
  343. package/dist/mcp/server.js.map +1 -0
  344. package/dist/mcp/stdio.d.ts +16 -0
  345. package/dist/mcp/stdio.d.ts.map +1 -0
  346. package/dist/mcp/stdio.js +51 -0
  347. package/dist/mcp/stdio.js.map +1 -0
  348. package/dist/mcp/tools.d.ts +11 -0
  349. package/dist/mcp/tools.d.ts.map +1 -0
  350. package/dist/mcp/tools.js +346 -0
  351. package/dist/mcp/tools.js.map +1 -0
  352. package/dist/mock/mockDataSource.d.ts +29 -0
  353. package/dist/mock/mockDataSource.d.ts.map +1 -0
  354. package/dist/mock/mockDataSource.js +350 -0
  355. package/dist/mock/mockDataSource.js.map +1 -0
  356. package/dist/mock/sampleReport.d.ts +4 -0
  357. package/dist/mock/sampleReport.d.ts.map +1 -0
  358. package/dist/mock/sampleReport.js +1001 -0
  359. package/dist/mock/sampleReport.js.map +1 -0
  360. package/dist/public/core.d.ts +22 -0
  361. package/dist/public/core.d.ts.map +1 -0
  362. package/dist/public/core.js +16 -0
  363. package/dist/public/core.js.map +1 -0
  364. package/dist/public/designer.d.ts +11 -0
  365. package/dist/public/designer.d.ts.map +1 -0
  366. package/dist/public/designer.js +5 -0
  367. package/dist/public/designer.js.map +1 -0
  368. package/dist/public/mcp.d.ts +8 -0
  369. package/dist/public/mcp.d.ts.map +1 -0
  370. package/dist/public/mcp.js +4 -0
  371. package/dist/public/mcp.js.map +1 -0
  372. package/dist/public/pdf.d.ts +6 -0
  373. package/dist/public/pdf.d.ts.map +1 -0
  374. package/dist/public/pdf.js +5 -0
  375. package/dist/public/pdf.js.map +1 -0
  376. package/dist/public/registry.d.ts +3 -0
  377. package/dist/public/registry.d.ts.map +1 -0
  378. package/dist/public/registry.js +2 -0
  379. package/dist/public/registry.js.map +1 -0
  380. package/dist/registry/adapter.d.ts +34 -0
  381. package/dist/registry/adapter.d.ts.map +1 -0
  382. package/dist/registry/adapter.js +166 -0
  383. package/dist/registry/adapter.js.map +1 -0
  384. package/dist/report/conflict.d.ts +4 -0
  385. package/dist/report/conflict.d.ts.map +1 -0
  386. package/dist/report/conflict.js +6 -0
  387. package/dist/report/conflict.js.map +1 -0
  388. package/dist/report/dataPath.d.ts +3 -0
  389. package/dist/report/dataPath.d.ts.map +1 -0
  390. package/dist/report/dataPath.js +11 -0
  391. package/dist/report/dataPath.js.map +1 -0
  392. package/dist/report/dataSchema.d.ts +4 -0
  393. package/dist/report/dataSchema.d.ts.map +1 -0
  394. package/dist/report/dataSchema.js +10 -0
  395. package/dist/report/dataSchema.js.map +1 -0
  396. package/dist/report/defaultSubReport.d.ts +6 -0
  397. package/dist/report/defaultSubReport.d.ts.map +1 -0
  398. package/dist/report/defaultSubReport.js +224 -0
  399. package/dist/report/defaultSubReport.js.map +1 -0
  400. package/dist/report/diagnostics.d.ts +7 -0
  401. package/dist/report/diagnostics.d.ts.map +1 -0
  402. package/dist/report/diagnostics.js +43 -0
  403. package/dist/report/diagnostics.js.map +1 -0
  404. package/dist/report/document.d.ts +58 -0
  405. package/dist/report/document.d.ts.map +1 -0
  406. package/dist/report/document.js +71 -0
  407. package/dist/report/document.js.map +1 -0
  408. package/dist/report/geometry.d.ts +14 -0
  409. package/dist/report/geometry.d.ts.map +1 -0
  410. package/dist/report/geometry.js +21 -0
  411. package/dist/report/geometry.js.map +1 -0
  412. package/dist/report/layoutDiagnostics.d.ts +5 -0
  413. package/dist/report/layoutDiagnostics.d.ts.map +1 -0
  414. package/dist/report/layoutDiagnostics.js +70 -0
  415. package/dist/report/layoutDiagnostics.js.map +1 -0
  416. package/dist/report/operations.d.ts +12 -0
  417. package/dist/report/operations.d.ts.map +1 -0
  418. package/dist/report/operations.js +81 -0
  419. package/dist/report/operations.js.map +1 -0
  420. package/dist/report/pagination.d.ts +5 -0
  421. package/dist/report/pagination.d.ts.map +1 -0
  422. package/dist/report/pagination.js +5 -0
  423. package/dist/report/pagination.js.map +1 -0
  424. package/dist/report/parameters.d.ts +14 -0
  425. package/dist/report/parameters.d.ts.map +1 -0
  426. package/dist/report/parameters.js +223 -0
  427. package/dist/report/parameters.js.map +1 -0
  428. package/dist/report/preflight.d.ts +75 -0
  429. package/dist/report/preflight.d.ts.map +1 -0
  430. package/dist/report/preflight.js +160 -0
  431. package/dist/report/preflight.js.map +1 -0
  432. package/dist/report/presentationCapabilities.d.ts +3 -0
  433. package/dist/report/presentationCapabilities.d.ts.map +1 -0
  434. package/dist/report/presentationCapabilities.js +13 -0
  435. package/dist/report/presentationCapabilities.js.map +1 -0
  436. package/dist/report/schema.d.ts +91 -0
  437. package/dist/report/schema.d.ts.map +1 -0
  438. package/dist/report/schema.js +168 -0
  439. package/dist/report/schema.js.map +1 -0
  440. package/dist/report/subReport.d.ts +7 -0
  441. package/dist/report/subReport.d.ts.map +1 -0
  442. package/dist/report/subReport.js +37 -0
  443. package/dist/report/subReport.js.map +1 -0
  444. package/dist/report/validateDocument.d.ts +8 -0
  445. package/dist/report/validateDocument.d.ts.map +1 -0
  446. package/dist/report/validateDocument.js +99 -0
  447. package/dist/report/validateDocument.js.map +1 -0
  448. package/dist/server/atomicFile.d.ts +11 -0
  449. package/dist/server/atomicFile.d.ts.map +1 -0
  450. package/dist/server/atomicFile.js +24 -0
  451. package/dist/server/atomicFile.js.map +1 -0
  452. package/dist/server/documentRepository.d.ts +26 -0
  453. package/dist/server/documentRepository.d.ts.map +1 -0
  454. package/dist/server/documentRepository.js +78 -0
  455. package/dist/server/documentRepository.js.map +1 -0
  456. package/dist/server/pdfService.d.ts +12 -0
  457. package/dist/server/pdfService.d.ts.map +1 -0
  458. package/dist/server/pdfService.js +117 -0
  459. package/dist/server/pdfService.js.map +1 -0
  460. package/dist/server/pdfWorker.d.ts +2 -0
  461. package/dist/server/pdfWorker.d.ts.map +1 -0
  462. package/dist/server/pdfWorker.js +101 -0
  463. package/dist/server/pdfWorker.js.map +1 -0
  464. package/dist/server/renderSafety.d.ts +26 -0
  465. package/dist/server/renderSafety.d.ts.map +1 -0
  466. package/dist/server/renderSafety.js +89 -0
  467. package/dist/server/renderSafety.js.map +1 -0
  468. package/dist/server/reportApi.d.ts +6 -0
  469. package/dist/server/reportApi.d.ts.map +1 -0
  470. package/dist/server/reportApi.js +114 -0
  471. package/dist/server/reportApi.js.map +1 -0
  472. package/dist/server/reportRepository.d.ts +17 -0
  473. package/dist/server/reportRepository.d.ts.map +1 -0
  474. package/dist/server/reportRepository.js +72 -0
  475. package/dist/server/reportRepository.js.map +1 -0
  476. package/dist/server/requestSchema.d.ts +73 -0
  477. package/dist/server/requestSchema.d.ts.map +1 -0
  478. package/dist/server/requestSchema.js +47 -0
  479. package/dist/server/requestSchema.js.map +1 -0
  480. package/dist/store/useReportStore.d.ts +62 -0
  481. package/dist/store/useReportStore.d.ts.map +1 -0
  482. package/dist/store/useReportStore.js +470 -0
  483. package/dist/store/useReportStore.js.map +1 -0
  484. package/dist/sync/reportSync.d.ts +34 -0
  485. package/dist/sync/reportSync.d.ts.map +1 -0
  486. package/dist/sync/reportSync.js +167 -0
  487. package/dist/sync/reportSync.js.map +1 -0
  488. package/dist/sync/useReportSync.d.ts +11 -0
  489. package/dist/sync/useReportSync.d.ts.map +1 -0
  490. package/dist/sync/useReportSync.js +58 -0
  491. package/dist/sync/useReportSync.js.map +1 -0
  492. package/dist/types/datasource.d.ts +44 -0
  493. package/dist/types/datasource.d.ts.map +1 -0
  494. package/dist/types/datasource.js +6 -0
  495. package/dist/types/datasource.js.map +1 -0
  496. package/dist/types/diagnostics.d.ts +28 -0
  497. package/dist/types/diagnostics.d.ts.map +1 -0
  498. package/dist/types/diagnostics.js +2 -0
  499. package/dist/types/diagnostics.js.map +1 -0
  500. package/dist/types/document.d.ts +46 -0
  501. package/dist/types/document.d.ts.map +1 -0
  502. package/dist/types/document.js +2 -0
  503. package/dist/types/document.js.map +1 -0
  504. package/dist/types/parameters.d.ts +39 -0
  505. package/dist/types/parameters.d.ts.map +1 -0
  506. package/dist/types/parameters.js +2 -0
  507. package/dist/types/parameters.js.map +1 -0
  508. package/dist/types/render.d.ts +21 -0
  509. package/dist/types/render.d.ts.map +1 -0
  510. package/dist/types/render.js +2 -0
  511. package/dist/types/render.js.map +1 -0
  512. package/dist/types/report.d.ts +108 -0
  513. package/dist/types/report.d.ts.map +1 -0
  514. package/dist/types/report.js +13 -0
  515. package/dist/types/report.js.map +1 -0
  516. package/package.json +112 -3
package/README.md CHANGED
@@ -1,3 +1,947 @@
1
- # Temporary Holding Version
1
+ # @haneinfo/report-engine
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Host-independent banded report core, Node PDF renderer, multi-document MCP tools and React 19
4
+ designer/viewer, ported from report_engine_mvp at `1fd22d629ea09f5a2184790b5a91a9b47e3c0744`.
5
+ E1–E5 and the maintainer-approved canGrow pagination correction are complete. The decision and
6
+ task-breakdown status remain draft; package version remains 0.0.0. Maintainers perform G1 versioning
7
+ and publication. See the [E5 validation report](../../validation/report-engine/report.md) for final
8
+ gates, historical assertion inventories, source differences, all 78 screenshots, visual findings,
9
+ retained formula lint diagnostics and the complete pending release plan.
10
+
11
+ ## Package and host responsibilities
12
+
13
+ This is a pure library with no plugin manifest. The first host, haneinfo-reports, owns authorization,
14
+ data queries, definition kinds, persistence, artifact storage and scheduling. The separate
15
+ `@haneinfo/instance-analytics` package aggregates readable state-machine instances; it does not
16
+ render PDFs. document-templates retains its existing flow-based output.
17
+
18
+ | Entry | Responsibility |
19
+ | --- | --- |
20
+ | `./core` (also `.`) | Report/data types, v1-to-v2 parsing, parameters, formulas, validation and preflight |
21
+ | `./pdf` | Node Worker rendering and HTTP handlers; host fonts, images and limits |
22
+ | `./mcp` | SDK-free host tool definitions, 22-tool catalog and multi-document contracts |
23
+ | `./registry` | Definition-registry draft adapter, RBAC, optimistic revisions, receipts and user-content wrapping |
24
+ | `./designer` | Browser-safe ReportDesigner, ReportViewer, createReportStore and createPdfClient |
25
+ | `./mcp/stdio` | Explicit local-development SDK v2 transport/file adapters; `./mcp/stdio/cli` is its executable entry |
26
+
27
+ Only `./designer` exports createReportStore. reportSync and useReportSync remain and use host draft
28
+ callbacks; the removed feature is the demo Vite current_report_layout.json synchronization.
29
+
30
+ ## Dependencies
31
+
32
+ | Dependency | E1 choice and reason |
33
+ | --- | --- |
34
+ | zod | Peer ^4.4.0 plus development dependency, following existing form/document-templates consumers; share the host's Zod 4 and avoid duplicate schema/error identities. Source declares ^4.6.7; the complete copied source compiles against the workspace's locked 4.4.3 without schema changes. |
35
+ | decimal.js | Runtime ^10.6.0, matching source arithmetic. |
36
+ | @js-temporal/polyfill | Runtime ^0.5.1, matching source dates/time zones. |
37
+ | @react-pdf/renderer | Runtime ^4.9.0; ESM-only rendering dependency. |
38
+ | jsbarcode | Runtime ^3.12.3, matching source barcode implementation. |
39
+ | qrcode | Runtime ^1.5.4, matching source QR implementation. |
40
+ | React | Peer ^19.2.7; development version pinned to existing workspace 19.2.7. No workspace React upgrade. |
41
+ | TypeScript | Existing 5.9.3; NodeNext/NodeNext, ES2022, .js relative imports. Copied source build/typecheck pass without TypeScript upgrades or compiler workarounds. |
42
+ | zustand | Runtime ^5.0.14, resolving to the existing single version 5.0.15; internal store authorized by the maintainer. |
43
+ | lucide-react, class-variance-authority, tailwind-merge, clsx | Runtime `^1.22.0`, `^0.7.1`, `^3.6.0`, `^2.1.1` added in E4 for `./designer`, aligned to existing workspace versions. `controls/types.ts` restores `ControlCategory` and `ReportControlPlugin`. |
44
+ | @react-pdf/types | Development-only 2.14.0, the renderer's existing transitive type package, explicitly declared for the source Style import. |
45
+ | @modelcontextprotocol/sdk | Source v1 dependency is not installed or imported; maintainer selected v2 on 2026-10-29. |
46
+ | @modelcontextprotocol/server | Optional peer exactly 2.0.0 plus devDependency 2.0.0; only the development transport entry imports it. |
47
+ | @modelcontextprotocol/client | DevDependency exactly 2.0.0; actual-client regression and stdio smoke tests. |
48
+ | @haneinfo/plugin-api, @haneinfo/definition-registry | Peers ^1.27.0 and ^0.2.6, respectively, plus workspace:* devDependencies; existing ports, RBAC, drafts, receipts and user-content wrapping. |
49
+ | @napi-rs/canvas, pdfjs-dist | Development-only 1.0.13 and 6.4.299, pinned to the source lockfile for visual regression. |
50
+ | jsdom, @testing-library/react | Development-only 30.0.1 and 16.3.2, pinned for Vitest component tests (`test:components`). |
51
+ | vite, @tailwindcss/vite, tailwindcss | Development-only 8.2.2, 4.3.3 and 4.3.3, pinned for the unshipped minimal E2E test host (`tests/host/serve.mjs`). |
52
+ | @playwright/test, @axe-core/playwright | Development-only 1.62.1 and 4.11.1, pinned for Chromium E2E flows, multi-viewport screenshots and axe accessibility verification (`test:e2e`). |
53
+ | @types/node, @types/react, @types/jsbarcode, @types/qrcode, vitest | Development only. |
54
+ | @fontsource/noto-sans-tc, buffer, oxlint | Not ported; full font, browser buffers and source linter are outside this package. |
55
+
56
+ The package has no manifest and does not change plugin-api or R1 changesets.
57
+ `./mcp`, `./registry`, `./mcp/stdio` and `./mcp/stdio/cli` are implemented in E3. `./designer` is implemented in E4 and exports `ReportDesigner`, `ReportViewer`, `createReportStore`, `createPdfClient` and related types; no other entry exports the store.
58
+
59
+ ## Source mapping
60
+
61
+ The original scaffolding commit is `9f1d910`. Each of its four Git blob IDs was compared
62
+ with the corresponding file at source commit 1fd22d6 and matched exactly. Checkout CRLF
63
+ is normalized by both repositories; comparison uses Git objects, not text decoding.
64
+ New agent-guide and empty entry placeholders are scaffolding, not replacement implementations.
65
+ The following inventory records each tracked source file and its final disposition. The 60 files in 081d053 also match their pinned source Git blobs exactly.
66
+
67
+ | Source path | Target path / disposition | Status |
68
+ | --- | --- |
69
+ | `.assets/agent_live_preview.svg` | — | Not ported: source application, development tooling or source documentation outside the library port |
70
+ | `.assets/agent_preview.png` | — | Not ported: source application, development tooling or source documentation outside the library port |
71
+ | `.assets/designer_preview.png` | — | Not ported: source application, development tooling or source documentation outside the library port |
72
+ | `.assets/pdf_preview.png` | — | Not ported: source application, development tooling or source documentation outside the library port |
73
+ | `.assets/report_engine_agent.mkv` | — | Not ported: source application, development tooling or source documentation outside the library port |
74
+ | `.assets/schema_preview.png` | — | Not ported: source application, development tooling or source documentation outside the library port |
75
+ | `.github/workflows/check.yml` | — | Not ported: source application, development tooling or source documentation outside the library port |
76
+ | `.gitignore` | `.gitignore` | E1 copied verbatim in b60c5ea; generated PDF/PNG/tmp files ignored |
77
+ | `.oxlintrc.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
78
+ | `CODE_REVIEW.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
79
+ | `README.md` | `README.md` | Copied verbatim, then adapted to the workspace library |
80
+ | `docs/conditional-printing.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
81
+ | `docs/embedding.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
82
+ | `docs/formula-engine-usage.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
83
+ | `docs/formula-engine-v1.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
84
+ | `docs/mcp-changes.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
85
+ | `docs/pdf-pagination.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
86
+ | `docs/review-guide.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
87
+ | `docs/testing.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
88
+ | `examples/conditional-invoice.json` | `tests/fixtures/v1/conditional-invoice.json` | E2 copied verbatim in 8fd6f06; Git blob still matches pinned source |
89
+ | `examples/custom-invoice.json` | `tests/fixtures/v1/custom-invoice.json` | E2 copied verbatim in 8fd6f06; Git blob still matches pinned source |
90
+ | `examples/embedded.html` | — | Not ported: source application, development tooling or source documentation outside the library port |
91
+ | `examples/embedded.tsx` | — | Not ported: source application, development tooling or source documentation outside the library port |
92
+ | `implementation_plan.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
93
+ | `index.html` | — | Not ported: source application, development tooling or source documentation outside the library port |
94
+ | `mcp-config.example.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
95
+ | `package-lock.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
96
+ | `package.json` | `package.json` | Copied verbatim, then adapted to the workspace library |
97
+ | `packages/report-engine/README.md` | — | Not ported: source application, development tooling or source documentation outside the library port |
98
+ | `packages/report-engine/package.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
99
+ | `playwright.config.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
100
+ | `public/favicon.svg` | — | Not ported: source application, development tooling or source documentation outside the library port |
101
+ | `public/fonts/NotoSansTC.ttf` | `src/__tests__/fixtures/ReportEngineFixture.ttf` | E1 derived test-only subset; full font not copied |
102
+ | `public/fonts/OFL.txt` | `src/__tests__/fixtures/OFL.txt` | E1 copied verbatim |
103
+ | `public/icons.svg` | — | Not ported: source application, development tooling or source documentation outside the library port |
104
+ | `scripts/check_bundle.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
105
+ | `scripts/finish_package.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
106
+ | `scripts/pdf_regression.ts` | `scripts/pdf_regression.ts` | E1 copied verbatim in b60c5ea, then adapted; source assertions preserved; full 54-page regression passes |
107
+ | `scripts/serve_e2e.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
108
+ | `scripts/test_mcp_e2e.ts` | `scripts/test_mcp_e2e.ts` + `tests/mcpE2e.test.ts` | E3 copied verbatim in 6bd7135; all 41 source asserts retained in vitest using registry and real v2 client |
109
+ | `scripts/test_package.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
110
+ | `src/App.tsx` | `src/designer/DesignerView.tsx` | E4 copied verbatim in fd205a0, then adapted as internal DesignerView shell |
111
+ | `src/DemoApp.tsx` | — | Not ported: standalone demo application shell with local state and copilot (E4-01) |
112
+ | `src/assets/hero.png` | — | Not ported: standalone demo application asset (E4-01) |
113
+ | `src/client/reportPdf.ts` | `src/client/reportPdf.ts` | E1 imported; E4 extended PdfRenderContext with v2 document/parameter/signal context |
114
+ | `src/compiler/bandLayout.tsx` | `src/compiler/bandLayout.tsx` | E1 imported; host-safe font/layout integration and maintainer-approved canGrow page-break guard (20c479f) |
115
+ | `src/compiler/bandPipeline.ts` | `src/compiler/bandPipeline.ts` | E1 imported; mechanical NodeNext adaptation |
116
+ | `src/compiler/evaluator.ts` | `src/compiler/evaluator.ts` | E1 imported; mechanical NodeNext adaptation |
117
+ | `src/compiler/formatters.ts` | `src/compiler/formatters.ts` | E1 imported; mechanical NodeNext adaptation |
118
+ | `src/compiler/grouping.ts` | `src/compiler/grouping.ts` | E1 imported; mechanical NodeNext adaptation |
119
+ | `src/compiler/pdfCompiler.tsx` | `src/compiler/pdfCompiler.tsx` | E1 imported; mechanical NodeNext adaptation |
120
+ | `src/components/agent/AgentCopilot.tsx` | — | Not ported: standalone demo copilot panel (E4-01) |
121
+ | `src/components/data/DataSourceEditor.tsx` | `src/components/data/DataSourceEditor.tsx` | E4 copied verbatim in fd205a0, then adapted for v2 templates and host tokens |
122
+ | `src/components/designer/BandCanvas.tsx` | `src/components/designer/BandCanvas.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens, locale context and ARIA grid compliance |
123
+ | `src/components/designer/Navbar.tsx` | `src/components/designer/Navbar.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens, parameter tab and callback sync |
124
+ | `src/components/designer/PropertyPanel.tsx` | `src/components/designer/PropertyPanel.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
125
+ | `src/components/designer/Toolbox.tsx` | `src/components/designer/Toolbox.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
126
+ | `src/components/designer/properties/BandPropertiesSection.tsx` | `src/components/designer/properties/BandPropertiesSection.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
127
+ | `src/components/designer/properties/ColorPickerField.tsx` | `src/components/designer/properties/ColorPickerField.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
128
+ | `src/components/designer/properties/ConditionalPrintSection.tsx` | `src/components/designer/properties/ConditionalPrintSection.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
129
+ | `src/components/designer/properties/ControlSpecificInspector.tsx` | `src/components/designer/properties/ControlSpecificInspector.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
130
+ | `src/components/designer/properties/FieldSelectInput.tsx` | `src/components/designer/properties/FieldSelectInput.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
131
+ | `src/components/designer/properties/GeometrySection.tsx` | `src/components/designer/properties/GeometrySection.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
132
+ | `src/components/designer/properties/GlobalReportSettings.tsx` | `src/components/designer/properties/GlobalReportSettings.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
133
+ | `src/components/designer/properties/TypographySection.tsx` | `src/components/designer/properties/TypographySection.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
134
+ | `src/components/diagnostics/ReportPreflightPanel.tsx` | `src/components/diagnostics/ReportPreflightPanel.tsx` | E4 copied verbatim in fd205a0, then adapted for v2 preflight, MULTI_VALUE_PARAMETER_REFERENCE and host tokens |
135
+ | `src/components/formula/CalculatedFieldsPanel.tsx` | `src/components/formula/CalculatedFieldsPanel.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
136
+ | `src/components/formula/ControlFormulaEditor.tsx` | `src/components/formula/ControlFormulaEditor.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
137
+ | `src/components/formula/FormulaEditor.tsx` | `src/components/formula/FormulaEditor.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
138
+ | `src/components/formula/useFormulaData.ts` | `src/components/formula/useFormulaData.ts` | E4 copied verbatim in fd205a0, then adapted for preview data and single-value parameters |
139
+ | `src/components/schema/SchemaViewer.tsx` | `src/components/schema/SchemaViewer.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
140
+ | `src/components/ui/LocaleSwitcher.tsx` | — | Not ported: relied on global i18n store; host controls locale via props (E4-02) |
141
+ | `src/components/ui/badge.tsx` | `src/components/ui/badge.tsx` | E4 copied verbatim in fd205a0, then adapted for NodeNext imports |
142
+ | `src/components/ui/badgeVariants.ts` | `src/components/ui/badgeVariants.ts` | E4 copied verbatim in fd205a0, then adapted for host tokens |
143
+ | `src/components/ui/button.tsx` | `src/components/ui/button.tsx` | E4 copied verbatim in fd205a0, then adapted for NodeNext imports |
144
+ | `src/components/ui/buttonVariants.ts` | `src/components/ui/buttonVariants.ts` | E4 copied verbatim in fd205a0, then adapted for host tokens |
145
+ | `src/components/ui/input.tsx` | `src/components/ui/input.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens |
146
+ | `src/components/ui/label.tsx` | `src/components/ui/label.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens |
147
+ | `src/components/viewer/ReportViewer.tsx` | `src/components/viewer/ReportViewer.tsx` | E4 copied verbatim in fd205a0, then adapted for runtime ParameterPanel, host preview data and PDF callbacks |
148
+ | `src/constants/labels.ts` | `src/constants/labels.ts` | E4 copied verbatim in fd205a0, then adapted for NodeNext imports |
149
+ | `src/controls/barcodeUtils.ts` | `src/controls/barcodeUtils.ts` | E1 imported; mechanical NodeNext adaptation |
150
+ | `src/controls/pdfRegistry.tsx` | `src/controls/pdfRegistry.tsx` | E1 imported; mechanical NodeNext adaptation |
151
+ | `src/controls/plugins/BarcodeControl.tsx` | `src/controls/plugins/BarcodeControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
152
+ | `src/controls/plugins/CheckBoxControl.tsx` | `src/controls/plugins/CheckBoxControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
153
+ | `src/controls/plugins/ExpressionControl.tsx` | `src/controls/plugins/ExpressionControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
154
+ | `src/controls/plugins/FieldControl.tsx` | `src/controls/plugins/FieldControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
155
+ | `src/controls/plugins/ImageControl.tsx` | `src/controls/plugins/ImageControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
156
+ | `src/controls/plugins/LabelControl.tsx` | `src/controls/plugins/LabelControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
157
+ | `src/controls/plugins/LineControl.tsx` | `src/controls/plugins/LineControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
158
+ | `src/controls/plugins/PanelControl.tsx` | `src/controls/plugins/PanelControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
159
+ | `src/controls/plugins/QRCodeControl.tsx` | `src/controls/plugins/QRCodeControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
160
+ | `src/controls/plugins/SubReportControl.tsx` | `src/controls/plugins/SubReportControl.tsx` | E4 copied verbatim in fd205a0, then adapted for browser-only style helpers and host tokens |
161
+ | `src/controls/registry.ts` | `src/controls/registry.ts` | E4 copied verbatim in fd205a0, then adapted for NodeNext imports |
162
+ | `src/controls/styleUtils.ts` | `src/controls/styleUtils.ts` | E1 imported; E4 extracted browser-safe `designerStyleUtils.ts` so `./designer` never imports Node font helpers |
163
+ | `src/controls/types.ts` | `src/controls/types.ts` | E1 imported; E4 restored `ControlCategory` and `ReportControlPlugin` from fd205a0 |
164
+ | `src/data/schema.ts` | `src/data/schema.ts` | E1 imported; mechanical NodeNext adaptation |
165
+ | `src/data/schemaField.ts` | `src/data/schemaField.ts` | E1 imported; mechanical NodeNext adaptation |
166
+ | `src/designer/EditorToolbar.tsx` | `src/designer/EditorToolbar.tsx` | E4 copied verbatim in fd205a0, then adapted for host tokens and locale context |
167
+ | `src/designer/ReportDesigner.tsx` | `src/designer/ReportDesigner.tsx` | E4 copied verbatim in fd205a0, then adapted for locale prop, v2 callbacks, accessDenied and WCAG 2.2 AA |
168
+ | `src/designer/services.ts` | `src/designer/services.ts` | E4 copied verbatim in fd205a0, then extended with preview data, parameter options, draft and conflict callbacks |
169
+ | `src/formula/engine.ts` | `src/formula/engine.ts` | E1 imported; mechanical NodeNext adaptation |
170
+ | `src/formula/parser.ts` | `src/formula/parser.ts` | E1 imported; mechanical NodeNext adaptation |
171
+ | `src/formula/presentation.ts` | `src/formula/presentation.ts` | E1 imported; mechanical NodeNext adaptation |
172
+ | `src/formula/registry.ts` | `src/formula/registry.ts` | E1 imported; mechanical NodeNext adaptation |
173
+ | `src/formula/report.ts` | `src/formula/report.ts` | E1 imported; mechanical NodeNext adaptation |
174
+ | `src/formula/types.ts` | `src/formula/types.ts` | E1 imported; mechanical NodeNext adaptation |
175
+ | `src/formula/values.ts` | `src/formula/values.ts` | E1 imported; mechanical NodeNext adaptation |
176
+ | `src/i18n/config.ts` | `src/i18n/config.ts` | E4 copied verbatim in fd205a0, then adapted for NodeNext imports |
177
+ | `src/i18n/index.ts` | `src/i18n/index.ts` | E4 copied verbatim in fd205a0, then adapted to use per-mount React `LocaleContext` instead of global store |
178
+ | `src/i18n/messages/en.ts` | `src/i18n/messages/en.ts` | E4 copied verbatim in fd205a0, then completed with missing keys and verb/action copy |
179
+ | `src/i18n/messages/index.ts` | `src/i18n/messages/index.ts` | E4 copied verbatim in fd205a0, then adapted for NodeNext imports |
180
+ | `src/i18n/messages/zh-TW.ts` | `src/i18n/messages/zh-TW.ts` | E4 copied verbatim in fd205a0, then completed with missing keys and Taiwan Mandarin copy |
181
+ | `src/i18n/store.ts` | — | Not ported: global Zustand locale store replaced by per-mount `LocaleContext` (E4-02) |
182
+ | `src/index.css` | — | Not ported: package no longer ships global styles or `:root` tokens; host supplies tokens and `@source` (E4-01) |
183
+ | `src/inspector/layoutInspector.ts` | `src/inspector/layoutInspector.ts` | E1 imported; mechanical NodeNext adaptation |
184
+ | `src/inspector/measureBand.ts` | `src/inspector/measureBand.ts` | E1 imported; mechanical NodeNext adaptation |
185
+ | `src/lib/utils.ts` | `src/lib/utils.ts` | E4 copied verbatim in fd205a0 |
186
+ | `src/main.tsx` | — | Not ported: standalone Vite application entry (E4-01) |
187
+ | `src/mcp/changeTools.ts` | `src/mcp/changeTools.ts` | E3 copied verbatim in 6bd7135, then adapted; source tool logic retained |
188
+ | `src/mcp/formulaTools.ts` | `src/mcp/formulaTools.ts` | E3 copied verbatim in 6bd7135, then adapted; source tool logic retained |
189
+ | `src/mcp/index.ts` | `src/mcp/index.ts` | E3 copied verbatim in 6bd7135, then adapted; source tool logic retained |
190
+ | `src/mcp/results.ts` | `src/mcp/results.ts` | E3 copied verbatim in 6bd7135, then adapted; source tool logic retained |
191
+ | `src/mcp/server.ts` | `src/mcp/server.ts` | E3 copied verbatim in 6bd7135, then adapted; source tool logic retained |
192
+ | `src/mcp/tools.ts` | `src/mcp/tools.ts` | E3 copied verbatim in 6bd7135, then adapted; source tool logic retained |
193
+ | `src/mock/mockDataSource.ts` | `src/mock/mockDataSource.ts` | E1 imported for core/PDF tests; never imported by `./designer` (E4-01) |
194
+ | `src/mock/sampleReport.ts` | `src/mock/sampleReport.ts` | E1 imported for core/PDF tests; never imported by `./designer` (E4-01) |
195
+ | `src/public/core.ts` | `src/public/core.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
196
+ | `src/public/designer.ts` | `src/public/designer.ts` | E4 copied verbatim in 00eff0d, then adapted to remove global CSS import and export `ReportViewer` |
197
+ | `src/public/mcp.ts` | `src/public/mcp.ts` | E3 copied verbatim in 6bd7135, then separated host and development exports |
198
+ | `src/public/pdf.ts` | `src/public/pdf.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
199
+ | `src/report/dataPath.ts` | `src/report/dataPath.ts` | E1 imported; mechanical NodeNext adaptation |
200
+ | `src/report/dataSchema.ts` | `src/report/dataSchema.ts` | E1 imported; mechanical NodeNext adaptation |
201
+ | `src/report/defaultSubReport.ts` | `src/report/defaultSubReport.ts` | E1 imported; mechanical NodeNext adaptation |
202
+ | `src/report/document.ts` | `src/report/document.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
203
+ | `src/report/geometry.ts` | `src/report/geometry.ts` | E1 imported; mechanical NodeNext adaptation |
204
+ | `src/report/layoutDiagnostics.ts` | `src/report/layoutDiagnostics.ts` | E1 imported; mechanical NodeNext adaptation |
205
+ | `src/report/operations.ts` | `src/report/operations.ts` | E1 imported; mechanical NodeNext adaptation |
206
+ | `src/report/pagination.ts` | `src/report/pagination.ts` | E1 imported; mechanical NodeNext adaptation |
207
+ | `src/report/preflight.ts` | `src/report/preflight.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
208
+ | `src/report/presentationCapabilities.ts` | `src/report/presentationCapabilities.ts` | E1 imported; mechanical NodeNext adaptation |
209
+ | `src/report/schema.ts` | `src/report/schema.ts` | E1 imported; mechanical NodeNext adaptation |
210
+ | `src/report/subReport.ts` | `src/report/subReport.ts` | E1 imported; mechanical NodeNext adaptation |
211
+ | `src/report/validateDocument.ts` | `src/report/validateDocument.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
212
+ | `src/server/atomicFile.ts` | `src/server/atomicFile.ts` | E1 imported; mechanical NodeNext adaptation |
213
+ | `src/server/documentRepository.ts` | `src/server/documentRepository.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
214
+ | `src/server/layoutPlugin.ts` | — | Removed by decision point 3 and maintainer 2026-10-29 decision; Vite demo only |
215
+ | `src/server/pdfService.ts` | `src/server/pdfService.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
216
+ | `src/server/reportApi.ts` | `src/server/reportApi.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
217
+ | `src/server/reportRepository.ts` | `src/server/reportRepository.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
218
+ | `src/server/requestSchema.ts` | `src/server/requestSchema.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
219
+ | `src/server/standalone.ts` | — | Not ported: standalone demo server entry |
220
+ | `src/store/useReportStore.ts` | `src/store/useReportStore.ts` | E1 imported; E4 copied designer store in fd205a0 and adapted for v2 documents, parameters and per-mount context |
221
+ | `src/sync/reportSync.ts` | `src/sync/reportSync.ts` | E1 imported; E3/E4 adapted to support host `loadDraft`/`saveDraft` callbacks and v2 templates |
222
+ | `src/sync/useReportSync.ts` | `src/sync/useReportSync.ts` | E4 copied verbatim in fd205a0, then adapted to drive `createReportSync` via host `loadDraft`/`saveDraft`/`onVersionConflict` callbacks |
223
+ | `src/types/datasource.ts` | `src/types/datasource.ts` | E1 imported; mechanical NodeNext adaptation |
224
+ | `src/types/diagnostics.ts` | `src/types/diagnostics.ts` | E1 imported; mechanical NodeNext adaptation |
225
+ | `src/types/document.ts` | `src/types/document.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
226
+ | `src/types/render.ts` | `src/types/render.ts` | E1 imported; E2 template/parameter integration on the ported implementation |
227
+ | `src/types/report.ts` | `src/types/report.ts` | E1 imported; mechanical NodeNext adaptation |
228
+ | `tests/api.test.ts` | — | 12 asserts removed by decision point 3 and maintainer 2026-10-29 decision (Vite demo feature removed); not weakened or replaced |
229
+ | `tests/designer.test.ts` | `tests/designer.test.ts` | E4 copied verbatim in fd205a0, migrated to Vitest; all 26 source assertions retained |
230
+ | `tests/document.test.ts` | `tests/document.test.ts` | E1 imported; vitest assertions preserved |
231
+ | `tests/e2e/designer.spec.ts` | `tests/e2e/designer.spec.ts` | E4 copied verbatim in fd205a0, adapted for minimal test host and real MCP v2 client/registry; all 47 source expect sites retained |
232
+ | `tests/fixtures/pdf-baseline.json` | `tests/fixtures/pdf-baseline.json` | E1 copied verbatim in b60c5ea; only long-text page 2 regenerated after the approved 75-line fixture change; all other bytes unchanged |
233
+ | `tests/formula.test.ts` | `tests/formula.test.ts` | E1 imported; vitest assertions preserved |
234
+ | `tests/formulaApi.test.ts` | `tests/formulaApi.test.ts` | E1 imported; vitest assertions preserved |
235
+ | `tests/helpers.ts` | `tests/helpers.ts` | E1 imported; vitest assertions preserved |
236
+ | `tests/mcpChanges.test.ts` | `tests/mcpChanges.test.ts` | E3 copied verbatim in 6bd7135, vitest/v2 transport; all 32 source asserts retained |
237
+ | `tests/pdf.test.ts` | `tests/pdf.test.ts` | E1 imported; vitest assertions preserved |
238
+ | `tests/pdfFixtures.ts` | `tests/pdfFixtures.ts` | E1 imported; maintainer-authorized long-text change: 95 lines (6,269 UTF-16 units) to 75 (4,949), to satisfy decision item 4's 5,000-unit cap; line format/layout unchanged |
239
+ | `tests/presentation.test.ts` | `tests/presentation.test.ts` | E1 imported; vitest assertions preserved |
240
+ | `tests/report.test.ts` | `tests/report.test.ts` | E1 imported; vitest assertions preserved |
241
+ | `tests/sync.test.ts` | `tests/sync.test.ts` | E3 copied verbatim in 6bd7135; all 32 source asserts retained against v2 responses, plus v2 template round-trip |
242
+ | `tests/vitePreview.test.ts` | — | 6 asserts removed by decision point 3 and maintainer 2026-10-29 decision (Vite demo feature removed); not weakened or replaced |
243
+ | `tsconfig.app.json` | `tsconfig.json` | Copied verbatim, then adapted to the workspace library |
244
+ | `tsconfig.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
245
+ | `tsconfig.node.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
246
+ | `tsconfig.package.json` | `tsconfig.build.json` | Copied verbatim, then adapted to the workspace library |
247
+ | `tsconfig.test.json` | — | Not ported: source application, development tooling or source documentation outside the library port |
248
+ | `vite.config.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
249
+ | `vite.package.config.ts` | — | Not ported: source application, development tooling or source documentation outside the library port |
250
+
251
+ ## Test assertion inventory
252
+
253
+ Static call-expression counts compared with the pinned source; assertions map one-to-one.
254
+ Counts are assertion sites, not dynamically executed assertion totals.
255
+
256
+ | Source test | Source assert calls | Ported expect/assert calls | Status |
257
+ | --- | ---: | ---: | --- |
258
+ | tests/formula.test.ts | 65 | 65 | E1 vitest migration; all source assertions retained |
259
+ | tests/formulaApi.test.ts | 36 | 36 | E1 vitest migration; all source assertions retained |
260
+ | tests/document.test.ts | 22 | 22 | E1 vitest migration; all source assertions retained |
261
+ | tests/report.test.ts | 54 | 54 | E1 vitest migration; all source assertions retained |
262
+ | tests/presentation.test.ts | 24 | 24 | E1 vitest migration; all source assertions retained |
263
+ | tests/pdf.test.ts | 12 | 40 | E1 vitest migration (12 source asserts retained) + 2026-10-29 canGrow multi-page pagination overlap regression tests (28 asserts across N = 26, 27, 30, 60, 1000 on legacy and v2 routes, single-row multi-page text, ReportHeader + PageHeader, GroupHeader + GroupFooter, and canGrow: false parity) |
264
+ | tests/safety.test.ts | — | 19 | New host safety assertions; includes four assertions for fixture lengths, the historical 95-line text-cap rejection (code and message), and successful 75-line PDF rendering with the same host configuration |
265
+ | tests/worker.test.ts | — | 13 | E1 actual Worker lifecycle/resource assertions retained |
266
+ | tests/documentV2.test.ts | — | 13 | E2: 3 v1/v2/host-data tests; looped fixture vectors execute 21 assertions |
267
+ | tests/parameters.test.ts | — | 30 | E2: 12 tests for five types, cardinalities, options and defaults |
268
+ | tests/parameterDocument.test.ts | — | 53 | E2: 45 tests for document/HTTP/Worker integration and JSON Pointer diagnostics |
269
+ | tests/documentDiagnostics.test.ts | — | 10 | Review: 7 structural-location/cap tests |
270
+ | tests/pdfBaseline.test.ts | — | 2 | Review: 4 cross-route consistency guard tests |
271
+ | tests/mcpChanges.test.ts | 32 | 32 | E3: vitest with original strict assert calls, v2 real client and file-byte races |
272
+ | tests/sync.test.ts | 32 | 37 | E3: all original assertions plus 5 v2-template sync assertions |
273
+ | scripts/test_mcp_e2e.ts | 41 | 43 | E3: source 41 strict asserts plus all-22-tools coverage and artifact non-publication guard; imported by mcpE2e.test.ts |
274
+ | tests/registry.test.ts | — | 36 | E3: kind/RBAC/scopes, receipts, wrapping, versions, previews and E2 parameter preservation |
275
+ | tests/mcpSafety.test.ts | — | 17 | E3: actual stdio client, explicit file config, output/image/text/Worker guards |
276
+ | tests/designer.test.ts | 26 | 26 | E4: store transactions, multi-drag single-step undo, selection/clipboard/arrange and PDF client abort/cache |
277
+ | tests/designerBoundary.test.ts | — | 3 | E4: `./designer` exports, no store leakage from other entries, and static import graph boundary (no Node/`@react-pdf/*`/Worker imports) |
278
+ | tests/designerComponents.test.tsx | — | 81 | E4: 9 tests covering dual-mount locale/state/history/clipboard isolation, parameter editor validation & undo, runtime parameter panel (touch-friendly multi-select checklist, search filter, keyboard toggle, required check & error retry without contradictory message), `MULTI_VALUE_PARAMETER_REFERENCE` preflight navigation, callback sync conflict handling, localized lazy panel transitions without English loading text, localized formula editor copy, `< 768px` narrow-viewport designer notice with read-only preview entry and preserved undo history across resize, and inserting all 10 control types in `en` and `zh-TW` without CJK leaks or bilingual side-by-side strings |
279
+ | tests/i18n.test.ts | — | 2 | E4: bilingual key parity (`zh-TW` vs `en`) and non-empty strings |
280
+ | tests/e2e/designer.spec.ts | 47 | 47 | E4: 5 Chromium browser flows on the minimal test host (conditional PDF bytes, preflight control navigation & 422, multi-drag single-step undo & shortcut scoping, real MCP v2 sync & version conflict, dual built-package designer isolation) |
281
+ | tests/e2e/quality.spec.ts | — | 63 | E4: 13 screens × 2 themes (`light`/`dark`, verifying `documentElement` `colorScheme`) × 3 viewports (`1440×900`, `768×1024`, `375×812`) with screen-specific content waits, no-loading-indicator guard, rendered PDF page verification (`pdfjs-dist`), geometric non-overlap assertions between PageHeader and detail rows in viewer and large screens, dark-theme print-white paper check, `< 768px` designer notice check, `768×1024` and `1440×900` zoom percentage vs rendered paper scale + zoom-in + drag coordinate accuracy assertions, 360px overflow & >=44px touch target assertions, 78 screenshots + 78 axe scans (0 violations, including `iframe`) |
282
+
283
+ helpers.ts and pdfFixtures.ts are imported E1 support files. api (12) and vitePreview (6) are
284
+ removed by decision point 3 and the maintainer's 2026-10-29 decision: their Vite demo feature is
285
+ removed. All other source assertions are retained: E1 (213), E3 (105: 32 + 32 + 41), E4 Vitest
286
+ (`tests/designer.test.ts`: 26) and E4 Playwright (`tests/e2e/designer.spec.ts`: 47).
287
+ Total Vitest assertion sites: **658** (518 from E1–E3 + 26 newly ported `designer.test.ts` + 86
288
+ E4 sites: 3 + 81 + 2 + 28 new canGrow pagination regression sites in `pdf.test.ts`). Total Playwright E2E assertion sites: **110** (47 source + 63 quality).
289
+ All 213 original assertions in the six E1 files are retained; pdf.test.ts adds 28 sites. E5 leaves src/formula unchanged.
290
+ The PDF CLI's 18 assert sites and pdfBaseline.ts cross-route consistency guard remain separate
291
+ and unchanged. Counts are static assertion sites; parameterized/looped cases execute more.
292
+
293
+ ## Verification
294
+
295
+ Run the workspace gates in order: `pnpm install`, `pnpm build`, `pnpm build:graph`,
296
+ `pnpm typecheck`, `pnpm -r --no-bail test`, `pnpm lint`, `pnpm specs:lint`,
297
+ `pnpm exec changeset status`. Run report-engine's `test:components`, `test:pdf`, `test:mcp`
298
+ and `test:e2e` scripts as well. The PDF script checks legacy and v2 independently against the
299
+ same frozen 10-case/54-page baseline and requires exact agreement between the two routes.
300
+
301
+ Final E5 results: 22 Vitest files / 172 tests / 658 assertion sites; components 4 files / 16 tests;
302
+ MCP 4 files / 16 tests / 22 tools; Playwright 2 files / 6 tests / 110 assertion sites; 78 axe scans
303
+ with zero violations. Workspace tests: 3,794 passed / 3 existing Windows skips in 48 packages.
304
+ Lint has zero errors: the preserved formula engine retains 11 noNonNullAssertion warnings,
305
+ 1 useOptionalChain warning and 8 useTemplate infos; 7 pre-existing validation infos are unchanged.
306
+ All other report-engine lint diagnostics are fixed mechanically using the existing required helper
307
+ and template literals. No suppression, rule weakening, dependency addition or baseline update.
308
+ See the validation report for individual diagnostic locations and the initial axe.json newline failure.
309
+
310
+ ## Host PDF safety (E1-03)
311
+
312
+ Call `renderReportPdf(input, hostOptions)`; font paths/Buffers are host configuration, never
313
+ request JSON. A readable font containing the CJK glyphs 中、文、測、試 is validated before rendering.
314
+ Font registration no longer uses window, a Vite constant or a bundled full font.
315
+ Images accept only registered ASCII keys (letters/digits, hyphen/underscore); the host resolver
316
+ returns bytes. URLs, data URLs and filesystem paths are rejected before rendering.
317
+ Non-printing C0/C1 characters are removed; tabs/newlines remain layout whitespace.
318
+ Text input and formatted output are limited to 5,000 UTF-16 units and markup remains plain text.
319
+ Input data is copied, not mutated.
320
+
321
+ Font fixture: source `public/fonts/NotoSansTC.ttf` at 1fd22d6, SHA-256
322
+ `28dba526a37f0e20795d200e5e1b36c878c908b3732f9c9cfe33a1fd95014add`.
323
+ CJK subset: SHA-256 `df20ade3b51e8779dbd22b3f56cad064a3653c29b3f4d12c673d5de2df26692e`,
324
+ 129,236 bytes, 544 mapped Unicode characters. Latin-only rejection fixture: 22,328 bytes, 95 characters,
325
+ SHA-256 `6f3df0c5659aa280caf35fc4194adae42bbc6746a9637132dd6f9e1693413be1`.
326
+ Both fixtures include per-file metadata/codepoints and the source OFL license.
327
+ The subset script was adapted from the existing document-templates precedent; in `9797d9e`
328
+ that script is copied verbatim from this workspace, while OFL.txt is copied from the pinned source.
329
+ It is not a source report_engine_mvp script.
330
+
331
+ Only fonttools 4.60.1 was installed from PyPI into a disposable system-temp venv.
332
+ Pip summary: downloaded the 2.3 MB cp312/win_amd64 wheel, successfully installed fonttools-4.60.1.
333
+ The venv and failed sandbox directory have been deleted. Fonttools is not a package dependency.
334
+
335
+ ## Worker generation contract (E1-04)
336
+
337
+ `renderReportPdf(input, hostOptions)` always compiles in a fresh, terminable Worker Thread.
338
+ The HTTP handler accepts hostOptions as its third argument; client JSON cannot configure it.
339
+ All limits are required positive safe integers supplied by the host (no hidden defaults):
340
+
341
+ ```ts
342
+ const host = {
343
+ font: '/host-configured/font.ttf', // or Buffer
344
+ limits: { maxPages: 200, maxTableRows: 10000, maxOutputBytes: 20971520,
345
+ generationTimeoutMs: 30000, maxConcurrentGenerations: 2 },
346
+ resolveImage: async (key: string) => authorizedImageBytes(key),
347
+ };
348
+ const bytes = await renderReportPdf(input, host);
349
+ ```
350
+
351
+ The timer covers host image resolution and worker generation; after timeout no new worker
352
+ is started. A currently running worker is terminated and awaited before rejection/capacity release.
353
+ Host callbacks themselves run in the caller and must provide their own I/O cancellation.
354
+ Admission counts are process-local; an App with multiple Node processes must budget each process.
355
+ Nested input rows count toward maxTableRows. Actual laid-out pages are checked through the
356
+ renderer 4.x onRender layout data (fail closed if unavailable); output bytes are bounded while
357
+ consuming its stream. PreflightDocument runs before PDF/font rendering. Its new optional
358
+ useDataSchema flag defaults true; the internal v1 bare-data adapter uses false to preserve
359
+ the original renderer's schema-less formula behavior. In E2, v2 always uses its template schema,
360
+ even when useDataSchema is false; the single host data source lives in options.dataSource.
361
+ Only sanitized user text reaches drawing nodes; the source layout/controls/formula implementation
362
+ is retained. Resolved image bytes are passed into the worker, never callback functions or paths.
363
+ The Worker always exits before a completed or failed call returns.
364
+
365
+ | Code | Meaning | HTTP status |
366
+ | --- | --- | --- |
367
+ | REPORT_ENGINE_INVALID | Invalid input, preflight diagnostics, host font/image configuration | 422 |
368
+ | REPORT_ENGINE_TOO_LARGE | Actual pages, nested row count or output bytes exceed host limits | 413 |
369
+ | REPORT_ENGINE_TIMEOUT | Generation deadline exceeded and worker terminated | 504 |
370
+ | REPORT_ENGINE_BUSY | Host concurrency budget exhausted | 503 |
371
+
372
+ Formula/preflight diagnostics retain their original fields and HTTP 422 behavior.
373
+ Worker lifecycle diagnostics are internal test support, not public exports.
374
+ All limits and awaited actual timeout exit are covered by tests.
375
+
376
+ ## PDF visual baseline (E1-05 complete)
377
+
378
+ The source regression script and 54-page baseline were copied verbatim in b60c5ea.
379
+ The script retains every original assertion and uses a tsc-only runner, the injected
380
+ font subset and the real Worker-backed renderer. Generated PDF/PNG/HTML and actual-baseline
381
+ output stay ignored. The unchanged 5,000 UTF-16-unit boundary is applied to every case.
382
+
383
+ The original long-text value was 95 identically formatted joined lines (6,269 UTF-16 units).
384
+ The maintainer authorized changing only the count to 75 (4,949 units), the largest number
385
+ of complete lines within the cap: each line is 65 units, plus the intervening newlines.
386
+ Expected markers are LINE-0001 through LINE-0075, AFTER-TEXT and REPORT-END; every marker
387
+ must still occur exactly once. Font, layout and other fixture data remain unchanged.
388
+ The historical 95-line value is constructed by the same original expression in safety.test.ts:
389
+ four expect sites verify 6,269/4,949 lengths, REPORT_ENGINE_INVALID rejection with the
390
+ 5000 UTF-16 message, and successful 75-line PDF rendering with the same font and limits.
391
+ The test count remains 58. No cap, refusal behavior or original assertion was relaxed.
392
+
393
+ Both old and new long-text outputs have **2 pages**. Extracted markers in the new PDF:
394
+
395
+ | Page | Markers | Continuation evidence |
396
+ | --- | --- | --- |
397
+ | 1 | LINE-0001–LINE-0061 | 61 original-format lines |
398
+ | 2 | LINE-0062–LINE-0075 | 14 continuing lines; AFTER-TEXT and REPORT-END follow |
399
+
400
+ Two additional CLI assertions require at least two pages and LINE markers on page 2;
401
+ per-page ranges are printed by test:pdf. The first run with the approved fixture correctly
402
+ failed against the old page-2 geometry digest, before the explicitly scoped baseline update:
403
+
404
+ ```text
405
+ AssertionError [ERR_ASSERTION]: long-text page 2: text geometry changed
406
+ actual: 28ea0547a3abec63ee37e771609abf0521d37f09a3c082efc511ee53b93d2c11
407
+ expected: d214d7a09ad54df85b03d51ced38fdd157961e95ee9396f85968fedad3ee35fe
408
+ ```
409
+
410
+ Only the long-text key was regenerated: page 1 is identical, and only page 2's geometry
411
+ and perceptual hash values changed. Geometry is the script's SHA-256 of text strings,
412
+ transforms and widths, so removing LINE-0076–LINE-0095 also changes this digest. The shorter
413
+ content and following AFTER-TEXT/REPORT-END placement on page 2 account for the approved
414
+ fixture-specific change. No font or layout setting was changed. Detailed page differences:
415
+
416
+ | Page | Page count, old → new | Geometry digest, old → new | Hash changed bits |
417
+ | --- | --- | --- | ---: |
418
+ | 1 | 2 → 2 | f5ceb184c47157712d3ce6cd1103bf378b15b169430daf5f63425e27bf478e76 → identical | 0 |
419
+ | 2 | 2 → 2 | d214d7a09ad54df85b03d51ced38fdd157961e95ee9396f85968fedad3ee35fe → 28ea0547a3abec63ee37e771609abf0521d37f09a3c082efc511ee53b93d2c11 | 66 |
420
+
421
+ Full perceptual hashes (1,024 bits each):
422
+
423
+ ```text
424
+ page 1 old = new:
425
+ 0000000000000000c6840000d6d6000090d600000000000086040000d6d40000c68e0000d6f6000090d6000000000000c6040000d6dc0000c68e0000d6d700005012000000000000c6040000d6d40000c68e0000d6d500001000000000000000c6040000d2d40000c68e0000d6d5000010000000000000008000000000000000
426
+ page 2 old:
427
+ 0000000000000000c6840000d6d6000090d600000000000086040000d6d40000c68e0000d6f6000090d6000000000000c6040000d6dc0000c68e0000d6d700005012000000000000980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000
428
+ page 2 new:
429
+ 0000000000000000c6840000d6d6000090d600000000000086040000d6d4000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000
430
+ ```
431
+
432
+ | Other case | Pages | Comparison with original baseline |
433
+ | --- | ---: | --- |
434
+ | conditional | 1 | Geometry/hash identical on every page |
435
+ | keep-together | 2 | Geometry/hash identical on every page |
436
+ | split-fixed-band | 2 | Geometry/hash identical on every page |
437
+ | empty | 1 | Geometry/hash identical on every page |
438
+ | table | 4 | Geometry/hash identical on every page |
439
+ | long-table | 3 | Geometry/hash identical on every page |
440
+ | nested | 4 | Geometry/hash identical on every page |
441
+ | groups | 2 | Geometry/hash identical on every page |
442
+ | large | 33 | Geometry/hash identical on every page |
443
+
444
+ All nine other keys (52 pages) retain their original bytes, including formatting. A raw
445
+ before/after comparison confirms that the only changed bytes are the two page-2 long-text
446
+ values. No font-subset hash rebaseline was needed elsewhere. The full test:pdf rerun passes
447
+ all content, margins, page counts, geometry and hash checks (10 cases / 54 pages).
448
+ The general --update page-count/geometry guards remain unchanged.
449
+
450
+ ## Template/data separation (E2-01)
451
+
452
+ ReportDocument now has formatVersion: 2, report, dataSource: { id, name, schema }, and
453
+ optional sampleData: { parameters?, items }. The strict v2 schema rejects dataSource.data.
454
+ parseReportDocument and reportDocumentSchema accept v1 and return v2: metadata, schema and
455
+ report are retained; all v1 dataSource.data becomes sampleData. Zod creates a copy and
456
+ neither caller input nor stored source bytes are rewritten. Hosts should remove confidential
457
+ samples before persisting templates. No automatic v2 save occurs on read.
458
+
459
+ renderReportPdf({ document, dataSource, executionTime, timeZone }, hostOptions) renders host
460
+ ReportDataSource data. preflightDocument(document, { dataSource, executionTime, timeZone })
461
+ uses the same single dataSource option; without it, sampleData (or empty rows) is used.
462
+ The document schema remains authoritative for host row validation. The source report/data
463
+ render input remains compatible. The E1 optional useDataSchema flag is retained only for
464
+ its legacy v1 schema-less bridge; v2 always enforces its schema; no second host-data argument was introduced.
465
+ GetReportPreviewData(document, parameters, signal?) => Promise<ReportDataSource> defines
466
+ the E4 callback contract: hosts own query authorization and cancellation, and runtime data
467
+ is never saved automatically. The designer implements this callback through its per-instance preview-data provider.
468
+
469
+ Store and draft callbacks round-trip v2 templates, sample data and parameter definitions.
470
+
471
+ E2 tests: documentV2.test.ts adds 3 tests / 13 expect sites (8 looped example compatibility
472
+ sites, 5 template/host precedence sites; 21 dynamically executed assertions). E1's 213 source, 19 safety and 13 worker assertion sites remain.
473
+ The PDF regression renders all unchanged fixtures through both legacy report/data and v2 +
474
+ host data, comparing each route's 54 pages with the unchanged E1 baseline. The two JSON fixtures were copied verbatim
475
+ from pinned source in 8fd6f06; embedded.html/tsx remain demo-only; sync.test.ts was retained in E3.
476
+
477
+ ## Report parameters (E2-02; maintainer decision 2026-10-29)
478
+
479
+ ReportDocument.parameters contains ReportParameterDefinition[]: name, label, type
480
+ (string/number/boolean/date/datetime), multiple?, required?, options? and defaultValue?.
481
+ Options are { kind: 'static', values: [{ value, label }] } or { kind: 'host', key }.
482
+ Defaults are { kind: 'fixed', value } or { kind: 'formula', expression }.
483
+ Core exports reportParameterDefinitionSchema, reportParameterDefinitionsSchema,
484
+ reportParameterOptionSchema, and resolveReportParameters(definitions, input?, options?).
485
+ Dates are strict ISO dates; datetime requires an explicit offset, using the existing
486
+ formula engine's Temporal semantics. Values are never coerced. Unknown parameter names,
487
+ duplicate definitions, header-name collisions, invalid types and option values are rejected.
488
+ Host options are supplied as options.parameterOptions[key]; the engine performs no I/O.
489
+
490
+ resolveReportParameters returns values (including arrays for authorized host query/filter
491
+ binding) and formulaParameters (single values only). Hosts bind values into their queries,
492
+ e.g. region = ANY(:regions). Arrays must contain values of the declared type, required arrays
493
+ cannot be empty, and every static/host-option selection must be listed. Multi-value defaults
494
+ must be fixed arrays. Single defaults can be fixed or existing engine formulas, e.g.
495
+ =DATEADD("month", -1, DATE(YEAR(TODAY()), MONTH(TODAY()), 1)). Formula defaults require host
496
+ executionTime and timeZone. References to other parameters, fields, row indexes and aggregates
497
+ are rejected: dependent parameters remain a report-center v2 feature. No syntax or function
498
+ was added; the catalog remains 38 functions.
499
+
500
+ Layout formulas use params.name for single report parameters and header fields. Their names
501
+ must not collide. Multi-values must never enter FormulaContext.reportParameters and layout
502
+ references to them (explicit or bare fallback) are rejected, including nested subreports.
503
+ Hosts wishing to display selections supply a separate scalar header field (e.g. SQL
504
+ array_to_string(:regions, '、')). The engine does not serialize lists for formulas.
505
+ These multi-value rules were decided by the maintainer on 2026-10-29.
506
+
507
+ parameters.test.ts adds 12 tests covering five types in both cardinalities, required values,
508
+ static/host options, fixed defaults, all single formula default types, timezone boundaries,
509
+ forbidden dependencies, header collisions, unknown names and copy/isolation behavior.
510
+
511
+ ## Parameter-aware validation and preflight (E2-03)
512
+
513
+ validateReportDocument uses the existing validateReportFormulas analyzer with header fields
514
+ and single report parameters in the existing params namespace. Multi-value definitions are
515
+ excluded from that schema. The document layer refines their UNKNOWN_FIELD diagnostics to
516
+ MULTI_VALUE_PARAMETER_REFERENCE, using AST spans and the declared row schema.
517
+ Declared row fields keep precedence over same-named query parameters. Source traversal covers
518
+ Band/control visibleWhen, styleRules.when, calculatedFields, Expression and fieldName, recursively
519
+ including subreports. No separate formula validator or syntax/function was introduced.
520
+
521
+ preflightDocument(document, { dataSource?, parameters?, parameterOptions?, executionTime?,
522
+ timeZone?, execute? }) validates host rows against the template schema, applies defaults,
523
+ validates selections and passes only headers plus single values into the existing formula run.
524
+ Host user inputs override declared single defaults, and cannot override header fields. A copied
525
+ host source is used; samples, template input and caller parameters are not mutated. execute:false
526
+ performs static checks without requiring runtime values; supplied host/sample data is still
527
+ structurally checked. The host can first call resolveReportParameters to bind query values and
528
+ then supply the returned dataset to preflight/render. Engine operations perform no query I/O.
529
+
530
+ Diagnostic paths use JSON Pointer at document boundaries: /report/bands/0/controls/0/expression,
531
+ /parameters/0/defaultValue/expression, /parameters/limit, /dataSource/data/items/0/amount.
532
+ Names containing slash/tilde are escaped. FormulaDiagnostic fields such as code/span/controlId
533
+ are preserved. Invalid default syntax/functions, incompatible return types, and forbidden
534
+ references are blocked statically; errors requiring execution (e.g. division by zero or invalid
535
+ calendar values) are also blocked by preflight with the default formula location.
536
+
537
+ parameterDocument.test.ts proves all maintainer rules: root/child × explicit/bare reference
538
+ matrix covers six formula locations (24 tests); row-precedence and nested-inheritance tests
539
+ check that valid row access stays valid and arrays never enter reportParameters. Five types ×
540
+ two cardinalities (10 tests) cover runtime value/option/default validation. Other tests cover
541
+ required/empty arrays, strict elements, fixed-only multi defaults, forbidden dependent defaults,
542
+ header collisions, scalar selection-display headers, host clock/timezone, malformed host data,
543
+ JSON Pointer escaping, HTTP and actual Worker rendering/rejection. parameters.test.ts independently
544
+ covers fixed/default/option definition vectors and asserts the unchanged 38-function catalog.
545
+
546
+ E2 including review fixes adds 71 tests and 108 expect sites (13 + 30 + 53 + 10 + 2); E1's 58 tests and all 245 expect sites
547
+ (213 source + 19 safety + 13 Worker) remain. Total: 129 tests / 353 expect sites. The PDF CLI
548
+ retains all 18 assertion sites, applies them to legacy and v2 inputs, and adds one exact
549
+ cross-route guard (19 sites across the CLI and pdfBaseline.ts). Each input checks 54 pages.
550
+ Both v1 fixture Git blobs still match pinned source exactly. No sync/UI/MCP work was imported.
551
+ MCP uses SDK v2 and host draft callbacks as described below.
552
+
553
+ ## E3 multi-document MCP (2026-10-29)
554
+
555
+ All ten E3 source files were copied unchanged in 6bd7135 before adaptation. The source
556
+ modules and function names remain: tools.ts, formulaTools.ts, changeTools.ts, results.ts,
557
+ server.ts and index.ts. The server module now builds McpToolDefinitionPort objects and
558
+ registerInto(target) accepts the McpToolRegistry / McpToolsPort registerTool contract.
559
+ It does not instantiate an SDK server or read/write artifact files. There is no publish tool.
560
+ Every tool requires code; every mutation requires a fresh UUID requestId (reused only for an
561
+ identical retry). Older mutation expectedVersion remains optional; every actual repository
562
+ write carries the snapshot version. apply_report_changes requires baseVersion; preview can
563
+ check it. Repository calls are read(code), write(code, document, expectedVersion).
564
+
565
+ The host provides initialDocument(code, context) to retain the source reset semantics for each
566
+ selected document. No global demo document is used. A missing code or reset seed must fail.
567
+ Host publishArtifact({ code, mediaType, bytes, name }, context) handles all PDF/SVG outputs;
568
+ its reference is returned to the agent. Tool input outputPath is rejected. The development
569
+ publisher writes uniquely named files only under an explicit absolute directory.
570
+ PDF always uses renderReportPdf with host font, registered image keys and all five Worker
571
+ limits. No assetsDirectory image resolver or second rendering implementation exists.
572
+ Inspection retains the source SVG and geometry diagnostics; it compiles the guarded PDF
573
+ before publishing either preview artifact. A host publisher is responsible for its own
574
+ storage authorization and atomicity if publishing a two-artifact inspection partially fails.
575
+
576
+ ReportDocument remains v2, with schema and optional sampleData. Source data-source tools edit
577
+ sample data and return a sample-data view; they never fetch runtime query data. Source formula
578
+ handlers reuse the E2 parameter resolver/document validator, retain single parameters and
579
+ header values, and never send multi-value query parameters to FormulaContext. Static validation
580
+ does not require runtime values; MULTI_VALUE_PARAMETER_REFERENCE remains a document diagnostic.
581
+ Parameter definitions survive layout edits, data-source replacement and atomic changes.
582
+
583
+ Use createReportMcpServer(options).registerInto(hostRegistry). The host supplies repository,
584
+ kind, per-code reset seeds, pdf options, publishArtifact and the agent output protection callback.
585
+ The registry helper supplies the existing definition-registry user-content boundary and notice.
586
+ Read-only tools omit mutates (the port represents false by absence); writes set mutates:true.
587
+ For the following table, R = definitionPermission(kind, 'read'),
588
+ W = definitionPermission(kind, 'write'). For Report these are report:definition:read and
589
+ report:definition:write. All handlers check actingUserId and the complete scope list.
590
+
591
+ | Tool | requiredScopes | mutates | Behavior regression |
592
+ | --- | --- | --- | --- |
593
+ | get_formula_catalog | R | false | source MCP regression: 38 functions, signatures, examples |
594
+ | validate_report_formulas | R | false | source MCP regression + mcpChanges: valid, cycles/unknown functions |
595
+ | preview_formula | R | false | source MCP regression: decimal total, formatted result, child Unicode |
596
+ | set_calculated_fields | R, W | true | source MCP regression: chained calculations, cycle rollback |
597
+ | preflight_report | R | false | mcpChanges: saved/candidate, structure/runtime; all-tools regression |
598
+ | preview_report_changes | R | false | mcpChanges: no writes, geometry, stale version; registry receipt test |
599
+ | apply_report_changes | R, W | true | mcpChanges: atomic batch, runtime failure, conflict/race, no-op |
600
+ | get_report_data_source | R | false | source MCP regression: persisted schema and sample rows |
601
+ | set_report_data_source | R, W | true | source MCP regression: atomic report/schema replacement, invalid data rollback |
602
+ | get_report_layout | R | false | source MCP regression + mcpChanges: geometry, snapshot-version consistency |
603
+ | get_available_data_fields | R | false | source MCP regression: calculations, schema discovery, sample values |
604
+ | add_control | R, W | true | source MCP regression: exact control placement |
605
+ | update_control | R, W | true | source MCP regression: child styles, runtime-invalid export rejection |
606
+ | batch_update_controls | R, W | true | source MCP regression: style merge, missing-target rollback |
607
+ | delete_control | R, W | true | source MCP regression: removes the inserted control |
608
+ | set_band_height | R, W | true | source MCP regression: negative height rejected without mutation |
609
+ | set_band_controls | R, W | true | all-tools extension: atomically replace selected band's controls |
610
+ | update_page_settings | R, W | true | source MCP regression: landscape printable width, stdio edit |
611
+ | reset_report_layout | R, W | true | source MCP regression: restore configured seed after corruption |
612
+ | set_full_report | R, W | true | source MCP regression: invalid structure rejected, valid full replacement |
613
+ | export_pdf | R | false | source MCP regression: empty/two/custom rows, PDF text, failed output preservation |
614
+ | inspect_and_preview_layout | R | false | all-tools extension: guarded PDF + SVG host callback; protected inspection text |
615
+
616
+ All tools in this table are called through the actual @modelcontextprotocol/client 2.0.0
617
+ in-memory transport using createTestDefinitionRegistry and the ./registry adapter.
618
+ The source's mcpChanges.test.ts additionally retains its complete file-byte/race assertions.
619
+
620
+ ### Development transport and dependencies
621
+
622
+ - ./mcp exports the host tools, contracts, tool catalog, change types and conflict error.
623
+ Its source entry and host tool modules import neither @modelcontextprotocol/* nor a file
624
+ repository nor node:fs. The existing PDF service owns font reads and Worker rendering.
625
+ - ./registry exports createRegistryReportRepository, createRegistryReportMcpOptions,
626
+ protectReportToolReply, RegistryReportRepositoryOptions and USER_CONTENT_NOTICE.
627
+ - ./mcp/stdio exports the SDK v2 adapter, explicit code-to-file repository allowlist,
628
+ explicit directory artifact publisher, source file repository and StdioServerTransport.
629
+ Only this development adapter imports @modelcontextprotocol/server and its ./stdio entry.
630
+ - ./mcp/stdio/cli is the executable development entry (dist/mcp/index.js). Set absolute
631
+ REPORT_ENGINE_LAYOUT_FILE (or positional file argument), REPORT_ENGINE_INITIAL_FILE,
632
+ REPORT_ENGINE_FONT and REPORT_ENGINE_OUTPUT_DIRECTORY. REPORT_ENGINE_CODE defaults to report;
633
+ REPORT_ENGINE_KIND defaults to Report. Missing configuration fails before any file is created.
634
+ The initial document is an explicitly provided JSON file, not a bundled demo reset seed.
635
+ - @modelcontextprotocol/server: optional peer 2.0.0 and devDependency 2.0.0.
636
+ @modelcontextprotocol/client: devDependency 2.0.0 only. No v1 SDK dependency/import.
637
+ @haneinfo/plugin-api: peer ^1.27.0 + dev workspace:*;
638
+ @haneinfo/definition-registry: peer ^0.2.6 + dev workspace:*.
639
+ No shared dependency upgrade and no other new large dependency.
640
+ - Only ./designer exports the per-instance store. reportSync and useReportSync preserve their source assertions and run through host callbacks. Vite layoutPlugin and the demo api/vitePreview tests are excluded by decision point 3 and the maintainer decision.
641
+
642
+ ### Registry adapter permissions and receipts (E3-02)
643
+
644
+ The host registers its own definition kind and stores ReportDocument in envelope.spec.
645
+ createRegistryReportMcpOptions({ registry, receipts, kind, rbac, initialDocument, pdf,
646
+ publishArtifact }) supplies the per-invocation repository and agent output boundary.
647
+ registry is the host DefinitionRegistryService draft interface (get/patchDraft), and receipts
648
+ is the read-only findReceipt view of the same DEFINITION_STORE. No alternate receipt store,
649
+ cache, definition schema, publisher or kind registration is created by this package.
650
+ createRegistryReportRepository is the lower-level actor/scopes/callerKey/call-bound adapter;
651
+ its raw document snapshots are engine inputs and must not be sent directly to an agent.
652
+
653
+ Both registry factories accept `documentPath` (default `/spec`), a JSON Pointer into the
654
+ definition envelope. For an App envelope whose spec contains `{ document, category, main,
655
+ header, children }`, use `/spec/document`. Reads parse only that value; writes issue one
656
+ `replace` at that exact path, preserving every sibling and the envelope metadata. The path
657
+ must already exist for replacement. RFC 6901 `~0` and `~1` escapes are supported.
658
+
659
+ `permissionScopes: { read, write }` overrides the exact scope names in both the tool catalog
660
+ and repository authorization. It is accepted by both registry factories and `createReportMcpServer`.
661
+ Omission retains `definitionPermission(kind, 'read' | 'write')`; mutations still require both
662
+ scopes at the tool boundary. Kind RBAC continues to use `hasDefinitionPermission` and is never
663
+ renamed by a custom scope. Hosts still own their semantic-validation and locking boundary.
664
+
665
+ Set `includeRegistryValidation: true` on either registry factory to return the persisted
666
+ registry result. The lower-level write snapshot and receipt replay gain
667
+ `validation: { valid, diagnostics }`; MCP replies gain `saved: true`, `valid`, the saved
668
+ `version`, and registry `diagnostics`. An invalid intermediate draft is still saved:
669
+ `success: true`, `isError: false`, `code: 'DRAFT_SAVED_INVALID'`, `saved: true`, `valid: false`.
670
+ Here success means the save completed, not that the draft may be published. Do not undo it
671
+ or retry it with a new requestId merely because valid is false. Fix the named JSON Pointer
672
+ paths with a new edit. Valid drafts can also carry registry warnings. Without the option,
673
+ successful write/replay replies retain the 0.1.0 shape and behavior.
674
+
675
+ Registry diagnostic codes, severity (`ERROR` / `WARNING`) and envelope JSON Pointer paths
676
+ are preserved; messages and suggestions use the existing `$userContent` protection in
677
+ both reply channels. `DefinitionRegistryError` diagnostics also survive failed tool calls,
678
+ including when validation-result reporting is not enabled. These remain failed writes
679
+ (`success: false`, `isError: true`, `data.applied: false`).
680
+ The exported `ReportToolOutcome` keeps its original report-diagnostic type by default;
681
+ `ReportToolOutcome<ReportToolDiagnostic>` also describes registry diagnostic results.
682
+
683
+ The registry already persists its complete DraftWriteResult in the same write receipt.
684
+ Replay uses that original revision, validity and diagnostics, even after another edit
685
+ fixes the draft or a new server instance handles the retry. It never revalidates current
686
+ content to synthesize a historical result. Non-default document paths participate in the
687
+ receipt digest; moving the document requires a new requestId. Default `/spec` digests
688
+ remain compatible with existing receipts. No registry or receipt-schema change is needed.
689
+
690
+ ```ts
691
+ createReportMcpServer(createRegistryReportMcpOptions({
692
+ registry, receipts, kind: 'ReportLayout', rbac,
693
+ documentPath: '/spec/document',
694
+ permissionScopes: {
695
+ read: 'haneinfo-reports:definition:read',
696
+ write: 'haneinfo-reports:definition:write',
697
+ },
698
+ includeRegistryValidation: true,
699
+ initialDocument, pdf, publishArtifact,
700
+ })).registerInto(hostRegistry);
701
+ ```
702
+
703
+ Tools require R for reads and R + W for mutations because editing first reads the draft.
704
+ The adapter also checks the actor's existing hasDefinitionPermission RBAC and calls the
705
+ registry as that actor. ADMIN and ALLOW_ALL permit both; READ_ALL and explicit read permit
706
+ reads only; explicit write without read cannot use the read-before-edit tools; DENY_ALL
707
+ with no grants permits neither. The acting user and connectionId (or API-key sub) are
708
+ required; missing RBAC fails closed. FinanceReport tests verify finance-report scopes and
709
+ an independent host envelope, including the E2 single/multiple parameter contract.
710
+
711
+ Writes replace only documentPath (by default /spec) with expectedVersion mapped to the registry's positive revision;
712
+ metadata, kind and code stay intact. Invalid/missing versions fail before patching. The reset
713
+ compatibility path can obtain the current envelope revision even when its report spec is
714
+ corrupt, then performs the same versioned patch with the explicit host seed. All other
715
+ legacy mutations pass the version of the document they read; apply uses baseVersion.
716
+ An engine validation failure, stale revision, preflight or preview does not update draft bytes,
717
+ revision, audit or receipts. Source no-op apply returns NO_CHANGES without a write.
718
+ Registry kind validation runs after saving and permits invalid intermediate drafts as described above.
719
+
720
+ A new mutation needs a UUID requestId. callerKey is connectionId or api-key:<sub>, and the
721
+ existing digestOf hashes the tool and complete validated input except requestId, including
722
+ kind and code. patchDraft atomically saves its normal DefinitionWriteReceipt with the draft.
723
+ Before re-executing a mutation the adapter checks that same durable receipt and current
724
+ actor permissions: an exact retry returns the recorded revision with data.replayed:true
725
+ without another edit; another input/tool/kind/code with the same requestId returns
726
+ REQUEST_ID_REUSED. The receipt behavior remains valid across adapter/server instances.
727
+ A new requestId with a stale baseVersion returns VERSION_CONFLICT.
728
+
729
+ Both content and structuredContent wrap every user string and sample string using the
730
+ existing wrapUserStrings, which invokes registry's wrapUserContent for strings. It also
731
+ wraps diagnostic messages, error messages and geometry/ASCII inspection text. Numeric,
732
+ boolean and null values retain the registry helper's existing inert-scalar behavior.
733
+ No new wrapping algorithm is introduced. The existing USER_CONTENT_NOTICE is appended to
734
+ tool descriptions. Direct repository reads intentionally remain raw engine data.
735
+
736
+ registry.test.ts covers the permission matrix, missing identity/scopes/RBAC, another kind,
737
+ metadata and parameter preservation, VERSION_CONFLICT, no-write preview, receipt persistence,
738
+ exact replay and requestId reuse, user-content protection in both channels, code isolation,
739
+ per-code reset and the absence of any publish tool. Existing mcpChanges assertions also
740
+ exercise a competing writer after validation and snapshot-version consistency after reads.
741
+
742
+ #### Registry host options verification (2026-10-30)
743
+
744
+ Base: main `23dc26f`; branch: `report-center/engine-registry-fix`. New tests first reproduced
745
+ the path/scope gaps and lost validation diagnostics, then passed with the implementation.
746
+ All existing assertions remain in place. The real MCP v2 client tests use the existing
747
+ in-memory registry/transport, including new server instances for receipt replay after a
748
+ later correcting edit. No App repository, definition-registry source, dependencies, package
749
+ versions, decisions or PDF baselines were changed. The pending changeset is minor for
750
+ report-engine only; the package remains 0.1.0 until maintainers run release versioning.
751
+
752
+ | Verification | Actual result |
753
+ | --- | --- |
754
+ | `pnpm install` | Passed; lockfile unchanged |
755
+ | `pnpm build`, `pnpm build:graph`, `pnpm typecheck` | Passed in README order |
756
+ | `pnpm -r --no-bail test` | Passed: 3,820 tests across 48 package summaries; 3 existing skips (plugin-cli 2, app-tooling 1) |
757
+ | `pnpm lint` | Passed, zero errors; 12 existing warnings and 15 infos; no rule or suppression changes |
758
+ | `pnpm specs:lint` | Passed |
759
+ | `pnpm exec changeset status` | Passed: report-engine minor only; no patch or major releases |
760
+ | `pnpm -C packages/report-engine test` | 22 files / 198 passed |
761
+ | `pnpm -C packages/report-engine test:mcp` | 4 files / 28 passed; all 22 tools retained; registry tests increased from 12 to 24 |
762
+ | `pnpm -C packages/report-engine test:components` | 4 files / 30 passed |
763
+ | `pnpm -C packages/report-engine test:pdf` | Passed: legacy and v2 each match the frozen 10-case / 54-page baseline, with exact agreement between routes |
764
+ | `pnpm -C packages/report-engine test:e2e` | 8 passed (Chromium, 3 minutes); 78 screenshots / 78 axe scans with zero violations, including the existing real-client designer synchronization flow |
765
+ | `git diff --check` | Passed |
766
+
767
+ The new cases cover nested/escaped pointers, complete sibling preservation, missing targets,
768
+ path-bound receipts, custom/default scopes and unchanged kind RBAC, saved invalid drafts and
769
+ replay through four mutation tools, warning-only validation, error diagnostics and wrapping in
770
+ both channels, unchanged opt-out behavior/types, no-op edits and rejected engine input.
771
+ Every requested verification was executed. The three workspace skips above remain skips;
772
+ there were no new skips. Generated PDF/screenshot artifacts stay in ignored package-local
773
+ directories; no frozen baseline or unrelated tracked file was changed.
774
+
775
+ ## E4 host designer, viewer and parameters (2026-10-29)
776
+
777
+ All 52 E4 source files were copied verbatim in `fd205a0` (51 designer/component/i18n/store/test
778
+ files) and `00eff0d` (`src/public/designer.ts`); every Git blob ID matches pinned source
779
+ `1fd22d629ea09f5a2184790b5a91a9b47e3c0744`. Source `src/App.tsx` was imported as internal
780
+ `src/designer/DesignerView.tsx`. Demo and local-file modules (`src/DemoApp.tsx`, `src/main.tsx`,
781
+ `src/components/agent/AgentCopilot.tsx`, `src/components/ui/LocaleSwitcher.tsx`, `src/i18n/store.ts`,
782
+ `src/index.css`, `src/assets/hero.png`, `src/server/layoutPlugin.ts`, `src/server/standalone.ts`)
783
+ are not ported; `src/mock/*` is never imported by `./designer`.
784
+
785
+ ### Public `./designer` entry and browser boundary
786
+
787
+ `./designer` (`dist/public/designer.js`) exports:
788
+ - `ReportDesigner`, `ReportViewer` (`ReportDesignerProps`, `ReportViewerProps`, `ReportDesignerHandle`)
789
+ - `createReportStore` (`ReportState`, `ReportStore`, `ReportTab`, `ArrangeMode`)
790
+ - `createPdfClient` (`PdfClientOptions`, `PdfRenderContext`, `PdfRequest`)
791
+ - `DesignerServices`
792
+
793
+ No other public entry (`./core`, `./pdf`, `./mcp`, `./registry`, `./mcp/stdio`) exports
794
+ `createReportStore`. Static import-graph verification (`tests/designerBoundary.test.ts`) confirms
795
+ that `./designer` never imports `node:*`, `@react-pdf/*`, `pdfService`, `pdfWorker`, `renderSafety`,
796
+ `reportRepository`, `documentRepository`, `mcp` or `registry`. Browser control plugins use
797
+ `src/controls/designerStyleUtils.ts` so `src/controls/styleUtils.ts` (which imports PDF font
798
+ helpers) is never pulled into browser bundles.
799
+
800
+ ### Host styling and Tailwind `@source` setup
801
+
802
+ The package ships no global stylesheet and no `:root` token overrides (`import "../index.css"` was
803
+ removed from `src/public/designer.ts`). All components use `@haneinfo/frontend-shell` semantic
804
+ token classes (`bg-background`, `text-foreground`, `bg-muted`, `text-muted-foreground`, `bg-card`,
805
+ `text-card-foreground`, `bg-popover`, `text-popover-foreground`, `bg-primary`,
806
+ `text-primary-foreground`, `border-border`, `border-input`, `ring-ring`, `text-destructive`) and
807
+ follow the host's `.dark` variant.
808
+
809
+ A host application using Tailwind CSS v4 must scan the built package in its global CSS (for example
810
+ `app/globals.css`, alongside `@haneinfo/frontend-shell`):
811
+
812
+ ```css
813
+ @import "tailwindcss";
814
+ @source "../../node_modules/@haneinfo/report-engine/dist";
815
+ @custom-variant dark (&:is(.dark *));
816
+ ```
817
+
818
+ The host must also set `color-scheme` (`light` or `dark`, e.g. `document.documentElement.style.colorScheme = isDark ? 'dark' : 'light'`) on the root document element according to the active theme so native browser controls (date picker icons, select dropdown arrows, scrollbars) match the theme (`@haneinfo/frontend-shell` already applies this via `theme-boot` and `theme-utils`).
819
+
820
+ `packages/report-engine/biome.json` exists solely to set `"css": { "parser": { "tailwindDirectives": true } }`
821
+ (inheriting root configuration via `"extends": "//"`) so Biome can parse `@import "tailwindcss"`,
822
+ `@source`, `@custom-variant`, `@theme` and `@apply` in `tests/host/tokens.css`. It disables no
823
+ lint rules and lowers no severity levels.
824
+
825
+ ### Locale prop, callbacks and v2 template/runtime separation
826
+
827
+ Each `<ReportDesigner>` or `<ReportViewer>` mount owns an isolated Zustand store, undo/redo
828
+ history, clipboard, `PreviewDataProvider`, `LocaleContext` (`locale: 'zh-TW' | 'en'`) and optional
829
+ draft sync session:
830
+
831
+ ```tsx
832
+ <ReportDesigner
833
+ initialDocument={document}
834
+ locale={locale} // 'zh-TW' | 'en'
835
+ viewOnly={false}
836
+ accessDenied={false}
837
+ renderPdf={renderPdf}
838
+ getReportPreviewData={getReportPreviewData}
839
+ getParameterOptions={getParameterOptions}
840
+ executionTime={executionTime}
841
+ timeZone={timeZone}
842
+ loadDraft={loadDraft}
843
+ saveDraft={saveDraft}
844
+ onVersionConflict={onVersionConflict}
845
+ onChange={handleDocumentChange}
846
+ />
847
+ ```
848
+
849
+ - **Template vs runtime preview data (`E4-01`, `E4-03`):** The store holds and emits a `formatVersion: 2`
850
+ `ReportDocument` (`report`, `dataSource` schema, optional `sampleData`, `parameters`). Runtime
851
+ preview data returned by `getReportPreviewData(document, parameters, signal)` lives exclusively
852
+ in `PreviewDataProvider` and never enters the template store, `onChange`, undo/redo history, JSON
853
+ export or `saveDraft`.
854
+ - **Draft sync and version conflict (`E4-03`):** `useReportSync` drives `createReportSync` only when
855
+ the host supplies `loadDraft` and `saveDraft`. In-flight local edits are never overwritten by a
856
+ background poll; HTTP 409 / `VERSION_CONFLICT` preserves local edits, displays a conflict banner
857
+ with retry/reload actions, and invokes `onVersionConflict(localDocument)`.
858
+ - **Parameter editor and runtime panel (`E4-03`):**
859
+ - `ParameterEditor` edits E2 `ReportParameterDefinition[]` (name, label, 5 value types,
860
+ single/multiple, required, static or host option key, fixed or formula default) with styled
861
+ `<Checkbox>` controls (`44×44px` touch target), styled fieldset legend badge, consistent input
862
+ and select typography, destructive delete button styling, live `reportDocumentV2Schema` and
863
+ `parameterDefaultDiagnostics` validation, `aria-invalid` / `aria-describedby` field errors, and
864
+ single-step undo/redo.
865
+ - `ParameterPanel` renders inside `ReportViewer`, loads host options via
866
+ `getParameterOptions(key, document, signal)` with loading skeleton and retryable error alert,
867
+ computes initial values via `resolveReportParameters` using host `executionTime` and `timeZone`,
868
+ provides a touch-friendly `<Checkbox>` checklist with search filtering for multi-value options,
869
+ validates required and typed inputs on submit, and triggers `getReportPreviewData` + `renderPdf`.
870
+ The panel and its pinned "Apply and preview" action remain visible even when there are no
871
+ parameters, allowing hosts to fetch fresh data. Each viewer owns a `useId` form ID and a form
872
+ ref; empty-state filter navigation scrolls and focuses only that viewer's panel, with matching
873
+ `aria-controls` (review correction `209ccf4`).
874
+ NativeSelect and DateInput share Input styles, theme tokens, error states and inset lucide icons.
875
+ DateInput keeps the native date picker and supports its calendar button, field click and Alt+Down;
876
+ browsers without showPicker retain native field and keyboard editing. Single datetime parameters
877
+ use datetime-local, converting between wall-clock input and offset-bearing contract values with
878
+ the instance service's timeZone (UTC fallback) and the existing Temporal dependency. Seconds and
879
+ fractional seconds survive conversion. Temporal's compatible DST policy moves spring-gap times
880
+ forward and chooses the earlier fall-overlap occurrence; existing instants are preserved until
881
+ edited. No parameter contract, public API or dependency changes are required.
882
+ - `ReportPreflightPanel` passes preview data and parameters to `preflightDocument`, displays
883
+ diagnostics including `MULTI_VALUE_PARAMETER_REFERENCE`, and navigates directly to the
884
+ offending control, band, calculated field or data source.
885
+
886
+ ### Running component and browser E2E tests
887
+
888
+ - Component & boundary tests (Vitest + jsdom):
889
+ `pnpm -C packages/report-engine test:components`
890
+ - Chromium E2E flows, multi-viewport screenshots & axe suite (Playwright + unshipped Vite test host on `http://127.0.0.1:5189`):
891
+ `pnpm -C packages/report-engine test:e2e`
892
+ (If Chromium is not yet installed on the machine, run `pnpm -C packages/report-engine exec playwright install chromium` once.)
893
+ Screenshots and `axe.json` are written to `packages/report-engine/scratch/e4-screenshots/` (gitignored).
894
+
895
+ ## Source differences and release constraints
896
+
897
+ The [validation report](../../validation/report-engine/report.md) maps every adaptation category to
898
+ decision efdd, a8d3 item 1 or a maintainer decision, with implementation commits. The 2026-10-29
899
+ canGrow correction (20c479f, 74af9ff) prevents detail rows from compressing PageHeader when a page
900
+ has less than one base band height remaining; its non-wrapping guard sends the band to the next
901
+ page. The large test-host case now uses canGrow without a workaround. The frozen baseline remains
902
+ `ba15f2aed87d4a8e0e48d6eceb88c3484830d2e2`.
903
+
904
+ Following the maintainer's 2026-10-29 decision to resolve visual findings before G1 publication,
905
+ commit `3fee7ca` fixes V01 (ParameterPanel restructured as a flex column with a pinned bottom action
906
+ bar so "Apply and preview" is never clipped on narrow viewports) and V03 (ReportViewer displays
907
+ localized empty state guidance with role="status" and filter navigation when preview data has 0 rows).
908
+ All 78 screenshots and axe accessibility evidence (0 violations) are updated.
909
+
910
+ Review correction `209ccf4` preserves those layouts and messages while isolating filter navigation
911
+ between mounts and restoring preview-data reloads for parameter-free reports. Two component
912
+ regressions add 14 assertion sites (10 for dual-viewer focus/IDs/ARIA, 4 for the parameter-free
913
+ action and host callback); all existing assertions remain. Commit `0eb8257` scopes the E2E submit
914
+ locator to the named form without depending on its changing loading label.
915
+
916
+ This review's rerun passed package build/typecheck, 175 tests (22 files), 19 component tests
917
+ (4 files), 16 MCP tests (4 files), both 54-page PDF inputs and 6 E2E tests (2 files). All 78 axe scans
918
+ have zero violations. Eight PNGs were refreshed, 70 are byte-identical, and `axe.json` only gained
919
+ a trailing newline; the exact file list and initial failures are in the validation report.
920
+ Workspace tests passed 3,797 with 3 skipped; the original 47 packages remain at 3,622/3. Graph build,
921
+ lint (0 errors, 12 warnings, 15 infos), specs lint and changeset status passed; no major release.
922
+
923
+ G1 UI correction `c2d44a0` also resolves V04 (mobile loading skeleton expanding/clipping its
924
+ ancestors), V05 (all 19 selects and native date icons) and V06 (manual ISO datetime input).
925
+ The loading skeleton uses percentage widths, minimum-width constraints and smaller mobile padding.
926
+ The paper grouping selector keeps white/deep-text print colors. New tests compare every visible
927
+ element's horizontal bounds at 360/375 px, including large-data PDF generation before/after completion;
928
+ all 13 screens across themes/viewports verify native controls, icon spacing and padding. Chromium's
929
+ native calendar indicator is checked in its actual user-agent shadow tree. The validation report
930
+ lists every replaced select and includes the pre-fix overflow failure output.
931
+
932
+ Visual review found wrapped formula actions after adding select wrappers; `2580c07` preserves flex
933
+ sizing and single-line action text, with an E2E text-height assertion. The final rerun passed all
934
+ requested gates: 186 package tests (22 files), 30 component tests (4 files), 16 MCP tests (4 files),
935
+ both 54-page PDF inputs and 8 E2E tests (2 files). Workspace tests passed 3,808/3 skipped; the original
936
+ 47 packages remain at 3,622/3. Biome ran successfully: 0 errors, 12 warnings, 15 infos. Specs indexes,
937
+ specs lint, graph build and changeset status passed, with no major release. All 78 final PNGs were
938
+ inspected and synchronized (50 changed, 28 byte-identical); regenerated axe.json remains byte-identical
939
+ with 78 zero-violation scans. See the [per-image review](../../validation/report-engine/screenshot-review-v04-v06.md).
940
+ Existing V02 remains: the minimal host's phone PDF text is small and formal host reading/zoom needs
941
+ maintainer validation. No additional UI defects remain from this review.
942
+
943
+ Before G1 publication, maintainers must replay R1 N06 against haneinfo-equipment-loan (absent on
944
+ this machine) and migrate that App's remaining @haneinfo/reports imports. MCP export_pdf and
945
+ preview tools use template sampleData; real-data execution belongs to report-center A6. The report
946
+ records remaining visual observations for maintainer review. Do not run changeset version/publish
947
+ or approve decisions as part of E5.