@shivaedev/test-story 0.31.4 → 0.33.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 (256) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +89 -15
  3. package/dist/client/adapters/reactRendering.d.ts +7 -0
  4. package/dist/client/adapters/reactRendering.d.ts.map +1 -0
  5. package/dist/client/adapters/reactRendering.js +4 -0
  6. package/dist/client/adapters/reactRendering.js.map +1 -0
  7. package/dist/client/adapters/waitForReact.d.ts +2 -0
  8. package/dist/client/adapters/waitForReact.d.ts.map +1 -0
  9. package/dist/client/adapters/waitForReact.js +8 -0
  10. package/dist/client/adapters/waitForReact.js.map +1 -0
  11. package/dist/client/react.d.ts +5 -4
  12. package/dist/client/react.d.ts.map +1 -1
  13. package/dist/client/react.js +9 -10
  14. package/dist/client/react.js.map +1 -1
  15. package/dist/server/adapters/receiveOtlp.d.ts +4 -0
  16. package/dist/server/adapters/receiveOtlp.d.ts.map +1 -0
  17. package/dist/server/adapters/receiveOtlp.js +39 -0
  18. package/dist/server/adapters/receiveOtlp.js.map +1 -0
  19. package/dist/server/adapters/screenAct.d.ts +4 -0
  20. package/dist/server/adapters/screenAct.d.ts.map +1 -0
  21. package/dist/server/adapters/screenAct.js +14 -0
  22. package/dist/server/adapters/screenAct.js.map +1 -0
  23. package/dist/server/adapters/screenMutations.d.ts +1 -1
  24. package/dist/server/adapters/screenMutations.d.ts.map +1 -1
  25. package/dist/server/adapters/screenMutations.js +1 -1
  26. package/dist/server/adapters/screenMutations.js.map +1 -1
  27. package/dist/server/adapters/screenNavigation.d.ts +1 -1
  28. package/dist/server/adapters/screenNavigation.d.ts.map +1 -1
  29. package/dist/server/adapters/screenNavigation.js +1 -1
  30. package/dist/server/adapters/screenNavigation.js.map +1 -1
  31. package/dist/server/adapters/storyFailure.d.ts +6 -0
  32. package/dist/server/adapters/storyFailure.d.ts.map +1 -0
  33. package/dist/server/adapters/storyFailure.js +13 -0
  34. package/dist/server/adapters/storyFailure.js.map +1 -0
  35. package/dist/server/adapters/visitHttp.d.ts +2 -0
  36. package/dist/server/adapters/visitHttp.d.ts.map +1 -0
  37. package/dist/server/adapters/visitHttp.js +4 -0
  38. package/dist/server/adapters/visitHttp.js.map +1 -0
  39. package/dist/server/browserReads.d.ts +4 -4
  40. package/dist/server/browserReads.d.ts.map +1 -1
  41. package/dist/server/browserReads.js +3 -16
  42. package/dist/server/browserReads.js.map +1 -1
  43. package/dist/server/domPage.d.ts +5 -0
  44. package/dist/server/domPage.d.ts.map +1 -0
  45. package/dist/server/domPage.js +9 -0
  46. package/dist/server/domPage.js.map +1 -0
  47. package/dist/server/fakeHttpService.d.ts +1 -1
  48. package/dist/server/fakeHttpService.d.ts.map +1 -1
  49. package/dist/server/fakeHttpService.js +2 -1
  50. package/dist/server/fakeHttpService.js.map +1 -1
  51. package/dist/server/forwardingProxy.d.ts +1 -1
  52. package/dist/server/forwardingProxy.d.ts.map +1 -1
  53. package/dist/server/forwardingProxy.js +1 -1
  54. package/dist/server/forwardingProxy.js.map +1 -1
  55. package/dist/server/httpVisitor.d.ts +12 -0
  56. package/dist/server/httpVisitor.d.ts.map +1 -0
  57. package/dist/server/httpVisitor.js +29 -0
  58. package/dist/server/httpVisitor.js.map +1 -0
  59. package/dist/server/internal/adapters/pageFetch.d.ts +3 -0
  60. package/dist/server/internal/adapters/pageFetch.d.ts.map +1 -0
  61. package/dist/server/internal/adapters/pageFetch.js +23 -0
  62. package/dist/server/internal/adapters/pageFetch.js.map +1 -0
  63. package/dist/server/internal/browserReadObserver.d.ts +3 -2
  64. package/dist/server/internal/browserReadObserver.d.ts.map +1 -1
  65. package/dist/server/internal/browserReadObserver.js +4 -2
  66. package/dist/server/internal/browserReadObserver.js.map +1 -1
  67. package/dist/server/internal/browserSubscriptions.d.ts +1 -1
  68. package/dist/server/internal/browserSubscriptions.d.ts.map +1 -1
  69. package/dist/server/internal/browserSubscriptions.js +3 -1
  70. package/dist/server/internal/browserSubscriptions.js.map +1 -1
  71. package/dist/server/internal/compose.d.ts.map +1 -1
  72. package/dist/server/internal/compose.js +2 -1
  73. package/dist/server/internal/compose.js.map +1 -1
  74. package/dist/server/internal/domDocument.d.ts +1 -1
  75. package/dist/server/internal/domDocument.d.ts.map +1 -1
  76. package/dist/server/internal/domDocument.js +1 -1
  77. package/dist/server/internal/domDocument.js.map +1 -1
  78. package/dist/server/internal/failureReport.d.ts +1 -0
  79. package/dist/server/internal/failureReport.d.ts.map +1 -1
  80. package/dist/server/internal/failureReport.js +4 -1
  81. package/dist/server/internal/failureReport.js.map +1 -1
  82. package/dist/server/internal/fakeHttpControls.d.ts +1 -1
  83. package/dist/server/internal/fakeHttpControls.d.ts.map +1 -1
  84. package/dist/server/internal/fakeHttpControls.js +1 -1
  85. package/dist/server/internal/fakeHttpControls.js.map +1 -1
  86. package/dist/server/internal/fakeHttpGates.d.ts.map +1 -1
  87. package/dist/server/internal/fakeHttpGates.js +2 -1
  88. package/dist/server/internal/fakeHttpGates.js.map +1 -1
  89. package/dist/server/internal/fakeHttpScripts.js +1 -1
  90. package/dist/server/internal/fakeHttpScripts.js.map +1 -1
  91. package/dist/server/internal/hooked.d.ts +1 -1
  92. package/dist/server/internal/hooked.d.ts.map +1 -1
  93. package/dist/server/internal/hooked.js +1 -1
  94. package/dist/server/internal/hooked.js.map +1 -1
  95. package/dist/server/internal/loadingDeadline.d.ts +3 -0
  96. package/dist/server/internal/loadingDeadline.d.ts.map +1 -0
  97. package/dist/server/internal/loadingDeadline.js +13 -0
  98. package/dist/server/internal/loadingDeadline.js.map +1 -0
  99. package/dist/server/internal/loopback.d.ts +1 -1
  100. package/dist/server/internal/loopback.d.ts.map +1 -1
  101. package/dist/server/internal/loopback.js +1 -1
  102. package/dist/server/internal/loopback.js.map +1 -1
  103. package/dist/server/internal/narration.d.ts +6 -9
  104. package/dist/server/internal/narration.d.ts.map +1 -1
  105. package/dist/server/internal/narration.js +17 -18
  106. package/dist/server/internal/narration.js.map +1 -1
  107. package/dist/server/internal/nextClientHint.d.ts +1 -1
  108. package/dist/server/internal/nextClientHint.d.ts.map +1 -1
  109. package/dist/server/internal/nextClientHint.js +2 -1
  110. package/dist/server/internal/nextClientHint.js.map +1 -1
  111. package/dist/server/internal/observeBrowser.d.ts +61 -0
  112. package/dist/server/internal/observeBrowser.d.ts.map +1 -0
  113. package/dist/server/internal/observeBrowser.js +21 -0
  114. package/dist/server/internal/observeBrowser.js.map +1 -0
  115. package/dist/server/internal/otlpReadout.js +1 -1
  116. package/dist/server/internal/otlpReadout.js.map +1 -1
  117. package/dist/server/internal/otlpReadouts.d.ts +9 -0
  118. package/dist/server/internal/otlpReadouts.d.ts.map +1 -0
  119. package/dist/server/internal/otlpReadouts.js +44 -0
  120. package/dist/server/internal/otlpReadouts.js.map +1 -0
  121. package/dist/server/internal/otlpTracing.d.ts +10 -0
  122. package/dist/server/internal/otlpTracing.d.ts.map +1 -0
  123. package/dist/server/internal/otlpTracing.js +45 -0
  124. package/dist/server/internal/otlpTracing.js.map +1 -0
  125. package/dist/server/internal/otlpValue.d.ts +1 -1
  126. package/dist/server/internal/otlpValue.d.ts.map +1 -1
  127. package/dist/server/internal/otlpValue.js +1 -1
  128. package/dist/server/internal/otlpValue.js.map +1 -1
  129. package/dist/server/internal/recordedSignals.d.ts +1 -1
  130. package/dist/server/internal/recordedSignals.d.ts.map +1 -1
  131. package/dist/server/internal/recordedSignals.js +4 -1
  132. package/dist/server/internal/recordedSignals.js.map +1 -1
  133. package/dist/server/internal/runUntil.d.ts +1 -1
  134. package/dist/server/internal/runUntil.d.ts.map +1 -1
  135. package/dist/server/internal/runUntil.js +1 -1
  136. package/dist/server/internal/runUntil.js.map +1 -1
  137. package/dist/server/internal/screenLoading.d.ts +2 -0
  138. package/dist/server/internal/screenLoading.d.ts.map +1 -0
  139. package/dist/server/internal/screenLoading.js +19 -0
  140. package/dist/server/internal/screenLoading.js.map +1 -0
  141. package/dist/server/internal/screenWaits.d.ts +2 -2
  142. package/dist/server/internal/screenWaits.d.ts.map +1 -1
  143. package/dist/server/internal/screenWaits.js +9 -5
  144. package/dist/server/internal/screenWaits.js.map +1 -1
  145. package/dist/server/internal/seed.d.ts +2 -1
  146. package/dist/server/internal/seed.d.ts.map +1 -1
  147. package/dist/server/internal/seed.js +4 -1
  148. package/dist/server/internal/seed.js.map +1 -1
  149. package/dist/server/internal/start.d.ts +1 -1
  150. package/dist/server/internal/start.d.ts.map +1 -1
  151. package/dist/server/internal/start.js +7 -4
  152. package/dist/server/internal/start.js.map +1 -1
  153. package/dist/server/internal/storyIt.d.ts.map +1 -1
  154. package/dist/server/internal/storyIt.js +3 -2
  155. package/dist/server/internal/storyIt.js.map +1 -1
  156. package/dist/server/internal/visitorCookies.d.ts +5 -0
  157. package/dist/server/internal/visitorCookies.d.ts.map +1 -0
  158. package/dist/server/internal/visitorCookies.js +50 -0
  159. package/dist/server/internal/visitorCookies.js.map +1 -0
  160. package/dist/server/internal/waitForScreen.d.ts +1 -1
  161. package/dist/server/internal/waitForScreen.d.ts.map +1 -1
  162. package/dist/server/internal/waitForScreen.js +7 -3
  163. package/dist/server/internal/waitForScreen.js.map +1 -1
  164. package/dist/server/internal/withWatchedClock.d.ts +1 -1
  165. package/dist/server/internal/withWatchedClock.d.ts.map +1 -1
  166. package/dist/server/internal/withWatchedClock.js +2 -1
  167. package/dist/server/internal/withWatchedClock.js.map +1 -1
  168. package/dist/server/lineSignals.d.ts +1 -1
  169. package/dist/server/lineSignals.d.ts.map +1 -1
  170. package/dist/server/lineSignals.js +1 -1
  171. package/dist/server/lineSignals.js.map +1 -1
  172. package/dist/server/memberScreens.d.ts +3 -2
  173. package/dist/server/memberScreens.d.ts.map +1 -1
  174. package/dist/server/memberScreens.js +4 -5
  175. package/dist/server/memberScreens.js.map +1 -1
  176. package/dist/server/otlpReceiver.d.ts +15 -4
  177. package/dist/server/otlpReceiver.d.ts.map +1 -1
  178. package/dist/server/otlpReceiver.js +9 -40
  179. package/dist/server/otlpReceiver.js.map +1 -1
  180. package/dist/server/outcomes.d.ts +1 -1
  181. package/dist/server/outcomes.d.ts.map +1 -1
  182. package/dist/server/outcomes.js +1 -1
  183. package/dist/server/outcomes.js.map +1 -1
  184. package/dist/server/routeOutbound.d.ts +1 -1
  185. package/dist/server/routeOutbound.d.ts.map +1 -1
  186. package/dist/server/routeOutbound.js +1 -1
  187. package/dist/server/routeOutbound.js.map +1 -1
  188. package/dist/server/screenDriver.d.ts +4 -2
  189. package/dist/server/screenDriver.d.ts.map +1 -1
  190. package/dist/server/screenDriver.js +4 -3
  191. package/dist/server/screenDriver.js.map +1 -1
  192. package/dist/server/seedCookies.d.ts +3 -3
  193. package/dist/server/seedCookies.d.ts.map +1 -1
  194. package/dist/server/seedCookies.js +4 -4
  195. package/dist/server/seedCookies.js.map +1 -1
  196. package/dist/server/until.d.ts +3 -1
  197. package/dist/server/until.d.ts.map +1 -1
  198. package/dist/server/until.js +4 -1
  199. package/dist/server/until.js.map +1 -1
  200. package/dist/server/watchedClock.d.ts +3 -1
  201. package/dist/server/watchedClock.d.ts.map +1 -1
  202. package/dist/server/watchedClock.js +5 -1
  203. package/dist/server/watchedClock.js.map +1 -1
  204. package/package.json +12 -5
  205. package/src/client/adapters/reactRendering.ts +5 -0
  206. package/src/client/adapters/waitForReact.ts +7 -0
  207. package/src/client/react.ts +13 -12
  208. package/src/server/adapters/receiveOtlp.ts +45 -0
  209. package/src/server/adapters/screenAct.ts +20 -0
  210. package/src/server/adapters/screenMutations.ts +1 -1
  211. package/src/server/adapters/screenNavigation.ts +1 -1
  212. package/src/server/adapters/storyFailure.ts +20 -0
  213. package/src/server/adapters/visitHttp.ts +3 -0
  214. package/src/server/browserReads.ts +5 -19
  215. package/src/server/domPage.ts +12 -0
  216. package/src/server/fakeHttpService.ts +2 -1
  217. package/src/server/forwardingProxy.ts +1 -1
  218. package/src/server/httpVisitor.ts +37 -0
  219. package/src/server/internal/adapters/pageFetch.ts +22 -0
  220. package/src/server/internal/browserReadObserver.ts +5 -2
  221. package/src/server/internal/browserSubscriptions.ts +3 -1
  222. package/src/server/internal/compose.ts +2 -1
  223. package/src/server/internal/domDocument.ts +1 -1
  224. package/src/server/internal/failureReport.ts +8 -1
  225. package/src/server/internal/fakeHttpControls.ts +1 -1
  226. package/src/server/internal/fakeHttpGates.ts +2 -1
  227. package/src/server/internal/fakeHttpScripts.ts +1 -1
  228. package/src/server/internal/hooked.ts +1 -1
  229. package/src/server/internal/loadingDeadline.ts +22 -0
  230. package/src/server/internal/loopback.ts +1 -1
  231. package/src/server/internal/narration.ts +26 -25
  232. package/src/server/internal/nextClientHint.ts +2 -1
  233. package/src/server/internal/observeBrowser.ts +25 -0
  234. package/src/server/internal/otlpReadout.ts +1 -1
  235. package/src/server/internal/otlpReadouts.ts +50 -0
  236. package/src/server/internal/otlpTracing.ts +56 -0
  237. package/src/server/internal/otlpValue.ts +1 -1
  238. package/src/server/internal/recordedSignals.ts +4 -1
  239. package/src/server/internal/runUntil.ts +1 -1
  240. package/src/server/internal/screenLoading.ts +21 -0
  241. package/src/server/internal/screenWaits.ts +15 -7
  242. package/src/server/internal/seed.ts +5 -1
  243. package/src/server/internal/start.ts +10 -4
  244. package/src/server/internal/storyIt.ts +3 -2
  245. package/src/server/internal/visitorCookies.ts +62 -0
  246. package/src/server/internal/waitForScreen.ts +7 -3
  247. package/src/server/internal/withWatchedClock.ts +2 -1
  248. package/src/server/lineSignals.ts +1 -1
  249. package/src/server/memberScreens.ts +8 -5
  250. package/src/server/otlpReceiver.ts +13 -46
  251. package/src/server/outcomes.ts +1 -1
  252. package/src/server/routeOutbound.ts +1 -1
  253. package/src/server/screenDriver.ts +9 -3
  254. package/src/server/seedCookies.ts +6 -6
  255. package/src/server/until.ts +5 -1
  256. package/src/server/watchedClock.ts +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.33.0 - 2026-11-02
4
+
5
+ ### Added
6
+
7
+ - Read exported secrets, traced SQL queries and reported errors from the fake OTLP receiver in stories.
8
+ - Build a scoped tracing layer with the tracer logger included, and flush buffered and in-flight spans to the receiver without stopping tracing.
9
+
10
+ ### Changed
11
+
12
+ - Story kits and the Effect test adapter import native Effect submodules instead of whole barrels. Cookie windows, member windows, React mounting and OTLP decoding load when used; browser RPC imports use dedicated modules.
13
+ - App test workers reuse Node's on-disk compilation cache while keeping Vitest's file isolation.
14
+
15
+ ### Fixed
16
+
17
+ - A timed-out DOM screen lookup closes its interrupted React `act()` scope before the story finishes, so later stories in the same file render and respond normally.
18
+ - Creation failures keep their original cause and name the story kit, the create phase and the rerun command. Cleanup failures evaluate asynchronous inspect hooks with the kit's services and print their state instead of serializing an Effect.
19
+
20
+ ## 0.32.0 - 2026-11-01
21
+
22
+ ### Added
23
+
24
+ - `domPage(url)` scopes global fetch URL resolution to an open DOM page and restores fetch and location when its scope closes. Pass its `pending` stream to `screenDriver` to wait for page fetches to resolve or reject.
25
+ - DOM `find` and `findText` keep waiting while the screen shows a visible loading status, `aria-busy="true"`, `Loading…` text or an open dialog. The normal 3-second budget extends to at most 10 seconds, configurable with `loadingTimeoutMs`. Explicit per-call timeouts remain hard deadlines; an idle screen keeps the usual timeout and target diagnostics.
26
+
27
+ ### Fixed
28
+
29
+ - Report production imports of the `@effect/platform-node` barrel with module subpaths that avoid loading optional integrations such as redis.
30
+ - Recognize native Effect `catchTags` record keys regardless of the handler body while retaining diagnostics for actual nested component and hook factories.
31
+ - Keep a constant's matching filename valid when the constant becomes private.
32
+ - Name each conflicting fix and format pass's file and line/column range when `quality fix` cannot settle.
33
+ - Use Node platform module subpaths in package runtimes and commands instead of loading the barrel.
34
+
3
35
  ## 0.31.4 - 2026-11-01
4
36
 
5
37
  ### Changed
package/README.md CHANGED
@@ -45,7 +45,7 @@ The first line is the assertion's own message. The box under it tells a reader w
45
45
 
46
46
  ## Using it
47
47
 
48
- Every source module is available through its `.ts` subpath, including modules under `server/internal/`. Kit authors choose which engine pieces to depend on.
48
+ Every source module is available through its `.ts` subpath, including modules under `server/internal/`. Kit authors choose which engine pieces to depend on. The core kit imports Effect submodules directly and leaves DOM, browser, PostgreSQL and OTLP engines out of its module graph. React mounting, member windows, cookie seeding, browser reads and OTLP decoding load their optional implementations when used, so a shared application kit can import an integration without loading its engine.
49
49
 
50
50
  Before writing or reviewing stories, follow the [story-testing skill](https://github.com/ShivaeDev/platform/blob/main/packages/skills/skills/story-testing/SKILL.md), shipped by `@shivaedev/skills`. It owns the rules for how a story reads, observable evidence, boundary-driven setup, verbs and readouts, assertions, jobs, framework gaps, faked preconditions, database isolation and focused runs. The examples below explain this package's API; framework fixtures exercise this package's responsibilities, rather than prescribe application scenarios.
51
51
 
@@ -277,7 +277,48 @@ app.it("continues the trace context a request's headers carry", [], function* ({
277
277
 
278
278
  `describeSpan` turns each span into words once in the kit, so the specs compare sentences instead of reading span fields and tags. Detachment only removes the incoming parent: spans that application startup explicitly creates still follow native Effect semantics.
279
279
 
280
- #### Forwarding requests to a host
280
+ #### Visiting an app over HTTP
281
+
282
+ Use `httpVisitor` from `@shivaedev/test-story/server/httpVisitor.ts` in the kit's scoped `create` or `after` hook after starting the real app. Each call acquires a separate cookie jar and a separate edge proxy, which closes with the calling Scope:
283
+
284
+ ```ts
285
+ import { httpVisitor } from "@shivaedev/test-story/server/httpVisitor.ts";
286
+
287
+ const ada = yield* httpVisitor(upstream, {
288
+ baseUrl: "https://app.example",
289
+ headers: {
290
+ origin: "https://foreign.example",
291
+ "x-forwarded-for": "198.51.100.7",
292
+ "x-real-ip": "192.0.2.4",
293
+ },
294
+ edge: { forwardedHops: ["203.0.113.9"] },
295
+ });
296
+
297
+ const bob = yield* httpVisitor(upstream, { baseUrl: "https://app.example" });
298
+ ```
299
+
300
+ `upstream` is the app's local HTTP listener. `baseUrl` is the public URL the visitor sees; it defaults to `upstream`. HTTPS here models TLS termination at the edge: transport to the local app remains HTTP. Requests present that public URL through `X-Forwarded-Host` and `X-Forwarded-Proto`. Secure cookies are accepted and sent only for HTTPS public URLs, including when the hostname is localhost. Ordinary and HttpOnly cookies are kept automatically, scoped by host/domain and path, and updated or removed by the app's Set-Cookie headers. Cookie expiry uses the story's Effect Clock. The visitors never share cookies.
301
+
302
+ `headers` supplies visitor request defaults; a request's own headers override them without case sensitivity. In this example the app receives Origin `https://foreign.example`, X-Forwarded-For `198.51.100.7, 203.0.113.9`, and X-Real-IP `192.0.2.4`. `edge` accepts `ForwardingProxyOptions`: its headers override the visitor's headers, and `forwardedHops` chooses which addresses the edge appends. Give each visitor its own edge policy to test trusted proxy boundaries.
303
+
304
+ `yield* ada.request("/session")` returns a native Response in an Effect. It accepts a path or an absolute public URL and optional fetch request options for method, headers, body and signal. Every request goes through this visitor's edge to the same upstream app; an absolute URL changes the public host/scheme used for headers and cookie selection. Redirects are returned without following them, and their cookies are retained, so the next story action can explicitly visit the Location. There is no credentials or redirect option. This HTTP client does not enforce browser CORS or SameSite policy.
305
+
306
+ Keep requests and response decoding inside the application's verbs and readouts. A verb performs one action, and a readout translates the HTTP answer into domain words such as `"signed in as ada"` or `"signed out"`; specs never inspect Exit, Cause or `_tag` shapes. For example, an application's kit exposes `as(name).signsIn()` and `as(name).session()` over its visitor:
307
+
308
+ ```ts
309
+ app.it("keeps ada's session separate from bob's", [visiting("ada"), visiting("bob")], function* ({ as }) {
310
+ yield* as("ada").signsIn();
311
+
312
+ yield* outcomes([
313
+ ["ada's session", () => as("ada").session(), "signed in as ada"],
314
+ ["bob's session", () => as("bob").session(), "signed out"],
315
+ ]);
316
+ });
317
+ ```
318
+
319
+ The kit awaits the HTTP answer directly; it needs no sleeps, polling or manual Cookie header copying. For DOM rendering and browser sign-in flows, use the document and member-screen transports below.
320
+
321
+ #### Controlling a forwarding proxy directly
281
322
 
282
323
  Use `forwardingProxy` from `@shivaedev/test-story/server/forwardingProxy.ts` in the kit's scoped `create` or `after` hook after starting the host under test:
283
324
 
@@ -301,21 +342,43 @@ Set `localAddress` to choose the source socket address of the proxy's connection
301
342
 
302
343
  #### Reading OTLP exports
303
344
 
304
- Use `otlpReceiver` from `@shivaedev/test-story/server/otlpReceiver.ts` in a kit's scoped `create` hook. It listens on an allocated loopback port and closes with the story scope. Point the application's real exporter at `${receiver.url}/v1/traces`, then flush the exporter before reading:
345
+ Use `otlpReceiver` from `@shivaedev/test-story/server/otlpReceiver.ts` in a kit's scoped `create` hook. It listens on an allocated loopback port and closes with the story scope. Build the application's tracing layer with `receiver.tracerLayer(options?)`, providing native OTLP serialization and an HTTP client:
305
346
 
306
347
  ```ts
307
- app.it("exports the work span without the planted secret", [], function* ({ runWork, disposeRuntime, exportedSpanNames, exportsContaining }) {
308
- yield* runWork();
309
- yield* disposeRuntime();
348
+ const receiver = yield* otlpReceiver();
349
+ const tracing = receiver.tracerLayer({ resource: { serviceName: "documents" } }).pipe(
350
+ Layer.provide(OtlpSerialization.layerJson),
351
+ Layer.provide(FetchHttpClient.layer),
352
+ );
353
+ const context = yield* Layer.build(tracing);
354
+ ```
355
+
356
+ Import `Layer` from `effect`, `OtlpSerialization` from `effect/observability` and `FetchHttpClient` from `effect/http`. Provide `context` to the application's work. The layer accepts native tracer options except the destination URL and compression; the receiver supplies its own URL. Use `OtlpSerialization.layerProtobuf` for protobuf exports. The layer includes Effect's tracer logger, so logs become span events even when the surrounding test logger omits it. Logger changes stay inside the provided context, and the story's Scope releases the exporter.
357
+
358
+ Expose `receiver.flush` as a separate story step. It exports buffered traces and waits on receiver signals for every sampled span that ended before the step, including exports already in flight. It leaves tracing running for later actions. Finish the traced operation before flushing; a span still running has nothing to export. This step tracks exporters built with `receiver.tracerLayer`; an independently configured exporter still needs its own flush.
359
+
360
+ ```ts
361
+ app.it("exports a leaked credential and omits a redacted credential", [], function* ({ tracesSecret, flush, exportsSecret }) {
362
+ yield* tracesSecret("redacted credential", true);
363
+ yield* tracesSecret("leaked credential", false);
364
+ yield* flush();
310
365
 
311
366
  yield* outcomes([
312
- ["exported spans", () => exportedSpanNames(), ["CountWords"]],
313
- ["exports with the planted secret", () => exportsContaining("planted-secret"), 0],
367
+ ["redacted credential exported", () => exportsSecret("redacted credential"), false],
368
+ ["leaked credential exported", () => exportsSecret("leaked credential"), true],
314
369
  ]);
315
370
  });
316
371
  ```
317
372
 
318
- Here `app` is the application's kit. Its `create` acquires the receiver and the real exporter pointed at that receiver, `runWork` performs the traced operation, `disposeRuntime` disposes the exporter's runtime and flushes pending spans, and `exportedSpanNames` and `exportsContaining` are Effect readouts over the receiver's `spans` and `requests`. Each action is visible in the spec. 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`. Search all body bytes when checking that a secret was not exported. Optional `path`, `status` (a number or attempt callback) and `answer` configure collector responses for failure stories.
373
+ 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
+
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. |
380
+
381
+ 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.
319
382
 
320
383
  For timeout stories, return `undefined` from the `status` callback to accept an export without sending response headers. Set `answer: null` to send headers without completing the response body.
321
384
 
@@ -571,7 +634,7 @@ app.it(
571
634
 
572
635
  Acquire hosts, workers and screens in per-story Scope so they inherit the story's Clock. An independent runtime or native HTTP handler must capture the Effect Context at acquisition, as with `HttpEffect.toWebHandlerWith(context)` or `Effect.runPromiseWith(context)`. Worker-scoped kit `layer` acquisition stays outside the per-story clock; shared services acquired there do not acquire a new clock for each story. Direct JavaScript wall-time reads are not replaced. Formatting stays with the application, including its locale and time zone.
573
636
 
574
- Long jumps also expire signed-in sessions. With Better Auth, use `signInAgain(auth, userId)` from `@shivaedev/identity/server/better-auth/testing.ts` to mint a fresh session on the caller’s Clock for the same user. Replace the visitor’s headers, or pass its returned cookies to `seedCookies` for a browser. The starter’s app kit exposes `signsInAgain(name)` and its cookie kit exposes `browserSignsInAgain()` for these steps. Their TestClocks start at the present by default so Better Auth’s wall-clock endpoints accept minted sessions; an explicit story `clock` still takes precedence.
637
+ Long jumps also expire signed-in sessions. With Better Auth, use `signInAgain(auth, userId)` from `@shivaedev/identity/server/better-auth/testing.ts` to mint a fresh session on the caller’s Clock for the same user. Replace the visitor’s headers, or pass its returned cookies to `seedCookies` for a browser. The starter’s app kit exposes `signsInAgain(name)` for this step. Its TestClock starts at the present by default so Better Auth’s wall-clock endpoints accept minted sessions; an explicit story `clock` still takes precedence.
575
638
 
576
639
  A live-clock kit still runs on real time when a story omits the override.
577
640
 
@@ -832,6 +895,15 @@ pnpm add --save-dev react react-dom @effect/atom-react @types/react @types/react
832
895
 
833
896
  ### Driving a screen
834
897
 
898
+ 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
+
900
+ ```ts
901
+ const page = yield* domPage(`${host.url}/notes`);
902
+ const driver = screenDriver({ act, pending: page.pending, root: view.container, tell: story.tell });
903
+ ```
904
+
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.
906
+
835
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.
836
908
 
837
909
  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.
@@ -872,9 +944,9 @@ This form of `settle()` observes client activity changes and flushes the rendere
872
944
 
873
945
  `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.
874
946
 
875
- `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, narrates the lookup, and uses the driver's live-time `timeoutMs` limit unless `timeout` overrides it in milliseconds. If no unique element appears before the limit, it fails with the same target diagnostics as the actions, including visible candidates for role/name targets.
947
+ `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.
876
948
 
877
- `findText(text, { timeout }?)` waits for one visible element with matching text, returning the deepest matching `HTMLElement`. Strings match exactly after whitespace normalization; regular expressions also work. Inline markup stays joined and hidden text is excluded. Separate visible matches are ambiguous, and a timeout names the text being awaited.
949
+ `findText(text, { timeout }?)` waits for one visible element with matching text, returning the deepest matching `HTMLElement`. It shares `find`'s loading-aware budget and explicit timeout behavior. Strings match exactly after whitespace normalization; regular expressions also work. Inline markup stays joined and hidden text is excluded. Separate visible matches are ambiguous, and a timeout names the text being awaited.
878
950
 
879
951
  `gone(target, { timeout }?)` waits until no rendered element matches the selector or role/name target. It accepts an already absent target and observes removal and hiding through DOM mutations, without polling. Like `find`, both waits also observe a supplied pending signal and wait until it is idle.
880
952
 
@@ -917,6 +989,7 @@ Import each module with the prefix `@shivaedev/test-story/`; there is no root en
917
989
  | `server/watchedClock.ts` | `watchedClock`, `WatchedClock`, `untilTimer(interval, options?)`, `passes(interval, then)` |
918
990
  | `server/browserReads.ts` | `browserReads(options)`, `BrowserReadsOptions`, `BrowserRead`, `BrowserSubscription` |
919
991
  | `server/domFetch.ts` | `domFetch(baseUrl, target?)` |
992
+ | `server/domPage.ts` | `domPage(url)` with a scoped global fetch and a `pending` stream |
920
993
  | `server/seedCookies.ts` | `seedCookies(cookies, target?)`, `DomCookie` |
921
994
  | `server/routeOutbound.ts` | `routeOutbound(routes)` |
922
995
  | `server/screenDriver.ts` | `screenDriver(options)`, `ScreenDriverOptions`, `ScreenDriver`, `ScreenTarget`, `MissingScreenPending` |
@@ -925,8 +998,9 @@ Import each module with the prefix `@shivaedev/test-story/`; there is no root en
925
998
  | `server/genreTags.ts` | `genreTags(...kitNames)`, `GenreTag` |
926
999
  | `server/domEnvironment.config.ts` | Default Vitest environment preserving Node host globals and happy-dom document transport |
927
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` |
928
1002
  | `server/forwardingProxy.ts` | `forwardingProxy(upstream, options?)`, `ForwardingProxyOptions` |
929
- | `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions` |
1003
+ | `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions`, `OtlpTracerOptions` |
930
1004
 
931
1005
  ### Install and limits
932
1006
 
@@ -938,8 +1012,8 @@ pnpm add --save-dev @shivaedev/test-story @effect/platform-node @effect/vitest e
938
1012
 
939
1013
  Test-story is an application's one test dependency: it brings [`@shivaedev/test`](https://github.com/ShivaeDev/platform/tree/main/packages/test#readme) and [`@shivaedev/test-sql`](https://github.com/ShivaeDev/platform/tree/main/packages/test-sql#readme), which an application on `@shivaedev/platform` imports by their own names without listing them. `@effect/sql-pg` is an optional peer for `test-sql`'s PostgreSQL helpers; install it when the stories use them. A library that tests with test-story still declares `test` or `test-sql` directly when it imports them.
940
1014
  - The package runs inside Vitest. The story reaches the failure by rewriting the first error's message in Vitest's `onTestFailed` hook.
941
- - Layer acquisition and engine creation failures precede that hook and carry no story appendix. A printed rerun command still needs a Vitest configuration that collects its file.
1015
+ - Engine creation failures name the kit and the create phase and include a rerun command. Layer acquisition failures precede the story and carry no story appendix. A printed rerun command still needs a Vitest configuration that collects its file.
942
1016
  - A kit's `it` is created when the kit is defined, so a kit lives in a module that only Vitest test files import.
943
- - `inspect` runs when the story fails, before its Scope closes. Plain functions, generators and functions returning an Effect are supported.
1017
+ - `inspect` runs when the story fails, before its Scope closes. If only cleanup fails, it runs after cleanup with the kit's services. Plain functions, generators and functions returning an Effect are supported.
944
1018
  - The spec line under the `✗` is found by matching the spec's path in the failure's stack, or else in the call site of the last line the story told or the last `runUntil`. A failure raised inside an Effect that the spec does not call directly may have none.
945
1019
  - The package is built for ShivaeDev applications and may change without a deprecation period.
@@ -0,0 +1,7 @@
1
+ export declare function reactRendering(): Promise<[
2
+ typeof import("@effect/atom-react"),
3
+ typeof import("effect/reactivity/AtomRegistry"),
4
+ typeof import("react-dom/client"),
5
+ typeof import("react")
6
+ ]>;
7
+ //# sourceMappingURL=reactRendering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactRendering.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/reactRendering.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,IAAI,OAAO,CACxC;IAAC,cAAc,oBAAoB,CAAC;IAAE,cAAc,gCAAgC,CAAC;IAAE,cAAc,kBAAkB,CAAC;IAAE,cAAc,OAAO,CAAC;CAAC,CACjJ,CAEA"}
@@ -0,0 +1,4 @@
1
+ export function reactRendering() {
2
+ return Promise.all([import("@effect/atom-react"), import("effect/reactivity/AtomRegistry"), import("react-dom/client"), import("react")]);
3
+ }
4
+ //# sourceMappingURL=reactRendering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactRendering.js","sourceRoot":"","sources":["../../../src/client/adapters/reactRendering.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc;IAG7B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,gCAAgC,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3I,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function waitForReact(): Promise<void>;
2
+ //# sourceMappingURL=waitForReact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForReact.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/waitForReact.ts"],"names":[],"mappings":"AAAA,wBAAsB,YAAY,kBAMjC"}
@@ -0,0 +1,8 @@
1
+ export async function waitForReact() {
2
+ const { act } = await import("react");
3
+ // Responses and React updates must settle together inside act.
4
+ await act(async () => {
5
+ await new Promise((resolve) => setTimeout(resolve, 10));
6
+ });
7
+ }
8
+ //# sourceMappingURL=waitForReact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForReact.js","sourceRoot":"","sources":["../../../src/client/adapters/waitForReact.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,YAAY;IACjC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;IACtC,+DAA+D;IAC/D,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,7 +1,8 @@
1
- import { Effect, Scope } from "effect";
2
- import * as AtomRegistry from "effect/reactivity/AtomRegistry";
3
- import { type ReactNode } from "react";
4
- import { type RootOptions } from "react-dom/client";
1
+ import * as Effect from "effect/Effect";
2
+ import type * as AtomRegistry from "effect/reactivity/AtomRegistry";
3
+ import * as Scope from "effect/Scope";
4
+ import type { ReactNode } from "react";
5
+ import type { RootOptions } from "react-dom/client";
5
6
  type CaughtErrorHandler = NonNullable<RootOptions["onCaughtError"]>;
6
7
  export interface ReactWarningsReadout {
7
8
  readonly caughtErrors: readonly unknown[];
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/client/react.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAAQ,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKhE,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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AAO,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,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,IAAI,qCAmB5C;AAED,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,CA6BtF"}
@@ -1,11 +1,12 @@
1
- import { RegistryContext } from "@effect/atom-react";
2
- import { Clock, Effect, Exit, Scope } from "effect";
3
- import * as AtomRegistry from "effect/reactivity/AtomRegistry";
4
- import { act, createElement } from "react";
5
- import { createRoot } from "react-dom/client";
1
+ import * as Clock from "effect/Clock";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Exit from "effect/Exit";
4
+ import * as Scope from "effect/Scope";
6
5
  import { beforeEach, expect, vi } from "vitest";
7
6
  import { eventually as retry } from "@shivaedev/test/eventually.ts";
8
7
  import { withLive } from "@shivaedev/test/withLive.ts";
8
+ import { reactRendering } from "#client/adapters/reactRendering.ts";
9
+ import { waitForReact } from "#client/adapters/waitForReact.ts";
9
10
  const acquireReactWarnings = Effect.acquireRelease(Effect.sync(() => {
10
11
  const errors = vi.spyOn(console, "error").mockImplementation(() => undefined);
11
12
  let consoleErrors;
@@ -64,10 +65,7 @@ export function eventually(assert) {
64
65
  const started = yield* Clock.currentTimeMillis;
65
66
  return yield* retry(Effect.try({ catch: (error) => error, try: assert }), {
66
67
  timeout: "3 seconds",
67
- // Responses and React updates must settle together inside act.
68
- wait: Effect.promise(() => act(async () => {
69
- await new Promise((resolve) => setTimeout(resolve, 10));
70
- })),
68
+ wait: Effect.promise(waitForReact),
71
69
  }).pipe(Effect.catch((error) => Effect.gen(function* () {
72
70
  const elapsed = (yield* Clock.currentTimeMillis) - started;
73
71
  return yield* Effect.fail(new Error(`Assertion did not pass after ${elapsed}ms: ${error instanceof Error ? error.message : String(error)}`, { cause: error }));
@@ -75,7 +73,8 @@ export function eventually(assert) {
75
73
  }));
76
74
  }
77
75
  export async function render(node, options) {
78
- const registry = AtomRegistry.make();
76
+ const [{ RegistryContext }, registryModule, { createRoot }, { act, createElement }] = await reactRendering();
77
+ const registry = registryModule.make();
79
78
  const container = document.createElement("div");
80
79
  document.body.append(container);
81
80
  const root = createRoot(container, options);
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/client/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,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C,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,4 @@
1
+ import type { IncomingMessage, ServerResponse } from "node:http";
2
+ import type { OtlpExport, OtlpReceiverOptions, OtlpSpan } from "#otlpReceiver.ts";
3
+ export declare function receiveOtlp(request: IncomingMessage, response: ServerResponse, requests: OtlpExport[], record: (span: OtlpSpan) => void, options: OtlpReceiverOptions): Promise<void>;
4
+ //# sourceMappingURL=receiveOtlp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiveOtlp.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/receiveOtlp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElF,wBAAsB,WAAW,CAChC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,UAAU,EAAE,EACtB,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,EAChC,OAAO,EAAE,mBAAmB,iBAmC5B"}
@@ -0,0 +1,39 @@
1
+ import * as HttpStatus from "effect/http/HttpStatus";
2
+ export async function receiveOtlp(request, response, requests, record, options) {
3
+ try {
4
+ const chunks = [];
5
+ for await (const chunk of request) {
6
+ chunks.push(Buffer.from(chunk));
7
+ }
8
+ const body = Buffer.concat(chunks);
9
+ requests.push({ body, headers: request.headers, path: request.url, rawHeaders: request.rawHeaders });
10
+ if (request.method !== "POST" || request.url !== (options.path ?? "/v1/traces")) {
11
+ response.writeHead(HttpStatus.fromLiteral("NotFound")).end();
12
+ return;
13
+ }
14
+ const contentType = request.headers["content-type"]?.split(";")[0]?.trim();
15
+ if (contentType !== "application/json" && contentType !== "application/x-protobuf") {
16
+ response.writeHead(HttpStatus.fromLiteral("UnsupportedMediaType")).end();
17
+ return;
18
+ }
19
+ const { otlpReadout } = await import("#internal/otlpReadout.ts");
20
+ for (const span of otlpReadout(body, contentType)) {
21
+ record(span);
22
+ }
23
+ const status = typeof options.status === "function" ? options.status(requests.length) : (options.status ?? HttpStatus.fromLiteral("OK"));
24
+ if (status === undefined) {
25
+ return;
26
+ }
27
+ response.writeHead(status);
28
+ if (options.answer === null) {
29
+ response.flushHeaders();
30
+ }
31
+ else {
32
+ response.end(options.answer ?? "{}");
33
+ }
34
+ }
35
+ catch {
36
+ response.writeHead(HttpStatus.fromLiteral("BadRequest")).end();
37
+ }
38
+ }
39
+ //# sourceMappingURL=receiveOtlp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiveOtlp.js","sourceRoot":"","sources":["../../../src/server/adapters/receiveOtlp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAGrD,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,OAAwB,EACxB,QAAwB,EACxB,QAAsB,EACtB,MAAgC,EAChC,OAA4B;IAE5B,IAAI,CAAC;QACJ,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO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AAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QACzI,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO;QACR,CAAC;QACD,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC7B,QAAQ,CAAC,YAAY,EAAE,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAChE,CAAC;AACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import * as Effect from "effect/Effect";
2
+ import type { ScreenDriverOptions } from "#screenDriver.ts";
3
+ export declare function screenAct(act: NonNullable<ScreenDriverOptions["act"]>, action: Effect.Effect<void>): Effect.Effect<void, never, never>;
4
+ //# sourceMappingURL=screenAct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenAct.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenAct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,qCAelG"}
@@ -0,0 +1,14 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Exit from "effect/Exit";
3
+ export function screenAct(act, action) {
4
+ return Effect.callback((resume, signal) => {
5
+ let outcome = Exit.void;
6
+ const completed = Promise.resolve(act(async () => {
7
+ // A rejected callback leaves React's act queue open, so deliver failure after act closes.
8
+ outcome = await Effect.runPromiseExit(action, { signal });
9
+ }));
10
+ completed.then(() => resume(Exit.isFailure(outcome) ? Effect.failCause(outcome.cause) : Effect.void), (error) => resume(Effect.die(error)));
11
+ return Effect.promise(() => completed);
12
+ });
13
+ }
14
+ //# sourceMappingURL=screenAct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenAct.js","sourceRoot":"","sources":["../../../src/server/adapters/screenAct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAGpC,MAAM,UAAU,SAAS,CAAC,GAA4C,EAAE,MAA2B;IAClG,OAAO,MAAM,CAAC,QAAQ,CAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;QAC/C,IAAI,OAAO,GAAoB,IAAI,CAAC,IAAI,CAAC;QACzC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAChC,GAAG,CAAC,KAAK,IAAI,EAAE;YACd,0FAA0F;YAC1F,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC,CACF,CAAC;QACF,SAAS,CAAC,IAAI,CACb,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EACrF,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAC7C,CAAC;QACF,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Effect } from "effect";
1
+ import * as Effect from "effect/Effect";
2
2
  export declare function screenMutations(root: HTMLElement, changed: () => void): Effect.Effect<MutationObserver, never, import("effect/Scope").Scope>;
3
3
  //# sourceMappingURL=screenMutations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screenMutations.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI,wEAWrE"}
1
+ {"version":3,"file":"screenMutations.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenMutations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI,wEAWrE"}
@@ -1,4 +1,4 @@
1
- import { Effect } from "effect";
1
+ import * as Effect from "effect/Effect";
2
2
  export function screenMutations(root, changed) {
3
3
  return Effect.acquireRelease(Effect.sync(() => {
4
4
  const observer = new MutationObserver(changed);
@@ -1 +1 @@
1
- {"version":3,"file":"screenMutations.js","sourceRoot":"","sources":["../../../src/server/adapters/screenMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,eAAe,CAAC,IAAiB,EAAE,OAAmB;IACrE,OAAO,MAAM,CAAC,cAAc,CAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QAChB,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/C,gFAAgF;QAChF,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAA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 -1,3 +1,3 @@
1
- import { Effect } from "effect";
1
+ import * as Effect from "effect/Effect";
2
2
  export declare function screenNavigation(root: () => HTMLElement, prefix: string): Effect.Effect<void, never, never>;
3
3
  //# sourceMappingURL=screenNavigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screenNavigation.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,WAAW,EAAE,MAAM,EAAE,MAAM,qCAkCvE"}
1
+ {"version":3,"file":"screenNavigation.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,WAAW,EAAE,MAAM,EAAE,MAAM,qCAkCvE"}
@@ -1,4 +1,4 @@
1
- import { Effect } from "effect";
1
+ import * as Effect from "effect/Effect";
2
2
  export function screenNavigation(root, prefix) {
3
3
  return Effect.suspend(() => {
4
4
  const location = root().ownerDocument.location;
@@ -1 +1 @@
1
- {"version":3,"file":"screenNavigation.js","sourceRoot":"","sources":["../../../src/server/adapters/screenNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,gBAAgB,CAAC,IAAuB,EAAE,MAAc;IACvE,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1B,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,QAAQ,IAAI,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,cAAc,CAAC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CAAC,CAAC;YAC1C,CAAC;QACF,CAAC,CAAC,CACF,CACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from "effect/Effect";
2
+ import type { TestContext } from "vitest";
3
+ import type { FailedTest } from "#internal/failureReport.ts";
4
+ export type FailureContext = Pick<TestContext, "onTestFailed" | "task">;
5
+ export declare const reportOnFailure: (args_0: FailureContext, report: (test: FailedTest) => Effect.Effect<string, never, unknown>) => Effect.Effect<void, never, unknown>;
6
+ //# sourceMappingURL=storyFailure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyFailure.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/storyFailure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,eAAe,0CAEZ,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,wCAUlE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { describeFailure } from "#internal/render.ts";
3
+ export const reportOnFailure = Effect.fnUntraced(function* ({ onTestFailed, task }, report) {
4
+ const run = Effect.runPromiseWith(yield* Effect.context());
5
+ onTestFailed(async ({ task: failedTask }) => {
6
+ const failure = failedTask.result?.errors?.[0];
7
+ if (failure !== undefined) {
8
+ const appendix = await run(report({ file: task.file.filepath, name: task.name, stack: failure.stack }));
9
+ failure.message = `${failure.message || describeFailure({ ...failure, message: "" })}\n\n${appendix}`;
10
+ }
11
+ });
12
+ });
13
+ //# sourceMappingURL=storyFailure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyFailure.js","sourceRoot":"","sources":["../../../src/server/adapters/storyFailure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EACzD,EAAE,YAAY,EAAE,IAAI,EAAkB,EACtC,MAAmE;IAEnE,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAW,CAAC,CAAC;IACpE,YAAY,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACxG,OAAO,CAAC,OAAO,GAAG,GAAG,OAAO,CAAC,OAAO,IAAI,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,QAAQ,EAAE,CAAC;QACvG,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function visitHttp(url: string, init: RequestInit, signal: AbortSignal): Promise<Response>;
2
+ //# sourceMappingURL=visitHttp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visitHttp.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/visitHttp.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,qBAE5E"}
@@ -0,0 +1,4 @@
1
+ export function visitHttp(url, init, signal) {
2
+ return fetch(url, { ...init, redirect: "manual", signal: init.signal ? AbortSignal.any([signal, init.signal]) : signal });
3
+ }
4
+ //# sourceMappingURL=visitHttp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visitHttp.js","sourceRoot":"","sources":["../../../src/server/adapters/visitHttp.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,IAAiB,EAAE,MAAmB;IAC5E,OAAO,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3H,CAAC"}
@@ -1,6 +1,6 @@
1
- import { Effect, Layer } from "effect";
2
- import { RpcClient } from "effect/rpc";
3
- import * as Socket from "effect/socket/Socket";
1
+ import * as Effect from "effect/Effect";
2
+ import type * as Layer from "effect/Layer";
3
+ import type * as Socket from "effect/socket/Socket";
4
4
  export type BrowserSubscription = {
5
5
  readonly payload: unknown;
6
6
  readonly tag: string;
@@ -82,6 +82,6 @@ export declare const browserReads: (options: BrowserReadsOptions) => Effect.Effe
82
82
  readonly _tag: "Resync";
83
83
  }, never, never>;
84
84
  }, never, import("effect/Scope").Scope>;
85
- protocol: (arg: string | undefined) => Layer.Layer<RpcClient.Protocol, never, never>;
85
+ protocol: (arg: string | undefined) => Layer.Layer<import("effect/rpc/RpcClient").Protocol, never, never>;
86
86
  }, never, import("effect/Scope").Scope>;
87
87
  //# sourceMappingURL=browserReads.d.ts.map