@effect/platform-bun 4.0.0-beta.7 → 4.0.0-beta.70
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.
- package/dist/BunChildProcessSpawner.d.ts +1 -1
- package/dist/BunChildProcessSpawner.js +1 -1
- package/dist/BunClusterHttp.d.ts +46 -7
- package/dist/BunClusterHttp.d.ts.map +1 -1
- package/dist/BunClusterHttp.js +17 -10
- package/dist/BunClusterHttp.js.map +1 -1
- package/dist/BunClusterSocket.d.ts +54 -9
- package/dist/BunClusterSocket.d.ts.map +1 -1
- package/dist/BunClusterSocket.js +54 -9
- package/dist/BunClusterSocket.js.map +1 -1
- package/dist/BunCrypto.d.ts +10 -0
- package/dist/BunCrypto.d.ts.map +1 -0
- package/dist/BunCrypto.js +14 -0
- package/dist/BunCrypto.js.map +1 -0
- package/dist/BunFileSystem.d.ts +4 -2
- package/dist/BunFileSystem.d.ts.map +1 -1
- package/dist/BunFileSystem.js +27 -3
- package/dist/BunFileSystem.js.map +1 -1
- package/dist/BunHttpClient.d.ts +2 -2
- package/dist/BunHttpClient.js +2 -2
- package/dist/BunHttpPlatform.d.ts +4 -2
- package/dist/BunHttpPlatform.d.ts.map +1 -1
- package/dist/BunHttpPlatform.js +5 -3
- package/dist/BunHttpPlatform.js.map +1 -1
- package/dist/BunHttpServer.d.ts +77 -19
- package/dist/BunHttpServer.d.ts.map +1 -1
- package/dist/BunHttpServer.js +63 -36
- package/dist/BunHttpServer.js.map +1 -1
- package/dist/BunHttpServerRequest.d.ts +26 -2
- package/dist/BunHttpServerRequest.d.ts.map +1 -1
- package/dist/BunHttpServerRequest.js +3 -1
- package/dist/BunHttpServerRequest.js.map +1 -1
- package/dist/BunMultipart.d.ts +28 -5
- package/dist/BunMultipart.d.ts.map +1 -1
- package/dist/BunMultipart.js +15 -5
- package/dist/BunMultipart.js.map +1 -1
- package/dist/BunPath.d.ts +12 -6
- package/dist/BunPath.d.ts.map +1 -1
- package/dist/BunPath.js +30 -7
- package/dist/BunPath.js.map +1 -1
- package/dist/BunRedis.d.ts +39 -9
- package/dist/BunRedis.d.ts.map +1 -1
- package/dist/BunRedis.js +42 -12
- package/dist/BunRedis.js.map +1 -1
- package/dist/BunRuntime.d.ts +24 -30
- package/dist/BunRuntime.d.ts.map +1 -1
- package/dist/BunRuntime.js +25 -11
- package/dist/BunRuntime.js.map +1 -1
- package/dist/BunServices.d.ts +32 -5
- package/dist/BunServices.d.ts.map +1 -1
- package/dist/BunServices.js +7 -3
- package/dist/BunServices.js.map +1 -1
- package/dist/BunSink.d.ts +2 -2
- package/dist/BunSink.js +2 -2
- package/dist/BunSocket.d.ts +30 -4
- package/dist/BunSocket.d.ts.map +1 -1
- package/dist/BunSocket.js +10 -3
- package/dist/BunSocket.js.map +1 -1
- package/dist/BunSocketServer.d.ts +2 -2
- package/dist/BunSocketServer.js +2 -2
- package/dist/BunStdio.d.ts +5 -2
- package/dist/BunStdio.d.ts.map +1 -1
- package/dist/BunStdio.js +24 -3
- package/dist/BunStdio.js.map +1 -1
- package/dist/BunStream.d.ts +3 -2
- package/dist/BunStream.d.ts.map +1 -1
- package/dist/BunStream.js +25 -3
- package/dist/BunStream.js.map +1 -1
- package/dist/BunTerminal.d.ts +8 -2
- package/dist/BunTerminal.d.ts.map +1 -1
- package/dist/BunTerminal.js +23 -3
- package/dist/BunTerminal.js.map +1 -1
- package/dist/BunWorker.d.ts +9 -2
- package/dist/BunWorker.d.ts.map +1 -1
- package/dist/BunWorker.js +29 -4
- package/dist/BunWorker.js.map +1 -1
- package/dist/BunWorkerRunner.d.ts +5 -1
- package/dist/BunWorkerRunner.d.ts.map +1 -1
- package/dist/BunWorkerRunner.js +27 -5
- package/dist/BunWorkerRunner.js.map +1 -1
- package/dist/index.d.ts +396 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +396 -21
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/BunChildProcessSpawner.ts +1 -1
- package/src/BunClusterHttp.ts +51 -11
- package/src/BunClusterSocket.ts +54 -9
- package/src/BunCrypto.ts +16 -0
- package/src/BunFileSystem.ts +27 -3
- package/src/BunHttpClient.ts +2 -2
- package/src/BunHttpPlatform.ts +28 -4
- package/src/BunHttpServer.ts +128 -56
- package/src/BunHttpServerRequest.ts +26 -2
- package/src/BunMultipart.ts +36 -6
- package/src/BunPath.ts +30 -7
- package/src/BunRedis.ts +44 -14
- package/src/BunRuntime.ts +41 -31
- package/src/BunServices.ts +34 -5
- package/src/BunSink.ts +2 -2
- package/src/BunSocket.ts +30 -4
- package/src/BunSocketServer.ts +2 -2
- package/src/BunStdio.ts +24 -3
- package/src/BunStream.ts +25 -3
- package/src/BunTerminal.ts +23 -3
- package/src/BunWorker.ts +29 -4
- package/src/BunWorkerRunner.ts +27 -5
- package/src/index.ts +397 -21
package/dist/BunSocket.js
CHANGED
|
@@ -2,17 +2,24 @@ import { flow } from "effect/Function";
|
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
3
|
import * as Socket from "effect/unstable/socket/Socket";
|
|
4
4
|
/**
|
|
5
|
-
* @since
|
|
5
|
+
* @since 4.0.0
|
|
6
6
|
*/
|
|
7
7
|
export * from "@effect/platform-node-shared/NodeSocket";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Provides a `Socket.WebSocketConstructor` backed by Bun's global
|
|
10
|
+
* `WebSocket` implementation.
|
|
11
|
+
*
|
|
10
12
|
* @category layers
|
|
13
|
+
* @since 4.0.0
|
|
11
14
|
*/
|
|
12
15
|
export const layerWebSocketConstructor = /*#__PURE__*/Layer.succeed(Socket.WebSocketConstructor)((url, protocols) => new globalThis.WebSocket(url, protocols));
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
17
|
+
* Creates a `Socket.Socket` layer for a WebSocket URL using Bun's global
|
|
18
|
+
* `WebSocket` constructor, honoring protocol, open-timeout, and close-code
|
|
19
|
+
* error options.
|
|
20
|
+
*
|
|
15
21
|
* @category layers
|
|
22
|
+
* @since 4.0.0
|
|
16
23
|
*/
|
|
17
24
|
export const layerWebSocket = /*#__PURE__*/flow(Socket.makeWebSocket, /*#__PURE__*/Layer.effect(Socket.Socket), /*#__PURE__*/Layer.provide(layerWebSocketConstructor));
|
|
18
25
|
//# sourceMappingURL=BunSocket.js.map
|
package/dist/BunSocket.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunSocket.js","names":["flow","Layer","Socket","layerWebSocketConstructor","succeed","WebSocketConstructor","url","protocols","globalThis","WebSocket","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/BunSocket.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunSocket.js","names":["flow","Layer","Socket","layerWebSocketConstructor","succeed","WebSocketConstructor","url","protocols","globalThis","WebSocket","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/BunSocket.ts"],"sourcesContent":[null],"mappings":"AAwBA,SAASA,IAAI,QAAQ,iBAAiB;AACtC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD;;;AAGA,cAAc,yCAAyC;AAEvD;;;;;;;AAOA,OAAO,MAAMC,yBAAyB,gBAElCF,KAAK,CAACG,OAAO,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIC,UAAU,CAACC,SAAS,CAACH,GAAG,EAAEC,SAAS,CAAC,CAC7D;AAED;;;;;;;;AAQA,OAAO,MAAMG,cAAc,gBAOqBV,IAAI,CAClDE,MAAM,CAACS,aAAa,eACpBV,KAAK,CAACW,MAAM,CAACV,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACY,OAAO,CAACV,yBAAyB,CAAC,CACzC","ignoreList":[]}
|
package/dist/BunSocketServer.js
CHANGED
package/dist/BunStdio.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type * as Layer from "effect/Layer";
|
|
2
2
|
import type { Stdio } from "effect/Stdio";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Provides the `Stdio` service backed by the current process arguments,
|
|
5
|
+
* stdin, stdout, and stderr streams.
|
|
6
|
+
*
|
|
7
|
+
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
6
9
|
*/
|
|
7
10
|
export declare const layer: Layer.Layer<Stdio>;
|
|
8
11
|
//# sourceMappingURL=BunStdio.d.ts.map
|
package/dist/BunStdio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunStdio.d.ts","sourceRoot":"","sources":["../src/BunStdio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunStdio.d.ts","sourceRoot":"","sources":["../src/BunStdio.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAmB,CAAA"}
|
package/dist/BunStdio.js
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun-backed implementation of Effect's `Stdio` service.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the process stdio layer for Bun applications by reusing
|
|
5
|
+
* the shared Node-compatible implementation. The layer connects `Stdio` to the
|
|
6
|
+
* current Bun process: arguments come from `process.argv`, input is read from
|
|
7
|
+
* `process.stdin`, and output and error output write to `process.stdout` and
|
|
8
|
+
* `process.stderr`. It is intended for CLIs, scripts, command runners, test
|
|
9
|
+
* harnesses, and other process-oriented programs that need standard input and
|
|
10
|
+
* output through Effect services.
|
|
11
|
+
*
|
|
12
|
+
* The underlying stdio streams are global resources owned by the Bun process.
|
|
13
|
+
* The layer keeps stdin open and does not end stdout or stderr by default,
|
|
14
|
+
* which avoids closing handles that prompts, loggers, or other code may still
|
|
15
|
+
* use. Stdio may be attached to a TTY, pipe, or redirected file, so
|
|
16
|
+
* terminal-specific behavior such as raw mode, echo, colors, cursor control,
|
|
17
|
+
* and terminal dimensions should be coordinated with terminal APIs rather than
|
|
18
|
+
* assumed from this layer.
|
|
19
|
+
*
|
|
20
|
+
* @since 4.0.0
|
|
3
21
|
*/
|
|
4
22
|
import * as NodeStdio from "@effect/platform-node-shared/NodeStdio";
|
|
5
23
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
24
|
+
* Provides the `Stdio` service backed by the current process arguments,
|
|
25
|
+
* stdin, stdout, and stderr streams.
|
|
26
|
+
*
|
|
27
|
+
* @category layers
|
|
28
|
+
* @since 4.0.0
|
|
8
29
|
*/
|
|
9
30
|
export const layer = NodeStdio.layer;
|
|
10
31
|
//# sourceMappingURL=BunStdio.js.map
|
package/dist/BunStdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunStdio.js","names":["NodeStdio","layer"],"sources":["../src/BunStdio.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunStdio.js","names":["NodeStdio","layer"],"sources":["../src/BunStdio.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,SAAS,MAAM,wCAAwC;AAInE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAuBD,SAAS,CAACC,KAAK","ignoreList":[]}
|
package/dist/BunStream.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { LazyArg } from "effect/Function";
|
|
2
2
|
import * as Stream from "effect/Stream";
|
|
3
3
|
/**
|
|
4
|
-
* @since
|
|
4
|
+
* @since 4.0.0
|
|
5
5
|
*/
|
|
6
6
|
export * from "@effect/platform-node-shared/NodeStream";
|
|
7
7
|
/**
|
|
8
8
|
* An optimized version of `Stream.fromReadableStream` that uses the Bun
|
|
9
9
|
* .readMany API to read multiple values at once from a `ReadableStream`.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @category constructors
|
|
12
|
+
* @since 4.0.0
|
|
12
13
|
*/
|
|
13
14
|
export declare const fromReadableStream: <A, E>(options: {
|
|
14
15
|
readonly evaluate: LazyArg<ReadableStream<A>>;
|
package/dist/BunStream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunStream.d.ts","sourceRoot":"","sources":["../src/BunStream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunStream.d.ts","sourceRoot":"","sources":["../src/BunStream.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAG9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC;;GAEG;AACH,cAAc,yCAAyC,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,CAAC,EACrC,SAAS;IACP,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7C,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC,CAAA;IACvC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAChD,KACA,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CA6Bf,CAAA"}
|
package/dist/BunStream.js
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun stream interoperability for Effect streams.
|
|
3
|
+
*
|
|
4
|
+
* This module provides Bun-specific adapters for working with streaming data at
|
|
5
|
+
* the boundary between Bun APIs and Effect. It re-exports the shared Node stream
|
|
6
|
+
* adapters for Bun's Node-compatible stream APIs, and adds an optimized
|
|
7
|
+
* `ReadableStream` constructor that uses Bun's `readMany` support to pull
|
|
8
|
+
* batches of Web Stream values into an Effect `Stream`.
|
|
9
|
+
*
|
|
10
|
+
* Common uses include adapting Bun `Request` and `Response` bodies, multipart
|
|
11
|
+
* uploads, and other Web `ReadableStream` sources so they can be transformed,
|
|
12
|
+
* decoded, or piped with Effect stream operators. Pulling from the Effect stream
|
|
13
|
+
* drives reads from the underlying reader, while Bun and the Web Streams runtime
|
|
14
|
+
* still control their own internal buffering and source backpressure.
|
|
15
|
+
*
|
|
16
|
+
* Web `ReadableStream` readers take an exclusive lock on the source. Request and
|
|
17
|
+
* response bodies are also one-shot: once consumed they become disturbed and
|
|
18
|
+
* should not be read through another API. The adapter cancels the reader when
|
|
19
|
+
* the consuming scope is finalized by default; set `releaseLockOnEnd` when the
|
|
20
|
+
* stream is externally owned and should only have its lock released. Read errors
|
|
21
|
+
* are mapped through the provided `onError` function.
|
|
22
|
+
*
|
|
23
|
+
* @since 4.0.0
|
|
3
24
|
*/
|
|
4
25
|
import * as Arr from "effect/Array";
|
|
5
26
|
import * as Cause from "effect/Cause";
|
|
@@ -8,14 +29,15 @@ import * as Effect from "effect/Effect";
|
|
|
8
29
|
import * as Scope from "effect/Scope";
|
|
9
30
|
import * as Stream from "effect/Stream";
|
|
10
31
|
/**
|
|
11
|
-
* @since
|
|
32
|
+
* @since 4.0.0
|
|
12
33
|
*/
|
|
13
34
|
export * from "@effect/platform-node-shared/NodeStream";
|
|
14
35
|
/**
|
|
15
36
|
* An optimized version of `Stream.fromReadableStream` that uses the Bun
|
|
16
37
|
* .readMany API to read multiple values at once from a `ReadableStream`.
|
|
17
38
|
*
|
|
18
|
-
* @
|
|
39
|
+
* @category constructors
|
|
40
|
+
* @since 4.0.0
|
|
19
41
|
*/
|
|
20
42
|
export const fromReadableStream = options => Stream.fromChannel(Channel.fromTransform(Effect.fnUntraced(function* (_, scope) {
|
|
21
43
|
const reader = options.evaluate().getReader();
|
package/dist/BunStream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunStream.js","names":["Arr","Cause","Channel","Effect","Scope","Stream","fromReadableStream","options","fromChannel","fromTransform","fnUntraced","_","scope","reader","evaluate","getReader","addFinalizer","releaseLockOnEnd","sync","releaseLock","promise","cancel","readMany","callback","resume","result","then","succeed","e","fail","onError","flatMap","loop","done","value","isReadonlyArrayNonEmpty"],"sources":["../src/BunStream.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunStream.js","names":["Arr","Cause","Channel","Effect","Scope","Stream","fromReadableStream","options","fromChannel","fromTransform","fnUntraced","_","scope","reader","evaluate","getReader","addFinalizer","releaseLockOnEnd","sync","releaseLock","promise","cancel","readMany","callback","resume","result","then","succeed","e","fail","onError","flatMap","loop","done","value","isReadonlyArrayNonEmpty"],"sources":["../src/BunStream.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,KAAKA,GAAG,MAAM,cAAc;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAGvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AAEvC;;;AAGA,cAAc,yCAAyC;AAEvD;;;;;;;AAOA,OAAO,MAAMC,kBAAkB,GAC7BC,OAIC,IAEDF,MAAM,CAACG,WAAW,CAACN,OAAO,CAACO,aAAa,CAACN,MAAM,CAACO,UAAU,CAAC,WAAUC,CAAC,EAAEC,KAAK;EAC3E,MAAMC,MAAM,GAAGN,OAAO,CAACO,QAAQ,EAAE,CAACC,SAAS,EAAE;EAC7C,OAAOX,KAAK,CAACY,YAAY,CACvBJ,KAAK,EACLL,OAAO,CAACU,gBAAgB,GAAGd,MAAM,CAACe,IAAI,CAAC,MAAML,MAAM,CAACM,WAAW,EAAE,CAAC,GAAGhB,MAAM,CAACiB,OAAO,CAAC,MAAMP,MAAM,CAACQ,MAAM,EAAE,CAAC,CAC3G;EACD,MAAMC,QAAQ,GAAGnB,MAAM,CAACoB,QAAQ,CAAiDC,MAAM,IAAI;IACzF,MAAMC,MAAM,GAAGZ,MAAM,CAACS,QAAQ,EAAE;IAChC,IAAI,MAAM,IAAIG,MAAM,EAAE;MACpBA,MAAM,CAACC,IAAI,CAAEf,CAAC,IAAKa,MAAM,CAACrB,MAAM,CAACwB,OAAO,CAAChB,CAAC,CAAC,CAAC,EAAGiB,CAAC,IAAKJ,MAAM,CAACrB,MAAM,CAAC0B,IAAI,CAACtB,OAAO,CAACuB,OAAO,CAACF,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC,MAAM;MACLJ,MAAM,CAACrB,MAAM,CAACwB,OAAO,CAACF,MAAM,CAAC,CAAC;IAChC;EACF,CAAC,CAAC;EACF;EACA,OAAOtB,MAAM,CAAC4B,OAAO,CACnBT,QAAQ,EACR,SAASU,IAAIA,CACX;IAAEC,IAAI;IAAEC;EAAK,CAAE;IAEf,IAAID,IAAI,EAAE;MACR,OAAOhC,KAAK,CAACgC,IAAI,EAAE;IACrB,CAAC,MAAM,IAAI,CAACjC,GAAG,CAACmC,uBAAuB,CAACD,KAAK,CAAC,EAAE;MAC9C,OAAO/B,MAAM,CAAC4B,OAAO,CAACT,QAAQ,EAAEU,IAAI,CAAC;IACvC;IACA,OAAO7B,MAAM,CAACwB,OAAO,CAACO,KAAK,CAAC;EAC9B,CAAC,CACF;AACH,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
package/dist/BunTerminal.d.ts
CHANGED
|
@@ -3,13 +3,19 @@ import type { Layer } from "effect/Layer";
|
|
|
3
3
|
import type { Scope } from "effect/Scope";
|
|
4
4
|
import type { Terminal, UserInput } from "effect/Terminal";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Creates a scoped `Terminal` service backed by process stdin/stdout, using the
|
|
7
|
+
* optional predicate to decide when key input should end the input stream.
|
|
8
|
+
*
|
|
7
9
|
* @category constructors
|
|
10
|
+
* @since 4.0.0
|
|
8
11
|
*/
|
|
9
12
|
export declare const make: (shouldQuit?: (input: UserInput) => boolean) => Effect<Terminal, never, Scope>;
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
14
|
+
* Provides the default process-backed `Terminal` service, ending key input on
|
|
15
|
+
* the default quit keys.
|
|
16
|
+
*
|
|
12
17
|
* @category layers
|
|
18
|
+
* @since 4.0.0
|
|
13
19
|
*/
|
|
14
20
|
export declare const layer: Layer<Terminal>;
|
|
15
21
|
//# sourceMappingURL=BunTerminal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunTerminal.d.ts","sourceRoot":"","sources":["../src/BunTerminal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunTerminal.d.ts","sourceRoot":"","sources":["../src/BunTerminal.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAqB,CAAA;AAErH;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAsB,CAAA"}
|
package/dist/BunTerminal.js
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun-backed implementation of Effect's `Terminal` service.
|
|
3
|
+
*
|
|
4
|
+
* This module provides a scoped, process-backed terminal for Bun programs by
|
|
5
|
+
* adapting the runtime's Node-compatible stdin, stdout, and `readline` support.
|
|
6
|
+
* It is useful for CLIs, prompts, REPLs, and terminal interfaces that need
|
|
7
|
+
* prompt output, line input, keypress input, or terminal dimensions.
|
|
8
|
+
*
|
|
9
|
+
* The service uses the current process streams, so acquire it with a scope or
|
|
10
|
+
* provide `layer` to ensure cleanup. When stdin is attached to a TTY, raw mode
|
|
11
|
+
* is enabled while the terminal is active and restored when the scope closes;
|
|
12
|
+
* this changes how keys are delivered and can affect other consumers of stdin.
|
|
13
|
+
* In pipes, redirected input, or CI, raw mode may be unavailable, keypress input
|
|
14
|
+
* is limited, and stdout dimensions may be reported as zero.
|
|
15
|
+
*
|
|
16
|
+
* @since 4.0.0
|
|
3
17
|
*/
|
|
4
18
|
import * as NodeTerminal from "@effect/platform-node-shared/NodeTerminal";
|
|
5
19
|
/**
|
|
6
|
-
*
|
|
20
|
+
* Creates a scoped `Terminal` service backed by process stdin/stdout, using the
|
|
21
|
+
* optional predicate to decide when key input should end the input stream.
|
|
22
|
+
*
|
|
7
23
|
* @category constructors
|
|
24
|
+
* @since 4.0.0
|
|
8
25
|
*/
|
|
9
26
|
export const make = NodeTerminal.make;
|
|
10
27
|
/**
|
|
11
|
-
*
|
|
28
|
+
* Provides the default process-backed `Terminal` service, ending key input on
|
|
29
|
+
* the default quit keys.
|
|
30
|
+
*
|
|
12
31
|
* @category layers
|
|
32
|
+
* @since 4.0.0
|
|
13
33
|
*/
|
|
14
34
|
export const layer = NodeTerminal.layer;
|
|
15
35
|
//# sourceMappingURL=BunTerminal.js.map
|
package/dist/BunTerminal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunTerminal.js","names":["NodeTerminal","make","layer"],"sources":["../src/BunTerminal.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunTerminal.js","names":["NodeTerminal","make","layer"],"sources":["../src/BunTerminal.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiBA,OAAO,KAAKA,YAAY,MAAM,2CAA2C;AAMzE;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAAmFD,YAAY,CAACC,IAAI;AAErH;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAoBF,YAAY,CAACE,KAAK","ignoreList":[]}
|
package/dist/BunWorker.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as Worker from "effect/unstable/workers/Worker";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provides the Bun `WorkerPlatform` together with a `Worker.Spawner` created
|
|
5
|
+
* from the supplied worker spawning function.
|
|
6
|
+
*
|
|
5
7
|
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
6
9
|
*/
|
|
7
10
|
export declare const layer: (spawn: (id: number) => globalThis.Worker) => Layer.Layer<Worker.WorkerPlatform | Worker.Spawner>;
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
12
|
+
* Provides the Bun `WorkerPlatform`, wiring worker messages and errors into
|
|
13
|
+
* Effect workers and requesting graceful worker shutdown during scope
|
|
14
|
+
* finalization before terminating on timeout.
|
|
15
|
+
*
|
|
10
16
|
* @category layers
|
|
17
|
+
* @since 4.0.0
|
|
11
18
|
*/
|
|
12
19
|
export declare const layerPlatform: Layer.Layer<Worker.WorkerPlatform, never, never>;
|
|
13
20
|
//# sourceMappingURL=BunWorker.d.ts.map
|
package/dist/BunWorker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunWorker.d.ts","sourceRoot":"","sources":["../src/BunWorker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunWorker.d.ts","sourceRoot":"","sources":["../src/BunWorker.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAA;AAGxD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,CAAC,EAAE,EAAE,MAAM,KAAK,UAAU,CAAC,MAAM,KACvC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAIlD,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,kDAgDzB,CAAA"}
|
package/dist/BunWorker.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Parent-side Bun support for Effect workers.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the `WorkerPlatform` used by Bun programs that spawn
|
|
5
|
+
* and communicate with `globalThis.Worker` instances through Effect's worker
|
|
6
|
+
* protocol. Pair it with `BunWorkerRunner` in the worker entrypoint when
|
|
7
|
+
* building worker-backed RPC clients, moving CPU-bound work off the main
|
|
8
|
+
* thread, isolating Bun-only services, or hosting long-lived handlers behind a
|
|
9
|
+
* typed message boundary.
|
|
10
|
+
*
|
|
11
|
+
* The supplied spawner is responsible for creating the Bun worker for each
|
|
12
|
+
* numeric worker id. Messages follow Bun's worker cloning and transfer
|
|
13
|
+
* semantics, so payloads and transfer lists must be accepted by the Bun worker
|
|
14
|
+
* runtime. Calls to `send` are buffered until the worker runner posts its ready
|
|
15
|
+
* signal; if the worker entrypoint never starts `BunWorkerRunner`, those
|
|
16
|
+
* buffered messages will not be delivered. Scope finalization sends the Effect
|
|
17
|
+
* worker close signal, waits for Bun's `close` event for a short grace period,
|
|
18
|
+
* and then terminates the worker if graceful shutdown does not complete.
|
|
19
|
+
*
|
|
20
|
+
* @since 4.0.0
|
|
3
21
|
*/
|
|
4
22
|
import * as Deferred from "effect/Deferred";
|
|
5
23
|
import * as Effect from "effect/Effect";
|
|
@@ -9,13 +27,20 @@ import * as Scope from "effect/Scope";
|
|
|
9
27
|
import * as Worker from "effect/unstable/workers/Worker";
|
|
10
28
|
import { WorkerError, WorkerUnknownError } from "effect/unstable/workers/WorkerError";
|
|
11
29
|
/**
|
|
12
|
-
*
|
|
30
|
+
* Provides the Bun `WorkerPlatform` together with a `Worker.Spawner` created
|
|
31
|
+
* from the supplied worker spawning function.
|
|
32
|
+
*
|
|
13
33
|
* @category layers
|
|
34
|
+
* @since 4.0.0
|
|
14
35
|
*/
|
|
15
36
|
export const layer = spawn => Layer.merge(layerPlatform, Layer.succeed(Worker.Spawner)(spawn));
|
|
16
37
|
/**
|
|
17
|
-
*
|
|
38
|
+
* Provides the Bun `WorkerPlatform`, wiring worker messages and errors into
|
|
39
|
+
* Effect workers and requesting graceful worker shutdown during scope
|
|
40
|
+
* finalization before terminating on timeout.
|
|
41
|
+
*
|
|
18
42
|
* @category layers
|
|
43
|
+
* @since 4.0.0
|
|
19
44
|
*/
|
|
20
45
|
export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/*#__PURE__*/Worker.makePlatform()({
|
|
21
46
|
setup({
|
|
@@ -46,7 +71,7 @@ export const layerPlatform = /*#__PURE__*/Layer.succeed(Worker.WorkerPlatform)(/
|
|
|
46
71
|
message: "An error event was emitted",
|
|
47
72
|
cause: event.error ?? event.message
|
|
48
73
|
})
|
|
49
|
-
})
|
|
74
|
+
}));
|
|
50
75
|
}
|
|
51
76
|
port.addEventListener("message", onMessage);
|
|
52
77
|
port.addEventListener("error", onError);
|
package/dist/BunWorker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunWorker.js","names":["Deferred","Effect","Exit","Layer","Scope","Worker","WorkerError","WorkerUnknownError","layer","spawn","merge","layerPlatform","succeed","Spawner","WorkerPlatform","makePlatform","setup","scope","worker","closeDeferred","makeUnsafe","addEventListener","doneUnsafe","void","as","addFinalizer","suspend","postMessage","await","pipe","interruptible","timeout","catchCause","sync","terminate","listen","deferred","emit","port","onMessage","event","data","onError","reason","message","cause","error","
|
|
1
|
+
{"version":3,"file":"BunWorker.js","names":["Deferred","Effect","Exit","Layer","Scope","Worker","WorkerError","WorkerUnknownError","layer","spawn","merge","layerPlatform","succeed","Spawner","WorkerPlatform","makePlatform","setup","scope","worker","closeDeferred","makeUnsafe","addEventListener","doneUnsafe","void","as","addFinalizer","suspend","postMessage","await","pipe","interruptible","timeout","catchCause","sync","terminate","listen","deferred","emit","port","onMessage","event","data","onError","reason","message","cause","error","removeEventListener"],"sources":["../src/BunWorker.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,gCAAgC;AACxD,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,qCAAqC;AAErF;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAChBC,KAAwC,IAExCN,KAAK,CAACO,KAAK,CACTC,aAAa,EACbR,KAAK,CAACS,OAAO,CAACP,MAAM,CAACQ,OAAO,CAAC,CAACJ,KAAK,CAAC,CACrC;AAEH;;;;;;;;AAQA,OAAO,MAAME,aAAa,gBAAGR,KAAK,CAACS,OAAO,CAACP,MAAM,CAACS,cAAc,CAAC,cAC/DT,MAAM,CAACU,YAAY,EAAqB,CAAC;EACvCC,KAAKA,CAAC;IAAEC,KAAK;IAAEC;EAAM,CAAE;IACrB,MAAMC,aAAa,GAAGnB,QAAQ,CAACoB,UAAU,EAAQ;IACjDF,MAAM,CAACG,gBAAgB,CAAC,OAAO,EAAE,MAAK;MACpCrB,QAAQ,CAACsB,UAAU,CAACH,aAAa,EAAEjB,IAAI,CAACqB,IAAI,CAAC;IAC/C,CAAC,CAAC;IACF,OAAOtB,MAAM,CAACuB,EAAE,CACdpB,KAAK,CAACqB,YAAY,CAChBR,KAAK,EACLhB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
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as WorkerRunner from "effect/unstable/workers/WorkerRunner";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provides the `WorkerRunnerPlatform` for code running inside a Bun worker,
|
|
5
|
+
* routing parent messages to the registered handler and sending responses back
|
|
6
|
+
* through the worker port.
|
|
7
|
+
*
|
|
5
8
|
* @category layers
|
|
9
|
+
* @since 4.0.0
|
|
6
10
|
*/
|
|
7
11
|
export declare const layer: Layer.Layer<WorkerRunner.WorkerRunnerPlatform>;
|
|
8
12
|
//# sourceMappingURL=BunWorkerRunner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunWorkerRunner.d.ts","sourceRoot":"","sources":["../src/BunWorkerRunner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunWorkerRunner.d.ts","sourceRoot":"","sources":["../src/BunWorkerRunner.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,YAAY,MAAM,sCAAsC,CAAA;AAIpE;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAgF/D,CAAA"}
|
package/dist/BunWorkerRunner.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun runtime support for Effect worker runners.
|
|
3
|
+
*
|
|
4
|
+
* This module is intended for code that is already executing inside a Bun
|
|
5
|
+
* `Worker`. It provides the `WorkerRunnerPlatform` used by `WorkerRunner` to
|
|
6
|
+
* receive request messages from the parent, run the registered Effect handler,
|
|
7
|
+
* and send responses back over Bun's worker `postMessage` channel.
|
|
8
|
+
*
|
|
9
|
+
* Use it with `BunWorker` when a Bun program needs to move RPC handlers,
|
|
10
|
+
* CPU-bound computations, or Bun-only services into an isolated worker while
|
|
11
|
+
* communicating through the Effect worker protocol. The runner must be started
|
|
12
|
+
* from the worker entrypoint, not the parent process; startup fails when the
|
|
13
|
+
* current global worker scope does not expose `postMessage`. Shutdown is driven
|
|
14
|
+
* by the parent protocol message, which closes the worker port, so long-running
|
|
15
|
+
* handlers should remain interruptible and keep resource cleanup in scopes.
|
|
16
|
+
* Messages follow Bun's worker cloning and transfer semantics, so payload
|
|
17
|
+
* schemas, transfer lists, `messageerror` events, and worker `error` events
|
|
18
|
+
* should be considered at the boundary.
|
|
19
|
+
*
|
|
20
|
+
* @since 4.0.0
|
|
3
21
|
*/
|
|
4
22
|
import * as Cause from "effect/Cause";
|
|
5
23
|
import * as Deferred from "effect/Deferred";
|
|
@@ -12,8 +30,12 @@ import * as Scope from "effect/Scope";
|
|
|
12
30
|
import { WorkerError, WorkerReceiveError, WorkerSpawnError } from "effect/unstable/workers/WorkerError";
|
|
13
31
|
import * as WorkerRunner from "effect/unstable/workers/WorkerRunner";
|
|
14
32
|
/**
|
|
15
|
-
*
|
|
33
|
+
* Provides the `WorkerRunnerPlatform` for code running inside a Bun worker,
|
|
34
|
+
* routing parent messages to the registered handler and sending responses back
|
|
35
|
+
* through the worker port.
|
|
36
|
+
*
|
|
16
37
|
* @category layers
|
|
38
|
+
* @since 4.0.0
|
|
17
39
|
*/
|
|
18
40
|
export const layer = /*#__PURE__*/Layer.succeed(WorkerRunner.WorkerRunnerPlatform)({
|
|
19
41
|
start: /*#__PURE__*/Effect.fnUntraced(function* () {
|
|
@@ -28,7 +50,7 @@ export const layer = /*#__PURE__*/Layer.succeed(WorkerRunner.WorkerRunnerPlatfor
|
|
|
28
50
|
const run = handler => Effect.scopedWith(Effect.fnUntraced(function* (scope) {
|
|
29
51
|
const closeLatch = Deferred.makeUnsafe();
|
|
30
52
|
const trackFiber = Fiber.runIn(scope);
|
|
31
|
-
const services = yield* Effect.
|
|
53
|
+
const services = yield* Effect.context();
|
|
32
54
|
const runFork = Effect.runForkWith(services);
|
|
33
55
|
const onExit = exit => {
|
|
34
56
|
if (exit._tag === "Failure" && !Cause.hasInterruptsOnly(exit.cause)) {
|
|
@@ -55,7 +77,7 @@ export const layer = /*#__PURE__*/Layer.succeed(WorkerRunner.WorkerRunnerPlatfor
|
|
|
55
77
|
message: "received messageerror event",
|
|
56
78
|
cause: error.data
|
|
57
79
|
})
|
|
58
|
-
})
|
|
80
|
+
}));
|
|
59
81
|
}
|
|
60
82
|
function onError(error) {
|
|
61
83
|
Deferred.doneUnsafe(closeLatch, new WorkerError({
|
|
@@ -63,7 +85,7 @@ export const layer = /*#__PURE__*/Layer.succeed(WorkerRunner.WorkerRunnerPlatfor
|
|
|
63
85
|
message: "received error event",
|
|
64
86
|
cause: error.data
|
|
65
87
|
})
|
|
66
|
-
})
|
|
88
|
+
}));
|
|
67
89
|
}
|
|
68
90
|
yield* Scope.addFinalizer(scope, Effect.sync(() => {
|
|
69
91
|
port.removeEventListener("message", onMessage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","identity","Layer","Scope","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","layer","succeed","WorkerRunnerPlatform","start","fnUntraced","self","reason","message","port","run","handler","scopedWith","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","onMessage","event","data","result","isEffect","fiber","addObserver","close","doneUnsafe","void","onMessageError","error","
|
|
1
|
+
{"version":3,"file":"BunWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","identity","Layer","Scope","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","layer","succeed","WorkerRunnerPlatform","start","fnUntraced","self","reason","message","port","run","handler","scopedWith","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","onMessage","event","data","result","isEffect","fiber","addObserver","close","doneUnsafe","void","onMessageError","error","onError","addFinalizer","sync","removeEventListener","addEventListener","postMessage","await","sendUnsafe","_portId","transfer","send"],"sources":["../src/BunWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,qCAAqC;AACvG,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AAIpE;;;;;;;;AAQA,OAAO,MAAMC,KAAK,gBAAmDN,KAAK,CAACO,OAAO,CAACF,YAAY,CAACG,oBAAoB,CAAC,CAAC;EACpHC,KAAK,eAAEb,MAAM,CAACc,UAAU,CAAC,aAAS;IAChC,IAAI,EAAE,aAAa,IAAIC,IAAI,CAAC,EAAE;MAC5B,OAAO,OAAO,IAAIT,WAAW,CAAC;QAC5BU,MAAM,EAAE,IAAIR,gBAAgB,CAAC;UAAES,OAAO,EAAE;QAAyB,CAAE;OACpE,CAAC;IACJ;IACA,MAAMC,IAAI,GAAGH,IAAI;IACjB,MAAMI,GAAG,GACPC,OAAsE,IAEtEpB,MAAM,CAACqB,UAAU,CAACrB,MAAM,CAACc,UAAU,CAAC,WAAUQ,KAAK;MACjD,MAAMC,UAAU,GAAGxB,QAAQ,CAACyB,UAAU,EAAqB;MAC3D,MAAMC,UAAU,GAAGvB,KAAK,CAACwB,KAAK,CAACJ,KAAK,CAAC;MACrC,MAAMK,QAAQ,GAAG,OAAO3B,MAAM,CAAC4B,OAAO,EAAK;MAC3C,MAAMC,OAAO,GAAG7B,MAAM,C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