@effect/platform-bun 4.0.0-rc.111 → 4.0.0-rc.113

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 (49) hide show
  1. package/AGENTS.md +24 -9
  2. package/CLAUDE.md +24 -9
  3. package/ai-docs/package.json +2 -2
  4. package/ai-docs/src/01_effect/01_basics/02_effect-fn.ts +18 -5
  5. package/ai-docs/src/01_effect/01_basics/index.md +5 -3
  6. package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +1 -1
  7. package/ai-docs/src/01_effect/03_services/20_layer-unwrap.ts +2 -2
  8. package/ai-docs/src/01_effect/05_resources/10_acquire-release.ts +2 -2
  9. package/ai-docs/src/03_stream/30_encoding.ts +5 -7
  10. package/ai-docs/src/08_observability/10_logging.ts +1 -1
  11. package/ai-docs/src/70_cli/10_basics.ts +7 -7
  12. package/ai-docs/src/71_ai/10_language-model.ts +2 -2
  13. package/ai-docs/src/71_ai/20_tools.ts +1 -1
  14. package/ai-docs/src/71_ai/30_chat.ts +1 -1
  15. package/dist/BunClusterHttp.d.ts +2 -2
  16. package/dist/BunClusterHttp.d.ts.map +1 -1
  17. package/dist/BunClusterHttp.js +3 -3
  18. package/dist/BunClusterHttp.js.map +1 -1
  19. package/dist/BunClusterSocket.d.ts +1 -1
  20. package/dist/BunClusterSocket.d.ts.map +1 -1
  21. package/dist/BunClusterSocket.js +2 -2
  22. package/dist/BunClusterSocket.js.map +1 -1
  23. package/dist/BunHttpPlatform.d.ts.map +1 -1
  24. package/dist/BunHttpPlatform.js +7 -4
  25. package/dist/BunHttpPlatform.js.map +1 -1
  26. package/dist/BunHttpServer.d.ts +22 -7
  27. package/dist/BunHttpServer.d.ts.map +1 -1
  28. package/dist/BunHttpServer.js +149 -39
  29. package/dist/BunHttpServer.js.map +1 -1
  30. package/dist/BunRedis.d.ts +1 -1
  31. package/dist/BunRedis.d.ts.map +1 -1
  32. package/dist/BunRedis.js +3 -12
  33. package/dist/BunRedis.js.map +1 -1
  34. package/dist/BunSocket.d.ts +3 -3
  35. package/dist/BunSocket.d.ts.map +1 -1
  36. package/dist/BunSocket.js +6 -3
  37. package/dist/BunSocket.js.map +1 -1
  38. package/dist/BunStream.d.ts +1 -1
  39. package/dist/BunStream.d.ts.map +1 -1
  40. package/dist/BunStream.js +8 -2
  41. package/dist/BunStream.js.map +1 -1
  42. package/package.json +5 -5
  43. package/src/BunClusterHttp.ts +3 -3
  44. package/src/BunClusterSocket.ts +4 -2
  45. package/src/BunHttpPlatform.ts +8 -4
  46. package/src/BunHttpServer.ts +180 -62
  47. package/src/BunRedis.ts +2 -1
  48. package/src/BunSocket.ts +7 -4
  49. package/src/BunStream.ts +12 -3
package/AGENTS.md CHANGED
@@ -11,9 +11,11 @@ purposes. In practice, you would not include these comments in your code.
11
11
 
12
12
  ## Writing `Effect` code
13
13
 
14
- Prefer writing Effect code with `Effect.gen` & `Effect.fn("name")`. Then attach
15
- additional behaviour with combinators. This style is more readable and easier to
16
- maintain than using combinators alone.
14
+ Prefer `Effect.gen` for inline Effect code. For reusable functions, prefer
15
+ `Effect.fn("name")` when tracing is useful and `Effect.fnUntraced` when it is not,
16
+ particularly in library implementations and hot paths. Avoid functions that only
17
+ wrap and return `Effect.gen`. Attach additional behaviour with combinators; this
18
+ style is more readable and easier to maintain than using combinators alone.
17
19
 
18
20
  ### Using Effect.gen
19
21
 
@@ -46,13 +48,16 @@ export class FileProcessingError extends Schema.TaggedError<FileProcessingError>
46
48
  }) {}
47
49
  ```
48
50
 
49
- ### Using Effect.fn
51
+ ### Using Effect.fn and Effect.fnUntraced
50
52
 
51
- When writing functions that return an Effect, use `Effect.fn` to use the
52
- generator syntax.
53
+ When writing reusable functions that return an Effect, use `Effect.fn` or
54
+ `Effect.fnUntraced` to use the generator syntax.
53
55
 
54
- **Avoid creating functions that return an Effect.gen**, use `Effect.fn`
55
- instead.
56
+ Use `Effect.fn("name")` when the function should create a tracing span. Prefer
57
+ `Effect.fnUntraced` when tracing is not needed, particularly for library
58
+ implementations and hot paths.
59
+
60
+ **Avoid creating functions that only wrap and return an `Effect.gen`**.
56
61
 
57
62
  ```ts
58
63
  import { Effect, Schema } from "effect"
@@ -80,6 +85,16 @@ export const effectFunction = Effect.fn("effectFunction")(
80
85
  })
81
86
  )
82
87
 
88
+ // Effect.fnUntraced avoids tracing and stack-frame capture while still reusing
89
+ // the generator body. This is preferred for library functions that do not
90
+ // represent a useful tracing boundary.
91
+ export const validateBatchSize = Effect.fnUntraced(function*(size: number): Effect.fn.Return<number, SomeError> {
92
+ if (!Number.isInteger(size) || size <= 0) {
93
+ return yield* new SomeError({ message: "Batch size must be a positive integer" })
94
+ }
95
+ return size
96
+ })
97
+
83
98
  // Use Schema.TaggedError to define a custom error
84
99
  export class SomeError extends Schema.TaggedError<SomeError>()("SomeError", {
85
100
  message: Schema.String
@@ -247,7 +262,7 @@ They let you model finite or infinite data sources.
247
262
  - `NodeStream.fromReadable` for Node.js readable streams
248
263
  - **[Consuming and transforming streams](./ai-docs/src/03_stream/20_consuming-streams.ts)**: How to transform and consume streams using operators like `map`, `flatMap`, `filter`, `mapEffect`, and various `run*` methods.
249
264
  - **[Decoding and encoding streams](./ai-docs/src/03_stream/30_encoding.ts)**:
250
- Use `Stream.pipeThroughChannel` with the `Ndjson` & `Msgpack` modules to
265
+ Use `Stream.pipeThroughChannel` with the `Ndjson` and `SchemaBinary` modules to
251
266
  decode and encode streams of structured data.
252
267
 
253
268
  ## Integrating Effect into existing applications
package/CLAUDE.md CHANGED
@@ -11,9 +11,11 @@ purposes. In practice, you would not include these comments in your code.
11
11
 
12
12
  ## Writing `Effect` code
13
13
 
14
- Prefer writing Effect code with `Effect.gen` & `Effect.fn("name")`. Then attach
15
- additional behaviour with combinators. This style is more readable and easier to
16
- maintain than using combinators alone.
14
+ Prefer `Effect.gen` for inline Effect code. For reusable functions, prefer
15
+ `Effect.fn("name")` when tracing is useful and `Effect.fnUntraced` when it is not,
16
+ particularly in library implementations and hot paths. Avoid functions that only
17
+ wrap and return `Effect.gen`. Attach additional behaviour with combinators; this
18
+ style is more readable and easier to maintain than using combinators alone.
17
19
 
18
20
  ### Using Effect.gen
19
21
 
@@ -46,13 +48,16 @@ export class FileProcessingError extends Schema.TaggedError<FileProcessingError>
46
48
  }) {}
47
49
  ```
48
50
 
49
- ### Using Effect.fn
51
+ ### Using Effect.fn and Effect.fnUntraced
50
52
 
51
- When writing functions that return an Effect, use `Effect.fn` to use the
52
- generator syntax.
53
+ When writing reusable functions that return an Effect, use `Effect.fn` or
54
+ `Effect.fnUntraced` to use the generator syntax.
53
55
 
54
- **Avoid creating functions that return an Effect.gen**, use `Effect.fn`
55
- instead.
56
+ Use `Effect.fn("name")` when the function should create a tracing span. Prefer
57
+ `Effect.fnUntraced` when tracing is not needed, particularly for library
58
+ implementations and hot paths.
59
+
60
+ **Avoid creating functions that only wrap and return an `Effect.gen`**.
56
61
 
57
62
  ```ts
58
63
  import { Effect, Schema } from "effect"
@@ -80,6 +85,16 @@ export const effectFunction = Effect.fn("effectFunction")(
80
85
  })
81
86
  )
82
87
 
88
+ // Effect.fnUntraced avoids tracing and stack-frame capture while still reusing
89
+ // the generator body. This is preferred for library functions that do not
90
+ // represent a useful tracing boundary.
91
+ export const validateBatchSize = Effect.fnUntraced(function*(size: number): Effect.fn.Return<number, SomeError> {
92
+ if (!Number.isInteger(size) || size <= 0) {
93
+ return yield* new SomeError({ message: "Batch size must be a positive integer" })
94
+ }
95
+ return size
96
+ })
97
+
83
98
  // Use Schema.TaggedError to define a custom error
84
99
  export class SomeError extends Schema.TaggedError<SomeError>()("SomeError", {
85
100
  message: Schema.String
@@ -247,7 +262,7 @@ They let you model finite or infinite data sources.
247
262
  - `NodeStream.fromReadable` for Node.js readable streams
248
263
  - **[Consuming and transforming streams](./ai-docs/src/03_stream/20_consuming-streams.ts)**: How to transform and consume streams using operators like `map`, `flatMap`, `filter`, `mapEffect`, and various `run*` methods.
249
264
  - **[Decoding and encoding streams](./ai-docs/src/03_stream/30_encoding.ts)**:
250
- Use `Stream.pipeThroughChannel` with the `Ndjson` & `Msgpack` modules to
265
+ Use `Stream.pipeThroughChannel` with the `Ndjson` and `SchemaBinary` modules to
251
266
  decode and encode streams of structured data.
252
267
 
253
268
  ## Integrating Effect into existing applications
@@ -27,8 +27,8 @@
27
27
  "@effect/sql-sqlite-wasm": "workspace:*",
28
28
  "@effect/vitest": "workspace:*",
29
29
  "effect": "workspace:*",
30
- "hono": "^4.13.2",
31
- "nodemailer": "^9.0.5"
30
+ "hono": "^4.13.7",
31
+ "nodemailer": "^10.0.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/nodemailer": "^8.0.1"
@@ -1,11 +1,14 @@
1
1
  /**
2
- * @title Using Effect.fn
2
+ * @title Using Effect.fn and Effect.fnUntraced
3
3
  *
4
- * When writing functions that return an Effect, use `Effect.fn` to use the
5
- * generator syntax.
4
+ * When writing reusable functions that return an Effect, use `Effect.fn` or
5
+ * `Effect.fnUntraced` to use the generator syntax.
6
6
  *
7
- * **Avoid creating functions that return an Effect.gen**, use `Effect.fn`
8
- * instead.
7
+ * Use `Effect.fn("name")` when the function should create a tracing span. Prefer
8
+ * `Effect.fnUntraced` when tracing is not needed, particularly for library
9
+ * implementations and hot paths.
10
+ *
11
+ * **Avoid creating functions that only wrap and return an `Effect.gen`**.
9
12
  */
10
13
 
11
14
  import { Effect, Schema } from "effect"
@@ -33,6 +36,16 @@ export const effectFunction = Effect.fn("effectFunction")(
33
36
  })
34
37
  )
35
38
 
39
+ // Effect.fnUntraced avoids tracing and stack-frame capture while still reusing
40
+ // the generator body. This is preferred for library functions that do not
41
+ // represent a useful tracing boundary.
42
+ export const validateBatchSize = Effect.fnUntraced(function*(size: number): Effect.fn.Return<number, SomeError> {
43
+ if (!Number.isInteger(size) || size <= 0) {
44
+ return yield* new SomeError({ message: "Batch size must be a positive integer" })
45
+ }
46
+ return size
47
+ })
48
+
36
49
  // Use Schema.TaggedError to define a custom error
37
50
  export class SomeError extends Schema.TaggedError<SomeError>()("SomeError", {
38
51
  message: Schema.String
@@ -1,5 +1,7 @@
1
1
  ## Writing `Effect` code
2
2
 
3
- Prefer writing Effect code with `Effect.gen` & `Effect.fn("name")`. Then attach
4
- additional behaviour with combinators. This style is more readable and easier to
5
- maintain than using combinators alone.
3
+ Prefer `Effect.gen` for inline Effect code. For reusable functions, prefer
4
+ `Effect.fn("name")` when tracing is useful and `Effect.fnUntraced` when it is not,
5
+ particularly in library implementations and hot paths. Avoid functions that only
6
+ wrap and return `Effect.gen`. Attach additional behaviour with combinators; this
7
+ style is more readable and easier to maintain than using combinators alone.
@@ -14,7 +14,7 @@ export const SqlClientLayer: Layer.Layer<
14
14
  PgClient.PgClient | SqlClient.SqlClient,
15
15
  Config.ConfigError | SqlError.SqlError
16
16
  > = PgClient.layerConfig({
17
- url: Config.redacted("DATABASE_URL")
17
+ url: Config.Redacted("DATABASE_URL")
18
18
  })
19
19
 
20
20
  export class UserRespositoryError extends Schema.TaggedError<UserRespositoryError>()("UserRespositoryError", {
@@ -51,7 +51,7 @@ export class MessageStore extends Context.Service<MessageStore, {
51
51
  static readonly layer = Layer.unwrap(
52
52
  Effect.gen(function*() {
53
53
  // Read config inside an Effect, then choose which concrete layer to use.
54
- const useInMemory = yield* Config.boolean("MESSAGE_STORE_IN_MEMORY").pipe(
54
+ const useInMemory = yield* Config.Boolean("MESSAGE_STORE_IN_MEMORY").pipe(
55
55
  Config.withDefault(false)
56
56
  )
57
57
 
@@ -59,7 +59,7 @@ export class MessageStore extends Context.Service<MessageStore, {
59
59
  return MessageStore.layerInMemory
60
60
  }
61
61
 
62
- const remoteUrl = yield* Config.url("MESSAGE_STORE_URL")
62
+ const remoteUrl = yield* Config.URL("MESSAGE_STORE_URL")
63
63
  return MessageStore.layerRemote(remoteUrl)
64
64
  })
65
65
  )
@@ -22,8 +22,8 @@ export class Smtp extends Context.Service<Smtp, {
22
22
  static readonly layer = Layer.effect(
23
23
  Smtp,
24
24
  Effect.gen(function*() {
25
- const user = yield* Config.string("SMTP_USER")
26
- const pass = yield* Config.redacted("SMTP_PASS")
25
+ const user = yield* Config.String("SMTP_USER")
26
+ const pass = yield* Config.Redacted("SMTP_PASS")
27
27
 
28
28
  // Use `Effect.acquireRelease` to manage the lifecycle of the SMTP
29
29
  // transporter.
@@ -1,19 +1,17 @@
1
1
  /**
2
2
  * @title Decoding and encoding streams
3
3
  *
4
- * Use `Stream.pipeThroughChannel` with the `Ndjson` & `Msgpack` modules to
4
+ * Use `Stream.pipeThroughChannel` with the `Ndjson` and `SchemaBinary` modules to
5
5
  * decode and encode streams of structured data.
6
6
  */
7
7
  import { DateTime, Schema, Stream } from "effect"
8
- import { Msgpack, Ndjson } from "effect/unstable/encoding"
8
+ import { Ndjson, SchemaBinary } from "effect/unstable/encoding"
9
9
 
10
- // All of the examples below can also be done with Msgpack by replacing `Ndjson`
11
- // with `Msgpack` and using the appropriate channels (`Msgpack.decode()`,
12
- // `Msgpack.encode()`, etc.).
13
- export const msgpackDecoder = Msgpack.decodeSchema(Schema.Struct({
10
+ // SchemaBinary derives a framed binary decoder directly from a schema.
11
+ export const schemaBinaryDecoder = SchemaBinary.decode(Schema.Struct({
14
12
  id: Schema.Int,
15
13
  name: Schema.String
16
- }))
14
+ }))()
17
15
 
18
16
  // ---------------------------------------------------------------------------
19
17
  // Domain
@@ -41,7 +41,7 @@ export const AppLoggerLayer = Logger.layer([appLogger]).pipe(
41
41
  // Create a logger layer that uses the default logger for development, and the
42
42
  // custom logger for production
43
43
  export const LoggerLayer = Layer.unwrap(Effect.gen(function*() {
44
- const env = yield* Config.string("NODE_ENV").pipe(Config.withDefault("development"))
44
+ const env = yield* Config.String("NODE_ENV").pipe(Config.withDefault("development"))
45
45
  if (env === "production") {
46
46
  return AppLoggerLayer
47
47
  }
@@ -10,7 +10,7 @@ import { Argument, Command, Flag } from "effect/unstable/cli"
10
10
 
11
11
  // You can define flags outside of commands and reuse them across multiple
12
12
  // commands.
13
- const workspace = Flag.string("workspace").pipe(
13
+ const workspace = Flag.String("workspace").pipe(
14
14
  Flag.withAlias("w"),
15
15
  Flag.withDescription("Workspace to operate on"),
16
16
  Flag.withDefault("personal")
@@ -21,7 +21,7 @@ const workspace = Flag.string("workspace").pipe(
21
21
  const tasks = Command.make("tasks").pipe(
22
22
  Command.withSharedFlags({
23
23
  workspace,
24
- verbose: Flag.boolean("verbose").pipe(
24
+ verbose: Flag.Boolean("verbose").pipe(
25
25
  Flag.withAlias("v"),
26
26
  Flag.withDescription("Print diagnostic output"),
27
27
  Flag.withDefault(false)
@@ -41,17 +41,17 @@ const Email = Schema.String.pipe(
41
41
  const create = Command.make(
42
42
  "create",
43
43
  {
44
- title: Argument.string("title").pipe(
44
+ title: Argument.String("title").pipe(
45
45
  Argument.withDescription("Task title"),
46
46
  // Reject empty titles at parse time, so the handler only ever sees
47
47
  // valid input
48
48
  Argument.withSchema(Schema.NonEmptyString)
49
49
  ),
50
- priority: Flag.choice("priority", ["low", "normal", "high"]).pipe(
50
+ priority: Flag.Literals("priority", ["low", "normal", "high"]).pipe(
51
51
  Flag.withDescription("Priority for the new task"),
52
52
  Flag.withDefault("normal")
53
53
  ),
54
- assignee: Flag.string("assignee").pipe(
54
+ assignee: Flag.String("assignee").pipe(
55
55
  Flag.withDescription("Email address of the person to assign"),
56
56
  Flag.withSchema(Email),
57
57
  Flag.optional
@@ -88,11 +88,11 @@ const create = Command.make(
88
88
  const list = Command.make(
89
89
  "list",
90
90
  {
91
- status: Flag.choice("status", ["open", "done", "all"]).pipe(
91
+ status: Flag.Literals("status", ["open", "done", "all"]).pipe(
92
92
  Flag.withDescription("Filter tasks by status"),
93
93
  Flag.withDefault("open")
94
94
  ),
95
- json: Flag.boolean("json").pipe(
95
+ json: Flag.Boolean("json").pipe(
96
96
  Flag.withDescription("Print machine-readable output"),
97
97
  Flag.withDefault(false)
98
98
  )
@@ -13,7 +13,7 @@ import { LaunchPlan } from "./fixtures/domain/LaunchPlan.ts"
13
13
 
14
14
  // You can use Config to create ai clients
15
15
  const AnthropicClientLayer = AnthropicClient.layerConfig({
16
- apiKey: Config.redacted("ANTHROPIC_API_KEY")
16
+ apiKey: Config.Redacted("ANTHROPIC_API_KEY")
17
17
  }).pipe(
18
18
  // Providers typically require an HttpClient, but you can choose which one to
19
19
  // use.
@@ -21,7 +21,7 @@ const AnthropicClientLayer = AnthropicClient.layerConfig({
21
21
  )
22
22
 
23
23
  const OpenAiClientLayer = OpenAiClient.layerConfig({
24
- apiKey: Config.redacted("OPENAI_API_KEY")
24
+ apiKey: Config.Redacted("OPENAI_API_KEY")
25
25
  }).pipe(
26
26
  Layer.provide(FetchHttpClient.layer)
27
27
  )
@@ -101,7 +101,7 @@ const ProductToolkitLayer = ProductToolkit.toLayer(Effect.gen(function*() {
101
101
 
102
102
  // Provider setup (same pattern as the language-model example).
103
103
  const OpenAiClientLayer = OpenAiClient.layerConfig({
104
- apiKey: Config.redacted("OPENAI_API_KEY")
104
+ apiKey: Config.Redacted("OPENAI_API_KEY")
105
105
  }).pipe(Layer.provide(FetchHttpClient.layer))
106
106
 
107
107
  export class ProductAssistantError extends Schema.TaggedError<ProductAssistantError>()(
@@ -14,7 +14,7 @@ import { FetchHttpClient } from "effect/unstable/http"
14
14
  // ---------------------------------------------------------------------------
15
15
 
16
16
  const OpenAiClientLayer = OpenAiClient.layerConfig({
17
- apiKey: Config.redacted("OPENAI_API_KEY")
17
+ apiKey: Config.Redacted("OPENAI_API_KEY")
18
18
  }).pipe(Layer.provide(FetchHttpClient.layer))
19
19
 
20
20
  // ---------------------------------------------------------------------------
@@ -48,7 +48,7 @@ export declare const layerHttpServer: Layer.Layer<HttpPlatform | Etag.Generator
48
48
  *
49
49
  * **Details**
50
50
  *
51
- * `serialization` defaults to MessagePack, `runnerHealth` defaults to ping
51
+ * `serialization` defaults to SchemaBinary, `runnerHealth` defaults to ping
52
52
  * checks, SQL-backed storage is used by default, and `shardingConfig` is
53
53
  * overlaid on environment-loaded sharding configuration. `local` storage uses
54
54
  * no-op message storage plus in-memory runner storage, while `byo` leaves both
@@ -69,7 +69,7 @@ export declare const layerHttpServer: Layer.Layer<HttpPlatform | Etag.Generator
69
69
  */
70
70
  export declare const layer: <const ClientOnly extends boolean = false, const Storage extends "local" | "sql" | "byo" = never>(options: {
71
71
  readonly transport: "http" | "websocket";
72
- readonly serialization?: "msgpack" | "ndjson" | undefined;
72
+ readonly serialization?: "binary" | "ndjson" | undefined;
73
73
  readonly serializationMaxBufferSize?: number | "unbounded" | undefined;
74
74
  readonly clientOnly?: ClientOnly | undefined;
75
75
  readonly storage?: Storage | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BunClusterHttp.d.ts","sourceRoot":"","sources":["../src/BunClusterHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAExE,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAA;AAC1D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAGxE,OAAO,KAAK,KAAK,IAAI,MAAM,2BAA2B,CAAA;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,OAAO;AACL;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AQ,GAAG,OAAO,CAAC,OAAO,GAAG,CAAC,KAAK,SAAS,OAAO,GAAG,KAAK,GAAG,cAAc,CAAC,cAAc,CAAC,EAC5F,MAAM,CAAC,WAAW,EAClB,OAAO,SAAS,OAAO,GAAG,KAAK,GAC3B,KAAK,SAAS,OAAO,GAAG,CAAC,cAAc,CAAC,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,GACrF,SAAS,CACd,GACD,KAAK,CAAC,KAAK,CACT,QAAQ,GAAG,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC,cAAc,EAC1D,UAAU,GAAG,MAAM,CAAC,WAAW,EAC/B,OAAO,SAAS,OAAO,GAAG,KAAK,GAC3B,KAAK,SAAS,OAAO,GAAG,CAAC,cAAc,CAAC,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,GACrF,SAAS,CAmDhB,CAAA"}
@@ -49,7 +49,7 @@ export const layerHttpServer = /*#__PURE__*/Effect.gen(function* () {
49
49
  *
50
50
  * **Details**
51
51
  *
52
- * `serialization` defaults to MessagePack, `runnerHealth` defaults to ping
52
+ * `serialization` defaults to SchemaBinary, `runnerHealth` defaults to ping
53
53
  * checks, SQL-backed storage is used by default, and `shardingConfig` is
54
54
  * overlaid on environment-loaded sharding configuration. `local` storage uses
55
55
  * no-op message storage plus in-memory runner storage, while `byo` leaves both
@@ -77,8 +77,8 @@ export const layer = options => {
77
77
  const runnerHealth = options?.clientOnly ? Layer.empty : options?.runnerHealth === "k8s" ? RunnerHealth.layerK8s(options.runnerHealthK8s).pipe(Layer.provide([BunFileSystem.layer, layerK8sHttpClient])) : RunnerHealth.layerPing.pipe(Layer.provide(Runners.layerRpc), Layer.provide(options.transport === "http" ? HttpRunner.layerClientProtocolHttpDefault.pipe(Layer.provide(FetchHttpClient.layer)) : HttpRunner.layerClientProtocolWebsocketDefault.pipe(Layer.provide(BunSocket.layerWebSocketConstructor))));
78
78
  return layer.pipe(Layer.provide(runnerHealth), Layer.provideMerge(options?.storage === "local" ? MessageStorage.layerNoop : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlMessageStorage.layer).pipe(Layer.provide(BunCrypto.layer))), Layer.provide(options?.storage === "local" ? RunnerStorage.layerMemory : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlRunnerStorage.layer)), Layer.provide(ShardingConfig.layerFromEnv(options?.shardingConfig)), Layer.provide(options?.serialization === "ndjson" ? RpcSerialization.layerNdjsonWith({
79
79
  maxBufferSize: options.serializationMaxBufferSize
80
- }) : RpcSerialization.layerMsgPackWith({
81
- maxBufferSize: options.serializationMaxBufferSize
80
+ }) : RpcSerialization.layerSchemaBinary({
81
+ maxFrameSize: options.serializationMaxBufferSize
82
82
  })));
83
83
  };
84
84
  //# sourceMappingURL=BunClusterHttp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunClusterHttp.js","names":[],"sources":["../src/BunClusterHttp.ts"],"sourcesContent":[null],"mappings":"AAWA,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,UAAU,MAAM,oCAAoC;AAChE,OAAO,KAAK,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAK,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAK,OAAO,MAAM,iCAAiC;AAC1D,OAAO,KAAK,aAAa,MAAM,uCAAuC;AAEtE,OAAO,KAAK,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAK,iBAAiB,MAAM,2CAA2C;AAC9E,OAAO,KAAK,gBAAgB,MAAM,0CAA0C;AAE5E,OAAO,KAAK,eAAe,MAAM,sCAAsC;AAIvE,OAAO,KAAK,gBAAgB,MAAM,sCAAsC;AAExE,SAAS,kBAAkB,QAAQ,uBAAuB;AAC1D,OAAO,KAAK,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAK,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAK,aAAa,MAAM,oBAAoB;AA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xB,UAAU,CAAC,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,GACpF,UAAU,CAAC,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC,CAC5G,CACF;EAEH,OAAO,KAAK,CAAC,IAAI,CACf,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAC3B,KAAK,CAAC,YAAY,CAChB,OAAO,EAAE,OAAO,KAAK,OAAO,GACxB,cAAc,CAAC,SAAS,GACxB,OAAO,EAAE,OAAO,KAAK,KAAK,GAC1B,KAAK,CAAC,KAAK,GACX,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAC9E,EACD,KAAK,CAAC,OAAO,CACX,OAAO,EAAE,OAAO,KAAK,OAAO,GACxB,aAAa,CAAC,WAAW,GACzB,OAAO,EAAE,OAAO,KAAK,KAAK,GAC1B,KAAK,CAAC,KAAK,GACX,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CACxC,EACD,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,EACnE,KAAK,CAAC,OAAO,CACX,OAAO,EAAE,aAAa,KAAK,QAAQ,GAC/B,gBAAgB,CAAC,eAAe,CAAC;IAAE,aAAa,EAAE,OAAO,CAAC;EAA0B,CAAE,CAAC,GACvF,gBAAgB,CAAC,iBAAiB,CAAC;IAAE,YAAY,EAAE,OAAO,CAAC;EAA0B,CAAE,CAAC,CAC7F,CACK;AACV,CAAC","ignoreList":[]}
@@ -44,7 +44,7 @@ layerSocketServer };
44
44
  * @since 4.0.0
45
45
  */
46
46
  export declare const layer: <const ClientOnly extends boolean = false, const Storage extends "local" | "sql" | "byo" = never>(options?: {
47
- readonly serialization?: "msgpack" | "ndjson" | undefined;
47
+ readonly serialization?: "binary" | "ndjson" | undefined;
48
48
  readonly serializationMaxBufferSize?: number | "unbounded" | undefined;
49
49
  readonly clientOnly?: ClientOnly | undefined;
50
50
  readonly storage?: Storage | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BunClusterSocket.d.ts","sourceRoot":"","sources":["../src/BunClusterSocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACvG,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAG5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAExE,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAA;AAC1D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAMxE,OAAO,KAAK,KAAK,YAAY,MAAM,qCAAqC,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAI9D,OAAO;AACL;;;;;;GAMG;AACH,mBAAmB;AACnB;;;;;;GAMG;AACH,iBAAiB,EAClB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,KAAK,CAAC,UAAU,SAAS,OAAO,GAAG,KAAK,EACxC,KAAK,CAAC,OAAO,SAAS,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,YAE3C;IACR,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;IACzD,QAAQ,CAAC,0BAA0B,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SA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AY,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IAClD,QAAQ,CAAC,eAAe,CAAC,EAAE;QACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QACvC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC5C,GAAG,SAAS,CAAA;IACb,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;CACxF,KACA,UAAU,SAAS,IAAI,GAAG,KAAK,CAAC,KAAK,CACpC,QAAQ,GAAG,OAAO,CAAC,OAAO,GAAG,CAAC,KAAK,SAAS,OAAO,GAAG,KAAK,GAAG,cAAc,CAAC,cAAc,CAAC,EAC5F,MAAM,CAAC,WAAW,EAClB,OAAO,SAAS,OAAO,GAAG,KAAK,GAC3B,KAAK,SAAS,OAAO,GAAG,CAAC,cAAc,CAAC,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,GACrF,SAAS,CACd,GACD,KAAK,CAAC,KAAK,CACT,QAAQ,GAAG,OAAO,CAAC,OAAO,GAAG,CAAC,KAAK,SAAS,OAAO,GAAG,KAAK,GAAG,cAAc,CAAC,cAAc,CAAC,EAC5F,YAAY,CAAC,iBAAiB,GAAG,MAAM,CAAC,WAAW,EACnD,OAAO,SAAS,OAAO,GAAG,KAAK,GAC3B,KAAK,SAAS,OAAO,GAAG,CAAC,cAAc,CAAC,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,GACrF,SAAS,CA6ChB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,CAmBvE,CAAA"}
@@ -58,8 +58,8 @@ export const layer = options => {
58
58
  const runnerHealth = options?.clientOnly ? Layer.empty : options?.runnerHealth === "k8s" ? RunnerHealth.layerK8s(options.runnerHealthK8s).pipe(Layer.provide([BunFileSystem.layer, layerK8sHttpClient])) : RunnerHealth.layerPing.pipe(Layer.provide(Runners.layerRpc), Layer.provide(layerClientProtocol));
59
59
  return layer.pipe(Layer.provide(runnerHealth), Layer.provideMerge(options?.storage === "local" ? MessageStorage.layerNoop : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlMessageStorage.layer).pipe(Layer.provide(BunCrypto.layer))), Layer.provide(options?.storage === "local" ? RunnerStorage.layerMemory : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlRunnerStorage.layer)), Layer.provide(ShardingConfig.layerFromEnv(options?.shardingConfig)), Layer.provide(options?.serialization === "ndjson" ? RpcSerialization.layerNdjsonWith({
60
60
  maxBufferSize: options?.serializationMaxBufferSize
61
- }) : RpcSerialization.layerMsgPackWith({
62
- maxBufferSize: options?.serializationMaxBufferSize
61
+ }) : RpcSerialization.layerSchemaBinary({
62
+ maxFrameSize: options?.serializationMaxBufferSize
63
63
  })));
64
64
  };
65
65
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BunClusterSocket.js","names":[],"sources":["../src/BunClusterSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAAS,mBAAmB,EAAE,iBAAiB,QAAQ,gDAAgD;AAEvG,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB;AAC/C,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,aAAa,MAAM,uCAAuC;AACtE,OAAO,KAAK,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAK,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAK,OAAO,MAAM,iCAAiC;AAC1D,OAAO,KAAK,aAAa,MAAM,uCAAuC;AAEtE,OAAO,KAAK,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAK,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAK,iBAAiB,MAAM,2CAA2C;AAC9E,OAAO,KAAK,gBAAgB,MAAM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;;;;;AAMA,OAAO,MAAM,kBAAkB,gBAA6C,aAAa,CAAC,KAAK,CAAC,IAAI,cAClG,KAAK,CAAC,OAAO,cAAC,KAAK,CAAC,MAAM,cAAC,MAAM,CAAC,GAAG,CAAC,aAAS;EAC7C,MAAM,EAAE,GAAG,OAAO,UAAU,CAAC,UAAU;EACvC,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC,CAAC,IAAI,CAClG,MAAM,CAAC,MAAM,CACd;EACD,IAAI,YAAY,CAAC,IAAI,KAAK,MAAM,EAAE;IAChC,OAAO,eAAe,CAAC,KAAK;EAC9B;EAEA,OAAO,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAC5C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE;IACvD,GAAG,EAAE;MACH,EAAE,EAAE,YAAY,CAAC;;GAEb,CAAC,CAAC,CACX;AACH,CAAC,CAAC,CAAC,CAAC,eACJ,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CACnC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"BunHttpPlatform.d.ts","sourceRoot":"","sources":["../src/BunHttpPlatform.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAA;AAuC7D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,kDAGjB,CAAA"}
1
+ {"version":3,"file":"BunHttpPlatform.d.ts","sourceRoot":"","sources":["../src/BunHttpPlatform.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAA;AA2C7D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,kDAGjB,CAAA"}
@@ -28,20 +28,23 @@ const compression = /*#__PURE__*/NodeHttpCompression.make(/*#__PURE__*/Platform.
28
28
  const make = /*#__PURE__*/Platform.make({
29
29
  platform: "bun",
30
30
  compression,
31
- fileResponse(path, status, statusText, headers, start, end, _contentLength) {
31
+ fileResponse(path, status, statusText, headers, start, end, contentLength) {
32
32
  let file = Bun.file(path);
33
33
  if (start > 0 || end !== undefined) {
34
34
  file = file.slice(start, end);
35
35
  }
36
36
  return Response.raw(file, {
37
- headers,
37
+ headers: {
38
+ ...headers,
39
+ "content-length": contentLength.toString()
40
+ },
38
41
  status,
39
42
  statusText
40
43
  });
41
44
  },
42
45
  fileWebResponse(file, status, statusText, headers, options) {
43
- const start = Number(options?.offset ?? 0);
44
- const end = options?.bytesToRead !== undefined ? start + Number(options.bytesToRead) : undefined;
46
+ const start = options?.offset ?? 0;
47
+ const end = options?.bytesToRead !== undefined ? start + options.bytesToRead : undefined;
45
48
  const body = start > 0 || end !== undefined ? file.slice(start, end, file.type) : file;
46
49
  return Response.raw(body, {
47
50
  headers,
@@ -1 +1 @@
1
- {"version":3,"file":"BunHttpPlatform.js","names":[],"sources":["../src/BunHttpPlatform.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,OAAO,KAAK,mBAAmB,MAAM,kDAAkD;AAGvF,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,IAAI,MAAM,2BAA2B;AACjD,OAAO,KAAK,QAAQ,MAAM,mCAAmC;AAC7D,OAAO,KAAK,QAAQ,MAAM,yCAAyC;AACnE,OAAO,KAAK,aAAa,MAAM,oBAAoB;AAEnD;AACA;AACA,MAAM,WAAW,gBAAG,mBAAmB,CAAC,IAAI,cAAC,QAAQ,CAAC,kBAAkB,CAAC;EACvE,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC;EAC7C,SAAS,EAAG,SAAS,IAAK,QAAQ,CAAC,uBAAuB,CAAC,SAAS,KAAK,IAAI,GAAG,QAAQ,GAAG,SAAS;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AC;EACJ,CAAC;EACD,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IACxD,MAAM,KAAK,GAAG,OAAO,EAAE,MAAM,IAAI,CAAC;IAClC,MAAM,GAAG,GAAG,OAAO,EAAE,WAAW,KAAK,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS;IACxF,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,IAAI,GAAG,KAAK,SAAS,GACtC,IAAa,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAC3C,IAAI;IACR,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE;MAAE,OAAO;MAAE,MAAM;MAAE;IAAU,CAAE,CAAC;EAC5D;CACD,CAAC;AAEF;;;;;;AAMA,OAAO,MAAM,KAAK,gBAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,cACjE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,eAClC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAC1B","ignoreList":[]}
@@ -25,8 +25,10 @@ import * as Etag from "effect/unstable/http/Etag";
25
25
  import type { HttpClient } from "effect/unstable/http/HttpClient";
26
26
  import type { HttpPlatform } from "effect/unstable/http/HttpPlatform";
27
27
  import * as Server from "effect/unstable/http/HttpServer";
28
+ import * as Error from "effect/unstable/http/HttpServerError";
28
29
  import * as ServerRequest from "effect/unstable/http/HttpServerRequest";
29
30
  import type * as ServerResponse from "effect/unstable/http/HttpServerResponse";
31
+ import * as NetAddress from "effect/unstable/net/NetAddress";
30
32
  import * as Socket from "effect/unstable/socket/Socket";
31
33
  import * as BunServices from "./BunServices.ts";
32
34
  /**
@@ -49,10 +51,22 @@ export type ServeOptions<R extends string> = (Bun.Serve.UnixServeOptions<WebSock
49
51
  * through, e.g.
50
52
  * `BunHttpServer.layer({ port: 3000, websocket: { perMessageDeflate: true } })`.
51
53
  *
54
+ * The `compressionThreshold` option controls the minimum message size in bytes
55
+ * that is compressed when per-message deflate is negotiated. It defaults to
56
+ * 1024, matching the default threshold of Node's `ws` server.
57
+ *
52
58
  * @category options
53
59
  * @since 4.0.0
54
60
  */
55
- export type WebSocketOptions = Omit<Bun.WebSocketHandler<WebSocketContext>, "open" | "message" | "close" | "drain" | "ping" | "pong" | "data" | "binaryType">;
61
+ export type WebSocketOptions = Omit<Bun.WebSocketHandler<WebSocketContext>, "open" | "message" | "close" | "drain" | "ping" | "pong" | "data" | "binaryType"> & {
62
+ /**
63
+ * The minimum message size in bytes that is compressed when per-message
64
+ * deflate is negotiated.
65
+ *
66
+ * @default 1024
67
+ */
68
+ readonly compressionThreshold?: number | undefined;
69
+ };
56
70
  /**
57
71
  * Creates a scoped Bun `HttpServer` from `Bun.serve` options, stopping the server on scope finalization with optional graceful shutdown settings.
58
72
  *
@@ -68,8 +82,8 @@ export declare const make: <R extends string>(options: ServeOptions<R> & {
68
82
  <E, R_1>(effect: Effect.Effect<ServerResponse.HttpServerResponse, E, R_1>): Effect.Effect<void, never, Exclude<R_1, ServerRequest.HttpServerRequest> | Scope.Scope>;
69
83
  <E, R_1, App extends Effect.Effect<ServerResponse.HttpServerResponse, any, any>>(effect: Effect.Effect<ServerResponse.HttpServerResponse, E, R_1>, middleware: import("effect/unstable/http/HttpMiddleware").HttpMiddleware.Applied<App, E, R_1>): Effect.Effect<void, never, Exclude<R_1, ServerRequest.HttpServerRequest> | Scope.Scope>;
70
84
  };
71
- readonly address: Server.Address;
72
- }, never, Scope.Scope>;
85
+ readonly address: NetAddress.SocketAddress;
86
+ }, Error.ServeError, Scope.Scope>;
73
87
  /**
74
88
  * Layer that provides only `HttpServer` by constructing a scoped Bun server from the supplied serve options.
75
89
  *
@@ -80,7 +94,7 @@ export declare const layerServer: <R extends string>(options: ServeOptions<R> &
80
94
  readonly disablePreemptiveShutdown?: boolean | undefined;
81
95
  readonly gracefulShutdownTimeout?: Duration.Input | undefined;
82
96
  readonly websocket?: WebSocketOptions | undefined;
83
- }) => Layer.Layer<Server.HttpServer>;
97
+ }) => Layer.Layer<Server.HttpServer, Error.ServeError>;
84
98
  /**
85
99
  * Layer that provides Bun HTTP support services: `HttpPlatform`, weak ETag generation, and `BunServices`.
86
100
  *
@@ -98,7 +112,7 @@ export declare const layer: <R extends string>(options: ServeOptions<R> & {
98
112
  readonly disablePreemptiveShutdown?: boolean | undefined;
99
113
  readonly gracefulShutdownTimeout?: Duration.Input | undefined;
100
114
  readonly websocket?: WebSocketOptions | undefined;
101
- }) => Layer.Layer<Server.HttpServer | HttpPlatform | Etag.Generator | BunServices.BunServices>;
115
+ }) => Layer.Layer<Server.HttpServer | HttpPlatform | Etag.Generator | BunServices.BunServices, Error.ServeError>;
102
116
  /**
103
117
  * Layer that starts a Bun HTTP server on an ephemeral port for tests.
104
118
  *
@@ -116,12 +130,13 @@ export declare const layerConfig: <R extends string>(options: Config.Wrap<ServeO
116
130
  readonly disablePreemptiveShutdown?: boolean | undefined;
117
131
  readonly gracefulShutdownTimeout?: Duration.Input | undefined;
118
132
  readonly websocket?: WebSocketOptions | undefined;
119
- }>) => Layer.Layer<Server.HttpServer | HttpPlatform | FileSystem.FileSystem | Etag.Generator | Path.Path, ConfigError>;
133
+ }>) => Layer.Layer<Server.HttpServer | HttpPlatform | FileSystem.FileSystem | Etag.Generator | Path.Path, ConfigError | Error.ServeError>;
120
134
  interface WebSocketContext {
121
135
  readonly deferred: Deferred.Deferred<ServerWebSocket<WebSocketContext>>;
122
- readonly closeDeferred: Deferred.Deferred<void, Socket.SocketError>;
123
136
  readonly buffer: Array<Uint8Array | string>;
137
+ closeError: Socket.SocketError | undefined;
124
138
  run: (_: Uint8Array | string) => void;
139
+ onClose: (error: Socket.SocketError) => void;
125
140
  }
126
141
  export {};
127
142
  //# sourceMappingURL=BunHttpServer.d.ts.map