effect 4.0.0-beta.27 → 4.0.0-beta.29

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 (208) hide show
  1. package/dist/Brand.d.ts +1 -1
  2. package/dist/Brand.d.ts.map +1 -1
  3. package/dist/Brand.js +1 -1
  4. package/dist/Brand.js.map +1 -1
  5. package/dist/ConfigProvider.d.ts +1 -1
  6. package/dist/Cron.d.ts +1 -1
  7. package/dist/Data.d.ts +1 -1
  8. package/dist/Data.d.ts.map +1 -1
  9. package/dist/Data.js.map +1 -1
  10. package/dist/Effect.d.ts +300 -184
  11. package/dist/Effect.d.ts.map +1 -1
  12. package/dist/Effect.js +99 -61
  13. package/dist/Effect.js.map +1 -1
  14. package/dist/Encoding.d.ts +1 -1
  15. package/dist/Exit.d.ts +24 -12
  16. package/dist/Exit.d.ts.map +1 -1
  17. package/dist/Exit.js +8 -4
  18. package/dist/Exit.js.map +1 -1
  19. package/dist/Fiber.d.ts +1 -0
  20. package/dist/Fiber.d.ts.map +1 -1
  21. package/dist/Fiber.js.map +1 -1
  22. package/dist/Function.d.ts +1 -9
  23. package/dist/Function.d.ts.map +1 -1
  24. package/dist/Function.js +2 -10
  25. package/dist/Function.js.map +1 -1
  26. package/dist/Graph.d.ts +1 -1
  27. package/dist/Newtype.d.ts +291 -0
  28. package/dist/Newtype.d.ts.map +1 -0
  29. package/dist/Newtype.js +161 -0
  30. package/dist/Newtype.js.map +1 -0
  31. package/dist/PlatformError.d.ts +2 -2
  32. package/dist/References.d.ts +6 -1
  33. package/dist/References.d.ts.map +1 -1
  34. package/dist/References.js +6 -1
  35. package/dist/References.js.map +1 -1
  36. package/dist/RequestResolver.d.ts +19 -19
  37. package/dist/RequestResolver.js +10 -10
  38. package/dist/RequestResolver.js.map +1 -1
  39. package/dist/Schedule.d.ts +142 -80
  40. package/dist/Schedule.d.ts.map +1 -1
  41. package/dist/Schedule.js +58 -32
  42. package/dist/Schedule.js.map +1 -1
  43. package/dist/Scheduler.d.ts +9 -0
  44. package/dist/Scheduler.d.ts.map +1 -1
  45. package/dist/Scheduler.js +11 -0
  46. package/dist/Scheduler.js.map +1 -1
  47. package/dist/Schema.d.ts +1 -1
  48. package/dist/Schema.d.ts.map +1 -1
  49. package/dist/Schema.js +3 -1
  50. package/dist/Schema.js.map +1 -1
  51. package/dist/SchemaAST.d.ts.map +1 -1
  52. package/dist/SchemaAST.js +1 -1
  53. package/dist/SchemaAST.js.map +1 -1
  54. package/dist/Stdio.d.ts +6 -2
  55. package/dist/Stdio.d.ts.map +1 -1
  56. package/dist/Stdio.js +2 -2
  57. package/dist/Stdio.js.map +1 -1
  58. package/dist/Stream.d.ts +8 -4
  59. package/dist/Stream.d.ts.map +1 -1
  60. package/dist/Stream.js +8 -4
  61. package/dist/Stream.js.map +1 -1
  62. package/dist/Types.d.ts +1 -22
  63. package/dist/Types.d.ts.map +1 -1
  64. package/dist/index.d.ts +71 -3
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +71 -3
  67. package/dist/index.js.map +1 -1
  68. package/dist/internal/effect.js +3 -1
  69. package/dist/internal/effect.js.map +1 -1
  70. package/dist/unstable/ai/LanguageModel.d.ts +12 -28
  71. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  72. package/dist/unstable/ai/LanguageModel.js +4 -18
  73. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  74. package/dist/unstable/ai/McpSchema.d.ts +20 -1
  75. package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
  76. package/dist/unstable/ai/McpSchema.js +8 -0
  77. package/dist/unstable/ai/McpSchema.js.map +1 -1
  78. package/dist/unstable/ai/McpServer.d.ts +65 -12
  79. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  80. package/dist/unstable/ai/McpServer.js +159 -45
  81. package/dist/unstable/ai/McpServer.js.map +1 -1
  82. package/dist/unstable/ai/Toolkit.d.ts +1 -1
  83. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  84. package/dist/unstable/ai/Toolkit.js +4 -11
  85. package/dist/unstable/ai/Toolkit.js.map +1 -1
  86. package/dist/unstable/ai/internal/codec-transformer.js +0 -5
  87. package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
  88. package/dist/unstable/cli/Prompt.js +35 -8
  89. package/dist/unstable/cli/Prompt.js.map +1 -1
  90. package/dist/unstable/cluster/Message.d.ts +5 -5
  91. package/dist/unstable/cluster/Reply.d.ts +3 -3
  92. package/dist/unstable/encoding/Msgpack.d.ts +1 -1
  93. package/dist/unstable/encoding/Ndjson.d.ts +1 -1
  94. package/dist/unstable/encoding/Sse.d.ts +1 -1
  95. package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
  96. package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
  97. package/dist/unstable/http/Cookies.d.ts +45 -1
  98. package/dist/unstable/http/Cookies.d.ts.map +1 -1
  99. package/dist/unstable/http/Cookies.js +22 -0
  100. package/dist/unstable/http/Cookies.js.map +1 -1
  101. package/dist/unstable/http/HttpBody.d.ts +1 -1
  102. package/dist/unstable/http/HttpClient.d.ts.map +1 -1
  103. package/dist/unstable/http/HttpClient.js +3 -7
  104. package/dist/unstable/http/HttpClient.js.map +1 -1
  105. package/dist/unstable/http/HttpClientError.d.ts +7 -7
  106. package/dist/unstable/http/HttpClientRequest.d.ts +5 -0
  107. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  108. package/dist/unstable/http/HttpClientRequest.js +21 -17
  109. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  110. package/dist/unstable/http/HttpEffect.d.ts +7 -0
  111. package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
  112. package/dist/unstable/http/HttpEffect.js +6 -0
  113. package/dist/unstable/http/HttpEffect.js.map +1 -1
  114. package/dist/unstable/http/HttpServerError.d.ts +6 -6
  115. package/dist/unstable/http/HttpServerRequest.d.ts +11 -0
  116. package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
  117. package/dist/unstable/http/HttpServerRequest.js +291 -1
  118. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  119. package/dist/unstable/http/HttpServerResponse.d.ts +47 -1
  120. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  121. package/dist/unstable/http/HttpServerResponse.js +227 -0
  122. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  123. package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
  124. package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
  125. package/dist/unstable/http/HttpStaticServer.js +353 -0
  126. package/dist/unstable/http/HttpStaticServer.js.map +1 -0
  127. package/dist/unstable/http/Multipart.d.ts +1 -1
  128. package/dist/unstable/http/UrlParams.d.ts +1 -1
  129. package/dist/unstable/http/index.d.ts +4 -0
  130. package/dist/unstable/http/index.d.ts.map +1 -1
  131. package/dist/unstable/http/index.js +4 -0
  132. package/dist/unstable/http/index.js.map +1 -1
  133. package/dist/unstable/httpapi/HttpApiGroup.d.ts +1 -0
  134. package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
  135. package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
  136. package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
  137. package/dist/unstable/reactivity/Atom.d.ts +7 -2
  138. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  139. package/dist/unstable/reactivity/Atom.js +33 -15
  140. package/dist/unstable/reactivity/Atom.js.map +1 -1
  141. package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -6
  142. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  143. package/dist/unstable/reactivity/AtomHttpApi.js +39 -9
  144. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  145. package/dist/unstable/reactivity/AtomRegistry.js +26 -2
  146. package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
  147. package/dist/unstable/reactivity/AtomRpc.d.ts +8 -8
  148. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  149. package/dist/unstable/reactivity/AtomRpc.js +46 -20
  150. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  151. package/dist/unstable/rpc/Rpc.d.ts +1 -1
  152. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  153. package/dist/unstable/rpc/Rpc.js.map +1 -1
  154. package/dist/unstable/rpc/RpcMiddleware.d.ts +5 -5
  155. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  156. package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
  157. package/dist/unstable/rpc/RpcServer.js +2 -2
  158. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  159. package/dist/unstable/rpc/Utils.js +1 -1
  160. package/dist/unstable/rpc/Utils.js.map +1 -1
  161. package/dist/unstable/socket/SocketServer.d.ts +3 -3
  162. package/dist/unstable/sql/Migrator.d.ts +1 -1
  163. package/dist/unstable/sql/SqlResolver.js +2 -2
  164. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  165. package/dist/unstable/workflow/Workflow.d.ts +1 -1
  166. package/package.json +1 -1
  167. package/src/Brand.ts +1 -1
  168. package/src/Data.ts +1 -2
  169. package/src/Effect.ts +300 -184
  170. package/src/Exit.ts +24 -12
  171. package/src/Fiber.ts +1 -0
  172. package/src/Function.ts +2 -10
  173. package/src/Newtype.ts +308 -0
  174. package/src/References.ts +6 -1
  175. package/src/RequestResolver.ts +20 -20
  176. package/src/Schedule.ts +142 -80
  177. package/src/Scheduler.ts +12 -0
  178. package/src/Schema.ts +4 -2
  179. package/src/SchemaAST.ts +1 -4
  180. package/src/Stdio.ts +8 -4
  181. package/src/Stream.ts +8 -4
  182. package/src/Types.ts +1 -23
  183. package/src/index.ts +72 -3
  184. package/src/internal/effect.ts +3 -0
  185. package/src/unstable/ai/LanguageModel.ts +16 -37
  186. package/src/unstable/ai/McpSchema.ts +14 -0
  187. package/src/unstable/ai/McpServer.ts +224 -53
  188. package/src/unstable/ai/Toolkit.ts +5 -14
  189. package/src/unstable/ai/internal/codec-transformer.ts +0 -7
  190. package/src/unstable/cli/Prompt.ts +31 -9
  191. package/src/unstable/http/Cookies.ts +84 -0
  192. package/src/unstable/http/HttpClient.ts +5 -6
  193. package/src/unstable/http/HttpClientRequest.ts +21 -17
  194. package/src/unstable/http/HttpEffect.ts +8 -0
  195. package/src/unstable/http/HttpServerRequest.ts +388 -1
  196. package/src/unstable/http/HttpServerResponse.ts +328 -1
  197. package/src/unstable/http/HttpStaticServer.ts +456 -0
  198. package/src/unstable/http/index.ts +5 -0
  199. package/src/unstable/httpapi/HttpApiGroup.ts +1 -0
  200. package/src/unstable/reactivity/Atom.ts +62 -35
  201. package/src/unstable/reactivity/AtomHttpApi.ts +45 -11
  202. package/src/unstable/reactivity/AtomRegistry.ts +30 -2
  203. package/src/unstable/reactivity/AtomRpc.ts +48 -17
  204. package/src/unstable/rpc/Rpc.ts +1 -3
  205. package/src/unstable/rpc/RpcMiddleware.ts +12 -6
  206. package/src/unstable/rpc/RpcServer.ts +2 -2
  207. package/src/unstable/rpc/Utils.ts +1 -1
  208. package/src/unstable/sql/SqlResolver.ts +2 -2
@@ -2489,6 +2489,11 @@ const processNumberBackspace = (state: NumberState) => {
2489
2489
  }))
2490
2490
  }
2491
2491
 
2492
+ const processNumberClear = (state: NumberState) =>
2493
+ Effect.succeed(Action.NextFrame({
2494
+ state: { ...state, cursor: 0, value: "", error: undefined }
2495
+ }))
2496
+
2492
2497
  const defaultIntProcessor = (input: string, state: NumberState) => {
2493
2498
  if (state.value.length === 0 && input === "-") {
2494
2499
  return Effect.succeed(Action.NextFrame({
@@ -2542,6 +2547,9 @@ const handleRenderInteger = (options: IntegerOptionsReq) => {
2542
2547
 
2543
2548
  const handleProcessInteger = (options: IntegerOptionsReq) => {
2544
2549
  return (input: Terminal.UserInput, state: NumberState) => {
2550
+ if (input.key.ctrl && input.key.name === "u") {
2551
+ return processNumberClear(state)
2552
+ }
2545
2553
  switch (input.key.name) {
2546
2554
  case "backspace": {
2547
2555
  return processNumberBackspace(state)
@@ -2612,6 +2620,9 @@ const handleRenderFloat = (options: FloatOptionsReq) => {
2612
2620
 
2613
2621
  const handleProcessFloat = (options: FloatOptionsReq) => {
2614
2622
  return (input: Terminal.UserInput, state: NumberState) => {
2623
+ if (input.key.ctrl && input.key.name === "u") {
2624
+ return processNumberClear(state)
2625
+ }
2615
2626
  switch (input.key.name) {
2616
2627
  case "backspace": {
2617
2628
  return processNumberBackspace(state)
@@ -2962,6 +2973,9 @@ const processAutoCompleteBackspace = <A>(state: AutoCompleteState, options: Auto
2962
2973
  return Effect.succeed(Action.NextFrame({ state: updateAutoCompleteState(state, options, query) }))
2963
2974
  }
2964
2975
 
2976
+ const processAutoCompleteClear = <A>(state: AutoCompleteState, options: AutoCompleteOptionsReq<A>) =>
2977
+ Effect.succeed(Action.NextFrame({ state: updateAutoCompleteState(state, options, "") }))
2978
+
2965
2979
  const processAutoCompleteInput = <A>(input: string, state: AutoCompleteState, options: AutoCompleteOptionsReq<A>) => {
2966
2980
  if (input.length === 0) {
2967
2981
  return Effect.succeed(Action.Beep())
@@ -3045,6 +3059,9 @@ const handleSelectProcess = <A>(options: SelectOptionsReq<A>) => {
3045
3059
 
3046
3060
  const handleAutoCompleteProcess = <A>(options: AutoCompleteOptionsReq<A>) => {
3047
3061
  return (input: Terminal.UserInput, state: AutoCompleteState) => {
3062
+ if (input.key.ctrl && input.key.name === "u") {
3063
+ return processAutoCompleteClear(state, options)
3064
+ }
3048
3065
  switch (input.key.name) {
3049
3066
  case "k":
3050
3067
  case "up": {
@@ -3091,10 +3108,6 @@ interface TextState {
3091
3108
  readonly error: string | undefined
3092
3109
  }
3093
3110
 
3094
- const getValue = (state: TextState, options: TextOptionsReq): string => {
3095
- return state.value.length > 0 ? state.value : options.default
3096
- }
3097
-
3098
3111
  const renderClearScreen = Effect.fnUntraced(function*(state: TextState, options: TextOptionsReq) {
3099
3112
  const terminal = yield* Terminal.Terminal
3100
3113
  const columns = yield* terminal.columns
@@ -3115,7 +3128,7 @@ const renderTextInput = (
3115
3128
  submitted: boolean,
3116
3129
  renderOptions?: RenderOptions | undefined
3117
3130
  ) => {
3118
- const text = getValue(nextState, options)
3131
+ const text = nextState.value
3119
3132
  if (renderOptions?.plain === true) {
3120
3133
  switch (options.type) {
3121
3134
  case "hidden": {
@@ -3217,6 +3230,13 @@ const processTextBackspace = (state: TextState) => {
3217
3230
  )
3218
3231
  }
3219
3232
 
3233
+ const processTextClear = (state: TextState) =>
3234
+ Effect.succeed(
3235
+ Action.NextFrame({
3236
+ state: { ...state, cursor: 0, value: "", error: undefined }
3237
+ })
3238
+ )
3239
+
3220
3240
  const processTextCursorLeft = (state: TextState) => {
3221
3241
  if (state.cursor <= 0) {
3222
3242
  return Effect.succeed(Action.Beep())
@@ -3245,11 +3265,10 @@ const processTab = (state: TextState, options: TextOptionsReq) => {
3245
3265
  if (state.value === options.default) {
3246
3266
  return Effect.succeed(Action.Beep())
3247
3267
  }
3248
- const value = getValue(state, options)
3249
- const cursor = value.length
3268
+ const value = state.value.length === 0 ? options.default : state.value
3250
3269
  return Effect.succeed(
3251
3270
  Action.NextFrame({
3252
- state: { ...state, value, cursor, error: undefined }
3271
+ state: { ...state, value, cursor: value.length, error: undefined }
3253
3272
  })
3254
3273
  )
3255
3274
  }
@@ -3278,6 +3297,9 @@ const handleTextRender = (options: TextOptionsReq) => {
3278
3297
 
3279
3298
  const handleTextProcess = (options: TextOptionsReq) => {
3280
3299
  return (input: Terminal.UserInput, state: TextState) => {
3300
+ if (input.key.ctrl && input.key.name === "u") {
3301
+ return processTextClear(state)
3302
+ }
3281
3303
  switch (input.key.name) {
3282
3304
  case "backspace": {
3283
3305
  return processTextBackspace(state)
@@ -3290,7 +3312,7 @@ const handleTextProcess = (options: TextOptionsReq) => {
3290
3312
  }
3291
3313
  case "enter":
3292
3314
  case "return": {
3293
- const value = getValue(state, options)
3315
+ const value = state.value
3294
3316
  return Effect.match(options.validate(value), {
3295
3317
  onFailure: (error) =>
3296
3318
  Action.NextFrame({
@@ -668,6 +668,90 @@ export const setUnsafe: {
668
668
  ))
669
669
  )
670
670
 
671
+ /**
672
+ * Add an expired cookie to a Cookies object
673
+ *
674
+ * @since 4.0.0
675
+ * @category combinators
676
+ */
677
+ export const expireCookie: {
678
+ /**
679
+ * Add an expired cookie to a Cookies object
680
+ *
681
+ * @since 4.0.0
682
+ * @category combinators
683
+ */
684
+ (
685
+ name: string,
686
+ options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
687
+ ): (self: Cookies) => Result.Result<Cookies, CookiesError>
688
+ /**
689
+ * Add an expired cookie to a Cookies object
690
+ *
691
+ * @since 4.0.0
692
+ * @category combinators
693
+ */
694
+ (
695
+ self: Cookies,
696
+ name: string,
697
+ options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
698
+ ): Result.Result<Cookies, CookiesError>
699
+ } = dual(
700
+ (args) => isCookies(args[0]),
701
+ (
702
+ self: Cookies,
703
+ name: string,
704
+ options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
705
+ ) =>
706
+ set(self, name, "", {
707
+ ...options,
708
+ maxAge: 0,
709
+ expires: new Date(0)
710
+ })
711
+ )
712
+
713
+ /**
714
+ * Add an expired cookie to a Cookies object, throwing an error if invalid
715
+ *
716
+ * @since 4.0.0
717
+ * @category combinators
718
+ */
719
+ export const expireCookieUnsafe: {
720
+ /**
721
+ * Add an expired cookie to a Cookies object, throwing an error if invalid
722
+ *
723
+ * @since 4.0.0
724
+ * @category combinators
725
+ */
726
+ (
727
+ name: string,
728
+ options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
729
+ ): (self: Cookies) => Cookies
730
+ /**
731
+ * Add an expired cookie to a Cookies object, throwing an error if invalid
732
+ *
733
+ * @since 4.0.0
734
+ * @category combinators
735
+ */
736
+ (
737
+ self: Cookies,
738
+ name: string,
739
+ options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
740
+ ): Cookies
741
+ } = dual(
742
+ (args) => isCookies(args[0]),
743
+ (
744
+ self: Cookies,
745
+ name: string,
746
+ options?: Omit<NonNullable<Cookie["options"]>, "expires" | "maxAge">
747
+ ): Cookies =>
748
+ setUnsafe(self, name, "", {
749
+ ...options,
750
+ maxAge: 0,
751
+ expires: new Date(0)
752
+ })
753
+ )
754
+
671
755
  /**
672
756
  * Add multiple cookies to a Cookies object
673
757
  *
@@ -6,7 +6,6 @@ import * as Cause from "../../Cause.ts"
6
6
  import { Clock } from "../../Clock.ts"
7
7
  import * as Duration from "../../Duration.ts"
8
8
  import * as Effect from "../../Effect.ts"
9
- import * as Exit from "../../Exit.ts"
10
9
  import * as Fiber from "../../Fiber.ts"
11
10
  import { constant, constFalse, constTrue, dual, flow, identity } from "../../Function.ts"
12
11
  import * as Inspectable from "../../Inspectable.ts"
@@ -1735,12 +1734,12 @@ class InterruptibleResponse implements HttpClientResponse.HttpClientResponse {
1735
1734
  get stream() {
1736
1735
  return Stream.suspend(() => {
1737
1736
  responseRegistry.unregister(this.original)
1738
- return Stream.onExit(this.original.stream, (exit) => {
1739
- if (Exit.hasInterrupts(exit)) {
1737
+ return Stream.ensuring(
1738
+ this.original.stream,
1739
+ Effect.sync(() => {
1740
1740
  this.controller.abort()
1741
- }
1742
- return Effect.void
1743
- })
1741
+ })
1742
+ )
1744
1743
  })
1745
1744
  }
1746
1745
 
@@ -87,7 +87,11 @@ const Proto = {
87
87
  }
88
88
  }
89
89
 
90
- function makeProto(
90
+ /**
91
+ * @since 4.0.0
92
+ * @category constructors
93
+ */
94
+ export function makeWith(
91
95
  method: HttpMethod,
92
96
  url: string,
93
97
  urlParams: UrlParams.UrlParams,
@@ -109,7 +113,7 @@ function makeProto(
109
113
  * @since 4.0.0
110
114
  * @category constructors
111
115
  */
112
- export const empty: HttpClientRequest = makeProto(
116
+ export const empty: HttpClientRequest = makeWith(
113
117
  "GET",
114
118
  "",
115
119
  UrlParams.empty,
@@ -251,7 +255,7 @@ export const setMethod: {
251
255
  } = dual(
252
256
  2,
253
257
  (self: HttpClientRequest, method: HttpMethod): HttpClientRequest =>
254
- makeProto(method, self.url, self.urlParams, self.hash, self.headers, self.body)
258
+ makeWith(method, self.url, self.urlParams, self.hash, self.headers, self.body)
255
259
  )
256
260
 
257
261
  /**
@@ -270,7 +274,7 @@ export const setHeader: {
270
274
  */
271
275
  (self: HttpClientRequest, key: string, value: string): HttpClientRequest
272
276
  } = dual(3, (self: HttpClientRequest, key: string, value: string): HttpClientRequest =>
273
- makeProto(
277
+ makeWith(
274
278
  self.method,
275
279
  self.url,
276
280
  self.urlParams,
@@ -295,7 +299,7 @@ export const setHeaders: {
295
299
  */
296
300
  (self: HttpClientRequest, input: Headers.Input): HttpClientRequest
297
301
  } = dual(2, (self: HttpClientRequest, input: Headers.Input): HttpClientRequest =>
298
- makeProto(
302
+ makeWith(
299
303
  self.method,
300
304
  self.url,
301
305
  self.urlParams,
@@ -394,7 +398,7 @@ export const setUrl: {
394
398
  (self: HttpClientRequest, url: string | URL): HttpClientRequest
395
399
  } = dual(2, (self: HttpClientRequest, url: string | URL): HttpClientRequest => {
396
400
  if (typeof url === "string") {
397
- return makeProto(
401
+ return makeWith(
398
402
  self.method,
399
403
  url,
400
404
  self.urlParams,
@@ -408,7 +412,7 @@ export const setUrl: {
408
412
  const hash = clone.hash ? clone.hash.slice(1) : undefined
409
413
  clone.search = ""
410
414
  clone.hash = ""
411
- return makeProto(
415
+ return makeWith(
412
416
  self.method,
413
417
  clone.toString(),
414
418
  urlParams,
@@ -435,7 +439,7 @@ export const prependUrl: {
435
439
  (self: HttpClientRequest, path: string): HttpClientRequest
436
440
  } = dual(2, (self: HttpClientRequest, path: string): HttpClientRequest => {
437
441
  if (path === "") return self
438
- return makeProto(
442
+ return makeWith(
439
443
  self.method,
440
444
  joinSegments(path, self.url),
441
445
  self.urlParams,
@@ -462,7 +466,7 @@ export const appendUrl: {
462
466
  (self: HttpClientRequest, path: string): HttpClientRequest
463
467
  } = dual(2, (self: HttpClientRequest, path: string): HttpClientRequest => {
464
468
  if (path === "") return self
465
- return makeProto(
469
+ return makeWith(
466
470
  self.method,
467
471
  joinSegments(self.url, path),
468
472
  self.urlParams,
@@ -500,7 +504,7 @@ export const updateUrl: {
500
504
  */
501
505
  (self: HttpClientRequest, f: (url: string) => string): HttpClientRequest
502
506
  } = dual(2, (self: HttpClientRequest, f: (url: string) => string): HttpClientRequest =>
503
- makeProto(
507
+ makeWith(
504
508
  self.method,
505
509
  f(self.url),
506
510
  self.urlParams,
@@ -525,7 +529,7 @@ export const setUrlParam: {
525
529
  */
526
530
  (self: HttpClientRequest, key: string, value: string): HttpClientRequest
527
531
  } = dual(3, (self: HttpClientRequest, key: string, value: string): HttpClientRequest =>
528
- makeProto(
532
+ makeWith(
529
533
  self.method,
530
534
  self.url,
531
535
  UrlParams.set(self.urlParams, key, value),
@@ -550,7 +554,7 @@ export const setUrlParams: {
550
554
  */
551
555
  (self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
552
556
  } = dual(2, (self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest =>
553
- makeProto(
557
+ makeWith(
554
558
  self.method,
555
559
  self.url,
556
560
  UrlParams.setAll(self.urlParams, input),
@@ -575,7 +579,7 @@ export const appendUrlParam: {
575
579
  */
576
580
  (self: HttpClientRequest, key: string, value: string): HttpClientRequest
577
581
  } = dual(3, (self: HttpClientRequest, key: string, value: string): HttpClientRequest =>
578
- makeProto(
582
+ makeWith(
579
583
  self.method,
580
584
  self.url,
581
585
  UrlParams.append(self.urlParams, key, value),
@@ -600,7 +604,7 @@ export const appendUrlParams: {
600
604
  */
601
605
  (self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
602
606
  } = dual(2, (self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest =>
603
- makeProto(
607
+ makeWith(
604
608
  self.method,
605
609
  self.url,
606
610
  UrlParams.appendAll(self.urlParams, input),
@@ -625,7 +629,7 @@ export const setHash: {
625
629
  */
626
630
  (self: HttpClientRequest, hash: string): HttpClientRequest
627
631
  } = dual(2, (self: HttpClientRequest, hash: string): HttpClientRequest =>
628
- makeProto(
632
+ makeWith(
629
633
  self.method,
630
634
  self.url,
631
635
  self.urlParams,
@@ -639,7 +643,7 @@ export const setHash: {
639
643
  * @category combinators
640
644
  */
641
645
  export const removeHash = (self: HttpClientRequest): HttpClientRequest =>
642
- makeProto(
646
+ makeWith(
643
647
  self.method,
644
648
  self.url,
645
649
  self.urlParams,
@@ -675,7 +679,7 @@ export const setBody: {
675
679
  headers = Headers.set(headers, "content-length", body.contentLength.toString())
676
680
  }
677
681
  }
678
- return makeProto(
682
+ return makeWith(
679
683
  self.method,
680
684
  self.url,
681
685
  self.urlParams,
@@ -173,6 +173,14 @@ export const appendPreResponseHandler = (handler: PreResponseHandler): Effect.Ef
173
173
  return Effect.void
174
174
  })
175
175
 
176
+ export {
177
+ /**
178
+ * @since 4.0.0
179
+ * @category fiber refs
180
+ */
181
+ appendPreResponseHandlerUnsafe
182
+ }
183
+
176
184
  /**
177
185
  * @since 4.0.0
178
186
  * @category fiber refs