@xandreed/process-host 0.0.0-stage → 0.15.1
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/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/index.d.ts +14 -0
- package/dist/index.js +10 -0
- package/dist/ports/process-peer.port.d.ts +22 -0
- package/dist/ports/process-peer.port.js +4 -0
- package/dist/process-host.adapter.d.ts +13 -0
- package/dist/process-host.adapter.js +153 -0
- package/dist/process-host.entity.d.ts +128 -0
- package/dist/process-host.entity.functions.d.ts +12 -0
- package/dist/process-host.entity.functions.js +17 -0
- package/dist/process-host.entity.js +38 -0
- package/dist/process-peer.conformance.d.ts +27 -0
- package/dist/process-peer.conformance.js +99 -0
- package/dist/process-peer.entity.d.ts +37 -0
- package/dist/process-peer.entity.js +40 -0
- package/dist/process-protocol.entity.d.ts +970 -0
- package/dist/process-protocol.entity.functions.d.ts +1495 -0
- package/dist/process-protocol.entity.functions.js +72 -0
- package/dist/process-protocol.entity.js +155 -0
- package/dist/process-runtime.adapter.d.ts +18 -0
- package/dist/process-runtime.adapter.js +49 -0
- package/dist/process-runtime.entity.d.ts +13 -0
- package/dist/process-runtime.entity.js +11 -0
- package/dist/stdio-peer.adapter.d.ts +11 -0
- package/dist/stdio-peer.adapter.js +260 -0
- package/package.json +29 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** Owned transport failures; native values stay in the optional internal cause. @public */
|
|
3
|
+
export declare const ProcessPeerReason: Schema.Literals<readonly ["Input", "InvalidFrame", "InvalidUtf8", "FrameTooLarge", "InvalidEvent", "Output", "WriteTimeout", "Capacity", "Closed"]>;
|
|
4
|
+
export type ProcessPeerReason = typeof ProcessPeerReason.Type;
|
|
5
|
+
/** The failing side of the peer. @public */
|
|
6
|
+
export declare const ProcessPeerDirection: Schema.Literals<readonly ["input", "output"]>;
|
|
7
|
+
export type ProcessPeerDirection = typeof ProcessPeerDirection.Type;
|
|
8
|
+
declare const ProcessPeerError_base: Schema.Class<ProcessPeerError, Schema.TaggedStruct<"ProcessPeerError", {
|
|
9
|
+
readonly reason: Schema.Literals<readonly ["Input", "InvalidFrame", "InvalidUtf8", "FrameTooLarge", "InvalidEvent", "Output", "WriteTimeout", "Capacity", "Closed"]>;
|
|
10
|
+
readonly direction: Schema.Literals<readonly ["input", "output"]>;
|
|
11
|
+
readonly message: Schema.String;
|
|
12
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
/** A transport failure with an owned message, never interpolated native error text. @public */
|
|
15
|
+
export declare class ProcessPeerError extends ProcessPeerError_base {
|
|
16
|
+
}
|
|
17
|
+
/** Bounds owned by one peer; frame bytes exclude the terminating LF and optional CR. @public */
|
|
18
|
+
export declare const ProcessPeerOptions: Schema.Struct<{
|
|
19
|
+
readonly maxFrameBytes: Schema.Int;
|
|
20
|
+
readonly readChunkBytes: Schema.Int;
|
|
21
|
+
readonly maxPendingWrites: Schema.Int;
|
|
22
|
+
readonly writeTimeoutMs: Schema.Int;
|
|
23
|
+
}>;
|
|
24
|
+
export type ProcessPeerOptions = typeof ProcessPeerOptions.Type;
|
|
25
|
+
/** Defaults support attachment-bearing commands without an unbounded transport queue. @public */
|
|
26
|
+
export declare const PROCESS_PEER_DEFAULTS: ProcessPeerOptions;
|
|
27
|
+
/** Internal peer lifetime; a failure remains authoritative after disposal. */
|
|
28
|
+
export declare const ProcessPeerPhase: Schema.toTaggedUnion<"_tag", readonly [Schema.TaggedStruct<"Open", {}>, Schema.TaggedStruct<"Failed", {
|
|
29
|
+
readonly error: typeof ProcessPeerError;
|
|
30
|
+
}>, Schema.TaggedStruct<"Closed", {}>]>;
|
|
31
|
+
export type ProcessPeerPhase = typeof ProcessPeerPhase.Type;
|
|
32
|
+
/** Native input completion is independent of writable output. */
|
|
33
|
+
export declare const ProcessInputPhase: Schema.toTaggedUnion<"_tag", readonly [Schema.TaggedStruct<"Open", {}>, Schema.TaggedStruct<"Ended", {}>, Schema.TaggedStruct<"Failed", {
|
|
34
|
+
readonly error: typeof ProcessPeerError;
|
|
35
|
+
}>]>;
|
|
36
|
+
export type ProcessInputPhase = typeof ProcessInputPhase.Type;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export const ProcessPeerReason = Schema.Literals([
|
|
3
|
+
"Input",
|
|
4
|
+
"InvalidFrame",
|
|
5
|
+
"InvalidUtf8",
|
|
6
|
+
"FrameTooLarge",
|
|
7
|
+
"InvalidEvent",
|
|
8
|
+
"Output",
|
|
9
|
+
"WriteTimeout",
|
|
10
|
+
"Capacity",
|
|
11
|
+
"Closed"
|
|
12
|
+
]), ProcessPeerDirection = Schema.Literals(["input", "output"]);
|
|
13
|
+
|
|
14
|
+
export class ProcessPeerError extends Schema.TaggedError()("ProcessPeerError", {
|
|
15
|
+
reason: ProcessPeerReason,
|
|
16
|
+
direction: ProcessPeerDirection,
|
|
17
|
+
message: Schema.String,
|
|
18
|
+
cause: Schema.optionalKey(Schema.Defect())
|
|
19
|
+
}) {
|
|
20
|
+
}
|
|
21
|
+
const Positive = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }));
|
|
22
|
+
export const ProcessPeerOptions = Schema.Struct({
|
|
23
|
+
maxFrameBytes: Positive,
|
|
24
|
+
readChunkBytes: Positive.check(Schema.isLessThanOrEqualTo(1073741824)),
|
|
25
|
+
maxPendingWrites: Positive,
|
|
26
|
+
writeTimeoutMs: Positive.check(Schema.isLessThanOrEqualTo(2147483647))
|
|
27
|
+
}), PROCESS_PEER_DEFAULTS = {
|
|
28
|
+
maxFrameBytes: 25165824,
|
|
29
|
+
readChunkBytes: 65536,
|
|
30
|
+
maxPendingWrites: 64,
|
|
31
|
+
writeTimeoutMs: 1e4
|
|
32
|
+
}, ProcessPeerPhase = Schema.Union([
|
|
33
|
+
Schema.TaggedStruct("Open", {}),
|
|
34
|
+
Schema.TaggedStruct("Failed", { error: ProcessPeerError }),
|
|
35
|
+
Schema.TaggedStruct("Closed", {})
|
|
36
|
+
]).pipe(Schema.toTaggedUnion("_tag")), ProcessInputPhase = Schema.Union([
|
|
37
|
+
Schema.TaggedStruct("Open", {}),
|
|
38
|
+
Schema.TaggedStruct("Ended", {}),
|
|
39
|
+
Schema.TaggedStruct("Failed", { error: ProcessPeerError })
|
|
40
|
+
]).pipe(Schema.toTaggedUnion("_tag"));
|