reactor-effect-client 0.0.0-reserved.0 → 0.2.0
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 +201 -0
- package/NOTICE +29 -0
- package/README.md +124 -2
- package/dist/FetchHttp.d.ts +9 -0
- package/dist/FetchHttp.d.ts.map +1 -0
- package/dist/FetchHttp.js +63 -0
- package/dist/FetchHttp.js.map +1 -0
- package/dist/PeerFactory.d.ts +15 -0
- package/dist/PeerFactory.d.ts.map +1 -0
- package/dist/PeerFactory.js +4 -0
- package/dist/PeerFactory.js.map +1 -0
- package/dist/PeerTypes.d.ts +64 -0
- package/dist/PeerTypes.d.ts.map +1 -0
- package/dist/PeerTypes.js +2 -0
- package/dist/PeerTypes.js.map +1 -0
- package/dist/Sequence.d.ts +81 -0
- package/dist/Sequence.d.ts.map +1 -0
- package/dist/Sequence.js +215 -0
- package/dist/Sequence.js.map +1 -0
- package/dist/SessionTypes.d.ts +164 -0
- package/dist/SessionTypes.d.ts.map +1 -0
- package/dist/SessionTypes.js +2 -0
- package/dist/SessionTypes.js.map +1 -0
- package/dist/Submission.d.ts +42 -0
- package/dist/Submission.d.ts.map +1 -0
- package/dist/Submission.js +52 -0
- package/dist/Submission.js.map +1 -0
- package/dist/bytes.d.ts +6 -0
- package/dist/bytes.d.ts.map +1 -0
- package/dist/bytes.js +32 -0
- package/dist/bytes.js.map +1 -0
- package/dist/contract.d.ts +58 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +87 -0
- package/dist/contract.js.map +1 -0
- package/dist/coordinator/_internal/client.d.ts +127 -0
- package/dist/coordinator/_internal/client.d.ts.map +1 -0
- package/dist/coordinator/_internal/client.js +450 -0
- package/dist/coordinator/_internal/client.js.map +1 -0
- package/dist/coordinator/_internal/response.d.ts +15 -0
- package/dist/coordinator/_internal/response.d.ts.map +1 -0
- package/dist/coordinator/_internal/response.js +57 -0
- package/dist/coordinator/_internal/response.js.map +1 -0
- package/dist/coordinator/_internal/schemas.d.ts +51 -0
- package/dist/coordinator/_internal/schemas.d.ts.map +1 -0
- package/dist/coordinator/_internal/schemas.js +170 -0
- package/dist/coordinator/_internal/schemas.js.map +1 -0
- package/dist/coordinator/index.d.ts +28 -0
- package/dist/coordinator/index.d.ts.map +1 -0
- package/dist/coordinator/index.js +25 -0
- package/dist/coordinator/index.js.map +1 -0
- package/dist/correlation.d.ts +32 -0
- package/dist/correlation.d.ts.map +1 -0
- package/dist/correlation.js +113 -0
- package/dist/correlation.js.map +1 -0
- package/dist/errors.d.ts +88 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +93 -0
- package/dist/errors.js.map +1 -0
- package/dist/h3/_internal/client.d.ts +9 -0
- package/dist/h3/_internal/client.d.ts.map +1 -0
- package/dist/h3/_internal/client.js +510 -0
- package/dist/h3/_internal/client.js.map +1 -0
- package/dist/h3/_internal/contracts.d.ts +123 -0
- package/dist/h3/_internal/contracts.d.ts.map +1 -0
- package/dist/h3/_internal/contracts.js +113 -0
- package/dist/h3/_internal/contracts.js.map +1 -0
- package/dist/h3/_internal/deployment.d.ts +8 -0
- package/dist/h3/_internal/deployment.d.ts.map +1 -0
- package/dist/h3/_internal/deployment.js +132 -0
- package/dist/h3/_internal/deployment.js.map +1 -0
- package/dist/h3/_internal/evidence.d.ts +17 -0
- package/dist/h3/_internal/evidence.d.ts.map +1 -0
- package/dist/h3/_internal/evidence.js +48 -0
- package/dist/h3/_internal/evidence.js.map +1 -0
- package/dist/h3/_internal/references.d.ts +18 -0
- package/dist/h3/_internal/references.d.ts.map +1 -0
- package/dist/h3/_internal/references.js +186 -0
- package/dist/h3/_internal/references.js.map +1 -0
- package/dist/h3/_internal/request.d.ts +16 -0
- package/dist/h3/_internal/request.d.ts.map +1 -0
- package/dist/h3/_internal/request.js +79 -0
- package/dist/h3/_internal/request.js.map +1 -0
- package/dist/h3/_internal/state.d.ts +30 -0
- package/dist/h3/_internal/state.d.ts.map +1 -0
- package/dist/h3/_internal/state.js +243 -0
- package/dist/h3/_internal/state.js.map +1 -0
- package/dist/h3/index.d.ts +10 -0
- package/dist/h3/index.d.ts.map +1 -0
- package/dist/h3/index.js +7 -0
- package/dist/h3/index.js.map +1 -0
- package/dist/h3/messages.d.ts +310 -0
- package/dist/h3/messages.d.ts.map +1 -0
- package/dist/h3/messages.js +114 -0
- package/dist/h3/messages.js.map +1 -0
- package/dist/h3/profile.d.ts +109 -0
- package/dist/h3/profile.d.ts.map +1 -0
- package/dist/h3/profile.js +70 -0
- package/dist/h3/profile.js.map +1 -0
- package/dist/h3/types.d.ts +173 -0
- package/dist/h3/types.d.ts.map +1 -0
- package/dist/h3/types.js +2 -0
- package/dist/h3/types.js.map +1 -0
- package/dist/host.d.ts +25 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +20 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/json.d.ts +18 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +123 -0
- package/dist/json.js.map +1 -0
- package/dist/media-stream.d.ts +10 -0
- package/dist/media-stream.d.ts.map +1 -0
- package/dist/media-stream.js +20 -0
- package/dist/media-stream.js.map +1 -0
- package/dist/observation.d.ts +26 -0
- package/dist/observation.d.ts.map +1 -0
- package/dist/observation.js +106 -0
- package/dist/observation.js.map +1 -0
- package/dist/orchestration/h3-source.d.ts +30 -0
- package/dist/orchestration/h3-source.d.ts.map +1 -0
- package/dist/orchestration/h3-source.js +303 -0
- package/dist/orchestration/h3-source.js.map +1 -0
- package/dist/orchestration/index.d.ts +12 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +9 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/media-buffer.d.ts +23 -0
- package/dist/orchestration/media-buffer.d.ts.map +1 -0
- package/dist/orchestration/media-buffer.js +73 -0
- package/dist/orchestration/media-buffer.js.map +1 -0
- package/dist/orchestration/queries.d.ts +10 -0
- package/dist/orchestration/queries.d.ts.map +1 -0
- package/dist/orchestration/queries.js +40 -0
- package/dist/orchestration/queries.js.map +1 -0
- package/dist/orchestration/references.d.ts +16 -0
- package/dist/orchestration/references.d.ts.map +1 -0
- package/dist/orchestration/references.js +76 -0
- package/dist/orchestration/references.js.map +1 -0
- package/dist/orchestration/renewal-state.d.ts +58 -0
- package/dist/orchestration/renewal-state.d.ts.map +1 -0
- package/dist/orchestration/renewal-state.js +60 -0
- package/dist/orchestration/renewal-state.js.map +1 -0
- package/dist/orchestration/renewal.d.ts +76 -0
- package/dist/orchestration/renewal.d.ts.map +1 -0
- package/dist/orchestration/renewal.js +633 -0
- package/dist/orchestration/renewal.js.map +1 -0
- package/dist/orchestration/request.d.ts +53 -0
- package/dist/orchestration/request.d.ts.map +1 -0
- package/dist/orchestration/request.js +122 -0
- package/dist/orchestration/request.js.map +1 -0
- package/dist/orchestration/routing.d.ts +21 -0
- package/dist/orchestration/routing.d.ts.map +1 -0
- package/dist/orchestration/routing.js +90 -0
- package/dist/orchestration/routing.js.map +1 -0
- package/dist/orchestration/source-slot.d.ts +99 -0
- package/dist/orchestration/source-slot.d.ts.map +1 -0
- package/dist/orchestration/source-slot.js +206 -0
- package/dist/orchestration/source-slot.js.map +1 -0
- package/dist/orchestration/types.d.ts +334 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +11 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/protobuf.d.ts +63 -0
- package/dist/protobuf.d.ts.map +1 -0
- package/dist/protobuf.js +252 -0
- package/dist/protobuf.js.map +1 -0
- package/dist/session/_internal/acquire.d.ts +23 -0
- package/dist/session/_internal/acquire.d.ts.map +1 -0
- package/dist/session/_internal/acquire.js +167 -0
- package/dist/session/_internal/acquire.js.map +1 -0
- package/dist/session/_internal/cleanup.d.ts +18 -0
- package/dist/session/_internal/cleanup.d.ts.map +1 -0
- package/dist/session/_internal/cleanup.js +94 -0
- package/dist/session/_internal/cleanup.js.map +1 -0
- package/dist/session/_internal/lifecycle.d.ts +62 -0
- package/dist/session/_internal/lifecycle.d.ts.map +1 -0
- package/dist/session/_internal/lifecycle.js +132 -0
- package/dist/session/_internal/lifecycle.js.map +1 -0
- package/dist/session/_internal/remote.d.ts +28 -0
- package/dist/session/_internal/remote.d.ts.map +1 -0
- package/dist/session/_internal/remote.js +61 -0
- package/dist/session/_internal/remote.js.map +1 -0
- package/dist/session/_internal/uploads.d.ts +4 -0
- package/dist/session/_internal/uploads.d.ts.map +1 -0
- package/dist/session/_internal/uploads.js +33 -0
- package/dist/session/_internal/uploads.js.map +1 -0
- package/dist/session/commands.d.ts +22 -0
- package/dist/session/commands.d.ts.map +1 -0
- package/dist/session/commands.js +13 -0
- package/dist/session/commands.js.map +1 -0
- package/dist/session/files.d.ts +15 -0
- package/dist/session/files.d.ts.map +1 -0
- package/dist/session/files.js +54 -0
- package/dist/session/files.js.map +1 -0
- package/dist/session/index.d.ts +76 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +16 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/media.d.ts +67 -0
- package/dist/session/media.d.ts.map +1 -0
- package/dist/session/media.js +2 -0
- package/dist/session/media.js.map +1 -0
- package/dist/session.d.ts +104 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +872 -0
- package/dist/session.js.map +1 -0
- package/dist/simulation/_internal/source.d.ts +12 -0
- package/dist/simulation/_internal/source.d.ts.map +1 -0
- package/dist/simulation/_internal/source.js +477 -0
- package/dist/simulation/_internal/source.js.map +1 -0
- package/dist/simulation/index.d.ts +14 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +13 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/types.d.ts +29 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +2 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/stats.d.ts +33 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +134 -0
- package/dist/stats.js.map +1 -0
- package/dist/testing/Faults.d.ts +4 -0
- package/dist/testing/Faults.d.ts.map +1 -0
- package/dist/testing/Faults.js +7 -0
- package/dist/testing/Faults.js.map +1 -0
- package/dist/testing/Png.d.ts +3 -0
- package/dist/testing/Png.d.ts.map +1 -0
- package/dist/testing/Png.js +68 -0
- package/dist/testing/Png.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/wire.d.ts +7 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.generated.d.ts +305 -0
- package/dist/wire.generated.d.ts.map +1 -0
- package/dist/wire.generated.js +1257 -0
- package/dist/wire.generated.js.map +1 -0
- package/dist/wire.js +5 -0
- package/dist/wire.js.map +1 -0
- package/notices/effect-LICENSE +21 -0
- package/notices/google-protobuf-LICENSE +32 -0
- package/notices/owned-webrtc/Effect-MIT.txt +21 -0
- package/notices/owned-webrtc/IETF.txt +43 -0
- package/notices/owned-webrtc/LICENSE +21 -0
- package/notices/owned-webrtc/UPSTREAM.md +20 -0
- package/notices/owned-webrtc/VP8-ADAPTATION.md +32 -0
- package/notices/owned-webrtc/VP8-AUTHORS.txt +42 -0
- package/notices/owned-webrtc/VP8-LICENSE.txt +25 -0
- package/notices/owned-webrtc/VP8-PATENTS.txt +21 -0
- package/notices/owned-webrtc/Werift-MIT.txt +21 -0
- package/notices/owned-webrtc/libvpx-v1.12.0-LICENSE.txt +28 -0
- package/notices/owned-webrtc/libvpx-v1.12.0-PATENTS.txt +22 -0
- package/notices/owned-webrtc/rfc3711.txt +3139 -0
- package/notices/owned-webrtc/str0m-MIT.txt +7 -0
- package/notices/owned-webrtc-LICENSE +21 -0
- package/notices/reactor-runtime-LICENSE +201 -0
- package/notices/reactor-runtime-NOTICE +5 -0
- package/notices/reactor-sdk-LICENSE +201 -0
- package/package.json +62 -4
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as Deferred from "effect/Deferred";
|
|
2
|
+
import * as Queue from "effect/Queue";
|
|
3
|
+
import * as Scope from "effect/Scope";
|
|
4
|
+
import type { IceCandidate, Mapping } from "../../contract.js";
|
|
5
|
+
import { ReactorError } from "../../errors.js";
|
|
6
|
+
import type { MediaTrack, Peer } from "../../PeerTypes.js";
|
|
7
|
+
import type { ReadyState, Status } from "../../SessionTypes.js";
|
|
8
|
+
/** Resources and protocol facts belonging to exactly one peer generation. */
|
|
9
|
+
export declare class Connection {
|
|
10
|
+
readonly generation: bigint;
|
|
11
|
+
readonly scope: Scope.Closeable;
|
|
12
|
+
readonly peer: Peer;
|
|
13
|
+
readonly iceWake: Queue.Queue<void, ReactorError>;
|
|
14
|
+
readonly ready: Deferred.Deferred<void, ReactorError>;
|
|
15
|
+
readonly failed: Deferred.Deferred<never, ReactorError>;
|
|
16
|
+
readonly iceBuffer: IceCandidate[];
|
|
17
|
+
iceBytes: number;
|
|
18
|
+
iceDone: boolean;
|
|
19
|
+
finalSent: boolean;
|
|
20
|
+
peerConnected: boolean;
|
|
21
|
+
controlOpen: boolean;
|
|
22
|
+
dataOpen: boolean;
|
|
23
|
+
connectionId?: number;
|
|
24
|
+
failure?: ReactorError;
|
|
25
|
+
mapping: readonly Mapping[];
|
|
26
|
+
negotiated?: ReadyState["remote"];
|
|
27
|
+
readonly paused: Set<string>;
|
|
28
|
+
readonly claimed: Set<string>;
|
|
29
|
+
readonly sending: Map<string, MediaTrack>;
|
|
30
|
+
readonly pendingClaims: Map<string, string>;
|
|
31
|
+
readonly trackBusy: Set<string>;
|
|
32
|
+
constructor(generation: bigint, scope: Scope.Closeable, peer: Peer);
|
|
33
|
+
readyGate(): void;
|
|
34
|
+
}
|
|
35
|
+
export interface ReadyConnection extends Connection {
|
|
36
|
+
readonly negotiated: ReadyState["remote"];
|
|
37
|
+
}
|
|
38
|
+
/** The phase and generation authority. Wire correlation remains in Session. */
|
|
39
|
+
export declare class SessionLifecycle {
|
|
40
|
+
private readonly onStatus;
|
|
41
|
+
private phase;
|
|
42
|
+
private revision;
|
|
43
|
+
private active;
|
|
44
|
+
private error;
|
|
45
|
+
readonly scope: Scope.Closeable;
|
|
46
|
+
readonly closing: Deferred.Deferred<never, ReactorError>;
|
|
47
|
+
constructor(onStatus: (status: Status) => void);
|
|
48
|
+
get status(): Status;
|
|
49
|
+
get generation(): bigint;
|
|
50
|
+
get connection(): Connection | undefined;
|
|
51
|
+
get lastError(): ReactorError | undefined;
|
|
52
|
+
get isClosing(): boolean;
|
|
53
|
+
transition(status: Status): void;
|
|
54
|
+
/** Called synchronously with Session's sampling reset and connecting event. */
|
|
55
|
+
begin(reconnect: boolean, hasKnownRemote: boolean, makePeer: () => Peer): Connection;
|
|
56
|
+
accepts(connection: Connection): boolean;
|
|
57
|
+
assertCurrent(connection: Connection): void;
|
|
58
|
+
currentReady(): ReadyConnection;
|
|
59
|
+
/** Retiring an old peer must not disconnect its replacement or overwrite its error. */
|
|
60
|
+
disconnect(connection: Connection, error: ReactorError): boolean;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/session/_internal/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,M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CAA2B;IACxC,QAAQ,CAAC,KAAK,kBAAsB;IACpC,QAAQ,CAAC,OAAO,yCAA8C;IAE9D,YAA6B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAAI;IAEnE,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,UAAU,IAAI,UAAU,GAAG,SAAS,CAEvC;IAED,IAAI,SAAS,IAAI,YAAY,GAAG,SAAS,CAExC;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAM/B;IAED,+EAA+E;IAC/E,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAenF;IAED,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEvC;IAED,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAO1C;IAED,YAAY,IAAI,eAAe,CAW9B;IAED,uFAAuF;IACvF,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAK/D;CACF"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as Deferred from "effect/Deferred";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Queue from "effect/Queue";
|
|
4
|
+
import * as Scope from "effect/Scope";
|
|
5
|
+
import { ReactorError } from "../../errors.js";
|
|
6
|
+
const transitions = {
|
|
7
|
+
idle: ["connecting", "closing"],
|
|
8
|
+
connecting: ["waiting", "disconnected", "closing"],
|
|
9
|
+
waiting: ["ready", "disconnected", "closing"],
|
|
10
|
+
ready: ["connecting", "disconnected", "closing"],
|
|
11
|
+
disconnected: ["connecting", "closing"],
|
|
12
|
+
closing: ["closed"],
|
|
13
|
+
closed: [],
|
|
14
|
+
};
|
|
15
|
+
/** Resources and protocol facts belonging to exactly one peer generation. */
|
|
16
|
+
export class Connection {
|
|
17
|
+
generation;
|
|
18
|
+
scope;
|
|
19
|
+
peer;
|
|
20
|
+
// Queue creation is synchronous and allocates no asynchronous work.
|
|
21
|
+
iceWake = Effect.runSync(Queue.dropping(1));
|
|
22
|
+
ready = Deferred.makeUnsafe();
|
|
23
|
+
failed = Deferred.makeUnsafe();
|
|
24
|
+
iceBuffer = [];
|
|
25
|
+
iceBytes = 0;
|
|
26
|
+
iceDone = false;
|
|
27
|
+
finalSent = false;
|
|
28
|
+
peerConnected = false;
|
|
29
|
+
controlOpen = false;
|
|
30
|
+
dataOpen = false;
|
|
31
|
+
connectionId;
|
|
32
|
+
failure;
|
|
33
|
+
mapping = [];
|
|
34
|
+
negotiated;
|
|
35
|
+
paused = new Set();
|
|
36
|
+
claimed = new Set();
|
|
37
|
+
sending = new Map();
|
|
38
|
+
pendingClaims = new Map();
|
|
39
|
+
trackBusy = new Set();
|
|
40
|
+
constructor(generation, scope, peer) {
|
|
41
|
+
this.generation = generation;
|
|
42
|
+
this.scope = scope;
|
|
43
|
+
this.peer = peer;
|
|
44
|
+
}
|
|
45
|
+
readyGate() {
|
|
46
|
+
if (this.peerConnected && this.controlOpen && this.dataOpen && this.failure === undefined)
|
|
47
|
+
Deferred.doneUnsafe(this.ready, Effect.void);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const isNegotiated = (connection) => connection.negotiated !== undefined;
|
|
51
|
+
/** The phase and generation authority. Wire correlation remains in Session. */
|
|
52
|
+
export class SessionLifecycle {
|
|
53
|
+
onStatus;
|
|
54
|
+
phase = "idle";
|
|
55
|
+
revision = 0n;
|
|
56
|
+
active;
|
|
57
|
+
error;
|
|
58
|
+
scope = Scope.makeUnsafe();
|
|
59
|
+
closing = Deferred.makeUnsafe();
|
|
60
|
+
constructor(onStatus) {
|
|
61
|
+
this.onStatus = onStatus;
|
|
62
|
+
}
|
|
63
|
+
get status() {
|
|
64
|
+
return this.phase;
|
|
65
|
+
}
|
|
66
|
+
get generation() {
|
|
67
|
+
return this.revision;
|
|
68
|
+
}
|
|
69
|
+
get connection() {
|
|
70
|
+
return this.active;
|
|
71
|
+
}
|
|
72
|
+
get lastError() {
|
|
73
|
+
return this.error;
|
|
74
|
+
}
|
|
75
|
+
get isClosing() {
|
|
76
|
+
return this.phase === "closing" || this.phase === "closed";
|
|
77
|
+
}
|
|
78
|
+
transition(status) {
|
|
79
|
+
if (this.phase === status)
|
|
80
|
+
return;
|
|
81
|
+
if (!transitions[this.phase].includes(status))
|
|
82
|
+
throw new ReactorError("InvalidState", `illegal transition ${this.phase} -> ${status}`);
|
|
83
|
+
this.phase = status;
|
|
84
|
+
this.onStatus(status);
|
|
85
|
+
}
|
|
86
|
+
/** Called synchronously with Session's sampling reset and connecting event. */
|
|
87
|
+
begin(reconnect, hasKnownRemote, makePeer) {
|
|
88
|
+
if (reconnect ? this.phase !== "ready" && this.phase !== "disconnected" : this.phase !== "idle")
|
|
89
|
+
throw new ReactorError("InvalidState", `${reconnect ? "reconnect" : "connect"} while ${this.phase}`);
|
|
90
|
+
if (reconnect && !hasKnownRemote)
|
|
91
|
+
throw new ReactorError("InvalidState", "cannot reconnect without a known session");
|
|
92
|
+
const generation = ++this.revision, scope = Scope.forkUnsafe(this.scope), peer = makePeer();
|
|
93
|
+
const connection = new Connection(generation, scope, peer);
|
|
94
|
+
this.active = connection;
|
|
95
|
+
this.error = undefined;
|
|
96
|
+
return connection;
|
|
97
|
+
}
|
|
98
|
+
accepts(connection) {
|
|
99
|
+
return this.active === connection && connection.failure === undefined && !this.isClosing;
|
|
100
|
+
}
|
|
101
|
+
assertCurrent(connection) {
|
|
102
|
+
// Preserve the actual failure even when close or reconnect also retired it.
|
|
103
|
+
if (connection.failure !== undefined)
|
|
104
|
+
throw connection.failure;
|
|
105
|
+
if (this.active !== connection || this.isClosing)
|
|
106
|
+
throw new ReactorError("Aborted", "retired connection generation", {
|
|
107
|
+
generation: connection.generation,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
currentReady() {
|
|
111
|
+
const connection = this.active;
|
|
112
|
+
if (this.isClosing)
|
|
113
|
+
throw new ReactorError("Closed", "session is closed", { outcome: "not-submitted" });
|
|
114
|
+
if (this.phase !== "ready" || connection === undefined)
|
|
115
|
+
throw new ReactorError("InvalidState", `operation requires ready, not ${this.phase}`, {
|
|
116
|
+
outcome: "not-submitted",
|
|
117
|
+
});
|
|
118
|
+
this.assertCurrent(connection);
|
|
119
|
+
if (!isNegotiated(connection))
|
|
120
|
+
throw new Error("ready connection has no negotiated descriptor");
|
|
121
|
+
return connection;
|
|
122
|
+
}
|
|
123
|
+
/** Retiring an old peer must not disconnect its replacement or overwrite its error. */
|
|
124
|
+
disconnect(connection, error) {
|
|
125
|
+
if (this.active !== connection || this.isClosing)
|
|
126
|
+
return false;
|
|
127
|
+
this.error = error;
|
|
128
|
+
this.transition("disconnected");
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../src/session/_internal/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,MAAM,WAAW,GAAsC;IACrD,IAAI,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAC/B,UAAU,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,SAAS,CAAC;IAClD,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC;IAC7C,KAAK,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE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Y;QACV,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,IAAI,IAAI,CAAC,SAAS;YAChB,MAAM,IAAI,YAAY,CAAC,QAAQ,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACtF,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,IAAI,UAAU,KAAK,SAAS;YACpD,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE,iCAAiC,IAAI,CAAC,KAAK,EAAE,EAAE;gBACpF,OAAO,EAAE,eAAe;aACzB,CAAC,CAAC;QACL,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAChG,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,uFAAuF;IACvF,UAAU,CAAC,UAAsB,EAAE,KAAmB;QACpD,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAC/D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { Descriptor } from "../../contract.js";
|
|
3
|
+
import type { CoordinatorClient } from "../../coordinator/_internal/client.js";
|
|
4
|
+
import { ReactorError } from "../../errors.js";
|
|
5
|
+
import type { SessionOptions } from "../../SessionTypes.js";
|
|
6
|
+
import type { SessionLifecycle } from "./lifecycle.js";
|
|
7
|
+
export interface KnownRemote {
|
|
8
|
+
readonly ownership: "owned" | "attached";
|
|
9
|
+
readonly id: string;
|
|
10
|
+
descriptor?: Descriptor;
|
|
11
|
+
connectionId?: number;
|
|
12
|
+
}
|
|
13
|
+
export type Remote = {
|
|
14
|
+
readonly ownership: "allocating" | "unknown";
|
|
15
|
+
} | KnownRemote;
|
|
16
|
+
export declare const isKnownRemote: (remote: Remote | undefined) => remote is KnownRemote;
|
|
17
|
+
/** One allocation's evidence survives peer generations and interrupted acquisition. */
|
|
18
|
+
export declare class RemoteSession {
|
|
19
|
+
private value;
|
|
20
|
+
get current(): Remote | undefined;
|
|
21
|
+
get id(): string | undefined;
|
|
22
|
+
get isKnown(): boolean;
|
|
23
|
+
requireKnown(): KnownRemote;
|
|
24
|
+
allocationLost(): void;
|
|
25
|
+
allocate(options: SessionOptions, http: CoordinatorClient, lifecycle: SessionLifecycle): Effect.Effect<string, ReactorError>;
|
|
26
|
+
isKnownTerminal(): boolean;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/session/_internal/remote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,UAAU,CAAC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,YAAY,GAAG,SAAS,CAAA;CAAE,GAAG,WAAW,CAAC;AAEpF,eAAO,MAAM,aAAa,WAAY,MAAM,GAAG,SAAS,KAAG,MAAM,IAAI,WACF,CAAC;AAEpE,uFAAuF;AACvF,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAqB;IAElC,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;IAED,IAAI,EAAE,IAAI,MAAM,GAAG,SAAS,CAE3B;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,YAAY,IAAI,WAAW,CAG1B;IAED,cAAc,IAAI,IAAI,CAErB;IAED,QAAQ,CACN,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,gBAAgB,GAC1B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CA0CrC;IAED,eAAe,IAAI,OAAO,CAMzB;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as Deferred from "effect/Deferred";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Exit from "effect/Exit";
|
|
4
|
+
import { terminal } from "../../contract.js";
|
|
5
|
+
import { ReactorError } from "../../errors.js";
|
|
6
|
+
export const isKnownRemote = (remote) => remote?.ownership === "owned" || remote?.ownership === "attached";
|
|
7
|
+
/** One allocation's evidence survives peer generations and interrupted acquisition. */
|
|
8
|
+
export class RemoteSession {
|
|
9
|
+
value;
|
|
10
|
+
get current() {
|
|
11
|
+
return this.value;
|
|
12
|
+
}
|
|
13
|
+
get id() {
|
|
14
|
+
return isKnownRemote(this.value) ? this.value.id : undefined;
|
|
15
|
+
}
|
|
16
|
+
get isKnown() {
|
|
17
|
+
return isKnownRemote(this.value);
|
|
18
|
+
}
|
|
19
|
+
requireKnown() {
|
|
20
|
+
if (!isKnownRemote(this.value))
|
|
21
|
+
throw new ReactorError("InvalidState", "no known session id");
|
|
22
|
+
return this.value;
|
|
23
|
+
}
|
|
24
|
+
allocationLost() {
|
|
25
|
+
if (this.value?.ownership === "allocating")
|
|
26
|
+
this.value = { ownership: "unknown" };
|
|
27
|
+
}
|
|
28
|
+
allocate(options, http, lifecycle) {
|
|
29
|
+
const self = this;
|
|
30
|
+
return Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
|
|
31
|
+
if (lifecycle.isClosing)
|
|
32
|
+
return yield* Effect.fail(new ReactorError("Closed", "session is closed", { outcome: "not-submitted" }));
|
|
33
|
+
if (isKnownRemote(self.value))
|
|
34
|
+
return self.value.id;
|
|
35
|
+
if (self.value !== undefined)
|
|
36
|
+
return yield* Effect.fail(new ReactorError("InvalidState", "session allocation is already pending or unresolved", { outcome: "unknown" }));
|
|
37
|
+
const intent = options.intent;
|
|
38
|
+
if (intent._tag === "Attach") {
|
|
39
|
+
self.value = {
|
|
40
|
+
ownership: "attached",
|
|
41
|
+
id: intent.sessionId,
|
|
42
|
+
...(intent.connectionId === undefined ? {} : { connectionId: intent.connectionId }),
|
|
43
|
+
};
|
|
44
|
+
return self.value.id;
|
|
45
|
+
}
|
|
46
|
+
self.value = { ownership: "allocating" };
|
|
47
|
+
return yield* restore(http
|
|
48
|
+
.create(intent.model, intent.extraArgs)
|
|
49
|
+
.pipe(Effect.raceFirst(Deferred.await(lifecycle.closing)))).pipe(Effect.map((descriptor) => {
|
|
50
|
+
self.value = { ownership: "owned", id: descriptor.session_id, descriptor };
|
|
51
|
+
return descriptor.session_id;
|
|
52
|
+
}), Effect.onExit((exit) => Exit.isFailure(exit) ? Effect.sync(() => self.allocationLost()) : Effect.void));
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
isKnownTerminal() {
|
|
56
|
+
return (isKnownRemote(this.value) &&
|
|
57
|
+
this.value.descriptor !== undefined &&
|
|
58
|
+
terminal(this.value.descriptor.state));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","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C,IAAI,CACJ,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;gBACxB,IAAI,CAAC,KAAK,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,CAAC;gBAC3E,OAAO,UAAU,CAAC,UAAU,CAAC;YAC/B,CAAC,CAAC,EACF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACrB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAC9E,CACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,eAAe;QACb,OAAO,CACL,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS;YACnC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CACtC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UploadReference } from "../../wire.generated.js";
|
|
2
|
+
/** Detach caller-owned references before correlation or dispatch can begin. */
|
|
3
|
+
export declare const captureUploads: (input: ReadonlyMap<string, UploadReference>) => Map<string, UploadReference>;
|
|
4
|
+
//# sourceMappingURL=uploads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../../../src/session/_internal/uploads.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI/D,+EAA+E;AAC/E,eAAO,MAAM,cAAc,UAClB,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,KAC1C,GAAG,CAAC,MAAM,EAAE,eAAe,CA4B7B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactorError } from "../../errors.js";
|
|
2
|
+
import { nonempty } from "../../json.js";
|
|
3
|
+
const maximumWireSize = (1n << 63n) - 1n;
|
|
4
|
+
/** Detach caller-owned references before correlation or dispatch can begin. */
|
|
5
|
+
export const captureUploads = (input) => {
|
|
6
|
+
try {
|
|
7
|
+
const result = new Map();
|
|
8
|
+
for (const [key, value] of input) {
|
|
9
|
+
if (result.size >= 128)
|
|
10
|
+
throw new TypeError("too many upload references");
|
|
11
|
+
nonempty(key, "upload key");
|
|
12
|
+
if (value === null || typeof value !== "object")
|
|
13
|
+
throw new TypeError("upload reference must be an object");
|
|
14
|
+
if (typeof value.size !== "bigint" || value.size < 0n || value.size > maximumWireSize) {
|
|
15
|
+
throw new TypeError("upload size must be a nonnegative signed-64-bit bigint");
|
|
16
|
+
}
|
|
17
|
+
result.set(key, Object.freeze({
|
|
18
|
+
upload_id: nonempty(value.upload_id, "upload id"),
|
|
19
|
+
name: nonempty(value.name, "upload name"),
|
|
20
|
+
mime_type: nonempty(value.mime_type, "upload MIME type"),
|
|
21
|
+
size: value.size,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
catch (cause) {
|
|
27
|
+
throw new ReactorError("InvalidInput", "invalid command upload reference", {
|
|
28
|
+
outcome: "not-submitted",
|
|
29
|
+
detail: cause,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["../../../src/session/_internal/uploads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,eAAe,GAAG,CAAC,EAAE,IAAI,GAAG,CAA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C;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactorError } from "../errors.js";
|
|
2
|
+
import type { ErrorContext } from "../errors.js";
|
|
3
|
+
type Details = Omit<ErrorContext, "outcome" | "operation" | "requestId" | "generation">;
|
|
4
|
+
/** Dispatch evidence is independent of the failure's transport category. */
|
|
5
|
+
export type CommandContext = Details & ({
|
|
6
|
+
readonly outcome: "not-submitted";
|
|
7
|
+
readonly operation: string;
|
|
8
|
+
readonly requestId?: string;
|
|
9
|
+
readonly generation?: bigint;
|
|
10
|
+
} | {
|
|
11
|
+
readonly outcome: "unknown" | "replied";
|
|
12
|
+
readonly operation: string;
|
|
13
|
+
readonly requestId: string;
|
|
14
|
+
readonly generation: bigint;
|
|
15
|
+
});
|
|
16
|
+
/** Every failed command carries the dispatch evidence established by its owner. */
|
|
17
|
+
export declare class CommandFailure extends ReactorError {
|
|
18
|
+
readonly context: CommandContext;
|
|
19
|
+
constructor(error: ReactorError, context: CommandContext);
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,KAAK,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC,CAAC;AAExF,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,OAAO,GAClC,CACI;IACE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,GACD;IACE,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CACJ,CAAC;AAEJ,mFAAmF;AACnF,qBAAa,cAAe,SAAQ,YAAY;IAC9C,SAAiB,OAAO,EAAE,cAAc,CAAC;IAEzC,YAAY,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAOvD;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactorError } from "../errors.js";
|
|
2
|
+
/** Every failed command carries the dispatch evidence established by its owner. */
|
|
3
|
+
export class CommandFailure extends ReactorError {
|
|
4
|
+
constructor(error, context) {
|
|
5
|
+
super({
|
|
6
|
+
code: error.code,
|
|
7
|
+
message: error.message,
|
|
8
|
+
context,
|
|
9
|
+
...(error.nativeError === undefined ? {} : { nativeError: error.nativeError }),
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAsB5C,mFAAmF;AACnF,MAAM,OAAO,cAAe,SAAQ,YAAY;IAG9C,YAAY,KAAmB,EAAE,OAAuB;QACtD,KAAK,CAAC;YACJ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO;YACP,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;SAC/E,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as FileSystem from "effect/FileSystem";
|
|
3
|
+
import * as Path from "effect/Path";
|
|
4
|
+
import { ReactorError } from "../errors.js";
|
|
5
|
+
import type { Session, Uploaded } from "./index.js";
|
|
6
|
+
export interface FileUploadOptions {
|
|
7
|
+
readonly mimeType?: string;
|
|
8
|
+
readonly maxBytes?: number;
|
|
9
|
+
readonly readTimeoutMs?: number;
|
|
10
|
+
}
|
|
11
|
+
/** Scoped, bounded host file loading shared by uploads and reference preparation. */
|
|
12
|
+
export declare const readFileBytes: (file: string, maxBytes: number) => Effect.Effect<Uint8Array, ReactorError, FileSystem.FileSystem>;
|
|
13
|
+
/** File IO is a host convenience; the result retains canonical upload evidence. */
|
|
14
|
+
export declare const uploadFile: (session: Session, file: string, options?: FileUploadOptions) => Effect.Effect<Uploaded, ReactorError, FileSystem.FileSystem | Path.Path>;
|
|
15
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/session/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,qFAAqF;AACrF,eAAO,MAAM,aAAa,SAClB,MAAM,YACF,MAAM,KACf,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,UAAU,CAyB5D,CAAC;AAEL,mFAAmF;AACnF,eAAO,MAAM,UAAU,YACZ,OAAO,QACV,MAAM,YACH,iBAAiB,KACzB,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAuCtE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as FileSystem from "effect/FileSystem";
|
|
3
|
+
import * as Path from "effect/Path";
|
|
4
|
+
import { collectBytes } from "../bytes.js";
|
|
5
|
+
import { ReactorError } from "../errors.js";
|
|
6
|
+
/** Scoped, bounded host file loading shared by uploads and reference preparation. */
|
|
7
|
+
export const readFileBytes = (file, maxBytes) => Effect.gen(function* () {
|
|
8
|
+
if (typeof file !== "string" ||
|
|
9
|
+
file.length === 0 ||
|
|
10
|
+
!Number.isSafeInteger(maxBytes) ||
|
|
11
|
+
maxBytes <= 0) {
|
|
12
|
+
return yield* Effect.fail(new ReactorError("InvalidInput", "A file and positive byte bound are required", {
|
|
13
|
+
outcome: "not-submitted",
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
const fs = yield* FileSystem.FileSystem;
|
|
17
|
+
return yield* collectBytes(fs.stream(file, { bytesToRead: maxBytes + 1 }), maxBytes).pipe(Effect.mapError((cause) => cause instanceof ReactorError
|
|
18
|
+
? cause
|
|
19
|
+
: new ReactorError("Upload", "Source file could not be read", {
|
|
20
|
+
outcome: "not-submitted",
|
|
21
|
+
detail: cause,
|
|
22
|
+
})));
|
|
23
|
+
});
|
|
24
|
+
/** File IO is a host convenience; the result retains canonical upload evidence. */
|
|
25
|
+
export const uploadFile = (session, file, options = {}) => Effect.gen(function* () {
|
|
26
|
+
const before = yield* session.ready;
|
|
27
|
+
const timeout = options.readTimeoutMs ?? 30_000;
|
|
28
|
+
if (!Number.isFinite(timeout) || timeout <= 0)
|
|
29
|
+
return yield* Effect.fail(new ReactorError("InvalidInput", "Invalid file-read deadline", {
|
|
30
|
+
outcome: "not-submitted",
|
|
31
|
+
}));
|
|
32
|
+
const bytes = yield* readFileBytes(file, options.maxBytes ?? 64 * 1024 * 1024).pipe(Effect.timeoutOrElse({
|
|
33
|
+
duration: timeout,
|
|
34
|
+
orElse: () => Effect.fail(new ReactorError("Upload", "Source file read timed out", { outcome: "not-submitted" })),
|
|
35
|
+
}));
|
|
36
|
+
const after = yield* session.ready;
|
|
37
|
+
if (after.generation !== before.generation)
|
|
38
|
+
return yield* Effect.fail(new ReactorError("Disconnected", "Connection changed while reading the upload file", {
|
|
39
|
+
outcome: "not-submitted",
|
|
40
|
+
}));
|
|
41
|
+
const path = yield* Path.Path;
|
|
42
|
+
const name = path.basename(file);
|
|
43
|
+
const extension = path.extname(name).toLowerCase();
|
|
44
|
+
const mime = options.mimeType ??
|
|
45
|
+
(extension === ".png"
|
|
46
|
+
? "image/png"
|
|
47
|
+
: extension === ".webp"
|
|
48
|
+
? "image/webp"
|
|
49
|
+
: extension === ".jpg" || extension === ".jpeg"
|
|
50
|
+
? "image/jpeg"
|
|
51
|
+
: "application/octet-stream");
|
|
52
|
+
return yield* session.upload(name, mime, bytes);
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/session/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAS5C,qFAAqF;AACrF,MAAM,CAAC,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,SAAS,KAAK,OAAO;oBAC7C,CAAC,CAAC,YAAY;oBACd,CAAC,CAAC,0BAA0B,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Crypto from "effect/Crypto";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import type * as Redacted from "effect/Redacted";
|
|
6
|
+
import type * as Scope from "effect/Scope";
|
|
7
|
+
import type * as Stream from "effect/Stream";
|
|
8
|
+
import * as Http from "effect/unstable/http/HttpClient";
|
|
9
|
+
import type { HttpOptions } from "../coordinator/_internal/client.js";
|
|
10
|
+
import { PeerFactory } from "../PeerFactory.js";
|
|
11
|
+
import type { ReactorError } from "../errors.js";
|
|
12
|
+
import type { Json, JsonObject } from "../json.js";
|
|
13
|
+
import type { Statistics } from "../stats.js";
|
|
14
|
+
import type { UploadReference, ClipReady } from "../wire.generated.js";
|
|
15
|
+
import type { SessionOptions, Snapshot, ReadyState, SessionEvent, CommandReply, CloseReport, Uploaded, Observe } from "../SessionTypes.js";
|
|
16
|
+
import type { CommandFailure } from "./commands.js";
|
|
17
|
+
import { type AcquisitionFailure } from "./_internal/acquire.js";
|
|
18
|
+
export interface Configuration extends Omit<HttpOptions, "apiUrl" | "credential"> {
|
|
19
|
+
readonly apiUrl?: string;
|
|
20
|
+
readonly credential?: Effect.Effect<Redacted.Redacted<string>, ReactorError>;
|
|
21
|
+
readonly session?: Pick<SessionOptions, "commandTimeoutMs" | "connectTimeoutMs" | "readyTimeoutMs" | "heartbeatMs" | "maxPending" | "maxUploadBytes">;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateOptions {
|
|
24
|
+
readonly model: string;
|
|
25
|
+
readonly version?: string;
|
|
26
|
+
readonly jwt?: Redacted.Redacted<string>;
|
|
27
|
+
readonly extraArgs?: Json;
|
|
28
|
+
}
|
|
29
|
+
export interface AttachOptions {
|
|
30
|
+
readonly sessionId: string;
|
|
31
|
+
readonly connectionId?: number;
|
|
32
|
+
readonly jwt?: Redacted.Redacted<string>;
|
|
33
|
+
}
|
|
34
|
+
/** One lifecycle and command contract, independent of the selected host peer. */
|
|
35
|
+
export interface Session {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly ownership: "owned" | "attached";
|
|
38
|
+
readonly connect: Effect.Effect<void, ReactorError>;
|
|
39
|
+
readonly reconnect: Effect.Effect<void, ReactorError>;
|
|
40
|
+
readonly current: Effect.Effect<Snapshot>;
|
|
41
|
+
readonly ready: Effect.Effect<ReadyState, ReactorError>;
|
|
42
|
+
readonly events: (options?: {
|
|
43
|
+
readonly capacity?: number;
|
|
44
|
+
readonly maxBytes?: number;
|
|
45
|
+
}) => Stream.Stream<SessionEvent, ReactorError>;
|
|
46
|
+
readonly observe: Observe;
|
|
47
|
+
readonly command: (name: string, data: unknown, uploads?: ReadonlyMap<string, UploadReference>, timeoutMs?: number) => Effect.Effect<CommandReply, CommandFailure>;
|
|
48
|
+
readonly schema: Effect.Effect<{
|
|
49
|
+
readonly openapi?: JsonObject;
|
|
50
|
+
}, ReactorError>;
|
|
51
|
+
readonly upload: (name: string, mimeType: string, bytes: Uint8Array, timeoutMs?: number) => Effect.Effect<Uploaded, ReactorError>;
|
|
52
|
+
readonly requestRecordingClip: (seconds: number) => Effect.Effect<ClipReady, ReactorError>;
|
|
53
|
+
readonly recording: Effect.Effect<ClipReady, ReactorError>;
|
|
54
|
+
readonly stats: Effect.Effect<Statistics, ReactorError>;
|
|
55
|
+
readonly close: Effect.Effect<CloseReport>;
|
|
56
|
+
}
|
|
57
|
+
export interface Factory {
|
|
58
|
+
/** Allocate without connecting so a supervisor can first register the owner. */
|
|
59
|
+
readonly create: (options: CreateOptions) => Effect.Effect<Session, AcquisitionFailure, Scope.Scope>;
|
|
60
|
+
/** Identify an existing session without acquiring its remote lifetime. */
|
|
61
|
+
readonly attach: (options: AttachOptions) => Effect.Effect<Session, AcquisitionFailure, Scope.Scope>;
|
|
62
|
+
/** Failure releases this partial acquisition before returning to the caller. */
|
|
63
|
+
readonly createConnected: (options: CreateOptions) => Effect.Effect<Session, AcquisitionFailure, Scope.Scope>;
|
|
64
|
+
readonly attachConnected: (options: AttachOptions) => Effect.Effect<Session, AcquisitionFailure, Scope.Scope>;
|
|
65
|
+
}
|
|
66
|
+
declare const Client_base: Context.ServiceClass<Client, "reactor-effect-client/Client", Factory>;
|
|
67
|
+
export declare class Client extends Client_base {
|
|
68
|
+
}
|
|
69
|
+
export declare const make: (configuration?: Configuration) => Effect.Effect<Factory, never, Http.HttpClient | PeerFactory | Crypto.Crypto>;
|
|
70
|
+
export declare const layer: (configuration?: Configuration) => Layer.Layer<Client, never, Http.HttpClient | PeerFactory | Crypto.Crypto>;
|
|
71
|
+
export { CommandFailure } from "./commands.js";
|
|
72
|
+
export { AcquisitionFailure } from "./_internal/acquire.js";
|
|
73
|
+
export type { CommandContext } from "./commands.js";
|
|
74
|
+
export type { Snapshot, ReadyState, SessionEvent, CommandReply, CloseReport, Uploaded, UploadProgress, Observation, } from "../SessionTypes.js";
|
|
75
|
+
export type { VideoFrame, AudioFrame, MediaPressure, MediaGeneration, RawMedia } from "./media.js";
|
|
76
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD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AAM,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7D,QAAQ,CAAC,eAAe,EAAE,CACxB,OAAO,EAAE,aAAa,KACnB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CAC9D;;AAED,qBAAa,MAAO,SAAQ,WAAkE;CAAG;AAEjG,eAAO,MAAM,IAAI,mBACA,aAAa,KAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC,MAAM,CAQ1E,CAAC;AAEL,eAAO,MAAM,KAAK,mBACD,aAAa,KAC3B,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC,MAAM,CAChC,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EACV,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Crypto from "effect/Crypto";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Http from "effect/unstable/http/HttpClient";
|
|
6
|
+
import { PeerFactory } from "../PeerFactory.js";
|
|
7
|
+
import { makeFactory } from "./_internal/acquire.js";
|
|
8
|
+
export class Client extends Context.Service()("reactor-effect-client/Client") {
|
|
9
|
+
}
|
|
10
|
+
export const make = (configuration = {}) => Effect.gen(function* () {
|
|
11
|
+
return makeFactory(configuration, yield* Http.HttpClient, yield* PeerFactory, yield* Crypto.Crypto);
|
|
12
|
+
});
|
|
13
|
+
export const layer = (configuration = {}) => Layer.effect(Client, make(configuration));
|
|
14
|
+
export { CommandFailure } from "./commands.js";
|
|
15
|
+
export { AcquisitionFailure } from "./_internal/acquire.js";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,KAAK,IAAI,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,OAAO,EAAE,WAAW,EAA2B,MAAM,wBAAwB,CAAC;AA+E9E,MAAM,OAAO,MAAO,SAAQ,OAAO,CAAC,OAAO,EAAmB,CAAC,8BAA8B,CAAC;CAAG;AAEjG,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,aAAa,GAAkB,EAAE,EAC6C,EAAE,CAChF,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,OAAO,WAAW,CAChB,aAAa,EACb,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,EACtB,KAAK,CAAC,CAAC,WAAW,EAClB,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CACrB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,aAAa,GAAkB,EAAE,EAC0C,EAAE,CAC7E,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|