@flanksource/page-runtime 0.0.0-stage → 0.0.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 (804) hide show
  1. package/.vitest/gavel-reporter-3e3dfb64eda19344.mjs +59 -0
  2. package/.vitest/vitest-report-root-1793958008919344000.json +1 -0
  3. package/.vitest/vitest-report-root-1793958052786561000.json +1 -0
  4. package/.vitest/vitest-report-root-1793958143511414000.json +1 -0
  5. package/.vitest/vitest-report-root-1793958185908019000.json +1 -0
  6. package/.vitest/vitest-report-root-1793958252687550000.json +1 -0
  7. package/.vitest/vitest-report-root-1793958260385388000.json +1 -0
  8. package/.vitest/vitest-report-root-1793958312358683000.json +1 -0
  9. package/.vitest/vitest-report-root-1793958386118791000.json +1 -0
  10. package/.vitest/vitest-report-root-1793958388712140000.json +1 -0
  11. package/.vitest/vitest-report-root-1793958429135603000.json +1 -0
  12. package/.vitest/vitest-report-root-1793958433387809000.json +1 -0
  13. package/.vitest/vitest-report-root-1793958517322792000.json +1 -0
  14. package/.vitest/vitest-report-root-1793958542332252000.json +1 -0
  15. package/.vitest/vitest-report-root-1793958617698698000.json +1 -0
  16. package/.vitest/vitest-report-root-1793958676587753000.json +1 -0
  17. package/.vitest/vitest-report-root-1793958707827469000.json +1 -0
  18. package/.vitest/vitest-report-root-1793958729745028000.json +1 -0
  19. package/.vitest/vitest-report-root-1793958736696408000.json +1 -0
  20. package/.vitest/vitest-report-root-1793958740449993000.json +1 -0
  21. package/.vitest/vitest-report-root-1793958841510921000.json +1 -0
  22. package/.vitest/vitest-report-root-1793958847664582000.json +1 -0
  23. package/.vitest/vitest-report-root-1793958900327643000.json +1 -0
  24. package/.vitest/vitest-report-root-1793958950822823000.json +1 -0
  25. package/.vitest/vitest-report-root-1793959013655262000.json +1 -0
  26. package/.vitest/vitest-report-root-1793959017905881000.json +1 -0
  27. package/.vitest/vitest-report-root-1793959093169044000.json +1 -0
  28. package/.vitest/vitest-report-root-1793959093978087000.json +1 -0
  29. package/.vitest/vitest-report-root-1793959101111925000.json +1 -0
  30. package/.vitest/vitest-report-root-1793959145317906000.json +1 -0
  31. package/.vitest/vitest-report-root-1793959190760607000.json +1 -0
  32. package/.vitest/vitest-report-root-1793959249695805000.json +1 -0
  33. package/.vitest/vitest-report-root-1793959323191511000.json +1 -0
  34. package/.vitest/vitest-report-root-1793959453311564000.json +1 -0
  35. package/.vitest/vitest-report-root-1793959495806182000.json +1 -0
  36. package/.vitest/vitest-report-root-1793959499945435000.json +1 -0
  37. package/.vitest/vitest-report-root-1793959546773807000.json +1 -0
  38. package/.vitest/vitest-report-root-1793959583335593000.json +1 -0
  39. package/.vitest/vitest-report-root-1793959621479504000.json +1 -0
  40. package/.vitest/vitest-report-root-1793959651002360000.json +1 -0
  41. package/.vitest/vitest-report-root-1793959655646061000.json +1 -0
  42. package/.vitest/vitest-report-root-1793959741176826000.json +1 -0
  43. package/.vitest/vitest-report-root-1793959744743733000.json +1 -0
  44. package/.vitest/vitest-report-root-1793959833244182000.json +1 -0
  45. package/.vitest/vitest-report-root-1793959882131751000.json +1 -0
  46. package/.vitest/vitest-report-root-1793959887033254000.json +1 -0
  47. package/.vitest/vitest-report-root-1793960000631977000.json +1 -0
  48. package/.vitest/vitest-report-root-1793960011938504000.json +1 -0
  49. package/.vitest/vitest-report-root-1793961370018852000.json +1 -0
  50. package/.vitest/vitest-report-root-1793961745370827000.json +1 -0
  51. package/.vitest/vitest-report-root-1793961764143180000.json +1 -0
  52. package/.vitest/vitest-report-root-1793961835963066000.json +1 -0
  53. package/.vitest/vitest-report-root-1793961890729922000.json +1 -0
  54. package/.vitest/vitest-report-root-1793961968680074000.json +1 -0
  55. package/.vitest/vitest-report-root-1793962066862337000.json +1 -0
  56. package/.vitest/vitest-report-root-1793962087917497000.json +1 -0
  57. package/.vitest/vitest-report-root-1793962157254386000.json +1 -0
  58. package/.vitest/vitest-report-root-1793962171214865000.json +1 -0
  59. package/.vitest/vitest-report-root-1793962183290533000.json +1 -0
  60. package/.vitest/vitest-report-root-1793962184809932000.json +1 -0
  61. package/.vitest/vitest-report-root-1793962197715204000.json +1 -0
  62. package/.vitest/vitest-report-root-1793962244650717000.json +1 -0
  63. package/.vitest/vitest-report-root-1793962259802273000.json +1 -0
  64. package/.vitest/vitest-report-root-1793962278799745000.json +1 -0
  65. package/.vitest/vitest-report-root-1793962304412974000.json +1 -0
  66. package/.vitest/vitest-report-root-1793962328411454000.json +1 -0
  67. package/.vitest/vitest-report-root-1793962355747869000.json +1 -0
  68. package/.vitest/vitest-report-root-1793962381401572000.json +1 -0
  69. package/.vitest/vitest-report-root-1793962393326735000.json +1 -0
  70. package/.vitest/vitest-report-root-1793962393329206000.json +1 -0
  71. package/.vitest/vitest-report-root-1793962437796768000.json +1 -0
  72. package/.vitest/vitest-report-root-1793962444190384000.json +1 -0
  73. package/.vitest/vitest-report-root-1793962445347541000.json +1 -0
  74. package/.vitest/vitest-report-root-1793962473691143000.json +1 -0
  75. package/.vitest/vitest-report-root-1793962474291457000.json +1 -0
  76. package/.vitest/vitest-report-root-1793962499680468000.json +1 -0
  77. package/.vitest/vitest-report-root-1793962504410483000.json +1 -0
  78. package/.vitest/vitest-report-root-1793962516850524000.json +1 -0
  79. package/.vitest/vitest-report-root-1793962536736273000.json +1 -0
  80. package/.vitest/vitest-report-root-1793962551181783000.json +1 -0
  81. package/.vitest/vitest-report-root-1793962553575620000.json +1 -0
  82. package/.vitest/vitest-report-root-1793962555169730000.json +1 -0
  83. package/.vitest/vitest-report-root-1793962572639765000.json +1 -0
  84. package/.vitest/vitest-report-root-1793962597102952000.json +1 -0
  85. package/.vitest/vitest-report-root-1793962637156669000.json +1 -0
  86. package/.vitest/vitest-report-root-1793962653530027000.json +1 -0
  87. package/.vitest/vitest-report-root-1793962665824334000.json +1 -0
  88. package/.vitest/vitest-report-root-1793962682161714000.json +1 -0
  89. package/.vitest/vitest-report-root-1793962719526168000.json +1 -0
  90. package/.vitest/vitest-report-root-1793962723853934000.json +1 -0
  91. package/.vitest/vitest-report-root-1793962741927728000.json +1 -0
  92. package/.vitest/vitest-report-root-1793962794308371000.json +1 -0
  93. package/.vitest/vitest-report-root-1793962796334481000.json +1 -0
  94. package/.vitest/vitest-report-root-1793962798075169000.json +1 -0
  95. package/.vitest/vitest-report-root-1793962836466676000.json +1 -0
  96. package/.vitest/vitest-report-root-1793962846507317000.json +1 -0
  97. package/.vitest/vitest-report-root-1793962876266701000.json +1 -0
  98. package/.vitest/vitest-report-root-1793962922031308000.json +1 -0
  99. package/.vitest/vitest-report-root-1793962932957166000.json +1 -0
  100. package/.vitest/vitest-report-root-1793962946930725000.json +1 -0
  101. package/.vitest/vitest-report-root-1793963027896350000.json +1 -0
  102. package/.vitest/vitest-report-root-1793963036618707000.json +1 -0
  103. package/.vitest/vitest-report-root-1793963067365318000.json +1 -0
  104. package/.vitest/vitest-report-root-1793963077597641000.json +1 -0
  105. package/.vitest/vitest-report-root-1793963126365651000.json +1 -0
  106. package/.vitest/vitest-report-root-1793963208744553000.json +1 -0
  107. package/.vitest/vitest-report-root-1793963232806450000.json +1 -0
  108. package/.vitest/vitest-report-root-1793963325077422000.json +1 -0
  109. package/.vitest/vitest-report-root-1793963392172877000.json +1 -0
  110. package/.vitest/vitest-report-root-1793963398218324000.json +1 -0
  111. package/.vitest/vitest-report-root-1793963410749092000.json +1 -0
  112. package/.vitest/vitest-report-root-1793963437279580000.json +1 -0
  113. package/.vitest/vitest-report-root-1793963450096193000.json +1 -0
  114. package/.vitest/vitest-report-root-1793963478908641000.json +1 -0
  115. package/.vitest/vitest-report-root-1793963507838465000.json +1 -0
  116. package/.vitest/vitest-report-root-1793963528668174000.json +1 -0
  117. package/.vitest/vitest-report-root-1793963601860390000.json +1 -0
  118. package/.vitest/vitest-report-root-1793963611633446000.json +1 -0
  119. package/.vitest/vitest-report-root-1793963624713406000.json +1 -0
  120. package/.vitest/vitest-report-root-1793963680656685000.json +1 -0
  121. package/.vitest/vitest-report-root-1793963705231851000.json +1 -0
  122. package/.vitest/vitest-report-root-1793963708929500000.json +1 -0
  123. package/.vitest/vitest-report-root-1793963710267844000.json +1 -0
  124. package/.vitest/vitest-report-root-1793963713999248000.json +1 -0
  125. package/.vitest/vitest-report-root-1793963786513455000.json +1 -0
  126. package/.vitest/vitest-report-root-1793963792518765000.json +1 -0
  127. package/.vitest/vitest-report-root-1793963804089549000.json +1 -0
  128. package/.vitest/vitest-report-root-1793963840412921000.json +1 -0
  129. package/.vitest/vitest-report-root-1793963880361176000.json +1 -0
  130. package/.vitest/vitest-report-root-1793963935121106000.json +1 -0
  131. package/.vitest/vitest-report-root-1793963937290698000.json +1 -0
  132. package/.vitest/vitest-report-root-1793963977050773000.json +1 -0
  133. package/.vitest/vitest-report-root-1793963981229158000.json +1 -0
  134. package/.vitest/vitest-report-root-1793963989422080000.json +1 -0
  135. package/.vitest/vitest-report-root-1793964025924629000.json +1 -0
  136. package/.vitest/vitest-report-root-1793964027983705000.json +1 -0
  137. package/.vitest/vitest-report-root-1793964059969386000.json +1 -0
  138. package/.vitest/vitest-report-root-1793964071524069000.json +1 -0
  139. package/.vitest/vitest-report-root-1793964076285860000.json +1 -0
  140. package/.vitest/vitest-report-root-1793964077988100000.json +1 -0
  141. package/.vitest/vitest-report-root-1793964093289042000.json +1 -0
  142. package/.vitest/vitest-report-root-1793964102899356000.json +1 -0
  143. package/.vitest/vitest-report-root-1793964128089691000.json +1 -0
  144. package/.vitest/vitest-report-root-1793964129495156000.json +1 -0
  145. package/.vitest/vitest-report-root-1793964182849665000.json +1 -0
  146. package/.vitest/vitest-report-root-1793964223959893000.json +1 -0
  147. package/.vitest/vitest-report-root-1793964253351716000.json +1 -0
  148. package/.vitest/vitest-report-root-1793964290220122000.json +1 -0
  149. package/.vitest/vitest-report-root-1793964318037006000.json +1 -0
  150. package/.vitest/vitest-report-root-1793964334676691000.json +1 -0
  151. package/.vitest/vitest-report-root-1793964378520677000.json +1 -0
  152. package/.vitest/vitest-report-root-1793964383748994000.json +1 -0
  153. package/.vitest/vitest-report-root-1793964394042303000.json +1 -0
  154. package/.vitest/vitest-report-root-1793964466521881000.json +1 -0
  155. package/.vitest/vitest-report-root-1793964470478175000.json +1 -0
  156. package/.vitest/vitest-report-root-1793964484499019000.json +1 -0
  157. package/.vitest/vitest-report-root-1793964527645213000.json +1 -0
  158. package/.vitest/vitest-report-root-1793964608875865000.json +1 -0
  159. package/.vitest/vitest-report-root-1793964623608336000.json +1 -0
  160. package/.vitest/vitest-report-root-1793964629870846000.json +1 -0
  161. package/.vitest/vitest-report-root-1793964674515564000.json +1 -0
  162. package/.vitest/vitest-report-root-1793964706923651000.json +1 -0
  163. package/.vitest/vitest-report-root-1793964712832942000.json +1 -0
  164. package/.vitest/vitest-report-root-1793964714824633000.json +1 -0
  165. package/.vitest/vitest-report-root-1793964755433952000.json +1 -0
  166. package/.vitest/vitest-report-root-1793964783157670000.json +1 -0
  167. package/.vitest/vitest-report-root-1793964818963246000.json +1 -0
  168. package/.vitest/vitest-report-root-1793964843818548000.json +1 -0
  169. package/.vitest/vitest-report-root-1793964929824204000.json +1 -0
  170. package/.vitest/vitest-report-root-1793964973060713000.json +1 -0
  171. package/.vitest/vitest-report-root-1793964983122482000.json +1 -0
  172. package/.vitest/vitest-report-root-1793965107264567000.json +1 -0
  173. package/.vitest/vitest-report-root-1793965258759177000.json +1 -0
  174. package/.vitest/vitest-report-root-1793965277212091000.json +1 -0
  175. package/.vitest/vitest-report-root-1793965420648188000.json +1 -0
  176. package/.vitest/vitest-report-root-1793965611688414000.json +1 -0
  177. package/.vitest/vitest-report-root-1793965753407694000.json +1 -0
  178. package/.vitest/vitest-report-root-1793965766104309000.json +1 -0
  179. package/.vitest/vitest-report-root-1793965766823098000.json +1 -0
  180. package/.vitest/vitest-report-root-1793965806066109000.json +1 -0
  181. package/.vitest/vitest-report-root-1793965824697182000.json +1 -0
  182. package/.vitest/vitest-report-root-1793965904374564000.json +1 -0
  183. package/.vitest/vitest-report-root-1793965920838340000.json +1 -0
  184. package/.vitest/vitest-report-root-1793965932520617000.json +1 -0
  185. package/.vitest/vitest-report-root-1793965971574656000.json +1 -0
  186. package/.vitest/vitest-report-root-1793966049815024000.json +1 -0
  187. package/.vitest/vitest-report-root-1793966057888034000.json +1 -0
  188. package/.vitest/vitest-report-root-1793966066838868000.json +1 -0
  189. package/.vitest/vitest-report-root-1793966160347764000.json +1 -0
  190. package/.vitest/vitest-report-root-1793966196305985000.json +1 -0
  191. package/.vitest/vitest-report-root-1793966221538043000.json +1 -0
  192. package/.vitest/vitest-report-root-1793966251519918000.json +1 -0
  193. package/.vitest/vitest-report-root-1793966447000588000.json +1 -0
  194. package/.vitest/vitest-report-root-1793966463178249000.json +1 -0
  195. package/.vitest/vitest-report-root-1793966486995648000.json +1 -0
  196. package/.vitest/vitest-report-root-1793966726756953000.json +1 -0
  197. package/.vitest/vitest-report-root-1793966763656807000.json +1 -0
  198. package/.vitest/vitest-report-root-1793966979409799000.json +1 -0
  199. package/.vitest/vitest-report-root-1793967385250149000.json +1 -0
  200. package/.vitest/vitest-report-root-1793967617080163000.json +1 -0
  201. package/.vitest/vitest-report-root-1793967649428508000.json +1 -0
  202. package/.vitest/vitest-report-root-1793967773689520000.json +1 -0
  203. package/.vitest/vitest-report-root-1793968743743508000.json +1 -0
  204. package/.vitest/vitest-report-root-1793968846470407000.json +1 -0
  205. package/.vitest/vitest-report-root-1793968880878391000.json +1 -0
  206. package/.vitest/vitest-report-root-1793969027713529000.json +1 -0
  207. package/.vitest/vitest-report-root-1793969041841266000.json +1 -0
  208. package/.vitest/vitest-report-root-1793969142007468000.json +1 -0
  209. package/.vitest/vitest-report-root-1793969164867379000.json +1 -0
  210. package/.vitest/vitest-report-root-1793969193145858000.json +1 -0
  211. package/.vitest/vitest-report-root-1793969246818533000.json +1 -0
  212. package/.vitest/vitest-report-root-1793969270845486000.json +1 -0
  213. package/.vitest/vitest-report-root-1793969272514219000.json +1 -0
  214. package/.vitest/vitest-report-root-1793969302476105000.json +1 -0
  215. package/.vitest/vitest-report-root-1793969401697799000.json +1 -0
  216. package/.vitest/vitest-report-root-1793969433222630000.json +1 -0
  217. package/.vitest/vitest-report-root-1793969453350714000.json +1 -0
  218. package/.vitest/vitest-report-root-1793969567187400000.json +1 -0
  219. package/.vitest/vitest-report-root-1793969602230024000.json +1 -0
  220. package/.vitest/vitest-report-root-1793969633261063000.json +1 -0
  221. package/.vitest/vitest-report-root-1793969673876404000.json +1 -0
  222. package/.vitest/vitest-report-root-1793969702287010000.json +1 -0
  223. package/.vitest/vitest-report-root-1793969745828386000.json +1 -0
  224. package/.vitest/vitest-report-root-1793969893687205000.json +1 -0
  225. package/.vitest/vitest-report-root-1793969949642120000.json +1 -0
  226. package/.vitest/vitest-report-root-1793969981399076000.json +1 -0
  227. package/.vitest/vitest-report-root-1793970027152713000.json +1 -0
  228. package/.vitest/vitest-report-root-1793970030585158000.json +1 -0
  229. package/.vitest/vitest-report-root-1793970160195767000.json +1 -0
  230. package/.vitest/vitest-report-root-1793970215752422000.json +1 -0
  231. package/.vitest/vitest-report-root-1793970217114968000.json +1 -0
  232. package/.vitest/vitest-report-root-1793970329879319000.json +1 -0
  233. package/.vitest/vitest-report-root-1793970590586994000.json +1 -0
  234. package/.vitest/vitest-report-root-1793970625359990000.json +1 -0
  235. package/.vitest/vitest-report-root-1793970672590269000.json +1 -0
  236. package/.vitest/vitest-report-root-1793970796789022000.json +1 -0
  237. package/.vitest/vitest-report-root-1793970825710990000.json +1 -0
  238. package/.vitest/vitest-report-root-1793970884000509000.json +1 -0
  239. package/.vitest/vitest-report-root-1793970900444617000.json +1 -0
  240. package/.vitest/vitest-report-root-1793972186024681000.json +1 -0
  241. package/.vitest/vitest-report-root-1793972227757396000.json +1 -0
  242. package/.vitest/vitest-report-root-1793972736341600000.json +1 -0
  243. package/.vitest/vitest-report-root-1793972769249562000.json +1 -0
  244. package/.vitest/vitest-report-root-1793972859435283000.json +1 -0
  245. package/.vitest/vitest-report-root-1793972915169294000.json +1 -0
  246. package/.vitest/vitest-report-root-1793973081515450000.json +1 -0
  247. package/.vitest/vitest-report-root-1793973111336773000.json +1 -0
  248. package/.vitest/vitest-report-root-1793973253986969000.json +1 -0
  249. package/.vitest/vitest-report-root-1793973561283775000.json +1 -0
  250. package/.vitest/vitest-report-root-1793973593320977000.json +1 -0
  251. package/.vitest/vitest-report-root-1793973648302867000.json +1 -0
  252. package/.vitest/vitest-report-root-1793973819657242000.json +1 -0
  253. package/.vitest/vitest-report-root-1793973952727311000.json +1 -0
  254. package/.vitest/vitest-report-root-1793974334455876000.json +1 -0
  255. package/.vitest/vitest-report-root-1793974437074196000.json +1 -0
  256. package/.vitest/vitest-report-root-1793974437553146000.json +1 -0
  257. package/.vitest/vitest-report-root-1793974461818626000.json +1 -0
  258. package/.vitest/vitest-report-root-1793974515255198000.json +1 -0
  259. package/.vitest/vitest-report-root-1793974516267191000.json +1 -0
  260. package/.vitest/vitest-report-root-1793974621202824000.json +1 -0
  261. package/.vitest/vitest-report-root-1793974718450330000.json +1 -0
  262. package/.vitest/vitest-report-root-1793974834942373000.json +1 -0
  263. package/.vitest/vitest-report-root-1793974921367314000.json +1 -0
  264. package/.vitest/vitest-report-root-1793975019367156000.json +1 -0
  265. package/.vitest/vitest-report-root-1793975048166096000.json +1 -0
  266. package/.vitest/vitest-report-root-1793975133024339000.json +1 -0
  267. package/.vitest/vitest-report-root-1793975159711704000.json +1 -0
  268. package/.vitest/vitest-report-root-1793975517481736000.json +1 -0
  269. package/.vitest/vitest-report-root-1793975680008825000.json +1 -0
  270. package/.vitest/vitest-report-root-1793976067648494000.json +1 -0
  271. package/.vitest/vitest-report-root-1793976314122479000.json +1 -0
  272. package/.vitest/vitest-report-root-1793976513022402000.json +1 -0
  273. package/.vitest/vitest-report-root-1793976540410805000.json +1 -0
  274. package/.vitest/vitest-report-root-1793976555103273000.json +1 -0
  275. package/.vitest/vitest-report-root-1793976702974407000.json +1 -0
  276. package/.vitest/vitest-report-root-1793976721093108000.json +1 -0
  277. package/.vitest/vitest-report-root-1793976955473681000.json +1 -0
  278. package/.vitest/vitest-report-root-1793977049628483000.json +1 -0
  279. package/.vitest/vitest-report-root-1793977098467804000.json +1 -0
  280. package/.vitest/vitest-report-root-1793977132144900000.json +1 -0
  281. package/.vitest/vitest-report-root-1793977279648191000.json +1 -0
  282. package/.vitest/vitest-report-root-1793977365312127000.json +1 -0
  283. package/.vitest/vitest-report-root-1793978227796817000.json +1 -0
  284. package/.vitest/vitest-report-root-1793978255189735000.json +1 -0
  285. package/.vitest/vitest-report-root-1793978306509070000.json +1 -0
  286. package/.vitest/vitest-report-root-1793978418301216000.json +1 -0
  287. package/.vitest/vitest-report-root-1793978445072573000.json +1 -0
  288. package/.vitest/vitest-report-root-1793978546605517000.json +1 -0
  289. package/.vitest/vitest-report-root-1793978576060950000.json +1 -0
  290. package/.vitest/vitest-report-root-1793978590261408000.json +1 -0
  291. package/.vitest/vitest-report-root-1793978674733179000.json +1 -0
  292. package/.vitest/vitest-report-root-1793978718588785000.json +1 -0
  293. package/.vitest/vitest-report-root-1793978725363453000.json +1 -0
  294. package/.vitest/vitest-report-root-1793978729967285000.json +1 -0
  295. package/.vitest/vitest-report-root-1793978755641607000.json +1 -0
  296. package/.vitest/vitest-report-root-1793978782769802000.json +1 -0
  297. package/.vitest/vitest-report-root-1793978784870947000.json +1 -0
  298. package/.vitest/vitest-report-root-1793978806927335000.json +1 -0
  299. package/.vitest/vitest-report-root-1793978822508324000.json +1 -0
  300. package/.vitest/vitest-report-root-1793978836339794000.json +1 -0
  301. package/.vitest/vitest-report-root-1793978837947352000.json +1 -0
  302. package/.vitest/vitest-report-root-1793978891548295000.json +1 -0
  303. package/.vitest/vitest-report-root-1793978946172947000.json +1 -0
  304. package/.vitest/vitest-report-root-1793978947109807000.json +1 -0
  305. package/.vitest/vitest-report-root-1793979034208662000.json +1 -0
  306. package/.vitest/vitest-report-root-1793979070583608000.json +1 -0
  307. package/.vitest/vitest-report-root-1793979081187144000.json +1 -0
  308. package/.vitest/vitest-report-root-1793979085428673000.json +1 -0
  309. package/.vitest/vitest-report-root-1793979155097858000.json +1 -0
  310. package/.vitest/vitest-report-root-1793979233508873000.json +1 -0
  311. package/.vitest/vitest-report-root-1793979268653273000.json +1 -0
  312. package/.vitest/vitest-report-root-1793979341978843000.json +1 -0
  313. package/.vitest/vitest-report-root-1793979345344877000.json +1 -0
  314. package/.vitest/vitest-report-root-1793979389390374000.json +1 -0
  315. package/.vitest/vitest-report-root-1793979400063493000.json +1 -0
  316. package/.vitest/vitest-report-root-1793979432448725000.json +1 -0
  317. package/.vitest/vitest-report-root-1793979459139430000.json +1 -0
  318. package/.vitest/vitest-report-root-1793979480341961000.json +1 -0
  319. package/.vitest/vitest-report-root-1793979510130869000.json +1 -0
  320. package/.vitest/vitest-report-root-1793979524763924000.json +1 -0
  321. package/.vitest/vitest-report-root-1793979571563010000.json +1 -0
  322. package/.vitest/vitest-report-root-1793979627916920000.json +1 -0
  323. package/.vitest/vitest-report-root-1793979726395379000.json +1 -0
  324. package/.vitest/vitest-report-root-1793979752029533000.json +1 -0
  325. package/.vitest/vitest-report-root-1793979753365744000.json +1 -0
  326. package/.vitest/vitest-report-root-1793979759386206000.json +1 -0
  327. package/.vitest/vitest-report-root-1793979787819109000.json +1 -0
  328. package/.vitest/vitest-report-root-1793979827615051000.json +1 -0
  329. package/.vitest/vitest-report-root-1793979927737393000.json +1 -0
  330. package/.vitest/vitest-report-root-1793979929836169000.json +1 -0
  331. package/.vitest/vitest-report-root-1793979955780781000.json +1 -0
  332. package/.vitest/vitest-report-root-1793980200569636000.json +1 -0
  333. package/.vitest/vitest-report-root-1793980206045213000.json +1 -0
  334. package/.vitest/vitest-report-root-1793980285772027000.json +1 -0
  335. package/.vitest/vitest-report-root-1793980459229828000.json +1 -0
  336. package/.vitest/vitest-report-root-1793980460545874000.json +1 -0
  337. package/.vitest/vitest-report-root-1793980554484341000.json +1 -0
  338. package/.vitest/vitest-report-root-1793980674494388000.json +1 -0
  339. package/.vitest/vitest-report-root-1793980683752195000.json +1 -0
  340. package/.vitest/vitest-report-root-1793980947108651000.json +1 -0
  341. package/.vitest/vitest-report-root-1793981129616629000.json +1 -0
  342. package/.vitest/vitest-report-root-1793981196611441000.json +1 -0
  343. package/.vitest/vitest-report-root-1793981226583545000.json +1 -0
  344. package/.vitest/vitest-report-root-1793981294259721000.json +1 -0
  345. package/.vitest/vitest-report-root-1793981353393048000.json +1 -0
  346. package/.vitest/vitest-report-root-1793981424585368000.json +1 -0
  347. package/.vitest/vitest-report-root-1793981513266687000.json +1 -0
  348. package/.vitest/vitest-report-root-1793981526418218000.json +1 -0
  349. package/.vitest/vitest-report-root-1793981540069877000.json +1 -0
  350. package/.vitest/vitest-report-root-1793981761193625000.json +1 -0
  351. package/.vitest/vitest-report-root-1793981868520992000.json +1 -0
  352. package/.vitest/vitest-report-root-1793982048467772000.json +1 -0
  353. package/.vitest/vitest-report-root-1793982119518020000.json +1 -0
  354. package/.vitest/vitest-report-root-1793982243473651000.json +1 -0
  355. package/.vitest/vitest-report-root-1793982406880629000.json +1 -0
  356. package/.vitest/vitest-report-root-1793982433563632000.json +1 -0
  357. package/.vitest/vitest-report-root-1793982496753204000.json +1 -0
  358. package/.vitest/vitest-report-root-1793982500153311000.json +1 -0
  359. package/.vitest/vitest-report-root-1793982542086095000.json +1 -0
  360. package/.vitest/vitest-report-root-1793982659482988000.json +1 -0
  361. package/.vitest/vitest-report-root-1793983799132716000.json +1 -0
  362. package/.vitest/vitest-report-root-1793983822721833000.json +1 -0
  363. package/.vitest/vitest-report-root-1793984998618484000.json +1 -0
  364. package/.vitest/vitest-report-root-1793985050475750000.json +1 -0
  365. package/.vitest/vitest-report-root-1793985095516077000.json +1 -0
  366. package/.vitest/vitest-report-root-1793985130729074000.json +1 -0
  367. package/.vitest/vitest-report-root-1793985177150997000.json +1 -0
  368. package/.vitest/vitest-report-root-1793985267658626000.json +1 -0
  369. package/.vitest/vitest-report-root-1793985412705211000.json +1 -0
  370. package/.vitest/vitest-report-root-1793985433752853000.json +1 -0
  371. package/.vitest/vitest-report-root-1794087938302852000.json +1 -0
  372. package/.vitest/vitest-report-root-1794087978339022000.json +1 -0
  373. package/.vitest/vitest-report-root-1794088095283811000.json +1 -0
  374. package/.vitest/vitest-report-root-1794088129997065000.json +1 -0
  375. package/.vitest/vitest-report-root-1794088147336556000.json +1 -0
  376. package/.vitest/vitest-report-root-1794088173414593000.json +1 -0
  377. package/.vitest/vitest-report-root-1794088221289657000.json +1 -0
  378. package/.vitest/vitest-report-root-1794088250766611000.json +1 -0
  379. package/.vitest/vitest-report-root-1794088365553234000.json +1 -0
  380. package/.vitest/vitest-report-root-1794088395202655000.json +1 -0
  381. package/.vitest/vitest-report-root-1794090028732187000.json +1 -0
  382. package/.vitest/vitest-report-root-1794090054787283000.json +1 -0
  383. package/.vitest/vitest-report-root-1794090153955794000.json +1 -0
  384. package/.vitest/vitest-report-root-1794090161850160000.json +1 -0
  385. package/.vitest/vitest-report-root-1794091755693314000.json +1 -0
  386. package/.vitest/vitest-report-root-1794091765029349000.json +1 -0
  387. package/.vitest/vitest-report-root-1794091975649927000.json +1 -0
  388. package/.vitest/vitest-report-root-1794091994027950000.json +1 -0
  389. package/.vitest/vitest-report-root-1794092005178771000.json +1 -0
  390. package/.vitest/vitest-report-root-1794113295302382000.json +1 -0
  391. package/.vitest/vitest-report-root-1794114156337032000.json +1 -0
  392. package/.vitest/vitest-report-root-1794114198454137000.json +1 -0
  393. package/.vitest/vitest-report-root-1794114254064413000.json +1 -0
  394. package/.vitest/vitest-report-root-1794114280107510000.json +1 -0
  395. package/.vitest/vitest-report-root-1794114495199837000.json +1 -0
  396. package/.vitest/vitest-report-root-1794114646604233000.json +1 -0
  397. package/.vitest/vitest-report-root-1794114666311689000.json +1 -0
  398. package/.vitest/vitest-report-root-1794114974303438000.json +1 -0
  399. package/.vitest/vitest-report-root-1794115037361450000.json +1 -0
  400. package/.vitest/vitest-report-root-1794115097838937000.json +1 -0
  401. package/.vitest/vitest-report-root-1794115604669388000.json +1 -0
  402. package/.vitest/vitest-report-root-1794115633814500000.json +1 -0
  403. package/.vitest/vitest-report-root-1794115648756242000.json +1 -0
  404. package/.vitest/vitest-report-root-1794115873440741000.json +1 -0
  405. package/.vitest/vitest-report-root-1794115952930230000.json +1 -0
  406. package/.vitest/vitest-report-root-1794115963344701000.json +1 -0
  407. package/.vitest/vitest-report-root-1794116196067450000.json +1 -0
  408. package/.vitest/vitest-report-root-1794116254301280000.json +1 -0
  409. package/.vitest/vitest-report-root-1794116259342966000.json +1 -0
  410. package/.vitest/vitest-report-root-1794118178787879000.json +1 -0
  411. package/.vitest/vitest-report-root-1794137087891409000.json +1 -0
  412. package/.vitest/vitest-report-root-1794137100301214000.json +1 -0
  413. package/.vitest/vitest-report-root-1794137107377813000.json +1 -0
  414. package/.vitest/vitest-report-root-1794137171230704000.json +1 -0
  415. package/.vitest/vitest-report-root-1794137317761465000.json +1 -0
  416. package/.vitest/vitest-report-root-1794137320282368000.json +1 -0
  417. package/LICENSE +17 -0
  418. package/PACKAGE_PUBLICATIONS.md +26 -0
  419. package/builder-package.json +19 -0
  420. package/package.json +77 -3
  421. package/scripts/build-builder.ts +27 -0
  422. package/scripts/build-library-runtime.ts +9 -0
  423. package/scripts/build-static.ts +75 -0
  424. package/scripts/build.ts +6 -0
  425. package/scripts/check-fragment.ts +12 -0
  426. package/scripts/local-workspaces.test.ts +31 -0
  427. package/scripts/local-workspaces.ts +55 -0
  428. package/scripts/release-version-cli.test.ts +40 -0
  429. package/scripts/release-version.test.ts +29 -0
  430. package/scripts/release-version.ts +46 -0
  431. package/scripts/run-package-build.ts +8 -0
  432. package/scripts/serve-packages.ts +8 -0
  433. package/spikes/README.md +70 -0
  434. package/spikes/barrel-rewriting/README.md +97 -0
  435. package/spikes/barrel-rewriting/measure.ts +134 -0
  436. package/spikes/barrel-rewriting/readme.ts +174 -0
  437. package/spikes/barrel-rewriting/results.json +3440 -0
  438. package/spikes/barrel-rewriting/run.ts +330 -0
  439. package/spikes/barrel-rewriting/setup.ts +90 -0
  440. package/spikes/barrel-rewriting/sw.ts +148 -0
  441. package/spikes/barrel-rewriting/tenant.ts +91 -0
  442. package/spikes/barrel-rewriting/worker-config.ts +33 -0
  443. package/spikes/closure-fragments/README.md +157 -0
  444. package/spikes/closure-fragments/results.json +959 -0
  445. package/spikes/closure-fragments/run.ts +298 -0
  446. package/spikes/compiler/README.md +177 -0
  447. package/spikes/compiler/compile.test.ts +78 -0
  448. package/spikes/compiler/compile.ts +82 -0
  449. package/spikes/compiler/facet-redact.d.ts +5 -0
  450. package/spikes/compiler/markers.ts +88 -0
  451. package/spikes/compiler/pages.ts +43 -0
  452. package/spikes/compiler/readme.ts +116 -0
  453. package/spikes/compiler/reference.ts +81 -0
  454. package/spikes/compiler/render.ts +113 -0
  455. package/spikes/compiler/results.json +3310 -0
  456. package/spikes/compiler/run.ts +250 -0
  457. package/spikes/compiler/sucrase-parser.d.ts +8 -0
  458. package/spikes/compiler/sw.ts +62 -0
  459. package/spikes/diagram-readiness/README.md +134 -0
  460. package/spikes/diagram-readiness/analysis.test.ts +52 -0
  461. package/spikes/diagram-readiness/analysis.ts +35 -0
  462. package/spikes/diagram-readiness/browser.ts +209 -0
  463. package/spikes/diagram-readiness/readme.ts +65 -0
  464. package/spikes/diagram-readiness/results.json +30289 -0
  465. package/spikes/diagram-readiness/run.ts +103 -0
  466. package/spikes/diagram-readiness/server.ts +53 -0
  467. package/spikes/esm-sh/README.md +27 -0
  468. package/spikes/esm-sh/browser-client.ts +18 -0
  469. package/spikes/esm-sh/browser-server.ts +104 -0
  470. package/spikes/esm-sh/fixtures/copy-to-clipboard-entry.headers +15 -0
  471. package/spikes/esm-sh/fixtures/copy-to-clipboard-entry.mjs.txt +3 -0
  472. package/spikes/esm-sh/fixtures/copy-to-clipboard-module.headers +13 -0
  473. package/spikes/esm-sh/fixtures/copy-to-clipboard-module.mjs.txt +142 -0
  474. package/spikes/esm-sh/fixtures/react-copy-to-clipboard-entry.headers +15 -0
  475. package/spikes/esm-sh/fixtures/react-copy-to-clipboard-entry.mjs.txt +3 -0
  476. package/spikes/esm-sh/fixtures/react-copy-to-clipboard-module.headers +11 -0
  477. package/spikes/esm-sh/fixtures/react-copy-to-clipboard-module.mjs.txt +222 -0
  478. package/spikes/esm-sh/fixtures/toggle-selection-entry.headers +14 -0
  479. package/spikes/esm-sh/fixtures/toggle-selection-entry.mjs.txt +3 -0
  480. package/spikes/esm-sh/fixtures/toggle-selection-module.headers +11 -0
  481. package/spikes/esm-sh/fixtures/toggle-selection-module.mjs.txt +76 -0
  482. package/spikes/esm-sh/fixtures.ts +54 -0
  483. package/spikes/esm-sh/redact.ts +1 -0
  484. package/spikes/frame-commenting/README.md +183 -0
  485. package/spikes/frame-commenting/agent.ts +110 -0
  486. package/spikes/frame-commenting/hook.ts +1 -0
  487. package/spikes/frame-commenting/host.ts +66 -0
  488. package/spikes/frame-commenting/measure.ts +180 -0
  489. package/spikes/frame-commenting/model.test.ts +27 -0
  490. package/spikes/frame-commenting/model.ts +40 -0
  491. package/spikes/frame-commenting/readme.ts +61 -0
  492. package/spikes/frame-commenting/results.json +5320 -0
  493. package/spikes/frame-commenting/run.ts +73 -0
  494. package/spikes/frame-commenting/setup.ts +125 -0
  495. package/spikes/lib/barrels.test.ts +107 -0
  496. package/spikes/lib/barrels.ts +309 -0
  497. package/spikes/lib/cjs-export-names.mjs +22 -0
  498. package/spikes/lib/content-types.ts +28 -0
  499. package/spikes/lib/convert-commonjs.ts +168 -0
  500. package/spikes/lib/fragment.ts +108 -0
  501. package/spikes/lib/library-set.ts +194 -0
  502. package/spikes/lib/module-transform.test.ts +133 -0
  503. package/spikes/lib/module-transform.ts +351 -0
  504. package/spikes/lib/origin.ts +140 -0
  505. package/spikes/lib/pages.ts +290 -0
  506. package/spikes/lib/report.ts +23 -0
  507. package/spikes/lib/runtime-server.ts +282 -0
  508. package/spikes/lib/static-server.ts +82 -0
  509. package/spikes/lib/trace.ts +384 -0
  510. package/spikes/local-folder-link/README.md +85 -0
  511. package/spikes/local-folder-link/checkout.ts +132 -0
  512. package/spikes/local-folder-link/documents.ts +36 -0
  513. package/spikes/local-folder-link/readme.ts +42 -0
  514. package/spikes/local-folder-link/results.json +12815 -0
  515. package/spikes/local-folder-link/rewrite.test.ts +27 -0
  516. package/spikes/local-folder-link/rewrite.ts +38 -0
  517. package/spikes/local-folder-link/run.ts +123 -0
  518. package/spikes/local-folder-link/server.ts +100 -0
  519. package/spikes/local-folder-link/sw.ts +97 -0
  520. package/spikes/origin-isolation/README.md +426 -0
  521. package/spikes/origin-isolation/browsers.ts +43 -0
  522. package/spikes/origin-isolation/helper.ts +6 -0
  523. package/spikes/origin-isolation/host.ts +25 -0
  524. package/spikes/origin-isolation/measure.ts +118 -0
  525. package/spikes/origin-isolation/model.test.ts +45 -0
  526. package/spikes/origin-isolation/model.ts +49 -0
  527. package/spikes/origin-isolation/proxy.ts +35 -0
  528. package/spikes/origin-isolation/readme.ts +83 -0
  529. package/spikes/origin-isolation/results.json +3242 -0
  530. package/spikes/origin-isolation/run.ts +35 -0
  531. package/spikes/origin-isolation/server.ts +108 -0
  532. package/spikes/origin-isolation/sw.ts +28 -0
  533. package/spikes/origin-isolation/tenant.ts +165 -0
  534. package/spikes/react-runtime-set/README.md +48 -0
  535. package/spikes/react-runtime-set/convert.ts +118 -0
  536. package/spikes/react-runtime-set/export-names.mjs +8 -0
  537. package/spikes/react-runtime-set/page/page.js +46 -0
  538. package/spikes/react-runtime-set/results.json +84 -0
  539. package/spikes/react-runtime-set/run.ts +255 -0
  540. package/spikes/run.ts +15 -0
  541. package/spikes/sw-tenant-frame/README.md +95 -0
  542. package/spikes/sw-tenant-frame/results.json +1348 -0
  543. package/spikes/sw-tenant-frame/run.ts +373 -0
  544. package/spikes/sw-tenant-frame/site/frame.html +113 -0
  545. package/spikes/sw-tenant-frame/site/host.html +25 -0
  546. package/spikes/sw-tenant-frame/site/sw.js +10 -0
  547. package/spikes/tailwind-parity/README.md +78 -0
  548. package/spikes/tailwind-parity/compare.test.ts +70 -0
  549. package/spikes/tailwind-parity/compare.ts +91 -0
  550. package/spikes/tailwind-parity/facet-font-scale.d.ts +6 -0
  551. package/spikes/tailwind-parity/facet-styles.ts +77 -0
  552. package/spikes/tailwind-parity/results.json +885 -0
  553. package/spikes/tailwind-parity/run.ts +385 -0
  554. package/spikes/tailwind-parity/runtime-tailwind.ts +82 -0
  555. package/src/activity-schema.ts +91 -0
  556. package/src/activity.test.ts +57 -0
  557. package/src/build/README.md +94 -0
  558. package/src/build/barrels.test.ts +107 -0
  559. package/src/build/barrels.ts +306 -0
  560. package/src/build/base.ts +2 -0
  561. package/src/build/check-fragment.ts +45 -0
  562. package/src/build/cjs-export-names.mjs +24 -0
  563. package/src/build/commonjs-exports.ts +24 -0
  564. package/src/build/convert-commonjs.ts +183 -0
  565. package/src/build/dependencies.ts +4 -0
  566. package/src/build/dependency-barrels.ts +59 -0
  567. package/src/build/dependency-cache.ts +40 -0
  568. package/src/build/dependency-plugin.ts +58 -0
  569. package/src/build/dependency-runtime.test.ts +121 -0
  570. package/src/build/dependency-runtime.ts +147 -0
  571. package/src/build/errors.ts +9 -0
  572. package/src/build/fragment.ts +89 -0
  573. package/src/build/index.ts +7 -0
  574. package/src/build/library-runtime.test.ts +343 -0
  575. package/src/build/library-runtime.ts +98 -0
  576. package/src/build/module-utils.ts +11 -0
  577. package/src/build/recipe-dependencies.ts +14 -0
  578. package/src/build/runtime-entries.ts +10 -0
  579. package/src/build/trace.ts +429 -0
  580. package/src/design-schema.ts +25 -0
  581. package/src/dev/README.md +48 -0
  582. package/src/dev/catalog.ts +79 -0
  583. package/src/dev/cli.test.ts +12 -0
  584. package/src/dev/cli.ts +25 -0
  585. package/src/dev/index.ts +115 -0
  586. package/src/dev/packages.test.ts +175 -0
  587. package/src/editing.test.tsx +31 -0
  588. package/src/editing.ts +25 -0
  589. package/src/frame/activity.browser.ts +34 -0
  590. package/src/frame/activity.test.ts +27 -0
  591. package/src/frame/activity.ts +50 -0
  592. package/src/frame/agent/README.md +47 -0
  593. package/src/frame/agent/agent.browser.ts +127 -0
  594. package/src/frame/agent/design.ts +62 -0
  595. package/src/frame/agent/index.ts +148 -0
  596. package/src/frame/agent/overlay.test.ts +42 -0
  597. package/src/frame/agent/overlay.ts +91 -0
  598. package/src/frame/agent/owner.test.ts +78 -0
  599. package/src/frame/agent/owner.ts +58 -0
  600. package/src/frame/agent/provider.tsx +14 -0
  601. package/src/frame/agent/react-override.ts +55 -0
  602. package/src/frame/agent/review.browser.ts +65 -0
  603. package/src/frame/agent/review.ts +107 -0
  604. package/src/frame/agent/testing/callsite.tsx +5 -0
  605. package/src/frame/agent/testing/client.ts +99 -0
  606. package/src/frame/agent/testing/library.ts +3 -0
  607. package/src/frame/agent/testing/modal.tsx +5 -0
  608. package/src/frame/agent/testing/review-client.ts +43 -0
  609. package/src/frame/agent/testing/review-server.ts +31 -0
  610. package/src/frame/agent/testing/server.ts +72 -0
  611. package/src/frame/agent/testing/vocabulary-host.ts +20 -0
  612. package/src/frame/agent/testing/vocabulary.tsx +10 -0
  613. package/src/frame/agent/vitest.browser.config.ts +6 -0
  614. package/src/frame/agent/vocabulary.browser.ts +30 -0
  615. package/src/frame/agent/vocabulary.test.ts +36 -0
  616. package/src/frame/agent/vocabulary.ts +13 -0
  617. package/src/frame/agent.ts +2 -0
  618. package/src/frame/boot-bundle.test.ts +20 -0
  619. package/src/frame/boot-styles.test.ts +102 -0
  620. package/src/frame/boot-styles.ts +50 -0
  621. package/src/frame/boot.test.ts +108 -0
  622. package/src/frame/boot.ts +205 -0
  623. package/src/frame/bridge.ts +27 -0
  624. package/src/frame/devtools-hook.ts +1 -0
  625. package/src/frame/entry.ts +4 -0
  626. package/src/frame/export-compiler.test.ts +23 -0
  627. package/src/frame/export-compiler.ts +18 -0
  628. package/src/frame/export-page.ts +59 -0
  629. package/src/frame/export.test.ts +17 -0
  630. package/src/frame/export.ts +90 -0
  631. package/src/frame/index.ts +7 -0
  632. package/src/frame/local-runtime.browser.ts +36 -0
  633. package/src/frame/page-agent.ts +2 -0
  634. package/src/frame/readiness.ts +51 -0
  635. package/src/frame/review-integration.browser.ts +48 -0
  636. package/src/frame/runtime.browser.ts +71 -0
  637. package/src/frame/tailwind/README.md +49 -0
  638. package/src/frame/tailwind/boot-styles.browser.ts +18 -0
  639. package/src/frame/tailwind/cache.test.ts +53 -0
  640. package/src/frame/tailwind/cache.ts +20 -0
  641. package/src/frame/tailwind/load.test.ts +74 -0
  642. package/src/frame/tailwind/load.ts +66 -0
  643. package/src/frame/tailwind/recipe.ts +81 -0
  644. package/src/frame/tailwind/runtime-cache.test.ts +97 -0
  645. package/src/frame/tailwind/runtime.ts +113 -0
  646. package/src/frame/tailwind/store.test.ts +104 -0
  647. package/src/frame/tailwind/store.ts +55 -0
  648. package/src/frame/tailwind/stylesheets.ts +37 -0
  649. package/src/frame/tailwind/tailwind.browser.ts +71 -0
  650. package/src/frame/tailwind/tailwind.test.ts +119 -0
  651. package/src/frame/tailwind/testing/client.ts +132 -0
  652. package/src/frame/tailwind/testing/compare.ts +91 -0
  653. package/src/frame/tailwind/testing/pages.ts +14 -0
  654. package/src/frame/tailwind/testing/server.ts +89 -0
  655. package/src/frame/tailwind/vitest.browser.config.ts +7 -0
  656. package/src/frame/testing/boot-page.ts +3 -0
  657. package/src/frame/testing/host.ts +60 -0
  658. package/src/frame/testing/local-host.tsx +33 -0
  659. package/src/frame/testing/server.ts +120 -0
  660. package/src/host/BuildLog.test.tsx +40 -0
  661. package/src/host/BuildLog.tsx +27 -0
  662. package/src/host/PageFrame.test.tsx +39 -0
  663. package/src/host/PageFrame.tsx +41 -0
  664. package/src/host/RuntimeActivity.tsx +75 -0
  665. package/src/host/activity-state.test.ts +37 -0
  666. package/src/host/activity-state.ts +69 -0
  667. package/src/host/agent-source.test.ts +9 -0
  668. package/src/host/agent-source.ts +14 -0
  669. package/src/host/agent-validation.test.ts +40 -0
  670. package/src/host/agent-validation.ts +73 -0
  671. package/src/host/bridge-request.test.ts +87 -0
  672. package/src/host/bridge.test.ts +34 -0
  673. package/src/host/bridge.ts +55 -0
  674. package/src/host/build-log.test.ts +47 -0
  675. package/src/host/build-log.ts +29 -0
  676. package/src/host/clear-cache.test.ts +75 -0
  677. package/src/host/clear-cache.ts +66 -0
  678. package/src/host/design-validation.test.ts +38 -0
  679. package/src/host/design-validation.ts +96 -0
  680. package/src/host/index.ts +11 -0
  681. package/src/host/link/index.ts +66 -0
  682. package/src/host/link/transport.test.ts +10 -0
  683. package/src/host/link/transport.ts +67 -0
  684. package/src/host/link/watch.ts +62 -0
  685. package/src/host/message-values.ts +55 -0
  686. package/src/host/origin.test.ts +10 -0
  687. package/src/host/origin.ts +7 -0
  688. package/src/host/review/README.md +32 -0
  689. package/src/host/review/index.ts +42 -0
  690. package/src/host/review/remote.test.ts +21 -0
  691. package/src/host/review/source.test.ts +19 -0
  692. package/src/host/review/validation.test.ts +34 -0
  693. package/src/host/review/validation.ts +55 -0
  694. package/src/host/runtime-integration.test.ts +29 -0
  695. package/src/host/source-path.test.ts +14 -0
  696. package/src/host/validation.ts +111 -0
  697. package/src/host/vocabulary-validation.test.ts +60 -0
  698. package/src/link/README.md +115 -0
  699. package/src/link/barrels.ts +5 -0
  700. package/src/link/build-cli.ts +12 -0
  701. package/src/link/build.test.ts +25 -0
  702. package/src/link/build.ts +99 -0
  703. package/src/link/commonjs.test.ts +34 -0
  704. package/src/link/commonjs.ts +39 -0
  705. package/src/link/examples/server.ts +18 -0
  706. package/src/link/index.ts +6 -0
  707. package/src/link/link.browser.ts +66 -0
  708. package/src/link/local-relay.browser.ts +22 -0
  709. package/src/link/overrides.test.ts +103 -0
  710. package/src/link/overrides.ts +69 -0
  711. package/src/link/page-sources.test.ts +52 -0
  712. package/src/link/page-sources.ts +69 -0
  713. package/src/link/source.ts +25 -0
  714. package/src/link/storage.ts +32 -0
  715. package/src/link/testing/client.ts +96 -0
  716. package/src/link/testing/folder.ts +19 -0
  717. package/src/link/testing/local-client.ts +30 -0
  718. package/src/link/testing/local-server.ts +26 -0
  719. package/src/link/testing/local-worker.ts +17 -0
  720. package/src/link/testing/server.ts +128 -0
  721. package/src/link/testing/worker.ts +32 -0
  722. package/src/link/testing-cache.ts +20 -0
  723. package/src/link/testing-fixtures.ts +16 -0
  724. package/src/link/types.ts +27 -0
  725. package/src/link/validation.ts +44 -0
  726. package/src/link/vitest.browser.config.ts +3 -0
  727. package/src/markers.ts +18 -0
  728. package/src/publication/build.ts +27 -0
  729. package/src/publication/fixtures/build.mjs +2 -0
  730. package/src/publication/index.ts +3 -0
  731. package/src/publication/lock.ts +32 -0
  732. package/src/publication/manifest.ts +14 -0
  733. package/src/publication/publication.test.ts +89 -0
  734. package/src/publication/publish.ts +80 -0
  735. package/src/publication/runtime.ts +28 -0
  736. package/src/publication/schema.ts +13 -0
  737. package/src/review-schema.ts +17 -0
  738. package/src/schema.ts +149 -0
  739. package/src/storage/db.test.ts +52 -0
  740. package/src/storage/db.ts +64 -0
  741. package/src/sw/activity-router.test.ts +53 -0
  742. package/src/sw/activity.ts +66 -0
  743. package/src/sw/barrels.ts +44 -0
  744. package/src/sw/candidates.test.ts +9 -0
  745. package/src/sw/candidates.ts +14 -0
  746. package/src/sw/compile.test.ts +152 -0
  747. package/src/sw/compile.ts +92 -0
  748. package/src/sw/compiler-columns.ts +44 -0
  749. package/src/sw/compiler-internals.d.ts +8 -0
  750. package/src/sw/compiler-plugins.ts +18 -0
  751. package/src/sw/compiler.test.ts +51 -0
  752. package/src/sw/compiler.ts +86 -0
  753. package/src/sw/composition.test.ts +51 -0
  754. package/src/sw/composition.ts +86 -0
  755. package/src/sw/content-types.ts +28 -0
  756. package/src/sw/converted-resolver.test.ts +129 -0
  757. package/src/sw/converted-router.test.ts +91 -0
  758. package/src/sw/converted.browser.ts +31 -0
  759. package/src/sw/converted.test.ts +31 -0
  760. package/src/sw/converted.ts +64 -0
  761. package/src/sw/editable-sites.ts +42 -0
  762. package/src/sw/errors.test.ts +8 -0
  763. package/src/sw/errors.ts +17 -0
  764. package/src/sw/index.ts +7 -0
  765. package/src/sw/integrity.ts +10 -0
  766. package/src/sw/legacy-storage.ts +18 -0
  767. package/src/sw/link-activity.test.ts +126 -0
  768. package/src/sw/link-activity.ts +21 -0
  769. package/src/sw/link-cache.test.ts +15 -0
  770. package/src/sw/link-cache.ts +19 -0
  771. package/src/sw/link-compiler.ts +112 -0
  772. package/src/sw/link-folder.ts +29 -0
  773. package/src/sw/link-markdown.test.ts +52 -0
  774. package/src/sw/link-relay.ts +40 -0
  775. package/src/sw/link-route.test.ts +150 -0
  776. package/src/sw/link-route.ts +239 -0
  777. package/src/sw/link-source.test.ts +31 -0
  778. package/src/sw/link-source.ts +41 -0
  779. package/src/sw/markers.test.ts +33 -0
  780. package/src/sw/markers.ts +128 -0
  781. package/src/sw/module-transform.test.ts +131 -0
  782. package/src/sw/module-transform.ts +352 -0
  783. package/src/sw/package-generation.test.ts +33 -0
  784. package/src/sw/page-clients.test.ts +37 -0
  785. package/src/sw/page-clients.ts +45 -0
  786. package/src/sw/profile.test.ts +21 -0
  787. package/src/sw/profile.ts +88 -0
  788. package/src/sw/resolver.test.ts +183 -0
  789. package/src/sw/resolver.ts +220 -0
  790. package/src/sw/router-cache.test.ts +78 -0
  791. package/src/sw/router.ts +320 -0
  792. package/src/sw/runtime-module.test.ts +61 -0
  793. package/src/sw/runtime-module.ts +13 -0
  794. package/src/sw/source-hash.test.ts +7 -0
  795. package/src/sw/source-hash.ts +37 -0
  796. package/src/sw/storage.test.ts +108 -0
  797. package/src/sw/versions.ts +89 -0
  798. package/src/sw/worker.ts +87 -0
  799. package/static/README.md +15 -0
  800. package/static/profile.example.json +15 -0
  801. package/tsconfig.json +10 -0
  802. package/vitest.browser.config.ts +4 -0
  803. package/vitest.config.ts +9 -0
  804. package/README.md +0 -3
@@ -0,0 +1,429 @@
1
+ import { createHash } from "node:crypto";
2
+ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
3
+ import { isBuiltin } from "node:module";
4
+ import { dirname, extname, join, relative, sep } from "node:path";
5
+ import { ResolverFactory, type ResolveResult } from "rolldown/experimental";
6
+ import { parseSync } from "rolldown/utils";
7
+ import { specifierKind } from "./module-utils.ts";
8
+
9
+ export type FileKind = "esm" | "commonjs" | "css" | "json" | "asset";
10
+
11
+ export type PackageId = { name: string; version: string; dir: string };
12
+
13
+ export type TracedFile = {
14
+ /** Package-relative URL, `<name>@<version>/<path>`, as the package origin serves it. */
15
+ url: string;
16
+ path: string;
17
+ kind: FileKind;
18
+ integrity: string;
19
+ /** Bare specifiers the file imports, as written. */
20
+ bareImports: string[];
21
+ };
22
+
23
+ /** A CommonJS-only package entry reached from ESM. It is converted into the owning library's runtime set. */
24
+ export type CommonJsEntry = { specifier: string; path: string; pkg: PackageId; name: string; url: string };
25
+
26
+ export type Failure = { name: string; detail: string };
27
+
28
+ export type FragmentSpec = {
29
+ name: string;
30
+ /** Directory that top-level packages resolve from. */
31
+ resolveFrom: string;
32
+ /**
33
+ * URL prefix of converted CommonJS files, `<library>@<version>/runtime/`. A fragment without one (additional
34
+ * packages) cannot convert, so a CommonJS-only package there is a failure.
35
+ */
36
+ runtimeBase?: string;
37
+ /** Top-level specifiers and the files they map to. */
38
+ entries: Array<{ specifier: string; path: string }>;
39
+ files?: string[];
40
+ /** Packages mapped at the top level wherever they are imported: the base set, in the fragment that provides it. */
41
+ topLevel: string[];
42
+ /** Packages left to other fragments' top-level entries. */
43
+ inherits: string[];
44
+ /** Compiler plugins the library declares; each module is also one of `entries`. */
45
+ compiler?: import("../schema.ts").CompilerPlugins;
46
+ };
47
+
48
+ export const IMPORT_CONDITIONS = ["browser", "import", "module", "default"];
49
+ export const REQUIRE_CONDITIONS = ["browser", "require", "default"];
50
+ export const EMPTY_MODULE = "export default {};\n";
51
+ const JS_EXTENSIONS = new Set([".js", ".mjs", ".cjs"]);
52
+ const NEW_URL = /new URL\(\s*(['"])(\.{1,2}\/[^'"]+)\1\s*,\s*import\.meta\.url\s*\)/g;
53
+ // A quoted reference runs to its closing quote: font URLs carry `;` (wght@400;600).
54
+ const CSS_IMPORT = /@import\s+(?:url\(\s*)?(?:(['"])(.*?)\1|([^'")\s;]+))/g;
55
+ const CSS_URL = /url\(\s*(['"]?)([^'")]+)\1\s*\)/g;
56
+
57
+ export function createResolver(conditionNames: string[]): ResolverFactory {
58
+ return new ResolverFactory({
59
+ conditionNames,
60
+ mainFields: ["browser", "module", "main"],
61
+ aliasFields: [["browser"]],
62
+ extensions: [".mjs", ".js", ".cjs", ".json"],
63
+ symlinks: true,
64
+ });
65
+ }
66
+
67
+ export function resolveBrowser(options: { resolver: ResolverFactory; fromDir: string; specifier: string }): ResolveResult & { empty?: boolean } {
68
+ const pkg = packageOf(join(options.fromDir, "package.json"));
69
+ const manifest = JSON.parse(readFileSync(join(pkg.dir, "package.json"), "utf8")) as { browser?: Record<string, string | false> | string };
70
+ const mapping = typeof manifest.browser === "object" ? manifest.browser[options.specifier] : undefined;
71
+ if (mapping === false) return { empty: true };
72
+ if (typeof mapping === "string" && specifierKind(mapping) === "builtin") {
73
+ return { builtin: { resolved: mapping, isRuntimeModule: mapping.startsWith("node:") } };
74
+ }
75
+ const result = options.resolver.sync(options.fromDir, options.specifier);
76
+ // The native resolver represents browser:false with its Ignored error, not a path or a typed flag.
77
+ if (result.error?.startsWith("Path is ignored ")) return { empty: true };
78
+ if (!result.path && isBuiltin(options.specifier)) return { builtin: { resolved: options.specifier, isRuntimeModule: options.specifier.startsWith("node:") } };
79
+ return result;
80
+ }
81
+
82
+ export function integrityOf(bytes: Uint8Array | string): string {
83
+ return `sha384-${createHash("sha384").update(bytes).digest("base64")}`;
84
+ }
85
+
86
+ export function packageName(specifier: string): string {
87
+ const parts = specifier.split("/");
88
+ return (specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0]) ?? specifier;
89
+ }
90
+
91
+ /** The string value of a dynamic import's argument, or null when it is computed. */
92
+ function stringLiteral(expression: string): string | null {
93
+ const text = expression.trim();
94
+ const quoted = /^(['"])([^'"\\]*)\1$/.exec(text);
95
+ if (quoted) return quoted[2] ?? null;
96
+ const template = /^`([^`$\\]*)`$/.exec(text);
97
+ return template ? (template[1] ?? null) : null;
98
+ }
99
+
100
+ const formats = new Map<string, { format: "esm" | "commonjs"; code: string; module: ReturnType<typeof parseSync>["module"] }>();
101
+
102
+ /** Parses a JavaScript file once and classifies it by its syntax, which is what a browser cares about. */
103
+ export function moduleFormat(path: string): { format: "esm" | "commonjs"; code: string; module: ReturnType<typeof parseSync>["module"] } {
104
+ const code = readFileSync(path, "utf8");
105
+ const known = formats.get(path);
106
+ if (known?.code === code) return known;
107
+ const parsed = parseSync(path, code, { lang: "js", sourceType: "unambiguous" });
108
+ const commonJsSyntax = /\brequire\s*\(|\bmodule\.exports\b|\bexports\.[\w$]+\s*=|\bexports\[/.test(code);
109
+ if (parsed.errors.length > 0) throw new Error(`${path}: ${parsed.errors.map((error) => error.message).join("; ")}`);
110
+ const format = !parsed.module.hasModuleSyntax && commonJsSyntax ? "commonjs" : "esm";
111
+ const result = { format, code, module: parsed.module } as const;
112
+ formats.set(path, result);
113
+ return result;
114
+ }
115
+
116
+ const manifests = new Map<string, PackageId | null>();
117
+
118
+ function manifestAt(dir: string): PackageId | null {
119
+ if (manifests.has(dir)) return manifests.get(dir) ?? null;
120
+ const file = join(dir, "package.json");
121
+ const manifest = existsSync(file) ? (JSON.parse(readFileSync(file, "utf8")) as { name?: string; version?: string }) : {};
122
+ const id = manifest.name && manifest.version ? { name: manifest.name, version: manifest.version, dir } : null;
123
+ manifests.set(dir, id);
124
+ return id;
125
+ }
126
+
127
+ /**
128
+ * The package that contains `path`: the nearest directory with a named, versioned package.json. Nested
129
+ * manifests without a version (subpath shims) and dependencies a library bundled into its own dist (no
130
+ * manifest at all) belong to the enclosing package.
131
+ */
132
+ export function packageOf(path: string): PackageId {
133
+ for (let dir = dirname(path); dir !== dirname(dir); dir = dirname(dir)) {
134
+ const manifest = manifestAt(dir);
135
+ if (manifest) return manifest;
136
+ }
137
+ throw new Error(`${path} is not inside a package`);
138
+ }
139
+
140
+ function urlOf(pkg: PackageId, path: string): string {
141
+ return `${pkg.name}@${pkg.version}/${relative(pkg.dir, path).split(sep).join("/")}`;
142
+ }
143
+
144
+ /** Picks an `exports` target for the browser, honouring the package's own condition order. */
145
+ function exportTarget(value: unknown): string | null {
146
+ if (typeof value === "string") return value;
147
+ if (Array.isArray(value)) {
148
+ for (const item of value) {
149
+ const target = exportTarget(item);
150
+ if (target) return target;
151
+ }
152
+ return null;
153
+ }
154
+ if (value && typeof value === "object") {
155
+ for (const [condition, nested] of Object.entries(value)) {
156
+ if (!IMPORT_CONDITIONS.includes(condition)) continue;
157
+ const target = exportTarget(nested);
158
+ if (target) return target;
159
+ }
160
+ }
161
+ return null;
162
+ }
163
+
164
+ function filesUnder(dir: string): string[] {
165
+ if (!existsSync(dir)) return [];
166
+ return readdirSync(dir, { recursive: true, encoding: "utf8" })
167
+ .map((entry) => join(dir, entry))
168
+ .filter((path) => statSync(path).isFile());
169
+ }
170
+
171
+ /** Every entry point a package's `exports` declares for the browser, with `*` patterns expanded. */
172
+ export function exportEntries(dir: string): Array<{ specifier: string; path: string }> {
173
+ const manifest = JSON.parse(readFileSync(join(dir, "package.json"), "utf8")) as { name: string; exports?: unknown };
174
+ const exportsField = manifest.exports;
175
+ if (!exportsField || typeof exportsField !== "object" || Array.isArray(exportsField)) {
176
+ throw new Error(`${manifest.name} has no subpath exports map`);
177
+ }
178
+ const entries: Array<{ specifier: string; path: string }> = [];
179
+ for (const [key, value] of Object.entries(exportsField)) {
180
+ const target = exportTarget(value);
181
+ if (!target) continue;
182
+ const specifier = key === "." ? manifest.name : `${manifest.name}${key.slice(1)}`;
183
+ if (!key.includes("*")) {
184
+ entries.push({ specifier, path: join(dir, target) });
185
+ continue;
186
+ }
187
+ const [targetPrefix = "", targetSuffix = ""] = target.split("*");
188
+ const base = join(dir, targetPrefix);
189
+ for (const path of filesUnder(dirname(base))) {
190
+ if (!path.startsWith(base) || !path.endsWith(targetSuffix) || path.endsWith(".d.ts")) continue;
191
+ const captured = path.slice(base.length, path.length - targetSuffix.length).split(sep).join("/");
192
+ entries.push({ specifier: specifier.replace("*", captured), path });
193
+ }
194
+ }
195
+ return entries;
196
+ }
197
+
198
+ export function resolveEntry(resolver: ResolverFactory, fromDir: string, specifier: string): { specifier: string; path: string } {
199
+ const result = resolver.sync(fromDir, specifier);
200
+ if (!result.path) throw new Error(`cannot resolve ${specifier} from ${fromDir}: ${result.error}`);
201
+ return { specifier, path: result.path };
202
+ }
203
+
204
+ type Pending = { file: TracedFile; code: string; module: ReturnType<typeof parseSync>["module"]; pkg: PackageId };
205
+
206
+ /**
207
+ * Traces a fragment's dependency closure: every file a browser loads from the fragment's entries, the bare
208
+ * imports each package needs mapped, and the CommonJS-only entries that must be converted.
209
+ */
210
+ export class ClosureTracer {
211
+ readonly imports: Record<string, string> = {};
212
+ readonly scopes: Record<string, Record<string, string>> = {};
213
+ /** URL remaps: CommonJS files that ESM code imports by a relative path, redirected to their converted file. */
214
+ readonly remaps: Record<string, string> = {};
215
+ /** Relative imports without a file name, by package: the runtime rewrites them to canonical URLs. */
216
+ readonly canonicalRewrites = new Map<string, number>();
217
+ readonly inherited = new Map<string, Set<string>>();
218
+ readonly files = new Map<string, TracedFile>();
219
+ readonly packages = new Map<string, string>();
220
+ readonly commonJs = new Map<string, CommonJsEntry>();
221
+ readonly failures: Failure[] = [];
222
+ readonly untraced: Array<{ url: string; expression: string }> = [];
223
+ /** Resources on other origins that traced files load, which the frame's CSP and egress allowlist must permit. */
224
+ readonly external: Array<{ url: string; reference: string }> = [];
225
+ readonly resolver = createResolver(IMPORT_CONDITIONS);
226
+ private readonly targets = new Map<string, string | null>();
227
+ private readonly queue: Pending[] = [];
228
+
229
+ constructor(readonly spec: FragmentSpec) {}
230
+
231
+ trace(): this {
232
+ for (const entry of this.spec.entries) {
233
+ const url = this.target(entry.path, entry.specifier, "bare");
234
+ if (url) this.mapTopLevel(entry.specifier, url);
235
+ }
236
+ for (const path of this.spec.files ?? []) this.target(path, this.spec.name, "relative");
237
+ this.drain();
238
+ return this;
239
+ }
240
+
241
+ traceDependencies(options: { path: string; dependencies: string[] }): void {
242
+ const pkg = packageOf(options.path);
243
+ const file = this.files.get(urlOf(pkg, options.path));
244
+ if (!file) throw new Error(`${options.path}: page-styles must be an ESM module`);
245
+ for (const specifier of options.dependencies) this.follow(specifier, file, pkg);
246
+ this.drain();
247
+ }
248
+
249
+ private emptyModule(): string {
250
+ if (!this.spec.runtimeBase) throw new Error(`${this.spec.name}: browser:false requires a library runtime set`);
251
+ const url = `${this.spec.runtimeBase}empty.js`;
252
+ this.files.set(url, { url, path: join(this.spec.resolveFrom, "dist/runtime/empty.js"), kind: "esm", integrity: integrityOf(EMPTY_MODULE), bareImports: [] });
253
+ return url;
254
+ }
255
+
256
+ /** Traces files queued after `trace`, such as ESM packages that converted CommonJS code imports. */
257
+ drain(): void {
258
+ for (let next = this.queue.shift(); next; next = this.queue.shift()) this.visit(next);
259
+ }
260
+
261
+ fail(name: string, detail: string): void {
262
+ if (!this.failures.some((failure) => failure.name === name && failure.detail === detail)) this.failures.push({ name, detail });
263
+ }
264
+
265
+ inherit(specifier: string, importer: string): void {
266
+ const importers = this.inherited.get(specifier) ?? new Set<string>();
267
+ importers.add(importer);
268
+ this.inherited.set(specifier, importers);
269
+ }
270
+
271
+ mapTopLevel(specifier: string, url: string): void {
272
+ const existing = this.imports[specifier];
273
+ if (existing && existing !== url) this.fail(specifier, `top-level conflict: ${existing} and ${url}`);
274
+ else this.imports[specifier] = url;
275
+ }
276
+
277
+ mapInScope(scope: string, specifier: string, url: string): void {
278
+ const table = (this.scopes[scope] ??= {});
279
+ const existing = table[specifier];
280
+ if (existing && existing !== url) this.fail(packageName(specifier), `scope ${scope} maps ${specifier} to both ${existing} and ${url}`);
281
+ else table[specifier] = url;
282
+ }
283
+
284
+ /** Maps a base-set specifier at the top level, resolved from the fragment root so every importer shares one copy. */
285
+ provideTopLevel(specifier: string): string | null {
286
+ const known = this.imports[specifier];
287
+ if (known) return known;
288
+ const resolved = this.resolver.sync(this.spec.resolveFrom, specifier);
289
+ if (!resolved.path) {
290
+ this.fail(packageName(specifier), `cannot resolve base-set specifier ${specifier}: ${resolved.error}`);
291
+ return null;
292
+ }
293
+ const url = this.target(resolved.path, specifier, "bare");
294
+ if (url) this.mapTopLevel(specifier, url);
295
+ return url;
296
+ }
297
+
298
+ /**
299
+ * Registers a file and returns the URL an import of it maps to: the file itself, or, for a CommonJS-only
300
+ * package entry, its converted file in the runtime set.
301
+ */
302
+ target(path: string, specifier: string, via: "bare" | "relative"): string | null {
303
+ if (this.targets.has(path)) return this.targets.get(path) ?? null;
304
+ const pkg = packageOf(path);
305
+ this.packages.set(`${pkg.name}@${pkg.version}`, pkg.dir);
306
+ const extension = extname(path);
307
+ let url: string | null = urlOf(pkg, path);
308
+ if (JS_EXTENSIONS.has(extension)) {
309
+ const parsed = moduleFormat(path);
310
+ if (parsed.format === "esm") this.addFile({ url, path, kind: "esm", integrity: integrityOf(parsed.code), bareImports: [] }, parsed, pkg);
311
+ else if (via === "bare") url = this.commonJsEntry(path, specifier, pkg);
312
+ else {
313
+ // An ESM wrapper importing its own CommonJS build: the import map redirects the file's URL to its conversion.
314
+ const converted = this.commonJsEntry(path, `${pkg.name}/${relative(pkg.dir, path).split(sep).join("/")}`, pkg);
315
+ if (converted) this.remaps[url] = converted;
316
+ }
317
+ } else if (extension === ".css") {
318
+ this.addCss(path, url, pkg);
319
+ } else {
320
+ const kind = extension === ".json" ? "json" : "asset";
321
+ this.addFile({ url, path, kind, integrity: integrityOf(readFileSync(path)), bareImports: [] }, null, pkg);
322
+ }
323
+ this.targets.set(path, url);
324
+ return url;
325
+ }
326
+
327
+ private commonJsEntry(path: string, specifier: string, pkg: PackageId): string | null {
328
+ if (!this.spec.runtimeBase) {
329
+ this.fail(pkg.name, `${pkg.name}@${pkg.version} is CommonJS-only; additional packages must ship ESM`);
330
+ return null;
331
+ }
332
+ const subpath = specifier === pkg.name ? "index" : specifier.slice(pkg.name.length + 1).replace(/\.(c|m)?js$/, "");
333
+ const name = `${pkg.name}@${pkg.version}/${subpath}`;
334
+ const url = `${this.spec.runtimeBase}${name}.js`;
335
+ this.commonJs.set(name, { specifier, path, pkg, name, url });
336
+ return url;
337
+ }
338
+
339
+ private addFile(file: TracedFile, parsed: ReturnType<typeof moduleFormat> | null, pkg: PackageId): void {
340
+ this.files.set(file.url, file);
341
+ if (parsed && file.kind === "esm") this.queue.push({ file, code: parsed.code, module: parsed.module, pkg });
342
+ }
343
+
344
+ private addCss(path: string, url: string, pkg: PackageId): void {
345
+ const code = readFileSync(path, "utf8");
346
+ this.files.set(url, { url, path, kind: "css", integrity: integrityOf(code), bareImports: [] });
347
+ const imports = new Set([...code.matchAll(CSS_IMPORT)].map((match) => match[2] ?? match[3] ?? ""));
348
+ for (const reference of imports) {
349
+ if (/^https?:/.test(reference)) this.external.push({ url, reference });
350
+ else this.target(join(dirname(path), reference), reference, "relative");
351
+ }
352
+ for (const match of code.matchAll(CSS_URL)) {
353
+ const value = match[2] ?? "";
354
+ if (imports.has(value) || !value || /^(data:|#|\/)/.test(value)) continue;
355
+ if (/^https?:/.test(value)) {
356
+ this.external.push({ url, reference: value });
357
+ continue;
358
+ }
359
+ const asset = join(dirname(path), value.split(/[?#]/)[0] ?? value);
360
+ if (existsSync(asset)) this.target(asset, value, "relative");
361
+ else this.fail(pkg.name, `${url} references missing asset ${value}`);
362
+ }
363
+ }
364
+
365
+ private visit({ file, code, module, pkg }: Pending): void {
366
+ const specifiers = new Set<string>();
367
+ for (const item of module.staticImports) specifiers.add(item.moduleRequest.value);
368
+ for (const item of module.staticExports) {
369
+ for (const entry of item.entries) if (entry.moduleRequest) specifiers.add(entry.moduleRequest.value);
370
+ }
371
+ for (const item of module.dynamicImports) {
372
+ const expression = code.slice(item.moduleRequest.start, item.moduleRequest.end);
373
+ const literal = stringLiteral(expression);
374
+ if (literal === null) this.untraced.push({ url: file.url, expression: expression.replace(/\s+/g, " ").slice(0, 120) });
375
+ else specifiers.add(literal);
376
+ }
377
+ for (const match of code.matchAll(NEW_URL)) if (match[2]) specifiers.add(match[2]);
378
+ for (const specifier of specifiers) this.follow(specifier, file, pkg);
379
+ }
380
+
381
+ private follow(specifier: string, file: TracedFile, pkg: PackageId): void {
382
+ const kind = specifierKind(specifier);
383
+ if (kind === "url") return;
384
+ const resolved = resolveBrowser({ resolver: this.resolver, fromDir: dirname(file.path), specifier });
385
+ if (resolved.empty) {
386
+ const url = this.emptyModule();
387
+ if (kind === "relative") this.remaps[urlOf(pkg, join(dirname(file.path), specifier))] = url;
388
+ else {
389
+ file.bareImports.push(specifier);
390
+ this.mapInScope(`${pkg.name}@${pkg.version}/`, specifier, url);
391
+ }
392
+ return;
393
+ }
394
+ if (resolved.builtin || (kind === "builtin" && !resolved.path)) {
395
+ this.fail(pkg.name, `${file.url} imports Node built-in ${resolved.builtin?.resolved ?? specifier}`);
396
+ return;
397
+ }
398
+ if (kind === "relative") {
399
+ if (!resolved.path) {
400
+ this.fail(pkg.name, `${file.url} imports missing ${specifier}`);
401
+ return;
402
+ }
403
+ const written = specifier.split(/[?#]/)[0] ?? specifier;
404
+ if (!resolved.path.endsWith(written.replace(/^(\.{1,2}\/)+/, "").split("/").join(sep))) {
405
+ this.canonicalRewrites.set(pkg.name, (this.canonicalRewrites.get(pkg.name) ?? 0) + 1);
406
+ }
407
+ const url = this.target(resolved.path, specifier, "relative");
408
+ const writtenPath = join(dirname(file.path), written);
409
+ if (url && writtenPath !== resolved.path) this.remaps[urlOf(pkg, writtenPath)] = this.remaps[url] ?? url;
410
+ return;
411
+ }
412
+ file.bareImports.push(specifier);
413
+ const name = packageName(specifier);
414
+ if (this.spec.inherits.includes(name)) {
415
+ this.inherit(specifier, file.url);
416
+ return;
417
+ }
418
+ if (this.spec.topLevel.includes(name)) {
419
+ this.provideTopLevel(specifier);
420
+ return;
421
+ }
422
+ if (!resolved.path) {
423
+ this.fail(name, `${file.url} cannot resolve ${specifier} (${resolved.error})`);
424
+ return;
425
+ }
426
+ const url = this.target(resolved.path, specifier, "bare");
427
+ if (url) this.mapInScope(`${pkg.name}@${pkg.version}/`, specifier, url);
428
+ }
429
+ }
@@ -0,0 +1,25 @@
1
+ import type { AgentSelection, JsonValue } from "./schema.ts";
2
+
3
+ export type DesignEdit =
4
+ | { kind: "delete" }
5
+ | { kind: "style"; prop: "variant" | "role"; value: string }
6
+ | { kind: "text"; prop: string; from: string; to: string }
7
+ | { kind: "attributes"; values: Record<string, string | number | null>; textFrom?: string };
8
+ export type DesignWriteRequest = { page: string; source: string; edit: DesignEdit; choose?: string };
9
+ export type DesignWriteCandidate = { id: string; file: string; line: number; column: number; context: string };
10
+ export type DesignWriteResult =
11
+ | { status: "applied"; file: string; path: string; line: number; hash: string }
12
+ | { status: "stale"; error: string; file: string }
13
+ | { status: "refused"; error: string; reason: string; file: string; line: number; column: number; attribute?: string }
14
+ | { status: "ambiguous"; error: string; candidates: DesignWriteCandidate[] }
15
+ | { status: "invalid"; error: string };
16
+ export type DesignHostMessage =
17
+ | { type: "design-override"; requestId: string; source: string; props: Record<string, JsonValue> }
18
+ | { type: "design-write"; requestId: string; page: string; source: string; edit: DesignEdit; choose?: string }
19
+ | { type: "design-write-result"; requestId: string; result: DesignWriteResult };
20
+ export type DesignFrameMessage =
21
+ | { type: "design-selection"; selection: AgentSelection; source: string; props: Record<string, JsonValue> }
22
+ | { type: "design-override-result"; requestId: string; source: string; ok: true }
23
+ | { type: "design-override-result"; requestId: string; source: string; ok: false; error: string }
24
+ | { type: "design-write-request"; requestId: string; request: DesignWriteRequest }
25
+ | { type: "design-write-result"; requestId: string; result: DesignWriteResult };
@@ -0,0 +1,48 @@
1
+ # Workspace package registry and origin
2
+
3
+ This Node-only development server exposes built workspace packages in the same layouts the browser resolver uses. It serves registry metadata at `/<name>` (including URL-encoded scoped names) and exact package files at `/<name>@<version>/<path>`. Package names, versions and the complete version manifest come from each configured directory's real `package.json`. Files, including runtime fragments at `dist/runtime/{importmap,barrels}.json`, are served byte-for-byte without rewriting integrity or imports.
4
+
5
+ Local metadata deliberately declares the release date **`2000-01-01T00:00:00.000Z`** (`LOCAL_RELEASE_TIME`). This is a development-only synthetic publication date, explicitly old enough for the reference host's seven-day `minReleaseAgeDays` policy. It is not the package's real npm publication date. No age calculation or current-time default is used.
6
+
7
+ Build the packages before starting the server. It never compiles a library, generates fragments or substitutes source for missing dist files. Rebuild runtime fragments whenever the dist bytes change, because the worker checks their integrity. Local responses use `Cache-Control: no-store`; files and manifests are read again on every request. A package identity change requires restarting the server. Existing browser locks and worker caches still obey the runtime's own cache policy.
8
+
9
+ ## CLI
10
+
11
+ From the clicky-ui repository root (dependencies are already installed):
12
+
13
+ ```bash
14
+ pnpm --filter @flanksource/page-runtime exec tsx scripts/serve-packages.ts --package ../ui --package ../../../facet --upstream-registry https://registry.npmjs.org --upstream-origin https://unpkg.com --port 5812
15
+ ```
16
+
17
+ `--package <dir>` is repeatable and required; directories are relative to the process working directory (`packages/page-runtime` with the command above). `--upstream-registry` defaults to `https://registry.npmjs.org`, `--upstream-origin` to `https://unpkg.com`, and `--port` to `5812`. Port `0` selects a free port. Invalid configuration and duplicate names fail startup. The server binds only `127.0.0.1` and prints its actual origin.
18
+
19
+ Unknown package metadata is proxied to the upstream registry. Unknown package files, including transitive closure files, are proxied to the upstream origin with their query string and status preserved. A configured local package requested at a different version returns **404 naming the available local version**. Missing local files return 404 and never fall through to npm. Traversal and symlink escapes are rejected. Proxy transport errors return 502 with the failing URL. GET, HEAD and OPTIONS are supported, with CORS on successful responses, preflights and errors. JavaScript, CSS, JSON, fonts and image assets carry their appropriate content types.
20
+
21
+ ## Programmatic API for browser-only playground prod
22
+
23
+ Until the shared `./dev` package export is added, import `packages/page-runtime/src/dev/index.ts` by its workspace path. Node 24 supports these erasable TypeScript modules directly; `tsx` also works.
24
+
25
+ ```ts
26
+ import { createPackageHandler, servePackages } from "./packages/page-runtime/src/dev/index.ts";
27
+
28
+ const options = {
29
+ packages: ["/workspace/clicky-ui/packages/ui", "/workspace/facet"],
30
+ upstreamRegistry: "https://registry.npmjs.org",
31
+ upstreamOrigin: "https://unpkg.com",
32
+ };
33
+ const local = await servePackages({ ...options, port: 0 });
34
+ // Use local.origin for both profile.registry and profile.packageOrigin.
35
+ await local.close();
36
+
37
+ // Or mount the same handler on a Node HTTP server at the origin root.
38
+ const handler = await createPackageHandler(options);
39
+ // await handler(request, response);
40
+ ```
41
+
42
+ `PackageOriginOptions` requires all three configuration properties. `createPackageHandler(options)` asynchronously validates packages and returns `(IncomingMessage, ServerResponse) => Promise<void>`, which owns the complete response, including error handling. Route package requests to it from a containing server; unrelated API/static routes stay with that server. If mounting below a prefix, strip that prefix from `request.url` before calling it and use the prefix in the profile URLs. `servePackages({ ...options, port })` wraps the handler in a loopback HTTP server and returns `{ origin, close }`; `close()` closes active connections and resolves after shutdown. Register application shutdown handlers in the caller. No signal handlers are installed by the programmatic API.
43
+
44
+ ## Focused tests
45
+
46
+ ```bash
47
+ gavel test --work-dir ./packages/page-runtime --framework vitest --recursive=false -- src/dev
48
+ ```
@@ -0,0 +1,79 @@
1
+ import { createHash } from "node:crypto";
2
+ import { watchFile, unwatchFile } from "node:fs";
3
+ import { readFile, realpath } from "node:fs/promises";
4
+ import { resolve } from "node:path";
5
+ import { atomicJson, publicationRoot, readPublication, type PackageCatalog, type Publication } from "../publication/index.ts";
6
+ import { readManifest, type PackageManifest } from "../publication/manifest.ts";
7
+ import { BUILD_ID, validateCatalog } from "../publication/schema.ts";
8
+
9
+ export type LocalPackage = { directory: string; manifest: PackageManifest };
10
+ type Catalog = { catalog: PackageCatalog; locals: Map<string, LocalPackage> };
11
+ export async function createCatalogStore(options: { packages: string[]; stateDir: string }) {
12
+ const listeners = new Set<(catalog: PackageCatalog) => void>();
13
+ const retained = new Map<string, Catalog>();
14
+ const directories = new Map<string, string>();
15
+ for (const path of options.packages) {
16
+ const publication = await readPublication(path);
17
+ if (directories.has(publication.name)) throw new Error(`Duplicate local package: ${publication.name}`);
18
+ directories.set(publication.name, path);
19
+ }
20
+ let current: Catalog;
21
+ let failure: Error | undefined;
22
+ const load = async () => {
23
+ const entries = await Promise.all([...directories].sort(([a], [b]) => a.localeCompare(b)).map(async ([name, path]) => {
24
+ const publication = await readPublication(path);
25
+ if (publication.name !== name) throw new Error(`${path}: package identity changed; restart the local origin`);
26
+ return publication;
27
+ }));
28
+ const packages = Object.fromEntries(entries.map(({ name, version, build }) => [name, { name, version, build }]));
29
+ const revision = createHash("sha256").update(JSON.stringify(packages)).digest("hex");
30
+ if (current?.catalog.revision === revision) { failure = undefined; return; }
31
+ const catalog = { revision, packages };
32
+ const locals = await localPackages(entries);
33
+ await atomicJson(resolve(options.stateDir, `${revision}.json`), catalog);
34
+ current = { catalog, locals }; failure = undefined;
35
+ retained.set(revision, current);
36
+ listeners.forEach(listener => listener(catalog));
37
+ };
38
+ await load();
39
+ let queue = Promise.resolve();
40
+ const refresh = () => { queue = queue.then(load).catch(error => { failure = error instanceof Error ? error : new Error(String(error)); }); };
41
+ const watchers = options.packages.map(path => {
42
+ const file = resolve(publicationRoot(path), "current.json");
43
+ const listener = () => refresh();
44
+ watchFile(file, { interval: 250, persistent: false }, listener);
45
+ return () => unwatchFile(file, listener);
46
+ });
47
+ // Catch a publication completed between the initial read and watcher setup.
48
+ refresh();
49
+ return {
50
+ current(): PackageCatalog { if (failure) throw failure; return current.catalog; },
51
+ async get(revision?: string): Promise<Catalog> {
52
+ if (!revision) { if (failure) throw failure; return current; }
53
+ if (!BUILD_ID.test(revision)) throw new Error("Invalid package catalog revision");
54
+ const known = retained.get(revision);
55
+ if (known) return known;
56
+ const catalog = validateCatalog(JSON.parse(await readFile(resolve(options.stateDir, `${revision}.json`), "utf8")));
57
+ if (catalog.revision !== revision || createHash("sha256").update(JSON.stringify(catalog.packages)).digest("hex") !== revision) throw new Error("Package catalog integrity mismatch");
58
+ const entries = Object.values(catalog.packages).map(entry => {
59
+ const path = directories.get(entry.name);
60
+ if (!path) throw new Error(`Unconfigured catalog package: ${entry.name}`);
61
+ return { ...entry, directory: resolve(publicationRoot(path), "generations", entry.build, "package") };
62
+ });
63
+ const loaded = { catalog, locals: await localPackages(entries) };
64
+ retained.set(revision, loaded);
65
+ return loaded;
66
+ },
67
+ subscribe(listener: (catalog: PackageCatalog) => void) { listeners.add(listener); return () => { listeners.delete(listener); }; },
68
+ close() { watchers.forEach(close => close()); listeners.clear(); },
69
+ };
70
+ }
71
+
72
+ async function localPackages(entries: Publication[]): Promise<Map<string, LocalPackage>> {
73
+ return new Map(await Promise.all(entries.map(async entry => {
74
+ const directory = await realpath(entry.directory);
75
+ const manifest = await readManifest(directory);
76
+ if (manifest.name !== entry.name || manifest.version !== entry.version) throw new Error(`Package snapshot identity mismatch: ${entry.name}`);
77
+ return [entry.name, { directory, manifest }] as const;
78
+ })));
79
+ }
@@ -0,0 +1,12 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { parsePackageArguments } from "./cli.ts";
3
+
4
+ describe("serve-packages arguments", () => {
5
+ it("accepts repeated package directories and explicit upstreams and port", () => {
6
+ expect(parsePackageArguments(["--package", "packages/ui", "--package", "../facet", "--upstream-registry", "https://registry.example.com", "--upstream-origin", "https://files.example.com", "--port", "0"])).toEqual({ packages: ["packages/ui", "../facet"], upstreamRegistry: "https://registry.example.com", upstreamOrigin: "https://files.example.com", port: 0, stateDir: ".tmp/package-origin" });
7
+ });
8
+
9
+ it.each([[], ["--package"], ["--package", "--port"], ["--unknown", "x"], ["--package", ".", "--port", "abc"], ["--package", ".", "--port", "65536"], ["--package", ".", "--port", "1", "--port", "2"]].map((args) => ({ args })))("rejects invalid arguments $args", ({ args }) => {
10
+ expect(() => parsePackageArguments(args)).toThrow();
11
+ });
12
+ });
package/src/dev/cli.ts ADDED
@@ -0,0 +1,25 @@
1
+ import type { PackageOriginOptions } from "./index.ts";
2
+
3
+ export function parsePackageArguments(args: string[]): PackageOriginOptions & { port: number } {
4
+ const options = { packages: [] as string[], upstreamRegistry: "https://registry.npmjs.org", upstreamOrigin: "https://unpkg.com", port: 5812, stateDir: ".tmp/package-origin" };
5
+ const seen = new Set<string>();
6
+ for (let index = 0; index < args.length; index += 2) {
7
+ const flag = args[index]!;
8
+ const value = args[index + 1];
9
+ if (!value || value.startsWith("--")) throw new Error(`${flag}: missing value`);
10
+ if (flag !== "--package" && seen.has(flag)) throw new Error(`${flag}: specified more than once`);
11
+ seen.add(flag);
12
+ switch (flag) {
13
+ case "--package": options.packages.push(value); break;
14
+ case "--upstream-registry": options.upstreamRegistry = value; break;
15
+ case "--upstream-origin": options.upstreamOrigin = value; break;
16
+ case "--state-dir": options.stateDir = value; break;
17
+ case "--port":
18
+ if (!/^\d+$/.test(value) || Number(value) > 65535) throw new Error(`Invalid port: ${value}`);
19
+ options.port = Number(value); break;
20
+ default: throw new Error(`Unknown option: ${flag}`);
21
+ }
22
+ }
23
+ if (!options.packages.length) throw new Error("Specify --package <dir> at least once");
24
+ return options;
25
+ }