@effect/platform-bun 4.0.0-beta.66 → 4.0.0-beta.68

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 (108) hide show
  1. package/dist/BunChildProcessSpawner.d.ts +1 -1
  2. package/dist/BunChildProcessSpawner.js +1 -1
  3. package/dist/BunClusterHttp.d.ts +44 -7
  4. package/dist/BunClusterHttp.d.ts.map +1 -1
  5. package/dist/BunClusterHttp.js +10 -6
  6. package/dist/BunClusterHttp.js.map +1 -1
  7. package/dist/BunClusterSocket.d.ts +48 -9
  8. package/dist/BunClusterSocket.d.ts.map +1 -1
  9. package/dist/BunClusterSocket.js +48 -9
  10. package/dist/BunClusterSocket.js.map +1 -1
  11. package/dist/BunCrypto.d.ts +10 -0
  12. package/dist/BunCrypto.d.ts.map +1 -0
  13. package/dist/BunCrypto.js +14 -0
  14. package/dist/BunCrypto.js.map +1 -0
  15. package/dist/BunFileSystem.d.ts +4 -2
  16. package/dist/BunFileSystem.d.ts.map +1 -1
  17. package/dist/BunFileSystem.js +27 -3
  18. package/dist/BunFileSystem.js.map +1 -1
  19. package/dist/BunHttpClient.d.ts +2 -2
  20. package/dist/BunHttpClient.js +2 -2
  21. package/dist/BunHttpPlatform.d.ts +4 -2
  22. package/dist/BunHttpPlatform.d.ts.map +1 -1
  23. package/dist/BunHttpPlatform.js +5 -3
  24. package/dist/BunHttpPlatform.js.map +1 -1
  25. package/dist/BunHttpServer.d.ts +59 -14
  26. package/dist/BunHttpServer.d.ts.map +1 -1
  27. package/dist/BunHttpServer.js +24 -12
  28. package/dist/BunHttpServer.js.map +1 -1
  29. package/dist/BunHttpServerRequest.d.ts +26 -2
  30. package/dist/BunHttpServerRequest.d.ts.map +1 -1
  31. package/dist/BunHttpServerRequest.js +3 -1
  32. package/dist/BunHttpServerRequest.js.map +1 -1
  33. package/dist/BunMultipart.d.ts +28 -5
  34. package/dist/BunMultipart.d.ts.map +1 -1
  35. package/dist/BunMultipart.js +8 -4
  36. package/dist/BunMultipart.js.map +1 -1
  37. package/dist/BunPath.d.ts +12 -6
  38. package/dist/BunPath.d.ts.map +1 -1
  39. package/dist/BunPath.js +30 -7
  40. package/dist/BunPath.js.map +1 -1
  41. package/dist/BunRedis.d.ts +37 -7
  42. package/dist/BunRedis.d.ts.map +1 -1
  43. package/dist/BunRedis.js +37 -7
  44. package/dist/BunRedis.js.map +1 -1
  45. package/dist/BunRuntime.d.ts +6 -6
  46. package/dist/BunRuntime.d.ts.map +1 -1
  47. package/dist/BunRuntime.js +19 -3
  48. package/dist/BunRuntime.js.map +1 -1
  49. package/dist/BunServices.d.ts +32 -5
  50. package/dist/BunServices.d.ts.map +1 -1
  51. package/dist/BunServices.js +7 -3
  52. package/dist/BunServices.js.map +1 -1
  53. package/dist/BunSink.d.ts +2 -2
  54. package/dist/BunSink.js +2 -2
  55. package/dist/BunSocket.d.ts +30 -4
  56. package/dist/BunSocket.d.ts.map +1 -1
  57. package/dist/BunSocket.js +10 -3
  58. package/dist/BunSocket.js.map +1 -1
  59. package/dist/BunSocketServer.d.ts +2 -2
  60. package/dist/BunSocketServer.js +2 -2
  61. package/dist/BunStdio.d.ts +5 -2
  62. package/dist/BunStdio.d.ts.map +1 -1
  63. package/dist/BunStdio.js +24 -3
  64. package/dist/BunStdio.js.map +1 -1
  65. package/dist/BunStream.d.ts +3 -2
  66. package/dist/BunStream.d.ts.map +1 -1
  67. package/dist/BunStream.js +25 -3
  68. package/dist/BunStream.js.map +1 -1
  69. package/dist/BunTerminal.d.ts +8 -2
  70. package/dist/BunTerminal.d.ts.map +1 -1
  71. package/dist/BunTerminal.js +23 -3
  72. package/dist/BunTerminal.js.map +1 -1
  73. package/dist/BunWorker.d.ts +9 -2
  74. package/dist/BunWorker.d.ts.map +1 -1
  75. package/dist/BunWorker.js +28 -3
  76. package/dist/BunWorker.js.map +1 -1
  77. package/dist/BunWorkerRunner.d.ts +5 -1
  78. package/dist/BunWorkerRunner.d.ts.map +1 -1
  79. package/dist/BunWorkerRunner.js +24 -2
  80. package/dist/BunWorkerRunner.js.map +1 -1
  81. package/dist/index.d.ts +396 -21
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +396 -21
  84. package/dist/index.js.map +1 -1
  85. package/package.json +5 -5
  86. package/src/BunChildProcessSpawner.ts +1 -1
  87. package/src/BunClusterHttp.ts +44 -7
  88. package/src/BunClusterSocket.ts +48 -9
  89. package/src/BunCrypto.ts +16 -0
  90. package/src/BunFileSystem.ts +27 -3
  91. package/src/BunHttpClient.ts +2 -2
  92. package/src/BunHttpPlatform.ts +28 -4
  93. package/src/BunHttpServer.ts +59 -14
  94. package/src/BunHttpServerRequest.ts +26 -2
  95. package/src/BunMultipart.ts +28 -5
  96. package/src/BunPath.ts +30 -7
  97. package/src/BunRedis.ts +37 -7
  98. package/src/BunRuntime.ts +23 -7
  99. package/src/BunServices.ts +34 -5
  100. package/src/BunSink.ts +2 -2
  101. package/src/BunSocket.ts +30 -4
  102. package/src/BunSocketServer.ts +2 -2
  103. package/src/BunStdio.ts +24 -3
  104. package/src/BunStream.ts +25 -3
  105. package/src/BunTerminal.ts +23 -3
  106. package/src/BunWorker.ts +28 -3
  107. package/src/BunWorkerRunner.ts +24 -2
  108. package/src/index.ts +397 -21
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAA;AAErE;;GAEG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;A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;GAgBG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA"}
package/dist/index.js CHANGED
@@ -1,91 +1,466 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  // @barrel: Auto-generated exports. Do not edit manually.
5
5
  /**
6
6
  * Node.js implementation of `ChildProcessSpawner`.
7
7
  *
8
- * @since 1.0.0
8
+ * @since 4.0.0
9
9
  */
10
10
  export * as BunChildProcessSpawner from "./BunChildProcessSpawner.js";
11
11
  /**
12
- * @since 1.0.0
12
+ * The `BunClusterHttp` module provides the Bun HTTP and WebSocket transports
13
+ * for Effect Cluster runners. It wires `HttpRunner` to the Bun HTTP server,
14
+ * supplies Fetch and Bun WebSocket client protocols, and builds a complete
15
+ * sharding layer with serialization, runner health, runner storage, and message
16
+ * storage.
17
+ *
18
+ * **Common tasks**
19
+ *
20
+ * - Run a Bun process as a cluster runner over HTTP or WebSocket with
21
+ * {@link layer}
22
+ * - Connect a client-only process to an existing HTTP cluster without starting
23
+ * a runner server
24
+ * - Use SQL-backed storage for durable multi-process clusters, `local` storage
25
+ * for short-lived development, or `byo` storage when the deployment owns the
26
+ * persistence boundary
27
+ * - Check runner health with protocol pings or Kubernetes pod readiness through
28
+ * {@link layerK8sHttpClient}
29
+ *
30
+ * **Gotchas**
31
+ *
32
+ * - `runnerAddress` is the host and port advertised to other runners; set
33
+ * `runnerListenAddress` when the local bind address differs from the
34
+ * externally reachable address
35
+ * - The HTTP and WebSocket transports serve runner RPCs at the default
36
+ * `HttpRunner` route, so proxies and load balancers must preserve the path
37
+ * and allow WebSocket upgrades when `transport` is `"websocket"`
38
+ * - `clientOnly` does not start an HTTP server or receive shard assignments
39
+ * - SQL storage is the default; `local` storage is in-memory/noop and `byo`
40
+ * requires the surrounding application to provide both runner and message
41
+ * storage services
42
+ * - Ping health checks use the selected transport and serialization, so route,
43
+ * port, proxy, or codec mismatches can make a runner appear unhealthy
44
+ *
45
+ * @since 4.0.0
13
46
  */
14
47
  export * as BunClusterHttp from "./BunClusterHttp.js";
15
48
  /**
16
- * @since 1.0.0
49
+ * The `BunClusterSocket` module provides the Bun socket transport for Effect
50
+ * Cluster runners. It wires `SocketRunner` to Bun-compatible TCP sockets,
51
+ * supplies RPC client and server protocol layers, and builds a complete
52
+ * sharding layer with serialization, runner health, runner storage, and message
53
+ * storage.
54
+ *
55
+ * **Common tasks**
56
+ *
57
+ * - Run a Bun process as a cluster runner over raw TCP sockets with
58
+ * {@link layer}
59
+ * - Connect a client-only process to an existing socket cluster without
60
+ * starting a runner server
61
+ * - Use SQL-backed storage for durable multi-process clusters, `local` storage
62
+ * for short-lived development, or `byo` storage when the deployment owns the
63
+ * persistence boundary
64
+ * - Check runner health with socket pings or Kubernetes pod readiness through
65
+ * {@link layerK8sHttpClient}
66
+ *
67
+ * **Gotchas**
68
+ *
69
+ * - `runnerAddress` is the host and port advertised to other runners; set
70
+ * `runnerListenAddress` when the local bind address differs from the
71
+ * externally reachable address
72
+ * - The socket transport is point-to-point RPC, not cluster gossip: runner
73
+ * membership, shard ownership, and persisted delivery are coordinated through
74
+ * `RunnerStorage`, `MessageStorage`, and `RunnerHealth`
75
+ * - `clientOnly` does not start a socket server or receive shard assignments
76
+ * - SQL storage is the default; `local` storage is in-memory/noop and `byo`
77
+ * requires the surrounding application to provide both runner and message
78
+ * storage services
79
+ * - Ping health checks use the same socket protocol, so unreachable ports,
80
+ * firewalls, or serialization mismatches can make a runner appear unhealthy
81
+ * - Kubernetes health checks use Bun's Fetch-backed HTTP client and the service
82
+ * account CA certificate when it is available
83
+ *
84
+ * @since 4.0.0
17
85
  */
18
86
  export * as BunClusterSocket from "./BunClusterSocket.js";
19
87
  /**
88
+ * Bun platform Crypto service layer.
89
+ *
20
90
  * @since 1.0.0
21
91
  */
92
+ export * as BunCrypto from "./BunCrypto.js";
93
+ /**
94
+ * Bun layer for Effect's `FileSystem` service.
95
+ *
96
+ * Use this module at the edge of Bun applications, CLIs, scripts, and tests
97
+ * that need real local filesystem access through `effect/FileSystem`: reading
98
+ * and writing files, creating directories and temporary files, inspecting
99
+ * metadata, managing links, or watching paths for changes. It exposes only the
100
+ * Bun `FileSystem` layer; the operations themselves are accessed from the
101
+ * `FileSystem` service once the layer is provided, or from `BunServices.layer`
102
+ * when the program also needs the standard Bun path, stdio, terminal, and child
103
+ * process services.
104
+ *
105
+ * Bun supports Node-compatible filesystem APIs, so this layer reuses the shared
106
+ * Node filesystem implementation. Paths therefore follow the current process and
107
+ * host platform rules: relative paths are resolved from the current working
108
+ * directory, separators and drive/UNC behavior are platform-dependent, and
109
+ * request URLs should be decoded and validated before being mapped to local
110
+ * paths. The service works with bytes, scoped file handles, and Effect
111
+ * streams/sinks; use `FileSystem.stream` for large files instead of
112
+ * `readFile`, and remember that stream offsets and lengths are byte positions.
113
+ * Bun `File` and `Blob` values are not filesystem handles here; path-based HTTP
114
+ * file responses are handled by the Bun HTTP platform adapter with `Bun.file`.
115
+ *
116
+ * @since 4.0.0
117
+ */
22
118
  export * as BunFileSystem from "./BunFileSystem.js";
23
119
  /**
24
- * @since 1.0.0
120
+ * @since 4.0.0
25
121
  */
26
122
  export * as BunHttpClient from "./BunHttpClient.js";
27
123
  /**
28
- * @since 1.0.0
124
+ * Bun implementation of the Effect HTTP platform service.
125
+ *
126
+ * This module connects the portable `HttpPlatform` file response helpers to
127
+ * Bun's Web-compatible runtime. `BunHttpServer` provides this layer when
128
+ * applications serve local files, public assets, downloads, byte ranges, or
129
+ * Web `File` values from Effect `HttpServerResponse` constructors.
130
+ *
131
+ * Path-based responses are backed by `Bun.file`, and Web `File` responses are
132
+ * returned directly as raw response bodies. The shared `HttpPlatform` service
133
+ * still computes file metadata such as ETags and last-modified headers, while
134
+ * this adapter lets Bun's `Response` implementation handle the platform body.
135
+ *
136
+ * Because the Bun server adapter sits on top of Web `Request` and `Response`,
137
+ * request bodies follow the usual single-consumption rules: choose the
138
+ * streamed, text, URL-encoded, or multipart view that matches the route. For
139
+ * `FormData` responses, let the `Response` constructor create the multipart
140
+ * content type and boundary unless you intentionally override it. File
141
+ * responses take filesystem paths, not request URLs; Bun request URLs are
142
+ * absolute at the runtime edge, and route paths are normalized by
143
+ * `BunHttpServer`, so decode and validate URL pathnames before mapping them to
144
+ * files.
145
+ *
146
+ * @since 4.0.0
29
147
  */
30
148
  export * as BunHttpPlatform from "./BunHttpPlatform.js";
31
149
  /**
32
- * @since 1.0.0
150
+ * Bun implementation of the Effect `HttpServer`.
151
+ *
152
+ * This module builds an Effect HTTP server from `Bun.serve`, translating Bun's
153
+ * Web `Request` objects into `HttpServerRequest` values and Effect
154
+ * `HttpServerResponse` values back into Web `Response` objects. It is the Bun
155
+ * runtime entry point for serving `HttpApp`s, streaming responses, file
156
+ * responses through `BunHttpPlatform`, multipart requests, and websocket
157
+ * endpoints through `HttpServerRequest.upgrade`.
158
+ *
159
+ * Common use cases include using {@link layer} or {@link layerConfig} to serve
160
+ * an application from Bun configuration, {@link layerServer} when only the
161
+ * `HttpServer` service is needed, and {@link layerTest} for tests that need an
162
+ * ephemeral Bun listener and fetch-compatible client.
163
+ *
164
+ * Bun supplies absolute request URLs and Web-standard request bodies. This
165
+ * adapter stores the normalized path-and-query URL on `HttpServerRequest.url`,
166
+ * while the underlying `Request` still follows Web body rules: pick the
167
+ * streamed, text, JSON, URL-encoded, or multipart view that matches the route
168
+ * instead of consuming the same body in incompatible ways. Because `Bun.serve`
169
+ * has a single active `fetch` handler, each `serve` call reloads that handler
170
+ * and restores the previous one when the serve scope finalizes.
171
+ *
172
+ * WebSocket upgrades must happen from the Bun request handler. The
173
+ * `HttpServerRequest.upgrade` effect calls `server.upgrade`, fails when Bun says
174
+ * the request is not upgradeable, buffers messages that arrive before the
175
+ * Effect socket handler is installed, and maps non-normal close codes into
176
+ * `Socket` errors. The server is stopped with `server.stop()` when its
177
+ * acquisition scope closes; unless preemptive shutdown is disabled, finalizing
178
+ * a serve scope also starts that stop with the configured graceful shutdown
179
+ * timeout or the default timeout.
180
+ *
181
+ * @since 4.0.0
33
182
  */
34
183
  export * as BunHttpServer from "./BunHttpServer.js";
35
184
  /**
36
- * @since 1.0.0
185
+ * Accessors for the Bun `Request` object backing a platform Bun
186
+ * `HttpServerRequest`.
187
+ *
188
+ * Use this module at interop boundaries when an Effect HTTP handler needs the
189
+ * original `Bun.BunRequest`, for example to read Bun route parameters, pass the
190
+ * request to Bun-specific APIs, inspect Web `Request` fields that are not
191
+ * exposed by the portable `HttpServerRequest` interface, or coordinate with code
192
+ * that already works directly with Bun's server request type.
193
+ *
194
+ * The returned request is the original Web request supplied by `Bun.serve`. It
195
+ * does not reflect Effect request overrides made by middleware, such as a
196
+ * rewritten URL, adjusted headers, or a substituted remote address. Its body is
197
+ * the same one-shot Web `ReadableStream` used by the Effect body helpers, so
198
+ * calling `text`, `json`, `formData`, `arrayBuffer`, or reading `body` directly
199
+ * can disturb the request and conflict with Effect body, multipart, or stream
200
+ * helpers unless ownership of the body is clear.
201
+ *
202
+ * Bun stores client IP information on the server rather than on the request
203
+ * object. Prefer `HttpServerRequest.remoteAddress` when you need the address
204
+ * seen by Effect or middleware; the raw request returned here will not expose
205
+ * middleware-provided remote address overrides.
206
+ *
207
+ * @since 4.0.0
37
208
  */
38
209
  export * as BunHttpServerRequest from "./BunHttpServerRequest.js";
39
210
  /**
40
- * @since 1.0.0
211
+ * Bun-specific helpers for parsing HTTP `multipart/form-data` request bodies.
212
+ *
213
+ * This module adapts a Bun `Request` body and headers into the shared
214
+ * `Multipart` model. Use `stream` from Bun HTTP handlers when form fields and
215
+ * uploaded files should be consumed incrementally, for example validating text
216
+ * fields while piping large file parts to storage. Use `persisted` when the
217
+ * whole form should be collected into a record and file parts should be written
218
+ * to scoped temporary files through the current `FileSystem`, `Path`, and
219
+ * `Scope` services.
220
+ *
221
+ * Bun requests expose one-shot web streams, so choose one body reader and do
222
+ * not call `formData`, `text`, `json`, or `arrayBuffer` before using this
223
+ * module. Incoming `FormData` uploads must include a `multipart/form-data`
224
+ * content type with the boundary generated by the client; when constructing
225
+ * `FormData` requests, let the runtime set that header. Stream file content for
226
+ * large uploads, reserve `contentEffect` for small files, and treat client
227
+ * filenames as metadata rather than trusted filesystem paths. Persisted file
228
+ * paths remain valid only for the surrounding scope.
229
+ *
230
+ * @since 4.0.0
41
231
  */
42
232
  export * as BunMultipart from "./BunMultipart.js";
43
233
  /**
44
- * @since 1.0.0
234
+ * Bun layers for Effect's `Path` service.
235
+ *
236
+ * Use this module when an Effect program running on Bun needs path
237
+ * manipulation from the `Path` service, such as joining and normalizing local
238
+ * filesystem locations, resolving configuration or static asset paths, handling
239
+ * CLI path arguments, or converting between filesystem paths and `file:` URLs.
240
+ *
241
+ * Bun exposes Node-compatible path behavior, so these layers reuse the shared
242
+ * Node path implementation. The default `layer` follows the host operating
243
+ * system's path rules, including separators, absolute paths, drive letters, and
244
+ * UNC paths where applicable. Use `layerPosix` or `layerWin32` when code needs
245
+ * stable POSIX or Windows semantics regardless of where Bun is running. These
246
+ * layers only manipulate path strings; they do not read the filesystem, validate
247
+ * that paths exist, or turn request URLs into safe local paths. `BunServices`
248
+ * already includes the default Bun path layer, so provide this module directly
249
+ * when you need only `Path` or one of the platform-specific variants.
250
+ *
251
+ * @since 4.0.0
45
252
  */
46
253
  export * as BunPath from "./BunPath.js";
47
254
  /**
48
- * @since 1.0.0
255
+ * Bun Redis integration backed by Bun's built-in `RedisClient`.
256
+ *
257
+ * This module provides scoped layers that create a Bun `RedisClient` and expose
258
+ * both the low-level `Redis` service used by Effect persistence modules and the
259
+ * `BunRedis` service for direct access to the underlying client. Use it in Bun
260
+ * applications that need Redis-backed persistence, persisted queues,
261
+ * distributed rate limiting, custom Redis commands, or Bun Redis features such
262
+ * as pub/sub through the raw client.
263
+ *
264
+ * The client is acquired when the layer is built and closed with `close` when
265
+ * the layer scope ends, so install the layer at the lifetime you want for the
266
+ * connection and pass a Redis URL, Bun `RedisOptions`, or `layerConfig` for
267
+ * connection settings. The portable `Redis` service sends ordinary commands
268
+ * through `RedisClient.send`; pub/sub is available through `BunRedis.client`
269
+ * or `BunRedis.use` and should normally use a separately scoped client so a
270
+ * subscription does not interfere with command traffic used by persistence or
271
+ * rate limiter stores.
272
+ *
273
+ * Persistence and rate limiter stores build keys and Lua scripts on top of this
274
+ * service. Choose stable prefixes and store ids to avoid collisions, account
275
+ * for persisted values that may fail to decode after schema changes, and avoid
276
+ * unbounded high-cardinality rate-limit keys unless you have a cleanup or
277
+ * bounding strategy.
278
+ *
279
+ * @since 4.0.0
49
280
  */
50
281
  export * as BunRedis from "./BunRedis.js";
51
282
  /**
52
- * @since 1.0.0
283
+ * Bun entry-point helpers for running Effect programs.
284
+ *
285
+ * This module exposes `runMain`, the Bun runtime launcher used at the edge of
286
+ * CLIs, scripts, servers, and worker processes. It runs an already
287
+ * self-contained Effect as the process main program, using the shared
288
+ * Node-compatible runtime implementation for error reporting, teardown, and
289
+ * `process` signal handling available in Bun.
290
+ *
291
+ * `BunRuntime` does not provide application services by itself. Provide any
292
+ * required layers, such as `BunServices.layer` or narrower service-specific
293
+ * layers, before passing the effect to `runMain`. On `SIGINT` or `SIGTERM`,
294
+ * the main fiber is interrupted so scoped resources and finalizers can shut
295
+ * down; keep long-running servers, workers, and subscriptions attached to that
296
+ * scope and avoid finalizers that never complete, otherwise process shutdown
297
+ * can be delayed.
298
+ *
299
+ * @since 4.0.0
53
300
  */
54
301
  export * as BunRuntime from "./BunRuntime.js";
55
302
  /**
56
- * @since 1.0.0
303
+ * Provides the aggregate Bun platform services layer for applications that run
304
+ * on the Bun runtime.
305
+ *
306
+ * This module is useful when an application needs the standard Bun-backed
307
+ * implementations of filesystem access, path operations, stdio, terminal
308
+ * interaction, and child process spawning from a single layer. Provide
309
+ * `BunServices.layer` near the edge of a program to satisfy effects that read
310
+ * or write files, resolve paths, interact with stdin/stdout/stderr or a
311
+ * terminal, or launch subprocesses.
312
+ *
313
+ * The layer only supplies the runtime services listed by `BunServices`; it does
314
+ * not provide unrelated platform services such as HTTP clients, HTTP servers,
315
+ * sockets, workers, or Redis. Several of these core Bun services are backed by
316
+ * the shared Node-compatible implementations used by the Bun adapters, so the
317
+ * default path, stdio, terminal, and subprocess behavior follows the current
318
+ * process and host platform. Libraries should continue to depend on the
319
+ * individual service tags they use, while Bun applications, CLIs, and tests can
320
+ * choose this layer or narrower service-specific layers depending on how much
321
+ * of the Bun runtime they want to expose.
322
+ *
323
+ * @since 4.0.0
57
324
  */
58
325
  export * as BunServices from "./BunServices.js";
59
326
  /**
60
- * @since 1.0.0
327
+ * @since 4.0.0
61
328
  */
62
329
  export * as BunSink from "./BunSink.js";
63
330
  /**
64
- * @since 1.0.0
331
+ * Bun platform socket entry point for Effect sockets backed by Bun-compatible
332
+ * Node streams and Bun's native WebSocket implementation.
333
+ *
334
+ * This module re-exports the shared Node socket constructors for TCP clients,
335
+ * Unix domain socket clients, and adapters from existing Node `Duplex` streams,
336
+ * then adds Bun-specific WebSocket layers using `globalThis.WebSocket`. Use it
337
+ * in Bun applications that connect to raw socket protocols, Unix sockets,
338
+ * realtime WebSocket services, or Effect RPC transports that need a
339
+ * `Socket.Socket` layer.
340
+ *
341
+ * TCP lifecycle behavior comes from the shared Node layer: sockets are scoped,
342
+ * finalizers close or destroy the underlying stream, open timeouts become
343
+ * socket open errors, and read, write, and close events are mapped to
344
+ * `SocketError` values. TLS concerns depend on the transport being used: `wss:`
345
+ * URLs are handled by Bun's WebSocket implementation, while TLS-wrapped
346
+ * `Duplex` streams can be adapted after they have been created elsewhere.
347
+ * When closing intentionally, send `Socket.CloseEvent` values so the close code
348
+ * and reason are preserved through the socket lifecycle.
349
+ *
350
+ * @since 4.0.0
65
351
  */
66
352
  export * as BunSocket from "./BunSocket.js";
67
353
  /**
68
- * @since 1.0.0
354
+ * @since 4.0.0
69
355
  */
70
356
  export * as BunSocketServer from "./BunSocketServer.js";
71
357
  /**
72
- * @since 1.0.0
358
+ * Bun-backed implementation of Effect's `Stdio` service.
359
+ *
360
+ * This module provides the process stdio layer for Bun applications by reusing
361
+ * the shared Node-compatible implementation. The layer connects `Stdio` to the
362
+ * current Bun process: arguments come from `process.argv`, input is read from
363
+ * `process.stdin`, and output and error output write to `process.stdout` and
364
+ * `process.stderr`. It is intended for CLIs, scripts, command runners, test
365
+ * harnesses, and other process-oriented programs that need standard input and
366
+ * output through Effect services.
367
+ *
368
+ * The underlying stdio streams are global resources owned by the Bun process.
369
+ * The layer keeps stdin open and does not end stdout or stderr by default,
370
+ * which avoids closing handles that prompts, loggers, or other code may still
371
+ * use. Stdio may be attached to a TTY, pipe, or redirected file, so
372
+ * terminal-specific behavior such as raw mode, echo, colors, cursor control,
373
+ * and terminal dimensions should be coordinated with terminal APIs rather than
374
+ * assumed from this layer.
375
+ *
376
+ * @since 4.0.0
73
377
  */
74
378
  export * as BunStdio from "./BunStdio.js";
75
379
  /**
76
- * @since 1.0.0
380
+ * Bun stream interoperability for Effect streams.
381
+ *
382
+ * This module provides Bun-specific adapters for working with streaming data at
383
+ * the boundary between Bun APIs and Effect. It re-exports the shared Node stream
384
+ * adapters for Bun's Node-compatible stream APIs, and adds an optimized
385
+ * `ReadableStream` constructor that uses Bun's `readMany` support to pull
386
+ * batches of Web Stream values into an Effect `Stream`.
387
+ *
388
+ * Common uses include adapting Bun `Request` and `Response` bodies, multipart
389
+ * uploads, and other Web `ReadableStream` sources so they can be transformed,
390
+ * decoded, or piped with Effect stream operators. Pulling from the Effect stream
391
+ * drives reads from the underlying reader, while Bun and the Web Streams runtime
392
+ * still control their own internal buffering and source backpressure.
393
+ *
394
+ * Web `ReadableStream` readers take an exclusive lock on the source. Request and
395
+ * response bodies are also one-shot: once consumed they become disturbed and
396
+ * should not be read through another API. The adapter cancels the reader when
397
+ * the consuming scope is finalized by default; set `releaseLockOnEnd` when the
398
+ * stream is externally owned and should only have its lock released. Read errors
399
+ * are mapped through the provided `onError` function.
400
+ *
401
+ * @since 4.0.0
77
402
  */
78
403
  export * as BunStream from "./BunStream.js";
79
404
  /**
80
- * @since 1.0.0
405
+ * Bun-backed implementation of Effect's `Terminal` service.
406
+ *
407
+ * This module provides a scoped, process-backed terminal for Bun programs by
408
+ * adapting the runtime's Node-compatible stdin, stdout, and `readline` support.
409
+ * It is useful for CLIs, prompts, REPLs, and terminal interfaces that need
410
+ * prompt output, line input, keypress input, or terminal dimensions.
411
+ *
412
+ * The service uses the current process streams, so acquire it with a scope or
413
+ * provide `layer` to ensure cleanup. When stdin is attached to a TTY, raw mode
414
+ * is enabled while the terminal is active and restored when the scope closes;
415
+ * this changes how keys are delivered and can affect other consumers of stdin.
416
+ * In pipes, redirected input, or CI, raw mode may be unavailable, keypress input
417
+ * is limited, and stdout dimensions may be reported as zero.
418
+ *
419
+ * @since 4.0.0
81
420
  */
82
421
  export * as BunTerminal from "./BunTerminal.js";
83
422
  /**
84
- * @since 1.0.0
423
+ * Parent-side Bun support for Effect workers.
424
+ *
425
+ * This module provides the `WorkerPlatform` used by Bun programs that spawn
426
+ * and communicate with `globalThis.Worker` instances through Effect's worker
427
+ * protocol. Pair it with `BunWorkerRunner` in the worker entrypoint when
428
+ * building worker-backed RPC clients, moving CPU-bound work off the main
429
+ * thread, isolating Bun-only services, or hosting long-lived handlers behind a
430
+ * typed message boundary.
431
+ *
432
+ * The supplied spawner is responsible for creating the Bun worker for each
433
+ * numeric worker id. Messages follow Bun's worker cloning and transfer
434
+ * semantics, so payloads and transfer lists must be accepted by the Bun worker
435
+ * runtime. Calls to `send` are buffered until the worker runner posts its ready
436
+ * signal; if the worker entrypoint never starts `BunWorkerRunner`, those
437
+ * buffered messages will not be delivered. Scope finalization sends the Effect
438
+ * worker close signal, waits for Bun's `close` event for a short grace period,
439
+ * and then terminates the worker if graceful shutdown does not complete.
440
+ *
441
+ * @since 4.0.0
85
442
  */
86
443
  export * as BunWorker from "./BunWorker.js";
87
444
  /**
88
- * @since 1.0.0
445
+ * Bun runtime support for Effect worker runners.
446
+ *
447
+ * This module is intended for code that is already executing inside a Bun
448
+ * `Worker`. It provides the `WorkerRunnerPlatform` used by `WorkerRunner` to
449
+ * receive request messages from the parent, run the registered Effect handler,
450
+ * and send responses back over Bun's worker `postMessage` channel.
451
+ *
452
+ * Use it with `BunWorker` when a Bun program needs to move RPC handlers,
453
+ * CPU-bound computations, or Bun-only services into an isolated worker while
454
+ * communicating through the Effect worker protocol. The runner must be started
455
+ * from the worker entrypoint, not the parent process; startup fails when the
456
+ * current global worker scope does not expose `postMessage`. Shutdown is driven
457
+ * by the parent protocol message, which closes the worker port, so long-running
458
+ * handlers should remain interruptible and keep resource cleanup in scopes.
459
+ * Messages follow Bun's worker cloning and transfer semantics, so payload
460
+ * schemas, transfer lists, `messageerror` events, and worker `error` events
461
+ * should be considered at the boundary.
462
+ *
463
+ * @since 4.0.0
89
464
  */
90
465
  export * as BunWorkerRunner from "./BunWorkerRunner.js";
91
466
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["BunChildProcessSpawner","BunClusterHttp","BunClusterSocket","BunFileSystem","BunHttpClient","BunHttpPlatform","BunHttpServer","BunHttpServerRequest","BunMultipart","BunPath","BunRedis","BunRuntime","BunServices","BunSink","BunSocket","BunSocketServer","BunStdio","BunStream","BunTerminal","BunWorker","BunWorkerRunner"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;AAKA,OAAO,KAAKA,sBAAsB,MAAM,6BAA6B;AAErE;;;AAGA,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AAErD;;;AAGA,OAAO,KAAKC,gBAAgB,MAAM,uBAAuB;AAEzD;;;AAGA,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAKC,eAAe,MAAM,sBAAsB;AAEvD;;;AAGA,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AAEnD;;;AAGA,OAAO,KAAKC,oBAAoB,MAAM,2BAA2B;AAEjE;;;AAGA,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,eAAe,MAAM,sBAAsB;AAEvD;;;AAGA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,eAAe,MAAM,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["BunChildProcessSpawner","BunClusterHttp","BunClusterSocket","BunCrypto","BunFileSystem","BunHttpClient","BunHttpPlatform","BunHttpServer","BunHttpServerRequest","BunMultipart","BunPath","BunRedis","BunRuntime","BunServices","BunSink","BunSocket","BunSocketServer","BunStdio","BunStream","BunTerminal","BunWorker","BunWorkerRunner"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;AAKA,OAAO,KAAKA,sBAAsB,MAAM,6BAA6B;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AAErD;;;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KC,WAAW,MAAM,kBAAkB;AAE/C;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKC,eAAe,MAAM,sBAAsB","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@effect/platform-bun",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.66",
4
+ "version": "4.0.0-beta.68",
5
5
  "license": "MIT",
6
6
  "description": "Platform specific implementations for the Bun runtime",
7
7
  "homepage": "https://effect.website",
@@ -45,14 +45,14 @@
45
45
  "provenance": true
46
46
  },
47
47
  "peerDependencies": {
48
- "effect": "^4.0.0-beta.66"
48
+ "effect": "^4.0.0-beta.68"
49
49
  },
50
50
  "dependencies": {
51
- "@effect/platform-node-shared": "^4.0.0-beta.66"
51
+ "@effect/platform-node-shared": "^4.0.0-beta.68"
52
52
  },
53
53
  "devDependencies": {
54
- "@types/bun": "^1.3.12",
55
- "effect": "^4.0.0-beta.66"
54
+ "@types/bun": "^1.3.13",
55
+ "effect": "^4.0.0-beta.68"
56
56
  },
57
57
  "scripts": {
58
58
  "codegen": "effect-utils codegen",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Node.js implementation of `ChildProcessSpawner`.
3
3
  *
4
- * @since 1.0.0
4
+ * @since 4.0.0
5
5
  */
6
6
  export * from "@effect/platform-node-shared/NodeChildProcessSpawner"
@@ -1,5 +1,38 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * The `BunClusterHttp` module provides the Bun HTTP and WebSocket transports
3
+ * for Effect Cluster runners. It wires `HttpRunner` to the Bun HTTP server,
4
+ * supplies Fetch and Bun WebSocket client protocols, and builds a complete
5
+ * sharding layer with serialization, runner health, runner storage, and message
6
+ * storage.
7
+ *
8
+ * **Common tasks**
9
+ *
10
+ * - Run a Bun process as a cluster runner over HTTP or WebSocket with
11
+ * {@link layer}
12
+ * - Connect a client-only process to an existing HTTP cluster without starting
13
+ * a runner server
14
+ * - Use SQL-backed storage for durable multi-process clusters, `local` storage
15
+ * for short-lived development, or `byo` storage when the deployment owns the
16
+ * persistence boundary
17
+ * - Check runner health with protocol pings or Kubernetes pod readiness through
18
+ * {@link layerK8sHttpClient}
19
+ *
20
+ * **Gotchas**
21
+ *
22
+ * - `runnerAddress` is the host and port advertised to other runners; set
23
+ * `runnerListenAddress` when the local bind address differs from the
24
+ * externally reachable address
25
+ * - The HTTP and WebSocket transports serve runner RPCs at the default
26
+ * `HttpRunner` route, so proxies and load balancers must preserve the path
27
+ * and allow WebSocket upgrades when `transport` is `"websocket"`
28
+ * - `clientOnly` does not start an HTTP server or receive shard assignments
29
+ * - SQL storage is the default; `local` storage is in-memory/noop and `byo`
30
+ * requires the surrounding application to provide both runner and message
31
+ * storage services
32
+ * - Ping health checks use the selected transport and serialization, so route,
33
+ * port, proxy, or codec mismatches can make a runner appear unhealthy
34
+ *
35
+ * @since 4.0.0
3
36
  */
4
37
  import type * as Config from "effect/Config"
5
38
  import * as Effect from "effect/Effect"
@@ -29,15 +62,17 @@ import * as BunSocket from "./BunSocket.ts"
29
62
 
30
63
  export {
31
64
  /**
32
- * @since 1.0.0
33
- * @category Re-exports
65
+ * @category re-exports
66
+ * @since 4.0.0
34
67
  */
35
68
  layerK8sHttpClient
36
69
  }
37
70
 
38
71
  /**
39
- * @since 1.0.0
40
- * @category Layers
72
+ * Bun HTTP server layer for cluster runners, using `ShardingConfig.runnerListenAddress` or `runnerAddress` as the listen address.
73
+ *
74
+ * @category layers
75
+ * @since 4.0.0
41
76
  */
42
77
  export const layerHttpServer: Layer.Layer<
43
78
  | HttpPlatform
@@ -56,8 +91,10 @@ export const layerHttpServer: Layer.Layer<
56
91
  }).pipe(Layer.unwrap)
57
92
 
58
93
  /**
59
- * @since 1.0.0
60
- * @category Layers
94
+ * Creates Bun cluster layers for HTTP or WebSocket transport, configuring serialization, storage, runner health, and optional client-only mode.
95
+ *
96
+ * @category layers
97
+ * @since 4.0.0
61
98
  */
62
99
  export const layer = <
63
100
  const ClientOnly extends boolean = false,