@shivaedev/test-story 0.33.0 → 0.35.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 (367) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +121 -53
  3. package/dist/client/{react.d.ts → adapters/react.d.ts} +0 -1
  4. package/dist/client/adapters/react.d.ts.map +1 -0
  5. package/dist/client/{react.js → adapters/react.js} +6 -18
  6. package/dist/client/adapters/react.js.map +1 -0
  7. package/dist/server/adapters/assertOutcomes.d.ts +12 -0
  8. package/dist/server/adapters/assertOutcomes.d.ts.map +1 -0
  9. package/dist/server/adapters/assertOutcomes.js +6 -0
  10. package/dist/server/adapters/assertOutcomes.js.map +1 -0
  11. package/dist/server/{internal → adapters}/documentRedirect.d.ts.map +1 -1
  12. package/dist/server/{internal → adapters}/documentRedirect.js.map +1 -1
  13. package/dist/server/{internal → adapters}/documentRequest.d.ts.map +1 -1
  14. package/dist/server/{internal → adapters}/documentRequest.js.map +1 -1
  15. package/dist/server/{internal → adapters}/documentResponse.d.ts.map +1 -1
  16. package/dist/server/{internal → adapters}/documentResponse.js.map +1 -1
  17. package/dist/server/{internal → adapters}/documentTransport.d.ts.map +1 -1
  18. package/dist/server/{internal → adapters}/documentTransport.js +3 -3
  19. package/dist/server/{internal → adapters}/documentTransport.js.map +1 -1
  20. package/dist/server/adapters/domEnvironment.config.d.ts.map +1 -0
  21. package/dist/server/{domEnvironment.config.js → adapters/domEnvironment.config.js} +3 -3
  22. package/dist/server/adapters/domEnvironment.config.js.map +1 -0
  23. package/dist/server/adapters/installOutbound.d.ts.map +1 -0
  24. package/dist/server/{internal → adapters}/installOutbound.js +39 -13
  25. package/dist/server/adapters/installOutbound.js.map +1 -0
  26. package/dist/server/adapters/makeForwardingProxy.d.ts +1 -1
  27. package/dist/server/adapters/makeForwardingProxy.d.ts.map +1 -1
  28. package/dist/server/{memberScreens.d.ts → adapters/memberScreens.d.ts} +1 -1
  29. package/dist/server/adapters/memberScreens.d.ts.map +1 -0
  30. package/dist/server/{memberScreens.js → adapters/memberScreens.js} +5 -4
  31. package/dist/server/adapters/memberScreens.js.map +1 -0
  32. package/dist/server/adapters/receiveOtlp.d.ts +1 -1
  33. package/dist/server/adapters/receiveOtlp.d.ts.map +1 -1
  34. package/dist/server/adapters/receiveOtlp.js +1 -1
  35. package/dist/server/adapters/receiveOtlp.js.map +1 -1
  36. package/dist/server/{internal → adapters}/screenAccessibility.d.ts +0 -2
  37. package/dist/server/adapters/screenAccessibility.d.ts.map +1 -0
  38. package/dist/server/{internal → adapters}/screenAccessibility.js +0 -5
  39. package/dist/server/adapters/screenAccessibility.js.map +1 -0
  40. package/dist/server/adapters/screenAct.d.ts +2 -2
  41. package/dist/server/adapters/screenAct.d.ts.map +1 -1
  42. package/dist/server/adapters/screenAct.js.map +1 -1
  43. package/dist/server/adapters/screenDialogs.d.ts +2 -0
  44. package/dist/server/adapters/screenDialogs.d.ts.map +1 -0
  45. package/dist/server/adapters/screenDialogs.js +9 -0
  46. package/dist/server/adapters/screenDialogs.js.map +1 -0
  47. package/dist/server/adapters/screenElements.d.ts +6 -2
  48. package/dist/server/adapters/screenElements.d.ts.map +1 -1
  49. package/dist/server/adapters/screenElements.js +25 -7
  50. package/dist/server/adapters/screenElements.js.map +1 -1
  51. package/dist/server/{internal → adapters}/screenLoading.d.ts.map +1 -1
  52. package/dist/server/{internal → adapters}/screenLoading.js +2 -2
  53. package/dist/server/{internal → adapters}/screenLoading.js.map +1 -1
  54. package/dist/server/adapters/screenQueries.d.ts +3 -1
  55. package/dist/server/adapters/screenQueries.d.ts.map +1 -1
  56. package/dist/server/adapters/screenQueries.js +30 -5
  57. package/dist/server/adapters/screenQueries.js.map +1 -1
  58. package/dist/server/adapters/seedCookies.d.ts.map +1 -0
  59. package/dist/server/adapters/seedCookies.js.map +1 -0
  60. package/dist/server/adapters/storyFailure.d.ts +1 -1
  61. package/dist/server/adapters/storyFailure.d.ts.map +1 -1
  62. package/dist/server/adapters/storyFailure.js +1 -1
  63. package/dist/server/adapters/storyFailure.js.map +1 -1
  64. package/dist/server/adapters/writeSnapshot.d.ts +3 -0
  65. package/dist/server/adapters/writeSnapshot.d.ts.map +1 -0
  66. package/dist/server/adapters/writeSnapshot.js +24 -0
  67. package/dist/server/adapters/writeSnapshot.js.map +1 -0
  68. package/dist/server/answers.d.ts +10 -0
  69. package/dist/server/answers.d.ts.map +1 -0
  70. package/dist/server/answers.js +47 -0
  71. package/dist/server/answers.js.map +1 -0
  72. package/dist/server/browserReads.d.ts +2 -2
  73. package/dist/server/browserReads.d.ts.map +1 -1
  74. package/dist/server/browserReads.js +1 -1
  75. package/dist/server/browserReads.js.map +1 -1
  76. package/dist/server/captureOutcome.d.ts +11 -0
  77. package/dist/server/captureOutcome.d.ts.map +1 -0
  78. package/dist/server/captureOutcome.js +15 -0
  79. package/dist/server/captureOutcome.js.map +1 -0
  80. package/dist/server/domPage.js +1 -1
  81. package/dist/server/domPage.js.map +1 -1
  82. package/dist/server/fakeHttpService.d.ts +4 -2
  83. package/dist/server/fakeHttpService.d.ts.map +1 -1
  84. package/dist/server/fakeHttpService.js +11 -9
  85. package/dist/server/fakeHttpService.js.map +1 -1
  86. package/dist/server/forwardingProxy.js +2 -2
  87. package/dist/server/forwardingProxy.js.map +1 -1
  88. package/dist/server/genreTags.js +1 -1
  89. package/dist/server/genreTags.js.map +1 -1
  90. package/dist/server/httpVisitor.d.ts +1 -1
  91. package/dist/server/httpVisitor.d.ts.map +1 -1
  92. package/dist/server/httpVisitor.js +3 -3
  93. package/dist/server/httpVisitor.js.map +1 -1
  94. package/dist/server/internal/browserReadObserver.d.ts +2 -2
  95. package/dist/server/internal/browserReadObserver.d.ts.map +1 -1
  96. package/dist/server/internal/browserReadObserver.js +16 -2
  97. package/dist/server/internal/browserReadObserver.js.map +1 -1
  98. package/dist/server/internal/browserSubscriptions.d.ts +2 -1
  99. package/dist/server/internal/browserSubscriptions.d.ts.map +1 -1
  100. package/dist/server/internal/browserSubscriptions.js +11 -3
  101. package/dist/server/internal/browserSubscriptions.js.map +1 -1
  102. package/dist/server/internal/compose.d.ts +2 -2
  103. package/dist/server/internal/compose.d.ts.map +1 -1
  104. package/dist/server/internal/compose.js +3 -3
  105. package/dist/server/internal/compose.js.map +1 -1
  106. package/dist/server/internal/compositionTypes.d.ts +3 -3
  107. package/dist/server/internal/compositionTypes.d.ts.map +1 -1
  108. package/dist/server/internal/engineSnapshot.d.ts +2 -2
  109. package/dist/server/internal/engineSnapshot.d.ts.map +1 -1
  110. package/dist/server/internal/engineSnapshot.js +4 -15
  111. package/dist/server/internal/engineSnapshot.js.map +1 -1
  112. package/dist/server/internal/errors.js +2 -2
  113. package/dist/server/internal/errors.js.map +1 -1
  114. package/dist/server/internal/failureReport.d.ts +1 -1
  115. package/dist/server/internal/failureReport.d.ts.map +1 -1
  116. package/dist/server/internal/failureReport.js +9 -6
  117. package/dist/server/internal/failureReport.js.map +1 -1
  118. package/dist/server/internal/fakeHttpAnswer.d.ts +2 -2
  119. package/dist/server/internal/fakeHttpAnswer.d.ts.map +1 -1
  120. package/dist/server/internal/fakeHttpAnswer.js +13 -5
  121. package/dist/server/internal/fakeHttpAnswer.js.map +1 -1
  122. package/dist/server/internal/fakeHttpControls.d.ts +5 -5
  123. package/dist/server/internal/fakeHttpControls.d.ts.map +1 -1
  124. package/dist/server/internal/fakeHttpControls.js +6 -6
  125. package/dist/server/internal/fakeHttpControls.js.map +1 -1
  126. package/dist/server/internal/fakeHttpGates.d.ts +2 -2
  127. package/dist/server/internal/fakeHttpGates.d.ts.map +1 -1
  128. package/dist/server/internal/fakeHttpGates.js +1 -1
  129. package/dist/server/internal/fakeHttpGates.js.map +1 -1
  130. package/dist/server/internal/fakeHttpReceive.d.ts +3 -3
  131. package/dist/server/internal/fakeHttpReceive.d.ts.map +1 -1
  132. package/dist/server/internal/fakeHttpReceive.js +6 -9
  133. package/dist/server/internal/fakeHttpReceive.js.map +1 -1
  134. package/dist/server/internal/fakeHttpScripts.d.ts +1 -1
  135. package/dist/server/internal/fakeHttpScripts.d.ts.map +1 -1
  136. package/dist/server/internal/fakeHttpScripts.js +1 -1
  137. package/dist/server/internal/fakeHttpScripts.js.map +1 -1
  138. package/dist/server/internal/fakeHttpSelection.d.ts +1 -1
  139. package/dist/server/internal/fakeHttpSelection.d.ts.map +1 -1
  140. package/dist/server/internal/fakeHttpSend.d.ts +1 -1
  141. package/dist/server/internal/fakeHttpSend.d.ts.map +1 -1
  142. package/dist/server/internal/fakeHttpSignals.d.ts +10 -0
  143. package/dist/server/internal/fakeHttpSignals.d.ts.map +1 -0
  144. package/dist/server/internal/fakeHttpSignals.js +26 -0
  145. package/dist/server/internal/fakeHttpSignals.js.map +1 -0
  146. package/dist/server/internal/genre.d.ts +1 -1
  147. package/dist/server/internal/genre.d.ts.map +1 -1
  148. package/dist/server/internal/hookInference.d.ts +9 -5
  149. package/dist/server/internal/hookInference.d.ts.map +1 -1
  150. package/dist/server/internal/narration.d.ts +1 -1
  151. package/dist/server/internal/narration.d.ts.map +1 -1
  152. package/dist/server/internal/narration.js +4 -4
  153. package/dist/server/internal/narration.js.map +1 -1
  154. package/dist/server/internal/nextScreenHint.d.ts +5 -0
  155. package/dist/server/internal/nextScreenHint.d.ts.map +1 -0
  156. package/dist/server/internal/nextScreenHint.js +14 -0
  157. package/dist/server/internal/nextScreenHint.js.map +1 -0
  158. package/dist/server/internal/observeBrowser.d.ts +3 -3
  159. package/dist/server/internal/observeBrowser.d.ts.map +1 -1
  160. package/dist/server/internal/observeScreen.d.ts +9 -0
  161. package/dist/server/internal/observeScreen.d.ts.map +1 -0
  162. package/dist/server/internal/observeScreen.js +25 -0
  163. package/dist/server/internal/observeScreen.js.map +1 -0
  164. package/dist/server/internal/otlpProtobuf.js +1 -1
  165. package/dist/server/internal/otlpProtobuf.js.map +1 -1
  166. package/dist/server/internal/otlpReadout.d.ts +4 -4
  167. package/dist/server/internal/otlpReadout.js +2 -2
  168. package/dist/server/internal/otlpReadout.js.map +1 -1
  169. package/dist/server/internal/otlpReadouts.d.ts +2 -1
  170. package/dist/server/internal/otlpReadouts.d.ts.map +1 -1
  171. package/dist/server/internal/otlpReadouts.js +10 -6
  172. package/dist/server/internal/otlpReadouts.js.map +1 -1
  173. package/dist/server/internal/otlpTracing.d.ts +1 -1
  174. package/dist/server/internal/otlpTracing.d.ts.map +1 -1
  175. package/dist/server/internal/runUntil.d.ts +2 -2
  176. package/dist/server/internal/runUntil.d.ts.map +1 -1
  177. package/dist/server/internal/runUntil.js +2 -2
  178. package/dist/server/internal/runUntil.js.map +1 -1
  179. package/dist/server/internal/screenInteractions.d.ts +10 -0
  180. package/dist/server/internal/screenInteractions.d.ts.map +1 -0
  181. package/dist/server/internal/screenInteractions.js +25 -0
  182. package/dist/server/internal/screenInteractions.js.map +1 -0
  183. package/dist/server/internal/screenReadouts.d.ts +10 -1
  184. package/dist/server/internal/screenReadouts.d.ts.map +1 -1
  185. package/dist/server/internal/screenReadouts.js +27 -2
  186. package/dist/server/internal/screenReadouts.js.map +1 -1
  187. package/dist/server/internal/screenText.js +1 -1
  188. package/dist/server/internal/screenText.js.map +1 -1
  189. package/dist/server/internal/screenWaits.d.ts +2 -2
  190. package/dist/server/internal/screenWaits.d.ts.map +1 -1
  191. package/dist/server/internal/screenWaits.js +8 -7
  192. package/dist/server/internal/screenWaits.js.map +1 -1
  193. package/dist/server/internal/seed.d.ts +9 -9
  194. package/dist/server/internal/seed.d.ts.map +1 -1
  195. package/dist/server/internal/seed.js +17 -8
  196. package/dist/server/internal/seed.js.map +1 -1
  197. package/dist/server/internal/start.d.ts +3 -3
  198. package/dist/server/internal/start.d.ts.map +1 -1
  199. package/dist/server/internal/start.js +9 -9
  200. package/dist/server/internal/start.js.map +1 -1
  201. package/dist/server/internal/storyIt.d.ts +2 -2
  202. package/dist/server/internal/storyIt.d.ts.map +1 -1
  203. package/dist/server/internal/storyIt.js +7 -7
  204. package/dist/server/internal/storyIt.js.map +1 -1
  205. package/dist/server/internal/targetName.d.ts +3 -0
  206. package/dist/server/internal/targetName.d.ts.map +1 -0
  207. package/dist/server/internal/targetName.js +6 -0
  208. package/dist/server/internal/targetName.js.map +1 -0
  209. package/dist/server/internal/traits.js +1 -1
  210. package/dist/server/internal/traits.js.map +1 -1
  211. package/dist/server/internal/waitForScreen.d.ts +5 -3
  212. package/dist/server/internal/waitForScreen.d.ts.map +1 -1
  213. package/dist/server/internal/waitForScreen.js +9 -23
  214. package/dist/server/internal/waitForScreen.js.map +1 -1
  215. package/dist/server/internal/withWatchedClock.js +1 -1
  216. package/dist/server/internal/withWatchedClock.js.map +1 -1
  217. package/dist/server/lineSignals.d.ts +2 -2
  218. package/dist/server/lineSignals.d.ts.map +1 -1
  219. package/dist/server/lineSignals.js +2 -2
  220. package/dist/server/lineSignals.js.map +1 -1
  221. package/dist/server/mountApp.d.ts +13 -0
  222. package/dist/server/mountApp.d.ts.map +1 -0
  223. package/dist/server/mountApp.js +8 -0
  224. package/dist/server/mountApp.js.map +1 -0
  225. package/dist/server/otlpReceiver.d.ts +4 -3
  226. package/dist/server/otlpReceiver.d.ts.map +1 -1
  227. package/dist/server/otlpReceiver.js +6 -6
  228. package/dist/server/otlpReceiver.js.map +1 -1
  229. package/dist/server/outcomes.d.ts +1 -8
  230. package/dist/server/outcomes.d.ts.map +1 -1
  231. package/dist/server/outcomes.js +2 -2
  232. package/dist/server/outcomes.js.map +1 -1
  233. package/dist/server/routeOutbound.js +2 -2
  234. package/dist/server/routeOutbound.js.map +1 -1
  235. package/dist/server/screenDriver.d.ts +33 -12
  236. package/dist/server/screenDriver.d.ts.map +1 -1
  237. package/dist/server/screenDriver.js +28 -14
  238. package/dist/server/screenDriver.js.map +1 -1
  239. package/dist/server/screenSignal.d.ts +10 -0
  240. package/dist/server/screenSignal.d.ts.map +1 -0
  241. package/dist/server/screenSignal.js +2 -0
  242. package/dist/server/screenSignal.js.map +1 -0
  243. package/dist/server/storyKit.d.ts +7 -7
  244. package/dist/server/storyKit.d.ts.map +1 -1
  245. package/dist/server/storyKit.js +5 -5
  246. package/dist/server/storyKit.js.map +1 -1
  247. package/dist/server/until.js +1 -1
  248. package/dist/server/until.js.map +1 -1
  249. package/dist/server/watchedClock.d.ts +2 -2
  250. package/dist/server/watchedClock.d.ts.map +1 -1
  251. package/dist/server/watchedClock.js +1 -1
  252. package/dist/server/watchedClock.js.map +1 -1
  253. package/package.json +9 -14
  254. package/src/client/{react.ts → adapters/react.ts} +6 -27
  255. package/src/server/adapters/assertOutcomes.ts +16 -0
  256. package/src/server/{internal → adapters}/documentTransport.ts +3 -3
  257. package/src/server/{domEnvironment.config.ts → adapters/domEnvironment.config.ts} +3 -3
  258. package/src/server/{internal → adapters}/installOutbound.ts +48 -13
  259. package/src/server/adapters/makeForwardingProxy.ts +1 -1
  260. package/src/server/{memberScreens.ts → adapters/memberScreens.ts} +5 -4
  261. package/src/server/adapters/receiveOtlp.ts +2 -2
  262. package/src/server/{internal → adapters}/screenAccessibility.ts +0 -7
  263. package/src/server/adapters/screenAct.ts +4 -4
  264. package/src/server/adapters/screenDialogs.ts +12 -0
  265. package/src/server/adapters/screenElements.ts +28 -8
  266. package/src/server/{internal → adapters}/screenLoading.ts +2 -2
  267. package/src/server/adapters/screenQueries.ts +35 -8
  268. package/src/server/adapters/storyFailure.ts +2 -2
  269. package/src/server/adapters/writeSnapshot.ts +25 -0
  270. package/src/server/answers.ts +55 -0
  271. package/src/server/browserReads.ts +2 -2
  272. package/src/server/captureOutcome.ts +29 -0
  273. package/src/server/domPage.ts +1 -1
  274. package/src/server/fakeHttpService.ts +11 -9
  275. package/src/server/forwardingProxy.ts +2 -2
  276. package/src/server/genreTags.ts +1 -1
  277. package/src/server/httpVisitor.ts +3 -3
  278. package/src/server/internal/browserReadObserver.ts +17 -3
  279. package/src/server/internal/browserSubscriptions.ts +12 -4
  280. package/src/server/internal/compose.ts +5 -5
  281. package/src/server/internal/compositionTypes.ts +3 -3
  282. package/src/server/internal/engineSnapshot.ts +6 -24
  283. package/src/server/internal/errors.ts +2 -2
  284. package/src/server/internal/failureReport.ts +11 -7
  285. package/src/server/internal/fakeHttpAnswer.ts +14 -7
  286. package/src/server/internal/fakeHttpControls.ts +7 -7
  287. package/src/server/internal/fakeHttpGates.ts +2 -2
  288. package/src/server/internal/fakeHttpReceive.ts +8 -11
  289. package/src/server/internal/fakeHttpScripts.ts +2 -2
  290. package/src/server/internal/fakeHttpSelection.ts +1 -1
  291. package/src/server/internal/fakeHttpSend.ts +1 -1
  292. package/src/server/internal/fakeHttpSignals.ts +28 -0
  293. package/src/server/internal/genre.ts +1 -1
  294. package/src/server/internal/hookInference.ts +9 -5
  295. package/src/server/internal/narration.ts +4 -4
  296. package/src/server/internal/nextScreenHint.ts +21 -0
  297. package/src/server/internal/observeBrowser.ts +1 -1
  298. package/src/server/internal/observeScreen.ts +34 -0
  299. package/src/server/internal/otlpProtobuf.ts +1 -1
  300. package/src/server/internal/otlpReadout.ts +2 -2
  301. package/src/server/internal/otlpReadouts.ts +11 -7
  302. package/src/server/internal/otlpTracing.ts +1 -1
  303. package/src/server/internal/runUntil.ts +3 -3
  304. package/src/server/internal/screenInteractions.ts +31 -0
  305. package/src/server/internal/screenReadouts.ts +28 -3
  306. package/src/server/internal/screenText.ts +1 -1
  307. package/src/server/internal/screenWaits.ts +10 -9
  308. package/src/server/internal/seed.ts +32 -14
  309. package/src/server/internal/start.ts +11 -11
  310. package/src/server/internal/storyIt.ts +8 -8
  311. package/src/server/internal/targetName.ts +7 -0
  312. package/src/server/internal/traits.ts +1 -1
  313. package/src/server/internal/waitForScreen.ts +13 -31
  314. package/src/server/internal/withWatchedClock.ts +1 -1
  315. package/src/server/lineSignals.ts +2 -2
  316. package/src/server/mountApp.ts +15 -0
  317. package/src/server/otlpReceiver.ts +7 -7
  318. package/src/server/outcomes.ts +2 -11
  319. package/src/server/routeOutbound.ts +2 -2
  320. package/src/server/screenDriver.ts +54 -26
  321. package/src/server/screenSignal.ts +9 -0
  322. package/src/server/storyKit.ts +10 -10
  323. package/src/server/until.ts +1 -1
  324. package/src/server/watchedClock.ts +1 -1
  325. package/dist/client/adapters/reactRendering.d.ts +0 -7
  326. package/dist/client/adapters/reactRendering.d.ts.map +0 -1
  327. package/dist/client/adapters/reactRendering.js +0 -4
  328. package/dist/client/adapters/reactRendering.js.map +0 -1
  329. package/dist/client/adapters/waitForReact.d.ts +0 -2
  330. package/dist/client/adapters/waitForReact.d.ts.map +0 -1
  331. package/dist/client/adapters/waitForReact.js +0 -8
  332. package/dist/client/adapters/waitForReact.js.map +0 -1
  333. package/dist/client/react.d.ts.map +0 -1
  334. package/dist/client/react.js.map +0 -1
  335. package/dist/server/domEnvironment.config.d.ts.map +0 -1
  336. package/dist/server/domEnvironment.config.js.map +0 -1
  337. package/dist/server/internal/installOutbound.d.ts.map +0 -1
  338. package/dist/server/internal/installOutbound.js.map +0 -1
  339. package/dist/server/internal/nextClientHint.d.ts +0 -4
  340. package/dist/server/internal/nextClientHint.d.ts.map +0 -1
  341. package/dist/server/internal/nextClientHint.js +0 -7
  342. package/dist/server/internal/nextClientHint.js.map +0 -1
  343. package/dist/server/internal/screenAccessibility.d.ts.map +0 -1
  344. package/dist/server/internal/screenAccessibility.js.map +0 -1
  345. package/dist/server/memberScreens.d.ts.map +0 -1
  346. package/dist/server/memberScreens.js.map +0 -1
  347. package/dist/server/seedCookies.d.ts.map +0 -1
  348. package/dist/server/seedCookies.js.map +0 -1
  349. package/src/client/adapters/reactRendering.ts +0 -5
  350. package/src/client/adapters/waitForReact.ts +0 -7
  351. package/src/server/internal/nextClientHint.ts +0 -12
  352. /package/dist/server/{internal → adapters}/documentRedirect.d.ts +0 -0
  353. /package/dist/server/{internal → adapters}/documentRedirect.js +0 -0
  354. /package/dist/server/{internal → adapters}/documentRequest.d.ts +0 -0
  355. /package/dist/server/{internal → adapters}/documentRequest.js +0 -0
  356. /package/dist/server/{internal → adapters}/documentResponse.d.ts +0 -0
  357. /package/dist/server/{internal → adapters}/documentResponse.js +0 -0
  358. /package/dist/server/{internal → adapters}/documentTransport.d.ts +0 -0
  359. /package/dist/server/{domEnvironment.config.d.ts → adapters/domEnvironment.config.d.ts} +0 -0
  360. /package/dist/server/{internal → adapters}/installOutbound.d.ts +0 -0
  361. /package/dist/server/{internal → adapters}/screenLoading.d.ts +0 -0
  362. /package/dist/server/{seedCookies.d.ts → adapters/seedCookies.d.ts} +0 -0
  363. /package/dist/server/{seedCookies.js → adapters/seedCookies.js} +0 -0
  364. /package/src/server/{internal → adapters}/documentRedirect.ts +0 -0
  365. /package/src/server/{internal → adapters}/documentRequest.ts +0 -0
  366. /package/src/server/{internal → adapters}/documentResponse.ts +0 -0
  367. /package/src/server/{seedCookies.ts → adapters/seedCookies.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.35.0 - 2026-11-03
4
+
5
+ ### Added
6
+
7
+ - `server/captureOutcome.ts` provides `captureOutcome` for Effects and `renderOutcome` for Exits, with package-owned renderers for success, expected failure, defect and interruption.
8
+ - OTLP receiver errors include `service` from the export resource's `service.name`, or `undefined` when absent.
9
+ - Screen drivers narrate and perform focus, blur, key presses with modifiers, and pointer/mouse hover through the renderer's act adapter. The selection readout returns a native select's chosen value and its option values and labels. All verbs use the existing target lookup and fail for missing controls.
10
+ - Screen drivers accept a ScreenSignal projection of ClientActivity in `activity` and a completion signal in `transport`, waiting for these and application `pending` work to finish together.
11
+ - `mountApp({ create, render })` acquires each story's application, React root and atom registry in Scope without resetting modules.
12
+ - Stage `after` hooks can return a native Effect Context to provide services to later stages and the story body, including application startup and scoped teardown.
13
+
14
+ ### Fixed
15
+
16
+ - `exportsSecret` also detects URL-encoded and form-encoded secrets in received exports.
17
+ - Screen verbs refuse targets detached from the document, including retained scopes after a React rerender, and name the detached target in the failure.
18
+ - Preserve the story failure report when writing a large engine snapshot fails, and include the filesystem error in the snapshot section.
19
+ - Quote rerun command paths and test names for the shell while preserving literal test-name matching.
20
+
21
+ ### Breaking
22
+
23
+ - Screen drivers accept the generic `ScreenSignal` from `server/screenSignal.ts` instead of contract activity directly. Replace `pending: clientActivity(client)` with `pending: activityScreenSignal(clientActivity(client))`; boolean pending streams and callbacks are unchanged. Screen signal states contain `pending: boolean` and a monotonic `hints: number`.
24
+ - Move the React rendering and warning helpers to `@shivaedev/test-story/client/adapters/react.ts`. Replace imports from `@shivaedev/test-story/client/react.ts` with this path.
25
+ - Move the DOM environment, member screens and cookie setup into server adapters. Replace `@shivaedev/test-story/server/domEnvironment.config.ts`, `@shivaedev/test-story/server/memberScreens.ts` and `@shivaedev/test-story/server/seedCookies.ts` with the corresponding `@shivaedev/test-story/server/adapters/` paths, including Vitest environment configuration. Story actions and expectations stay the same.
26
+ - Remove `eventually` from `@shivaedev/test-story/client/react.ts`. Move story waits into kit verbs that await engine completion signals. For React results, supply the application's pending stream to `screenDriver`, await `settle()`, then assert on its readouts.
27
+
28
+ ## 0.34.0 - 2026-11-02
29
+
30
+ ### Added
31
+
32
+ - Fake HTTP services expose replaying `received` and `completed` Effect streams so stories can wait independently for each request's arrival and response completion, separately from abandonment.
33
+ - Add scoped HTTP visitors with separate cookie jars and forwarding proxies. Stories can model a public HTTPS origin, retain app cookies, and present foreign Origin and forged forwarding headers over real HTTP.
34
+ - Read labelled element text with `labelledText(label)` and native table rows with `table(label)` in screen drivers.
35
+ - Scope a screen driver to a portal with `dialog(target)`. Member screens find body portals linked by their triggers' `aria-controls` while keeping other members' dialogs out of reach.
36
+
37
+ ### Fixed
38
+
39
+ - Keep member screen dialog queries inside the member's root, including when the driver uses a child mount. Mount member portals inside `member.root` so their controls remain accessible to that member. Standalone screen drivers continue to find document portals.
40
+ - Compose outbound routes acquired in separate scopes. Each scope removes only its own registrations; the newest active route for a shared hostname wins, and closing it restores the earlier route.
41
+ - Subscription opening waits settle when a stream completes without a value, dies or disconnects, preserving answered subscriptions and tagged refusals.
42
+
43
+ ### Breaking
44
+
45
+ - Held route replies and scripted status reply functions now compute at request arrival, before waiting for release. Move state changes that should affect the reply before sending the request, or use an immediate `fault` to replace a waiting reply at injection time.
46
+ - `screenDriver` with client activity now exposes `SignalNotReceived` from `nextLiveHint()` when the activity stream ends without a new hint. Handle this typed error from `@shivaedev/test-story/server/until.ts` instead of assuming the wait always succeeds. Subscription readouts include a `closed` state for streams that terminate before answering; consumers matching subscription states must handle `closed`.
47
+
3
48
  ## 0.33.0 - 2026-11-02
4
49
 
5
50
  ### Added
package/README.md CHANGED
@@ -38,7 +38,7 @@ The bakery when the test failed:
38
38
  {"bowls":1,"capacity":3,"dough":0,"flour":0,"loaves":1,"minute":1,"orders":[],"ovenLit":true,"overfired":false,
39
39
  "smoking":false,"starter":false}
40
40
 
41
- Rerun: vitest run src/test-support/failingStories.ts -t "Bakery Story: marks where an assertion stopped the story"
41
+ Rerun: vitest run 'src/test-support/failingStories.ts' -t 'Bakery Story: marks where an assertion stopped the story'
42
42
  ```
43
43
 
44
44
  The first line is the assertion's own message. The box under it tells a reader who has never seen the package how to read what follows. Then comes the story: the two traits the test named, the line the bakery told as it baked, and a `✗` where the test stopped, with the spec line it stopped at. Last come the bakery's whole state at that moment and the command that reruns the test, so the failure alone is enough to find the cause.
@@ -140,7 +140,7 @@ This is the bakery kit this package tests itself with. `emptyBakery`, `stillWait
140
140
  | `create()` | A fresh engine. Every story starts from a new one. |
141
141
  | `layer` | Optional. The worker Effect layer that provides the services hooks, traits and test bodies use. Per-test Scope is already available to creation, staged and run hooks, traits and bodies. A hook that needs a service the layer does not provide does not compile, and neither does a test whose traits or body need one. |
142
142
  | `stages` | The order traits are applied in. A trait names its stage, and one that names a stage the kit does not declare does not compile. |
143
- | `after` | Optional. A hook per stage that runs once that stage's traits are applied, even when no trait names the stage, so a value it derives is ready before a later stage reads it. Its typed failure fails the test. |
143
+ | `after` | Optional. A hook per stage that runs once that stage's traits are applied, even when no trait names the stage, so a value it derives is ready before a later stage reads it. A returned native Effect Context provides services to later stages and the body. Its typed failure fails the test. |
144
144
  | `run` | Optional. What `story.runUntil` needs: `step(engine, tell)` advances the engine once and tells what happened, `maxSteps` caps one run, `failed(engine)` returns a sentence when the engine is in a state it cannot recover from, and `diagnose(engine)` says why it has not finished. |
145
145
  | `inspect` | Optional. The part of the engine a failure prints. Without it, the failure prints the whole engine. |
146
146
  | `verbs(engine, story)` | One action or one observation per verb. A verb that waits for a stepped engine returns the Effect from `story.runUntil`; the spec reads observations and asserts separately. |
@@ -208,7 +208,9 @@ const app = storyKit({
208
208
 
209
209
  `routeOutbound(routes)` from `@shivaedev/test-story/server/routeOutbound.ts` installs the same routing in the current Effect Scope. Acquire a `fakeHttpService` in `create`, then yield `routeOutbound({ "api.example.com": api.url })` so the fake listener and its routing belong to that story. Pass `{ passthrough: true }` as its second argument to allow unrouted Node fetch requests.
210
210
 
211
- Routing uses the global dispatcher that Node's built-in `fetch` already uses. The kit's `outbound` option installs routing before `around`, creation, traits and the body, stays active during scoped cleanup, and restores the previous dispatcher after each story, including a failing story. Stories within one worker must run one at a time because that dispatcher is shared; parallelism belongs between workers or inside one story. The DOM environment uses the same routing for host-side Node fetch and document requests, including redirect destinations. It refuses external hosts even when the kit omits `outbound`.
211
+ Separate registrations compose: every active registration's hosts remain reachable. If registrations name the same host, the newest active registration wins. Closing a scope removes only its registrations, revealing any earlier route for that host. Unrouted external hosts remain refused while any active registration requires strict routing.
212
+
213
+ Routing uses the global dispatcher that Node's built-in `fetch` already uses. The kit's `outbound` option installs routing before `around`, creation, traits and the body, stays active during scoped cleanup, and removes its registrations after each story, including a failing story. The original dispatcher is restored when the last registration closes. Stories within one worker must run one at a time because that dispatcher is shared; parallelism belongs between workers or inside one story. The DOM environment uses the same routing for host-side Node fetch and document requests, including redirect destinations. It refuses external hosts even when the kit omits `outbound`.
212
214
 
213
215
  #### Asserting on application traces
214
216
 
@@ -372,11 +374,11 @@ app.it("exports a leaked credential and omits a redacted credential", [], functi
372
374
 
373
375
  Here `app` is the application's kit. `tracesSecret` performs one traced action, and the kit exposes the receiver's readouts through its own domain verbs. Readouts return values and the spec states expectations:
374
376
 
375
- | Readout | Returns |
376
- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
377
- | `receiver.exportsSecret(value)` | Whether the value occurs in any received export body. It searches raw bytes and decoded JSON keys and values, including escaped strings and fields outside the decoded spans. Transport headers are excluded. |
378
- | `receiver.queries()` | SQL text from `db.query.text` or the older `db.statement` attribute, in received span order. Repeated queries remain repeated. |
379
- | `receiver.errors()` | Exception events as `{ operation, message, type }`, where operation is the span name and type is the optional exception type. A failed span without an exception event contributes its status message (or span name), with no type. Status and exception representations of the same failure produce one entry. |
377
+ | Readout | Returns |
378
+ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
379
+ | `receiver.exportsSecret(value)` | Whether the value occurs in any received export body. It searches raw bytes and decoded JSON keys and values, including escaped strings and fields outside the decoded spans. It also matches URL-encoded and form-encoded values. Transport headers are excluded. |
380
+ | `receiver.queries()` | SQL text from `db.query.text` or the older `db.statement` attribute, in received span order. Repeated queries remain repeated. |
381
+ | `receiver.errors()` | Exception events as `{ operation, message, service, type }`, where operation is the span name, service is the resource `service.name` (undefined when absent), and type is the optional exception type. A failed span without an exception event contributes its status message (or span name), with no type. Status and exception representations of the same failure produce one entry. |
380
382
 
381
383
  The receiver accepts OTLP/HTTP JSON and protobuf. `spans` flattens all exports into decoded trace and span IDs, parent span IDs, names, numeric OTLP kinds and status codes, attributes, events and links. Attributes retain OTLP key/value objects, including lossless decimal strings for integers; each span also has `resourceAttributes`. `requests` retains every request's unmodified `body` Buffer, parsed `headers`, original `rawHeaders` pairs and `path`. Optional `path`, `status` (a number or attempt callback) and `answer` configure collector responses for failure stories.
382
384
 
@@ -414,7 +416,7 @@ yield* paused.release;
414
416
  const user = yield* Fiber.join(pending);
415
417
  ```
416
418
 
417
- `application.loadUser` is the application's real client call. `scriptFault` affects the next authorized matching request to that named route, then the route answers normally. `hold` pauses that route until `release`; `waiting` completes when a request reaches the hold, so a story needs no polling to know when to release it. Other routes still answer. Use a live-clock kit for HTTP stories that need real-time waits; a TestClock kit can still drive the real HTTP client while controlling the fake’s reply time.
419
+ `application.loadUser` is the application's real client call. `scriptFault` affects the next authorized matching request to that named route, then the route answers normally. `hold` pauses delivery until `release`; the route's reply handler runs when the request arrives, so a held reply sees the request and state at arrival. `waiting` completes when the first request reaches the hold. For several arrivals, observe `received` as described under [waiting for a signal](#waiting-for-a-signal). Other routes still answer. Use a live-clock kit for HTTP stories that need real-time waits; a TestClock kit can still drive the real HTTP client while controlling the fake’s reply time.
418
420
 
419
421
  Use the controls through kit verbs after acquiring the service. `scriptFault(route, { kind: "status", reply })` scripts the next authorized reply, including raw bytes or `chunks`, a synchronous or asynchronous iterable of strings and byte arrays. Set `headers["content-type"]` to the story's media type; the default is JSON. Chunks are written in iteration order as they become available, so an async iterable can wait between pieces.
420
422
 
@@ -441,7 +443,7 @@ const bytes = yield* Fiber.join(pending);
441
443
 
442
444
  Use `scriptFault(route, fault, options)` to install a fault for future authorized matching requests. It returns a control with a narrated `lift` effect. The default strikes once before the route's reply runs; `{ repeat: true }` keeps it installed until lifted. Status faults can repeat too.
443
445
 
444
- A status fault’s `reply` can be a fixed `FakeHttpReply` or a function `(request, now) => FakeHttpReply`. The fake evaluates the function when it answers, using the request being answered (including a held request for `fault`) and milliseconds from the Effect `Clock` captured when the service was created. A repeating fault rebuilds its reply for every request. TestClock stories therefore get deterministic refusal times:
446
+ A status fault’s `reply` can be a fixed `FakeHttpReply` or a function `(request, now) => FakeHttpReply`. A scripted function runs at arrival, before any hold, using the arriving request and milliseconds from the Effect `Clock` captured when the service was created. A repeating fault rebuilds its reply for every request. An immediate `fault` evaluates its function when injected, using the waiting request and the clock at injection. TestClock stories therefore get deterministic refusal times:
445
447
 
446
448
  ```ts
447
449
  yield* api.scriptFault("user", {
@@ -525,7 +527,7 @@ The bakery when the test failed:
525
527
  {"bowls":1,"capacity":3,"dough":0,"flour":0,"loaves":0,"minute":0,"orders":[],"ovenLit":true,"overfired":false,
526
528
  "smoking":false,"starter":false}
527
529
 
528
- Rerun: vitest run src/test-support/failingStories.ts -t "Bakery Story: marks the trait that refused"
530
+ Rerun: vitest run 'src/test-support/failingStories.ts' -t 'Bakery Story: marks the trait that refused'
529
531
  ```
530
532
 
531
533
  The first line names the trait and what it threw, which the error also keeps as its `cause`, and the `help:` line says what to change. The `✗` marks the trait that refused, and the line under it points at the spec line that named it. A trait that fails with a string, a plain object or a tagged error prints by its content, never as `[object Object]`, and an interrupted trait stays interrupted.
@@ -552,6 +554,10 @@ bakery.it("tells each step into the story", [ovenIsLit()], function* ({ baker, o
552
554
 
553
555
  A spec starts a story, acts through verbs and checks what a user would see. When it needs a setup or an action the kit lacks, add a trait or verb to the kit instead of building it in the spec.
554
556
 
557
+ Use `captureOutcome` from `@shivaedev/test-story/server/captureOutcome.ts` to turn an Effect's outcome into your kit's domain words. Supply `onSuccess(value)`, `onFailure(error)`, `onDefect(defect, cause)` and `onInterrupt()` renderers. Return the value unchanged from `onSuccess` to keep it. `renderOutcome(exit, renderers)` applies the same renderers to an existing native Exit. Expected failures take precedence over defects in a combined Cause; defects take precedence over interruption. Pure interruption calls `onInterrupt`. Capture returns an Effect with no expected error channel and retains the original service requirements.
558
+
559
+ The general `answered`, `answerOf`, `causeWords`, `resultOf`, `errorWords`, `decodedErrorWords`, `words` and `countWords` helpers live in `@shivaedev/test-story/server/answers.ts`. A kit with its own vocabulary supplies its renderers to `captureOutcome` instead.
560
+
555
561
  For several outcomes after one action, use `outcomes` from `@shivaedev/test-story/server/outcomes.ts`. Each row is `[label, () => readout(), expected]`. The list states the run order, independently of alphabetical key sorting:
556
562
 
557
563
  ```ts
@@ -677,7 +683,7 @@ Outside a story kit, `yield* watchedClock` instruments the active native TestClo
677
683
 
678
684
  ### Running the engine
679
685
 
680
- Hooks and steps that wait for real workers can use `withLive(Effect.sleep(...))` or `withLive(eventually(...))` from `@shivaedev/test/withLive.ts` and `@shivaedev/test/eventually.ts`. Both work under the kit's live clock and a story's TestClock override. The wrapped work uses live time without advancing the story's virtual time; outside it, the selected clock still applies. Unwrapped `eventually` uses the active clock and advances TestClock between attempts.
686
+ Hooks and verbs wait for real workers through the engine's completion signals: take from a queue the worker offers to, await a Deferred it completes, or use [`until`](#waiting-for-a-signal) on its observable stream. Keep these waits in the kit under domain names. A deadline bounds a failed wait; it never proves completion. For React stories, pass the application's pending signal to a [screen driver](#driving-a-screen), await `settle()` after an action, then read the screen and assert in the spec.
681
687
 
682
688
  `story.runUntil(condition, { maxSteps })` returns an Effect that asks three questions before every step:
683
689
  1. `run.failed` returns a sentence: it dies with it, even when the condition also holds.
@@ -740,7 +746,34 @@ const completed = yield* receiver.untilSpan(
740
746
  );
741
747
  ```
742
748
 
743
- `fakeHttpService` offers `untilAbandoned(matches, options)`. It returns the request record when the connection closes before its response finishes, including a held request or a stalled response body. Completed responses do not emit this signal. An unfinished connection closed by a scripted fault also qualifies; the signal observes the connection, not who closed it.
749
+ `fakeHttpService` exposes two Effect streams of `FakeHttpRequestRecord`: `received` emits once the request body is read and path parameters are decoded, before guards and holds; `completed` emits when the server finishes writing the response, including its body. Receipt includes guard rejections, unmatched routes and malformed path parameters. A held request has arrived without completing; a stalled body has sent headers without completing. Each record's `status` reflects its current state, just like `requests`.
750
+
751
+ ```ts
752
+ const arrived = yield* until(
753
+ service.received,
754
+ (request) => request.path === "/orders/42",
755
+ { name: "order request received" },
756
+ );
757
+ const completed = yield* until(
758
+ service.completed,
759
+ (request) => request.path === "/orders/42",
760
+ { name: "order response completed" },
761
+ );
762
+ ```
763
+
764
+ Import `until` and `collectUntil` from `@shivaedev/test-story/server/until.ts`. To wait for several new arrivals to the same path, drop the already recorded requests before filtering and collecting. Capture this stream before starting the requests:
765
+
766
+ ```ts
767
+ const arrivals = service.received.pipe(
768
+ Stream.drop(service.requests.length),
769
+ Stream.filter((request) => request.path === "/orders/42"),
770
+ );
771
+ yield* collectUntil(arrivals, (requests) => requests.length === 3, { name: "three order requests received" });
772
+ ```
773
+
774
+ Both streams replay observations from acquisition to each subscriber independently. A wait can therefore start before or after arrival or completion; observing one request does not consume another observer's signal. Use different predicates to wait for individual requests, or drop earlier observations as above when requests share a path. These waits use `until`'s live-time deadline and `SignalNotReceived` diagnostics.
775
+
776
+ `untilAbandoned(matches, options)` returns the request record when the connection closes before its response finishes, including a held request or a stalled response body. Completed responses do not emit this signal, and abandoned responses do not emit `completed`. An unfinished connection closed by a scripted fault also qualifies; the signal observes the connection, not who closed it.
744
777
 
745
778
  ```ts
746
779
  const abandoned = yield* service.untilAbandoned(
@@ -757,7 +790,7 @@ After the engine has been created, a failing story test adds the story to its fi
757
790
  - a short guide to reading the story, in a box;
758
791
  - every line in order, traits marked `given`;
759
792
  - `✗` after the last line, on the trait that refused, or alone when the test failed before the story told a line, and under it the spec line where the test stopped or that named the refusing trait;
760
- - the engine's state from `inspect` as JSON, broken between its fields to fit 120 columns. State longer than 2,000 characters is written to `node_modules/.cache/test-story/` under the working directory, and the failure names the file;
793
+ - the engine's state from `inspect` as JSON, broken between its fields to fit 120 columns. State longer than 2,000 characters is written to `node_modules/.cache/test-story/` under the working directory, and the failure names the file. If writing fails, the report keeps the story and shows the filesystem error;
761
794
  - the command that reruns the test, with `-t` on a second line when one line would pass 120 columns.
762
795
 
763
796
  The package wraps between words or JSON fields toward 120 columns and prints the story's own lines whole. An indivisible word, field or rerun command component can exceed that width. A passing test adds nothing. A typed failure with no message, such as an `after` hook's `NoBowls`, prints by its tag.
@@ -778,17 +811,19 @@ Set `runIf: hasPostgres` in the kit definition to gate all its stories once, whe
778
811
 
779
812
  The [order feature kit](https://github.com/ShivaeDev/platform/tree/main/packages/react/src/test-support/order-example) is an example: it runs the feature’s services, repository, contracts, JSON serialization and authentication middleware over a loopback HTTP listener with bearer tokens.
780
813
 
781
- For full-app stories, use `around: withIsolatedDatabase` from `@shivaedev/test-sql/server/withIsolatedDatabase.ts` with a PostgreSQL test layer prepared from the application's migrations. Each story gets a database cloned from that template, and HTTP and worker pools commit into the same clone. The clone is dropped after scoped hosts and pools close. The starter's [application kit](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/test-support/application.ts) uses this isolation path.
814
+ For full-app stories that always use the migrated template, use `around: withIsolatedDatabase` from `@shivaedev/test-sql/server/withIsolatedDatabase.ts` with a PostgreSQL test layer prepared from the application's migrations. Each story gets a database cloned from that template, and HTTP and worker pools commit into the same clone. The clone is dropped after scoped hosts and pools close. The starter's [application kit](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/test-support/application.ts) uses this isolation path.
815
+
816
+ When traits choose an empty or migrated starting database, use test-sql's [`storyDatabase`](https://github.com/ShivaeDev/platform/tree/main/packages/test-sql#choose-an-empty-database-per-story-or-trait) controller instead. Return its `acquire` Effect from a database stage's `after` hook, before the stage that starts the application. A Context returned by an `after` hook augments the existing services for later traits, hooks, verbs and the body, replacing services with the same keys. Stage-provided services are inferred for those consumers; creation still requires worker services. Scoped resources retain the Context in which they were acquired and close in reverse acquisition order, so application teardown can query its clone before the clone's connections close.
782
817
 
783
818
  For repository-level tests on a migrated template, `withTestTransaction` from `@shivaedev/test-sql/server/withTestTransaction.ts` provides rollback isolation when all work uses its transaction connection. See the [database test helpers](https://github.com/ShivaeDev/platform/blob/main/packages/test-sql/README.md) for template preparation and both wrappers.
784
819
 
785
- React screen traits acquire roots in Scope and use a fresh native atom registry for each screen. Cleanup unmounts roots before disposing registries and servers. Screen verbs dispatch DOM events and use bounded observations of rendered output. Select a live clock once on an HTTP/DOM kit; keep TestClock for deterministic local stories. `runUntil` is for engines with a meaningful step hook, not HTTP or DOM polling. Creation forms use the same pattern with `useCreate` from `@shivaedev/react/client/create.ts`.
820
+ React screen traits acquire roots in Scope and use a fresh native atom registry for each screen. Cleanup unmounts roots before disposing registries and servers. Screen verbs dispatch DOM events; the screen driver's `settle()` waits on the application's pending signal and flushes React before readouts. Select a live clock once on an HTTP/DOM kit; keep TestClock for deterministic local stories. `runUntil` is for engines with a meaningful step hook. Creation forms use the same pattern with `useCreate` from `@shivaedev/react/client/create.ts`.
786
821
 
787
822
  For cookie sessions, use the DOM host setup below. Native `RpcTest` can exercise handlers in faster local stories, but omits serialization and transport. An `inspect` hook may read engine state through an Effect or generator, using the kit’s layer before the story’s Scope closes.
788
823
 
789
824
  ### DOM stories with cookie sessions
790
825
 
791
- Install `happy-dom` as a dev dependency. Select the `@shivaedev/test-story/server/domEnvironment.config.ts` Vitest environment for DOM tests that start their host in the same process:
826
+ Install `happy-dom` as a dev dependency. Select the `@shivaedev/test-story/server/adapters/domEnvironment.config.ts` Vitest environment for DOM tests that start their host in the same process:
792
827
 
793
828
  ```ts
794
829
  import { fileURLToPath } from "node:url";
@@ -796,7 +831,7 @@ import { defineConfig } from "vitest/config";
796
831
 
797
832
  export default defineConfig({
798
833
  test: {
799
- environment: fileURLToPath(import.meta.resolve("@shivaedev/test-story/server/domEnvironment.config.ts")),
834
+ environment: fileURLToPath(import.meta.resolve("@shivaedev/test-story/server/adapters/domEnvironment.config.ts")),
800
835
  },
801
836
  });
802
837
  ```
@@ -831,11 +866,11 @@ const cookieApp = storyKit({
831
866
 
832
867
  #### Seeding a signed-in precondition
833
868
 
834
- `seedCookies(cookies)` from `@shivaedev/test-story/server/seedCookies.ts` returns an Effect that seeds the current happy-dom window's cookie container, including HttpOnly cookies. Call `domFetch(baseUrl)` first so the document and requests use the same origin. Each cookie has `name` and `value`, with optional `domain`, `path`, `httpOnly`, `secure`, `sameSite` (`Lax`, `Strict` or `None`) and `expires` (Unix seconds). Better Auth's test-utils login cookies fit this shape directly.
869
+ `seedCookies(cookies)` from `@shivaedev/test-story/server/adapters/seedCookies.ts` returns an Effect that seeds the current happy-dom window's cookie container, including HttpOnly cookies. Call `domFetch(baseUrl)` first so the document and requests use the same origin. Each cookie has `name` and `value`, with optional `domain`, `path`, `httpOnly`, `secure`, `sameSite` (`Lax`, `Strict` or `None`) and `expires` (Unix seconds). Better Auth's test-utils login cookies fit this shape directly.
835
870
 
836
871
  ```ts
837
872
  import { signedInUser } from "@shivaedev/identity/server/better-auth/testing.ts";
838
- import { seedCookies } from "@shivaedev/test-story/server/seedCookies.ts";
873
+ import { seedCookies } from "@shivaedev/test-story/server/adapters/seedCookies.ts";
839
874
 
840
875
  const { cookies } = yield* signedInUser(testAuth, {
841
876
  email: "alice@example.test",
@@ -867,7 +902,7 @@ socialApp.it("a social sign-in returns with a cookie session", [], function* ({
867
902
 
868
903
  #### Several members on one host
869
904
 
870
- Use `memberScreens` from `@shivaedev/test-story/server/memberScreens.ts` inside a DOM kit's `create` hook. Supply `baseUrl`, `mount(member)` returning an Effect, and `verbs(member, tell)` returning that member's verbs and readouts. Each `MemberScreen` carries its `name`, `fetch`, `registry` and `root`. Mount the application into that root with that registry, and give its auth and HTTP clients the member's fetch. Cookie contexts are independent even when every member uses the same host.
905
+ Use `memberScreens` from `@shivaedev/test-story/server/adapters/memberScreens.ts` inside a DOM kit's `create` hook. Supply `baseUrl`, `mount(member)` returning an Effect, and `verbs(member, tell)` returning that member's verbs and readouts. Each `MemberScreen` carries its `name`, `fetch`, `registry` and `root`. Mount the application into that root with that registry, and give its auth and HTTP clients the member's fetch. Cookie contexts are independent even when every member uses the same host. Each member's screen driver finds dialogs inside that member's root and body portals linked by an element in that root through `aria-controls`. Give body portals unique IDs and point each member's trigger at its own dialog. Unlinked body dialogs remain outside member screens; standalone drivers can find document-wide portals.
871
906
 
872
907
  A trait calls `yield* members.open("ada", cookies)` with a minted session's cookies. The kit's verbs hook returns `members.verbs(story.tell)`, exposing `as("ada")` to the spec. Member narration includes the name. The calling Scope closes every cookie context, disposes every registry and removes every root. Register renderer unmounting in the mount hook with `Effect.acquireRelease` so it runs before the registry and root are released.
873
908
 
@@ -885,7 +920,7 @@ sharedLists.it("grace sees ada's addition", [signedInMembers("ada", "grace")], f
885
920
 
886
921
  ### Rendering React components
887
922
 
888
- Use `render`, `eventually`, `captureReactWarnings` and `expectNoReactWarnings` from `@shivaedev/test-story/client/react.ts` in happy-dom tests. Install the optional peers when using this module:
923
+ Use `render`, `captureReactWarnings` and `expectNoReactWarnings` from `@shivaedev/test-story/client/adapters/react.ts` in happy-dom tests. Wait for engine signals and use the [screen driver's `settle()`](#driving-a-screen) before asserting rendered results. Install the optional peers when using this module:
889
924
 
890
925
  ```sh
891
926
  pnpm add --save-dev react react-dom @effect/atom-react @types/react @types/react-dom happy-dom
@@ -893,18 +928,31 @@ pnpm add --save-dev react react-dom @effect/atom-react @types/react @types/react
893
928
 
894
929
  `render(node, options?)` attaches a React root with its own native atom registry. Its `render(nextNode)` keeps that registry; `unmount()` disposes the root, registry and container. Acquire it with `Effect.acquireRelease` in a story kit so the scope releases it. `captureReactWarnings` acquires a scoped readout of console warnings and caught React errors; `expectNoReactWarnings()` registers a Vitest guard instead. The [React render testing guide](https://github.com/ShivaeDev/platform/tree/main/packages/react#render-tests-in-happy-dom) shows the helpers with a native RPC component and explains the act wait and error declarations.
895
930
 
931
+ ### Mounting a fresh app
932
+
933
+ Acquire `mountApp({ create, render })` from `@shivaedev/test-story/server/mountApp.ts` in a DOM kit's `create` hook. Each acquisition runs the application's `create` Effect and mounts its React node with a fresh atom registry and root. The result exposes `app`, `container`, `registry`, `render` and `unmount`. Scope unmounts the view before releasing resources acquired by `create`. Put clients and mutable application state in that Effect; imports can stay at module level without `vi.resetModules()`.
934
+
935
+ ```ts
936
+ const view = yield* mountApp({
937
+ create: Effect.sync(() => makeNotesApp(host.url)),
938
+ render: (app) => createElement(NotesApp, { app }),
939
+ });
940
+ ```
941
+
942
+ Stories can edit and save through this view while the next story starts with its own client, query cache and inputs. `mountApp` does not reset state that an application keeps outside its factory.
943
+
896
944
  ### Driving a screen
897
945
 
898
946
  Acquire `domPage(url)` from `@shivaedev/test-story/server/domPage.ts` in the DOM kit's `create` hook before mounting a page that calls global `fetch`. While its Scope is open, string URLs resolve against the window's current address, including after navigation. Native `URL` and `Request` inputs and fetch options pass through to the existing Node transport. Closing the Scope restores global fetch and the previous page address; outside it, relative global fetch URLs keep Node's behavior. This helper uses the single shared window, so acquire and close pages serially.
899
947
 
900
948
  ```ts
901
949
  const page = yield* domPage(`${host.url}/notes`);
902
- const driver = screenDriver({ act, pending: page.pending, root: view.container, tell: story.tell });
950
+ const driver = screenDriver({ act, transport: page.pending, root: view.container, tell: story.tell });
903
951
  ```
904
952
 
905
- Pass the page's native `pending` stream to the screen driver to wait for global fetches to resolve or reject, including requests sent by `useBrowserErrors`. After a page action, `yield* driver.settle()` waits for every outstanding fetch without sleeping. This counts fetch completion at response headers, not consumption of a streaming response body, and does not supply the document cookie jar; keep using `domFetch` for clients that need that document transport.
953
+ Pass the page's native `pending` stream as the driver's `transport` option to wait for global fetches to resolve or reject, including requests sent by `useBrowserErrors`. After a page action, `yield* driver.settle()` waits for every outstanding fetch without sleeping. This counts fetch completion at response headers, not consumption of a streaming response body, and does not supply the document cookie jar; keep using `domFetch` for clients that need that document transport.
906
954
 
907
- `screenDriver(options)` supplies DOM verbs and readouts for a kit's `verbs` hook. Give it the mounted `root` (or a getter for a root that navigation replaces) and the story's `tell`. The `pending` option is required for `settle()`; `nextLiveHint()` requires client activity in that option. DOM actions, lookups and synchronous readouts work without it. Without `pending`, `settle()` fails immediately in its error channel with `MissingScreenPending`, exported from `server/screenDriver.ts`, even when the screen is idle.
955
+ `screenDriver(options)` supplies DOM verbs and readouts for a kit's `verbs` hook. Give it the mounted `root` (or a getter for a root that navigation replaces) and the story's `tell`. Supply at least one of `pending`, `activity` or `transport` for `settle()`. `nextLiveHint()` needs `activity` or a `ScreenSignal` in `pending`. DOM actions, lookups and synchronous readouts work without these signals. Without any completion signal, `settle()` fails immediately in its error channel with `MissingScreenPending`, exported from `server/screenDriver.ts`, even when the screen is idle.
908
956
 
909
957
  To use `settle()`, supply a native `Stream<boolean>` as `pending`, emitting the current pending state on subscription and every subsequent change. For example, a package that tracks work in a native `SubscriptionRef<boolean>` supplies `pending: SubscriptionRef.changes(requests.pending)`. For a native boolean atom, use `AtomRegistry.toStream(view.registry, pendingAtom)` from `effect/reactivity/AtomRegistry`. Keep pending true until the resulting screen work is ready to render. Settlement keeps its `Effect<void>` type with no typed errors and waits until the stream emits false; DOM mutations also wake the driver, and repeated identical renders never count as completion. `find()` waits for pending work to finish and its target to appear, reacting to both signals and mutations.
910
958
 
@@ -922,26 +970,45 @@ verbs: ({ view, requests }, story) =>
922
970
  });
923
971
  ```
924
972
 
925
- For a real contract client, use its activity instead of maintaining request counters or reading loading markup:
973
+ A `ScreenSignal` from `server/screenSignal.ts` is a native `Stream<ScreenSignalState>` with a `current` Effect. Each state reports `pending` until screen work is ready to render and a monotonic `hints` count for received updates. Any engine can supply this shape; waits observe it without knowing which engine produced it.
974
+
975
+ For a real contract client, project its native activity with `activityScreenSignal`. Combine it with application work and transport requests when a screen uses all three:
926
976
 
927
977
  ```ts
928
- import { clientActivity } from "@shivaedev/contract/clientActivity.ts";
978
+ import { activityScreenSignal, clientActivity } from "@shivaedev/contract/clientActivity.ts";
929
979
  import { screenDriver } from "@shivaedev/test-story/server/screenDriver.ts";
930
980
 
931
- const screen = screenDriver({ act, pending: clientActivity(client), root, tell });
981
+ const screen = screenDriver({
982
+ act,
983
+ activity: activityScreenSignal(clientActivity(client)),
984
+ pending: SubscriptionRef.changes(app.pending),
985
+ transport: page.pending,
986
+ root,
987
+ tell,
988
+ });
932
989
  yield* screen.click({ role: "button", name: "Save" });
933
990
  yield* screen.settle();
934
991
  expect(screen.text("output")).toBe("Saved title");
935
992
  ```
936
993
 
937
- This form of `settle()` observes client activity changes and flushes the renderer before returning. Finite RPC calls, coalesced invalidations and refreshing query atoms all keep it waiting; subscription streams themselves do not. `find()` waits for idle client activity and a matching target, including a target rendered by a later DOM mutation. Keep live coalescing enabled. `nextLiveHint()` waits for the next subscription update received after the verb starts, including initial or resync updates; it does not wait for a refresh. Start the wait before another viewer writes, then settle before reading the resulting screen. It needs client activity; a callback-only driver fails with `MissingClientActivity`.
994
+ `settle()` waits until every supplied source is idle together, then flushes the renderer before returning. A source that becomes busy while another finishes keeps the wait open. `pending` and `transport` each accept the same sampler, boolean stream or `ScreenSignal` shape; `activity` accepts a `ScreenSignal`; contract owns the projection from native `ClientActivity`. It observes changes from all three without sleeps, quiet windows or polling. Finite RPC calls, coalesced invalidations and refreshing query atoms all keep it waiting; subscription streams themselves do not. `find()` waits for idle client activity and a matching target, including a target rendered by a later DOM mutation. Keep live coalescing enabled. `nextLiveHint()` waits for the next subscription update received after the verb starts, including initial or resync updates; it does not wait for a refresh. Start the wait before another viewer writes, then settle before reading the resulting screen. If the client activity stream ends without a new hint, the wait fails with `SignalNotReceived` from `server/until.ts`. It needs `activity` or a `ScreenSignal` in `pending`; a callback-only driver fails with `MissingClientActivity`. Existing `pending: activityScreenSignal(clientActivity(client))` wiring remains supported.
995
+
996
+ `click(selector)`, `enter(selector, value)`, `select(selector, value)`, `focus(selector)`, `blur(selector)`, `pressKey(selector, key, options?)`, `hover(selector)` and `submit(selector = "form")` return Effects. Selectors identify exactly one descendant of the root or a dialog portalled into its document (owned by that member for `memberScreens`); missing or ambiguous controls fail. Hidden targets and targets inside hidden ancestors refuse actions and readouts. Text entry focuses an input or textarea and dispatches input and change events. Select focuses a native `<select>`, sets an available option value and dispatches change inside `act`. Disabled controls refuse clicks, entry and selection, inert ancestors also prevent form submission, and read-only fields refuse entry. Actions do not wait for settlement, so a story can release a held request before calling `settle()`.
938
997
 
939
- `click(selector)`, `enter(selector, value)`, `select(selector, value)` and `submit(selector = "form")` return Effects. Selectors identify exactly one descendant of the root or a dialog portalled into its document; missing or ambiguous controls fail. Hidden targets and targets inside hidden ancestors refuse actions and readouts. Text entry focuses an input or textarea and dispatches input and change events. Select focuses a native `<select>`, sets an available option value and dispatches change inside `act`. Disabled controls refuse clicks, entry and selection, inert ancestors also prevent form submission, and read-only fields refuse entry. Actions do not wait for settlement, so a story can release a held request before calling `settle()`.
998
+ `focus` and `blur` move native focus, including React focus and blur handlers when `act` is supplied. `pressKey` dispatches bubbling, cancelable keydown and keyup events to the target; pass `KeyboardEventInit` options such as `{ ctrlKey: true }` for modifiers. It does not synthesize text entry or browser default actions. `hover` dispatches pointer and mouse over, enter and move events, including React hover handlers. Each action narrates its target and accepts a role/name target such as `{ role: "textbox", name: "Name" }`.
999
+
1000
+ `selection(selector)` synchronously reads a native select as `{ value, options: [{ value, label }] }` and narrates the readout. Option labels use a nonempty `label` attribute, otherwise their text. A non-select target fails.
940
1001
 
941
1002
  `within(container)` returns the same driver scoped to that container, including nested `within` calls. Pass a selector, a role/name target or an `HTMLElement`. Selector and role containers must resolve to one rendered descendant and use the usual missing or ambiguous target diagnostics. For example, `within({ role: "region", name: "Billing" }).click({ role: "button", name: "Save" })` can address a Save button when Delivery has an identical button. A scoped driver searches only that container, including when the container is a portalled dialog. Settlement keeps the original pending signal and error type.
942
1003
 
1004
+ `dialog(target)` searches under `body` for exactly one visible native dialog, `role="dialog"` or `role="alertdialog"` matching a selector or role/name target, then returns a driver scoped to it. It keeps the original driver’s member ownership, renderer and pending signal, including through nested scopes. For example, `screen.dialog({ role: "dialog", name: "Preferences" }).click({ role: "button", name: "Confirm" })` acts only inside that screen's Preferences dialog, even when another member has an identically named body portal. The member's trigger must link a body portal through `aria-controls`.
1005
+
943
1006
  `text(selector?)` reads visible HTML text from the selected element or the whole root. Block boundaries (using CSS display) and `<br>` separate adjacent text with a newline when there is no existing whitespace; inline text, including emphasis, stays joined. A card's title, message and action read as separate parts. Text transforms and layout wrapping are not applied. `value(selector)` returns the current input or textarea value. Both narrate what they read through `tell` and leave assertions to the spec. Entry narration omits the supplied value.
944
1007
 
1008
+ `labelledText(label)` reads visible text from one element named by `aria-label`, `aria-labelledby` or a native form label. It accepts an exact string or a regular expression and fails for missing, hidden or ambiguous readouts. For example, `labelledText("Summary")` reads a labelled region without needing its role or CSS selector.
1009
+
1010
+ `table(label)` finds a native HTML table by its accessible name, including a heading referenced through `aria-labelledby`, and returns an array of rows, each an array of visible cell text. Header and body rows retain DOM order; hidden rows, cells and nested hidden text are excluded. For example, `table("Ready deliveries")` returns `[["City", "Status"], ["London", "Ready"], ["Paris", "In transit"]]`. Strings match exactly and regular expressions match the table's name. These readouts narrate their results through `tell` and leave assertions to the spec.
1011
+
945
1012
  `click`, `enter`, `select`, `submit`, `text` and `value` also accept a `ScreenTarget` object such as `{ role: "button", name: "Save" }` or `{ role: "textbox", name: /email/i }`. The role and computed accessible name must match exactly when strings are used; regular expressions match the name. An alert without an accessible name can instead match its visible text. Like Testing Library's role queries, these targets exclude hidden elements, including `aria-hidden` ancestors. Missing or ambiguous targets fail with the requested role, name and the visible candidates on screen. Narration names the role and name instead of a selector.
946
1013
 
947
1014
  `find(target, { timeout }?)` returns an Effect that waits for exactly one matching rendered element and returns that `HTMLElement`. It accepts the same selectors and role/name targets as the actions and narrates the lookup. Its normal live-time budget is 3 seconds, configurable with the driver's `timeoutMs`. While the screen shows a rendered, accessible loading indicator (`role="status"`, `aria-busy="true"`, `Loading…` or `Loading...` text) or an open dialog, the default wait extends to a total of 10 seconds, configurable with `loadingTimeoutMs`. This lets screen transitions take longer on loaded runners. The root and portalled dialogs count; `within` keeps loading detection inside its scope. Once the normal budget has passed, an idle screen without the target fails immediately with the usual target diagnostics, including visible candidates for role/name targets. A per-call `timeout` sets a hard deadline in milliseconds, including while loading.
@@ -971,7 +1038,7 @@ const client = makeClient(Notes, { protocol: observed.protocol, url });
971
1038
 
972
1039
  Expose `observed.readCount`, `observed.reads`, `observed.hints` and `observed.watchHints` through the kit's verbs. `readCount()` counts query requests and `$changes` subscription openings; `readCount("notes.list")` selects one tag. `reads()` returns their `tag`, encoded `payload` and `kind` (`"query"` or `"subscription"`), in send order. Commands and protocol acknowledgements do not count. `hints()` returns the `LiveHint` values received for those subscriptions, including `Resync`.
973
1040
 
974
- `observed.subscriptions()` returns each opening's `tag`, encoded `payload` and `state`: `"open"`, `"answered"` after its first streamed value, or `"refused"` with `refusalTag` from its failure Exit. A refusal is not a hint. Expose `observed.waitForSubscriptions` through the kit and `yield* waitForSubscriptions` after the page has opened its subscriptions. It waits on response signals until every opening has answered or been refused. It has no polling budget and resolves immediately when no opening is pending. It does not wait for future navigation to open subscriptions or for React to render.
1041
+ `observed.subscriptions()` returns each opening's `tag`, encoded `payload` and `state`: `"open"`, `"answered"` after its first streamed value, `"refused"` with `refusalTag` from a tagged failure Exit, or `"closed"` when the stream completes empty, dies or disconnects before answering. A refusal or closure is not a hint. Expose `observed.waitForSubscriptions` through the kit and `yield* waitForSubscriptions` after the page has opened its subscriptions. It waits on response signals until every opening has answered, been refused or closed. Closing a client also closes its unanswered openings and leaves other clients' openings pending. It has no polling budget and resolves immediately when no opening is pending. It does not wait for future navigation to open subscriptions or for React to render.
975
1042
 
976
1043
  A story calls `const hints = yield* watchHints()` before the write, then `yield* hints.next` to await its browser delivery. Each watcher buffers its own future deliveries until the calling Scope closes. The wait uses the transport's signal with no polling budget. A hint means the browser received it; wait on the application's query or screen signal separately before asserting its rendered result or refetch count. Give another page its own readout to keep its traffic separate.
977
1044
 
@@ -979,28 +1046,29 @@ A story calls `const hints = yield* watchHints()` before the write, then `yield*
979
1046
 
980
1047
  Import each module with the prefix `@shivaedev/test-story/`; there is no root entry.
981
1048
 
982
- | Module | Exports |
983
- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
984
- | `server/storyKit.ts` | `storyKit`, `Trait`, `RunUntilOptions`, `Story`, `RunHooks`, `StoryKitDefinition`, `Told`, `StoryBody`, `StoryTest`, `StoryIt`, `StoryKit` |
985
- | `server/adapters/outcomeMatchers.ts` | `lessThan(limit)`, `atMost(limit)`, `greaterThan(limit)`, `atLeast(limit)`, `NumericBound` |
986
- | `server/outcomes.ts` | `outcomes(rows)` |
987
- | `server/lineSignals.ts` | `lineSignals(output)` with `lines` and `untilLine(matches, options)` |
988
- | `server/until.ts` | `until(stream, matches, options)`, `collectUntil(stream, matches, options)`, `UntilOptions`, `SignalNotReceived` |
989
- | `server/watchedClock.ts` | `watchedClock`, `WatchedClock`, `untilTimer(interval, options?)`, `passes(interval, then)` |
990
- | `server/browserReads.ts` | `browserReads(options)`, `BrowserReadsOptions`, `BrowserRead`, `BrowserSubscription` |
991
- | `server/domFetch.ts` | `domFetch(baseUrl, target?)` |
992
- | `server/domPage.ts` | `domPage(url)` with a scoped global fetch and a `pending` stream |
993
- | `server/seedCookies.ts` | `seedCookies(cookies, target?)`, `DomCookie` |
994
- | `server/routeOutbound.ts` | `routeOutbound(routes)` |
995
- | `server/screenDriver.ts` | `screenDriver(options)`, `ScreenDriverOptions`, `ScreenDriver`, `ScreenTarget`, `MissingScreenPending` |
996
- | `server/memberScreens.ts` | `memberScreens(options)`, `MemberScreen` |
997
- | `server/domNavigate.ts` | `domNavigate(url?)` |
998
- | `server/genreTags.ts` | `genreTags(...kitNames)`, `GenreTag` |
999
- | `server/domEnvironment.config.ts` | Default Vitest environment preserving Node host globals and happy-dom document transport |
1000
- | `server/fakeHttpService.ts` | `fakeHttpService(options)`, `FakeHttpRoute`, `FakeHttpRequest`, `FakeHttpRequestRecord` (`status`: number, `"pending"` or `"unanswered"`), `FakeHttpReply`, `FakeHttpReplySource` (fixed or request/time function), `FakeHttpFault`, `FakeHttpHold`, `FakeHttpHoldOptions` (`params`, `once`), `FakeHttpScope`, `FakeHttpScriptOptions`, `FakeHttpScript`, `FakeHttpServiceOptions` |
1001
- | `server/httpVisitor.ts` | `httpVisitor(upstream, options?)`, `HttpVisitorOptions`, `VisitorRequest` |
1002
- | `server/forwardingProxy.ts` | `forwardingProxy(upstream, options?)`, `ForwardingProxyOptions` |
1003
- | `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions`, `OtlpTracerOptions` |
1049
+ | Module | Exports |
1050
+ | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1051
+ | `server/storyKit.ts` | `storyKit`, `Trait`, `RunUntilOptions`, `Story`, `RunHooks`, `StoryKitDefinition`, `Told`, `StoryBody`, `StoryTest`, `StoryIt`, `StoryKit` |
1052
+ | `server/adapters/outcomeMatchers.ts` | `lessThan(limit)`, `atMost(limit)`, `greaterThan(limit)`, `atLeast(limit)`, `NumericBound` |
1053
+ | `server/outcomes.ts` | `outcomes(rows)` |
1054
+ | `server/lineSignals.ts` | `lineSignals(output)` with `lines` and `untilLine(matches, options)` |
1055
+ | `server/until.ts` | `until(stream, matches, options)`, `collectUntil(stream, matches, options)`, `UntilOptions`, `SignalNotReceived` |
1056
+ | `server/watchedClock.ts` | `watchedClock`, `WatchedClock`, `untilTimer(interval, options?)`, `passes(interval, then)` |
1057
+ | `server/browserReads.ts` | `browserReads(options)`, `BrowserReadsOptions`, `BrowserRead`, `BrowserSubscription` |
1058
+ | `server/domFetch.ts` | `domFetch(baseUrl, target?)` |
1059
+ | `server/mountApp.ts` | `mountApp({ create, render })` acquires a fresh app and React root in Scope |
1060
+ | `server/domPage.ts` | `domPage(url)` with a scoped global fetch and a `pending` stream |
1061
+ | `server/adapters/seedCookies.ts` | `seedCookies(cookies, target?)`, `DomCookie` |
1062
+ | `server/routeOutbound.ts` | `routeOutbound(routes)` |
1063
+ | `server/screenDriver.ts` | `screenDriver(options)`, `ScreenDriverOptions`, `ScreenDriver`, `ScreenTarget`, `MissingScreenPending` |
1064
+ | `server/adapters/memberScreens.ts` | `memberScreens(options)`, `MemberScreen` |
1065
+ | `server/domNavigate.ts` | `domNavigate(url?)` |
1066
+ | `server/genreTags.ts` | `genreTags(...kitNames)`, `GenreTag` |
1067
+ | `server/adapters/domEnvironment.config.ts` | Default Vitest environment preserving Node host globals and happy-dom document transport |
1068
+ | `server/fakeHttpService.ts` | `fakeHttpService(options)`, `FakeHttpRoute`, `FakeHttpRequest`, `FakeHttpRequestRecord` (`status`: number, `"pending"` or `"unanswered"`), `FakeHttpReply`, `FakeHttpReplySource` (fixed or request/time function), `FakeHttpFault`, `FakeHttpHold`, `FakeHttpHoldOptions` (`params`, `once`), `FakeHttpScope`, `FakeHttpScriptOptions`, `FakeHttpScript`, `FakeHttpServiceOptions` |
1069
+ | `server/httpVisitor.ts` | `httpVisitor(upstream, options?)`, `HttpVisitorOptions`, `VisitorRequest` |
1070
+ | `server/forwardingProxy.ts` | `forwardingProxy(upstream, options?)`, `ForwardingProxyOptions` |
1071
+ | `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions`, `OtlpTracerOptions` |
1004
1072
 
1005
1073
  ### Install and limits
1006
1074
 
@@ -17,7 +17,6 @@ export declare const captureReactWarnings: Effect.Effect<ReactWarnings, never, S
17
17
  export declare function expectNoReactWarnings(): {
18
18
  expectCaughtError(matches: (error: unknown) => boolean): NonNullable<RootOptions["onCaughtError"]>;
19
19
  };
20
- export declare function eventually(assert: () => void): Effect.Effect<void, Error, never>;
21
20
  export interface Rendered {
22
21
  readonly container: HTMLDivElement;
23
22
  readonly registry: AtomRegistry.AtomRegistry;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,YAAY,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,KAAK,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,YAAY,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC;CACxD;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,KAAK,kBAAkB,CAAC;IACzF,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,oBAAoB,CAAC;CAC1C;AAqCD,eAAO,MAAM,oBAAoB,kDAA6D,CAAC;AAE/F,wBAAgB,qBAAqB;IAkBnC,iBAAiB,UAAU,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;EAInG;AACD,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AACD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkCtF"}
@@ -1,12 +1,7 @@
1
- import * as Clock from "effect/Clock";
2
1
  import * as Effect from "effect/Effect";
3
2
  import * as Exit from "effect/Exit";
4
3
  import * as Scope from "effect/Scope";
5
4
  import { beforeEach, expect, vi } from "vitest";
6
- import { eventually as retry } from "@shivaedev/test/eventually.ts";
7
- import { withLive } from "@shivaedev/test/withLive.ts";
8
- import { reactRendering } from "#client/adapters/reactRendering.ts";
9
- import { waitForReact } from "#client/adapters/waitForReact.ts";
10
5
  const acquireReactWarnings = Effect.acquireRelease(Effect.sync(() => {
11
6
  const errors = vi.spyOn(console, "error").mockImplementation(() => undefined);
12
7
  let consoleErrors;
@@ -60,20 +55,13 @@ export function expectNoReactWarnings() {
60
55
  },
61
56
  };
62
57
  }
63
- export function eventually(assert) {
64
- return withLive(Effect.gen(function* () {
65
- const started = yield* Clock.currentTimeMillis;
66
- return yield* retry(Effect.try({ catch: (error) => error, try: assert }), {
67
- timeout: "3 seconds",
68
- wait: Effect.promise(waitForReact),
69
- }).pipe(Effect.catch((error) => Effect.gen(function* () {
70
- const elapsed = (yield* Clock.currentTimeMillis) - started;
71
- return yield* Effect.fail(new Error(`Assertion did not pass after ${elapsed}ms: ${error instanceof Error ? error.message : String(error)}`, { cause: error }));
72
- })));
73
- }));
74
- }
75
58
  export async function render(node, options) {
76
- const [{ RegistryContext }, registryModule, { createRoot }, { act, createElement }] = await reactRendering();
59
+ const [{ RegistryContext }, registryModule, { createRoot }, { act, createElement }] = await Promise.all([
60
+ import("@effect/atom-react"),
61
+ import("effect/reactivity/AtomRegistry"),
62
+ import("react-dom/client"),
63
+ import("react"),
64
+ ]);
77
65
  const registry = registryModule.make();
78
66
  const container = document.createElement("div");
79
67
  document.body.append(container);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/client/adapters/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAehD,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CACjD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;IAChB,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC9E,IAAI,aAA0D,CAAC;IAC/D,MAAM,YAAY,GAAc,EAAE,CAAC;IACnC,MAAM,YAAY,GAA0B,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAkB;QAC9B,iBAAiB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,MAAM,WAAW,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YACtC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/B,OAAO,CAAC,KAAK,EAAE,EAAE;gBAChB,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;oBACpB,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC;gBAC3B,CAAC;qBAAM,CAAC;oBACP,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACF,CAAC,CAAC;QACH,CAAC;QACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YACxB,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;QACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,YAAY,CAAC,EAAE,aAAa,EAAE,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC;KAC7H,CAAC;IACF,OAAO;QACN,OAAO;QACP,YAAY;QACZ,OAAO,EAAE,GAAG,EAAE;YACb,aAAa,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC;YAC7C,MAAM,CAAC,WAAW,EAAE,CAAC;QACtB,CAAC;KACD,CAAC;AACH,CAAC,CAAC,EACF,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;AAE/F,MAAM,UAAU,qBAAqB;IACpC,IAAI,OAAoD,CAAC;IACzD,UAAU,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,oBAAoB,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1F,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;QAC1C,cAAc,CAAC,GAAG,EAAE;YACnB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9C,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;YACvD,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAClC,MAAM,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACnE,MAAM,CACL,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,EAC1C,2CAA2C,CAC3C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACN,iBAAiB,CAAC,OAAoC;YACrD,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;KACD,CAAC;AACH,CAAC;AAOD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe,EAAE,OAAqB;IAClE,MAAM,CAAC,EAAE,eAAe,EAAE,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvG,MAAM,CAAC,oBAAoB,CAAC;QAC5B,MAAM,CAAC,gCAAgC,CAAC;QACxC,MAAM,CAAC,kBAAkB,CAAC;QAC1B,MAAM,CAAC,OAAO,CAAC;KACf,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5C,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,KAAK,UAAU,OAAO;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,OAAO;QACR,CAAC;QACD,OAAO,GAAG,KAAK,CAAC;QAChB,IAAI,CAAC;YACJ,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,CAAC;gBAAS,CAAC;YACV,QAAQ,CAAC,OAAO,EAAE,CAAC;YACnB,SAAS,CAAC,MAAM,EAAE,CAAC;QACpB,CAAC;IACF,CAAC;IACD,KAAK,UAAU,MAAM,CAAC,IAAe;QACpC,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACxG,CAAC;IACD,IAAI,CAAC;QACJ,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,OAAO,EAAE,CAAC;QAChB,MAAM,KAAK,CAAC;IACb,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { type DeeplyAllowMatchers } from "vitest";
3
+ import type { NumericBound } from "./outcomeMatchers.ts";
4
+ type NativeMatcher = Exclude<DeeplyAllowMatchers<number>, number>;
5
+ export type Expected<T> = NativeMatcher | (T extends readonly unknown[] ? {
6
+ readonly [TKey in keyof T]: Expected<T[TKey]>;
7
+ } : T extends object ? {
8
+ readonly [TKey in keyof T]?: Expected<T[TKey]>;
9
+ } : T | (T extends number ? NumericBound : never));
10
+ export declare const assertOutcomes: (actual: readonly Record<string, unknown>[], expected: readonly Record<string, unknown>[]) => Effect.Effect<void, never, never>;
11
+ export {};
12
+ //# sourceMappingURL=assertOutcomes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertOutcomes.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/assertOutcomes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,mBAAmB,EAAU,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,KAAK,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,QAAQ,CAAC,CAAC,IACnB,aAAa,GACb,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,GAC3B;IAAE,QAAQ,EAAE,IAAI,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAAE,GACjD,CAAC,SAAS,MAAM,GACf;IAAE,QAAQ,EAAE,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAAE,GAClD,CAAC,GAAG,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC;AAErD,eAAO,MAAM,cAAc,iIAEzB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { expect } from "vitest";
3
+ export const assertOutcomes = Effect.fnUntraced(function* (actual, expected) {
4
+ yield* Effect.sync(() => expect(actual).toMatchObject(expected));
5
+ });
6
+ //# sourceMappingURL=assertOutcomes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertOutcomes.js","sourceRoot":"","sources":["../../../src/server/adapters/assertOutcomes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAA4B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAY1D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAA0C,EAAE,QAA4C;IAClJ,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"documentRedirect.d.ts","sourceRoot":"","sources":["../../../src/server/internal/documentRedirect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAC;AAEvE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI;IAgBrI,IAAI;IACJ,OAAO;EASR"}
1
+ {"version":3,"file":"documentRedirect.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/documentRedirect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAC;AAEvE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI;IAgBrI,IAAI;IACJ,OAAO;EASR"}