reactor-effect-client 0.2.0 → 0.3.0-rc.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/README.md +62 -6
- package/dist/FetchHttp.js +1 -1
- package/dist/FetchHttp.js.map +1 -1
- package/dist/PeerFactory.d.ts +13 -2
- package/dist/PeerFactory.d.ts.map +1 -1
- package/dist/PeerFactory.js.map +1 -1
- package/dist/PeerTypes.d.ts +2 -2
- package/dist/PeerTypes.d.ts.map +1 -1
- package/dist/Sequence.d.ts +18 -14
- package/dist/Sequence.d.ts.map +1 -1
- package/dist/Sequence.js +117 -122
- package/dist/Sequence.js.map +1 -1
- package/dist/SessionTypes.d.ts +168 -15
- package/dist/SessionTypes.d.ts.map +1 -1
- package/dist/SessionTypes.js +18 -1
- package/dist/SessionTypes.js.map +1 -1
- package/dist/bytes.js +3 -3
- package/dist/bytes.js.map +1 -1
- package/dist/contract.d.ts +120 -29
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +105 -73
- package/dist/contract.js.map +1 -1
- package/dist/coordinator/_internal/client.d.ts +111 -17
- package/dist/coordinator/_internal/client.d.ts.map +1 -1
- package/dist/coordinator/_internal/client.js +187 -74
- package/dist/coordinator/_internal/client.js.map +1 -1
- package/dist/coordinator/_internal/recording.d.ts +33 -0
- package/dist/coordinator/_internal/recording.d.ts.map +1 -0
- package/dist/coordinator/_internal/recording.js +123 -0
- package/dist/coordinator/_internal/recording.js.map +1 -0
- package/dist/coordinator/_internal/response.d.ts.map +1 -1
- package/dist/coordinator/_internal/response.js +5 -7
- package/dist/coordinator/_internal/response.js.map +1 -1
- package/dist/coordinator/_internal/schemas.d.ts +40 -6
- package/dist/coordinator/_internal/schemas.d.ts.map +1 -1
- package/dist/coordinator/_internal/schemas.js +94 -64
- package/dist/coordinator/_internal/schemas.js.map +1 -1
- package/dist/coordinator/index.d.ts +14 -2
- package/dist/coordinator/index.d.ts.map +1 -1
- package/dist/coordinator/index.js +14 -18
- package/dist/coordinator/index.js.map +1 -1
- package/dist/correlation.d.ts +15 -0
- package/dist/correlation.d.ts.map +1 -1
- package/dist/correlation.js +26 -8
- package/dist/correlation.js.map +1 -1
- package/dist/duration.d.ts +25 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/duration.js +47 -0
- package/dist/duration.js.map +1 -0
- package/dist/errors.d.ts +1264 -49
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +698 -46
- package/dist/errors.js.map +1 -1
- package/dist/h3/_internal/client.d.ts +2 -2
- package/dist/h3/_internal/client.d.ts.map +1 -1
- package/dist/h3/_internal/client.js +210 -125
- package/dist/h3/_internal/client.js.map +1 -1
- package/dist/h3/_internal/contracts.d.ts.map +1 -1
- package/dist/h3/_internal/contracts.js +2 -2
- package/dist/h3/_internal/contracts.js.map +1 -1
- package/dist/h3/_internal/deployment.d.ts.map +1 -1
- package/dist/h3/_internal/deployment.js +5 -4
- package/dist/h3/_internal/deployment.js.map +1 -1
- package/dist/h3/_internal/evidence.js +1 -1
- package/dist/h3/_internal/evidence.js.map +1 -1
- package/dist/h3/_internal/operations.d.ts +48 -0
- package/dist/h3/_internal/operations.d.ts.map +1 -0
- package/dist/h3/_internal/operations.js +230 -0
- package/dist/h3/_internal/operations.js.map +1 -0
- package/dist/h3/_internal/references.d.ts.map +1 -1
- package/dist/h3/_internal/references.js +3 -8
- package/dist/h3/_internal/references.js.map +1 -1
- package/dist/h3/_internal/request.js +1 -1
- package/dist/h3/_internal/request.js.map +1 -1
- package/dist/h3/_internal/retained.d.ts +22 -0
- package/dist/h3/_internal/retained.d.ts.map +1 -0
- package/dist/h3/_internal/retained.js +89 -0
- package/dist/h3/_internal/retained.js.map +1 -0
- package/dist/h3/_internal/state.d.ts +15 -1
- package/dist/h3/_internal/state.d.ts.map +1 -1
- package/dist/h3/_internal/state.js +69 -29
- package/dist/h3/_internal/state.js.map +1 -1
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/index.d.ts.map +1 -1
- package/dist/h3/messages.d.ts +118 -109
- package/dist/h3/messages.d.ts.map +1 -1
- package/dist/h3/messages.js +73 -51
- package/dist/h3/messages.js.map +1 -1
- package/dist/h3/types.d.ts +108 -13
- package/dist/h3/types.d.ts.map +1 -1
- package/dist/host.d.ts +6 -6
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +4 -5
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +13 -6
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +34 -14
- package/dist/json.js.map +1 -1
- package/dist/media-stream.d.ts.map +1 -1
- package/dist/media-stream.js +9 -11
- package/dist/media-stream.js.map +1 -1
- package/dist/observation.d.ts +9 -0
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +20 -18
- package/dist/observation.js.map +1 -1
- package/dist/orchestration/h3-source.d.ts +32 -4
- package/dist/orchestration/h3-source.d.ts.map +1 -1
- package/dist/orchestration/h3-source.js +47 -14
- package/dist/orchestration/h3-source.js.map +1 -1
- package/dist/orchestration/index.d.ts +9 -6
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +5 -3
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/media-buffer.d.ts +12 -4
- package/dist/orchestration/media-buffer.d.ts.map +1 -1
- package/dist/orchestration/media-buffer.js +31 -11
- package/dist/orchestration/media-buffer.js.map +1 -1
- package/dist/orchestration/open-h3.d.ts +65 -0
- package/dist/orchestration/open-h3.d.ts.map +1 -0
- package/dist/orchestration/open-h3.js +65 -0
- package/dist/orchestration/open-h3.js.map +1 -0
- package/dist/orchestration/references.d.ts +5 -1
- package/dist/orchestration/references.d.ts.map +1 -1
- package/dist/orchestration/references.js +37 -34
- package/dist/orchestration/references.js.map +1 -1
- package/dist/orchestration/renewal-state.js +1 -1
- package/dist/orchestration/renewal-state.js.map +1 -1
- package/dist/orchestration/renewal.d.ts +64 -64
- package/dist/orchestration/renewal.d.ts.map +1 -1
- package/dist/orchestration/renewal.js +149 -88
- package/dist/orchestration/renewal.js.map +1 -1
- package/dist/orchestration/request.d.ts +11 -12
- package/dist/orchestration/request.d.ts.map +1 -1
- package/dist/orchestration/request.js +63 -66
- package/dist/orchestration/request.js.map +1 -1
- package/dist/orchestration/routing.d.ts.map +1 -1
- package/dist/orchestration/routing.js +17 -14
- package/dist/orchestration/routing.js.map +1 -1
- package/dist/orchestration/source-slot.d.ts +15 -5
- package/dist/orchestration/source-slot.d.ts.map +1 -1
- package/dist/orchestration/source-slot.js +40 -21
- package/dist/orchestration/source-slot.js.map +1 -1
- package/dist/orchestration/types.d.ts +594 -39
- package/dist/orchestration/types.d.ts.map +1 -1
- package/dist/orchestration/types.js +20 -0
- package/dist/orchestration/types.js.map +1 -1
- package/dist/protobuf.js +2 -2
- package/dist/protobuf.js.map +1 -1
- package/dist/session/_internal/acquire.d.ts +4 -6
- package/dist/session/_internal/acquire.d.ts.map +1 -1
- package/dist/session/_internal/acquire.js +40 -50
- package/dist/session/_internal/acquire.js.map +1 -1
- package/dist/session/_internal/cleanup.d.ts +2 -1
- package/dist/session/_internal/cleanup.d.ts.map +1 -1
- package/dist/session/_internal/cleanup.js +23 -15
- package/dist/session/_internal/cleanup.js.map +1 -1
- package/dist/session/_internal/lifecycle.d.ts +5 -0
- package/dist/session/_internal/lifecycle.d.ts.map +1 -1
- package/dist/session/_internal/lifecycle.js +16 -6
- package/dist/session/_internal/lifecycle.js.map +1 -1
- package/dist/session/_internal/remote.d.ts.map +1 -1
- package/dist/session/_internal/remote.js +16 -7
- package/dist/session/_internal/remote.js.map +1 -1
- package/dist/session/_internal/uploads.d.ts +4 -1
- package/dist/session/_internal/uploads.d.ts.map +1 -1
- package/dist/session/_internal/uploads.js +25 -27
- package/dist/session/_internal/uploads.js.map +1 -1
- package/dist/session/commands.d.ts +1 -21
- package/dist/session/commands.d.ts.map +1 -1
- package/dist/session/commands.js +1 -12
- package/dist/session/commands.js.map +1 -1
- package/dist/session/files.d.ts +10 -2
- package/dist/session/files.d.ts.map +1 -1
- package/dist/session/files.js +11 -16
- package/dist/session/files.js.map +1 -1
- package/dist/session/index.d.ts +6 -6
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js.map +1 -1
- package/dist/session/media.d.ts +53 -6
- package/dist/session/media.d.ts.map +1 -1
- package/dist/session/recorder.d.ts +24 -0
- package/dist/session/recorder.d.ts.map +1 -0
- package/dist/session/recorder.js +19 -0
- package/dist/session/recorder.js.map +1 -0
- package/dist/session.d.ts +5 -4
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +208 -109
- package/dist/session.js.map +1 -1
- package/dist/simulation/_internal/source.d.ts.map +1 -1
- package/dist/simulation/_internal/source.js +57 -48
- package/dist/simulation/_internal/source.js.map +1 -1
- package/dist/simulation/index.d.ts +4 -5
- package/dist/simulation/index.d.ts.map +1 -1
- package/dist/simulation/index.js +3 -4
- package/dist/simulation/index.js.map +1 -1
- package/dist/simulation/types.d.ts +16 -2
- package/dist/simulation/types.d.ts.map +1 -1
- package/dist/stats.d.ts.map +1 -1
- package/dist/stats.js +4 -5
- package/dist/stats.js.map +1 -1
- package/package.json +5 -4
- package/notices/owned-webrtc/Effect-MIT.txt +0 -21
- package/notices/owned-webrtc/IETF.txt +0 -43
- package/notices/owned-webrtc/LICENSE +0 -21
- package/notices/owned-webrtc/UPSTREAM.md +0 -20
- package/notices/owned-webrtc/VP8-ADAPTATION.md +0 -32
- package/notices/owned-webrtc/VP8-AUTHORS.txt +0 -42
- package/notices/owned-webrtc/VP8-LICENSE.txt +0 -25
- package/notices/owned-webrtc/VP8-PATENTS.txt +0 -21
- package/notices/owned-webrtc/Werift-MIT.txt +0 -21
- package/notices/owned-webrtc/libvpx-v1.12.0-LICENSE.txt +0 -28
- package/notices/owned-webrtc/libvpx-v1.12.0-PATENTS.txt +0 -22
- package/notices/owned-webrtc/rfc3711.txt +0 -3139
- package/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AE,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,CAI1B;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,CAgDrC;IAED,eAAe,IAAI,OAAO,CAMzB;CACF"}
|
|
@@ -18,7 +18,7 @@ export class RemoteSession {
|
|
|
18
18
|
}
|
|
19
19
|
requireKnown() {
|
|
20
20
|
if (!isKnownRemote(this.value))
|
|
21
|
-
throw
|
|
21
|
+
throw ReactorError.fromCode("InvalidState", "no known session id");
|
|
22
22
|
return this.value;
|
|
23
23
|
}
|
|
24
24
|
allocationLost() {
|
|
@@ -29,11 +29,13 @@ export class RemoteSession {
|
|
|
29
29
|
const self = this;
|
|
30
30
|
return Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
|
|
31
31
|
if (lifecycle.isClosing)
|
|
32
|
-
return yield*
|
|
32
|
+
return yield* ReactorError.fromCode("Closed", "session is closed", {
|
|
33
|
+
outcome: "not-submitted",
|
|
34
|
+
});
|
|
33
35
|
if (isKnownRemote(self.value))
|
|
34
36
|
return self.value.id;
|
|
35
37
|
if (self.value !== undefined)
|
|
36
|
-
return yield*
|
|
38
|
+
return yield* ReactorError.fromCode("InvalidState", "session allocation is already pending or unresolved", { outcome: "unknown" });
|
|
37
39
|
const intent = options.intent;
|
|
38
40
|
if (intent._tag === "Attach") {
|
|
39
41
|
self.value = {
|
|
@@ -46,10 +48,17 @@ export class RemoteSession {
|
|
|
46
48
|
self.value = { ownership: "allocating" };
|
|
47
49
|
return yield* restore(http
|
|
48
50
|
.create(intent.model, intent.extraArgs)
|
|
49
|
-
.pipe(Effect.raceFirst(Deferred.await(lifecycle.closing)))).pipe(Effect.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
.pipe(Effect.raceFirst(Deferred.await(lifecycle.closing)))).pipe(Effect.onExit((exit) => Exit.isFailure(exit) ? Effect.sync(() => self.allocationLost()) : Effect.void),
|
|
52
|
+
// Ownership rests on the id alone: if the rest of the reply cannot
|
|
53
|
+
// describe the session, owned cleanup still has an id to terminate.
|
|
54
|
+
Effect.flatMap((allocation) => {
|
|
55
|
+
const owned = { ownership: "owned", id: allocation.sessionId };
|
|
56
|
+
self.value = owned;
|
|
57
|
+
return http.describe(allocation).pipe(Effect.map((descriptor) => {
|
|
58
|
+
owned.descriptor = descriptor;
|
|
59
|
+
return owned.id;
|
|
60
|
+
}));
|
|
61
|
+
}));
|
|
53
62
|
}));
|
|
54
63
|
}
|
|
55
64
|
isKnownTerminal() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../src/session/_internal/remote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAa/C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAA0B,EAAyB,EAAE,CACjF,MAAM,EAAE,SAAS,KAAK,OAAO,IAAI,MAAM,EAAE,SAAS,K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,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"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { UploadReference } from "../../wire.generated.js";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Detach caller-owned references before correlation or dispatch can begin.
|
|
4
|
+
* Each rejection is an InvalidInput ReactorError that was never submitted.
|
|
5
|
+
*/
|
|
3
6
|
export declare const captureUploads: (input: ReadonlyMap<string, UploadReference>) => Map<string, UploadReference>;
|
|
4
7
|
//# sourceMappingURL=uploads.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAQ/D;;;GAGG;AACH,eAAO,MAAM,cAAc,UAClB,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,KAC1C,GAAG,CAAC,MAAM,EAAE,eAAe,CAoB7B,CAAC"}
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
import { ReactorError } from "../../errors.js";
|
|
2
|
-
import { nonempty } from "../../json.js";
|
|
2
|
+
import { nonempty, record } from "../../json.js";
|
|
3
3
|
const maximumWireSize = (1n << 63n) - 1n;
|
|
4
|
-
|
|
4
|
+
const invalid = (message) => {
|
|
5
|
+
throw ReactorError.fromCode("InvalidInput", message, { outcome: "not-submitted" });
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Detach caller-owned references before correlation or dispatch can begin.
|
|
9
|
+
* Each rejection is an InvalidInput ReactorError that was never submitted.
|
|
10
|
+
*/
|
|
5
11
|
export const captureUploads = (input) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
});
|
|
12
|
+
if (!(input instanceof Map))
|
|
13
|
+
return invalid("upload references must be a Map");
|
|
14
|
+
const result = new Map();
|
|
15
|
+
for (const [key, value] of input) {
|
|
16
|
+
if (result.size >= 128)
|
|
17
|
+
return invalid("too many upload references");
|
|
18
|
+
const reference = record(value, "upload reference");
|
|
19
|
+
const size = reference.size;
|
|
20
|
+
if (typeof size !== "bigint" || size < 0n || size > maximumWireSize)
|
|
21
|
+
return invalid("upload size must be a nonnegative signed-64-bit bigint");
|
|
22
|
+
result.set(nonempty(key, "upload key"), Object.freeze({
|
|
23
|
+
upload_id: nonempty(reference.upload_id, "upload id"),
|
|
24
|
+
name: nonempty(reference.name, "upload name"),
|
|
25
|
+
mime_type: nonempty(reference.mime_type, "upload MIME type"),
|
|
26
|
+
size,
|
|
27
|
+
}));
|
|
31
28
|
}
|
|
29
|
+
return result;
|
|
32
30
|
};
|
|
33
31
|
//# sourceMappingURL=uploads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["../../../src/session/_internal/uploads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBA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,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC;YACrD,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;YAC7C,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,kBAAkB,CAAC;YAC5D,IAAI;SACL,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
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 {};
|
|
1
|
+
export { CommandContext, CommandFailure } from "../errors.js";
|
|
22
2
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/session/commands.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
1
|
+
export { CommandContext, CommandFailure } from "../errors.js";
|
|
13
2
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/session/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/session/files.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
import type * as Duration from "effect/Duration";
|
|
1
2
|
import * as Effect from "effect/Effect";
|
|
2
3
|
import * as FileSystem from "effect/FileSystem";
|
|
3
4
|
import * as Path from "effect/Path";
|
|
4
5
|
import { ReactorError } from "../errors.js";
|
|
6
|
+
import type { UploadTimeoutOptions } from "../SessionTypes.js";
|
|
5
7
|
import type { Session, Uploaded } from "./index.js";
|
|
6
|
-
export interface FileUploadOptions {
|
|
8
|
+
export interface FileUploadOptions extends UploadTimeoutOptions {
|
|
7
9
|
readonly mimeType?: string;
|
|
8
10
|
readonly maxBytes?: number;
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* How long reading the file may take; 30 seconds by default. A bare number
|
|
13
|
+
* is milliseconds.
|
|
14
|
+
*/
|
|
15
|
+
readonly readTimeout?: Duration.Input | undefined;
|
|
16
|
+
/** @deprecated Removed in 0.3.0: use `readTimeout` (a bare number is milliseconds). */
|
|
17
|
+
readonly readTimeoutMs?: never;
|
|
10
18
|
}
|
|
11
19
|
/** Scoped, bounded host file loading shared by uploads and reference preparation. */
|
|
12
20
|
export declare const readFileBytes: (file: string, maxBytes: number) => Effect.Effect<Uint8Array, ReactorError, FileSystem.FileSystem>;
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/session/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAU,YAAY,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC;IAClD,uFAAuF;IACvF,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC;CAChC;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,CA0CtE,CAAC"}
|
package/dist/session/files.js
CHANGED
|
@@ -2,21 +2,20 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as FileSystem from "effect/FileSystem";
|
|
3
3
|
import * as Path from "effect/Path";
|
|
4
4
|
import { collectBytes } from "../bytes.js";
|
|
5
|
-
import {
|
|
5
|
+
import { duration } from "../duration.js";
|
|
6
|
+
import { parsed, ReactorError } from "../errors.js";
|
|
6
7
|
/** Scoped, bounded host file loading shared by uploads and reference preparation. */
|
|
7
8
|
export const readFileBytes = (file, maxBytes) => Effect.gen(function* () {
|
|
8
9
|
if (typeof file !== "string" ||
|
|
9
10
|
file.length === 0 ||
|
|
10
11
|
!Number.isSafeInteger(maxBytes) ||
|
|
11
12
|
maxBytes <= 0) {
|
|
12
|
-
return yield*
|
|
13
|
-
outcome: "not-submitted",
|
|
14
|
-
}));
|
|
13
|
+
return yield* ReactorError.fromCode("InvalidInput", "A file and positive byte bound are required", { outcome: "not-submitted" });
|
|
15
14
|
}
|
|
16
15
|
const fs = yield* FileSystem.FileSystem;
|
|
17
|
-
return yield* collectBytes(fs.stream(file, { bytesToRead: maxBytes + 1 }), maxBytes).pipe(Effect.mapError((cause) => cause
|
|
16
|
+
return yield* collectBytes(fs.stream(file, { bytesToRead: maxBytes + 1 }), maxBytes).pipe(Effect.mapError((cause) => ReactorError.is(cause)
|
|
18
17
|
? cause
|
|
19
|
-
:
|
|
18
|
+
: ReactorError.fromCode("Upload", "Source file could not be read", {
|
|
20
19
|
outcome: "not-submitted",
|
|
21
20
|
detail: cause,
|
|
22
21
|
})));
|
|
@@ -24,20 +23,16 @@ export const readFileBytes = (file, maxBytes) => Effect.gen(function* () {
|
|
|
24
23
|
/** File IO is a host convenience; the result retains canonical upload evidence. */
|
|
25
24
|
export const uploadFile = (session, file, options = {}) => Effect.gen(function* () {
|
|
26
25
|
const before = yield* session.ready;
|
|
27
|
-
const timeout = options.
|
|
28
|
-
if (!Number.isFinite(timeout) || timeout <= 0)
|
|
29
|
-
return yield* Effect.fail(new ReactorError("InvalidInput", "Invalid file-read deadline", {
|
|
30
|
-
outcome: "not-submitted",
|
|
31
|
-
}));
|
|
26
|
+
const timeout = yield* parsed(() => duration(options.readTimeout ?? "30 seconds", "file read timeout"));
|
|
32
27
|
const bytes = yield* readFileBytes(file, options.maxBytes ?? 64 * 1024 * 1024).pipe(Effect.timeoutOrElse({
|
|
33
28
|
duration: timeout,
|
|
34
|
-
orElse: () => Effect.fail(
|
|
29
|
+
orElse: () => Effect.fail(ReactorError.fromCode("Upload", "Source file read timed out", {
|
|
30
|
+
outcome: "not-submitted",
|
|
31
|
+
})),
|
|
35
32
|
}));
|
|
36
33
|
const after = yield* session.ready;
|
|
37
34
|
if (after.generation !== before.generation)
|
|
38
|
-
return yield*
|
|
39
|
-
outcome: "not-submitted",
|
|
40
|
-
}));
|
|
35
|
+
return yield* ReactorError.fromCode("Disconnected", "Connection changed while reading the upload file", { outcome: "not-submitted" });
|
|
41
36
|
const path = yield* Path.Path;
|
|
42
37
|
const name = path.basename(file);
|
|
43
38
|
const extension = path.extname(name).toLowerCase();
|
|
@@ -49,6 +44,6 @@ export const uploadFile = (session, file, options = {}) => Effect.gen(function*
|
|
|
49
44
|
: extension === ".jpg" || extension === ".jpeg"
|
|
50
45
|
? "image/jpeg"
|
|
51
46
|
: "application/octet-stream");
|
|
52
|
-
return yield* session.upload(name, mime, bytes);
|
|
47
|
+
return yield* session.upload(name, mime, bytes, options.uploadTimeout === undefined ? {} : { uploadTimeout: options.uploadTimeout });
|
|
53
48
|
});
|
|
54
49
|
//# sourceMappingURL=files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/session/files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/session/files.ts"],"names":[],"mappings":"AACA,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,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAgBpD,qFAAqF;AACrF,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,IAAY,EACZ,QAAgB,EACgD,EAAE,CAClE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,CAAC,MAAM,KAAK,CAAC;QACjB,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC/B,QAAQ,IAAI,CAAC,EACb,CAAC;QACD,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,QAAQ,CACjC,cAAc,EACd,6CAA6C,EAC7C,EAAE,OAAO,EAAE,eAAe,EAAE,CAC7B,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CACvF,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,YAAY,CAAC,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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACnD,MAAM,IAAI,GACR,OAAO,CAAC,QAAQ;QAChB,CAAC,SAAS,KAAK,MAAM;YACnB,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,SAAS,KAAK,OAAO;gBACrB,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,OAAO;oBAC7C,CAAC,CAAC,YAAY;oBACd,CAAC,CAAC,0BAA0B,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAC1B,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CACpF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/dist/session/index.d.ts
CHANGED
|
@@ -11,14 +11,14 @@ import { PeerFactory } from "../PeerFactory.js";
|
|
|
11
11
|
import type { ReactorError } from "../errors.js";
|
|
12
12
|
import type { Json, JsonObject } from "../json.js";
|
|
13
13
|
import type { Statistics } from "../stats.js";
|
|
14
|
-
import type {
|
|
15
|
-
import type { SessionOptions, Snapshot, ReadyState, SessionEvent, CommandReply, CloseReport, Uploaded, Observe } from "../SessionTypes.js";
|
|
14
|
+
import type { ClipReady } from "../wire.generated.js";
|
|
15
|
+
import type { CommandOptions, SessionOptions, SessionTimeouts, UploadTimeoutOptions, Snapshot, ReadyState, SessionEvent, CommandReply, CloseReport, Uploaded, Observe } from "../SessionTypes.js";
|
|
16
16
|
import type { CommandFailure } from "./commands.js";
|
|
17
17
|
import { type AcquisitionFailure } from "./_internal/acquire.js";
|
|
18
18
|
export interface Configuration extends Omit<HttpOptions, "apiUrl" | "credential"> {
|
|
19
19
|
readonly apiUrl?: string;
|
|
20
20
|
readonly credential?: Effect.Effect<Redacted.Redacted<string>, ReactorError>;
|
|
21
|
-
readonly session?: Pick<SessionOptions, "
|
|
21
|
+
readonly session?: SessionTimeouts & Pick<SessionOptions, "maxPending" | "maxUploadBytes">;
|
|
22
22
|
}
|
|
23
23
|
export interface CreateOptions {
|
|
24
24
|
readonly model: string;
|
|
@@ -44,11 +44,11 @@ export interface Session {
|
|
|
44
44
|
readonly maxBytes?: number;
|
|
45
45
|
}) => Stream.Stream<SessionEvent, ReactorError>;
|
|
46
46
|
readonly observe: Observe;
|
|
47
|
-
readonly command: (name: string, data: unknown,
|
|
47
|
+
readonly command: (name: string, data: unknown, options?: CommandOptions) => Effect.Effect<CommandReply, CommandFailure>;
|
|
48
48
|
readonly schema: Effect.Effect<{
|
|
49
49
|
readonly openapi?: JsonObject;
|
|
50
50
|
}, ReactorError>;
|
|
51
|
-
readonly upload: (name: string, mimeType: string, bytes: Uint8Array,
|
|
51
|
+
readonly upload: (name: string, mimeType: string, bytes: Uint8Array, options?: UploadTimeoutOptions) => Effect.Effect<Uploaded, ReactorError>;
|
|
52
52
|
readonly requestRecordingClip: (seconds: number) => Effect.Effect<ClipReady, ReactorError>;
|
|
53
53
|
readonly recording: Effect.Effect<ClipReady, ReactorError>;
|
|
54
54
|
readonly stats: Effect.Effect<Statistics, ReactorError>;
|
|
@@ -71,6 +71,6 @@ export declare const layer: (configuration?: Configuration) => Layer.Layer<Clien
|
|
|
71
71
|
export { CommandFailure } from "./commands.js";
|
|
72
72
|
export { AcquisitionFailure } from "./_internal/acquire.js";
|
|
73
73
|
export type { CommandContext } from "./commands.js";
|
|
74
|
-
export type { Snapshot, ReadyState, SessionEvent, CommandReply, CloseReport, Uploaded, UploadProgress, Observation, } from "../SessionTypes.js";
|
|
74
|
+
export type { CommandOptions, ReplyTimeoutOptions, SessionTimeouts, UploadTimeoutOptions, Snapshot, ReadyState, SessionEvent, CommandReply, CloseReport, Uploaded, UploadProgress, Observation, } from "../SessionTypes.js";
|
|
75
75
|
export type { VideoFrame, AudioFrame, MediaPressure, MediaGeneration, RawMedia } from "./media.js";
|
|
76
76
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,iCAAiC,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,
|
|
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,KA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AK,KAAK,MAAM,cAAc,CAAC;AAItC,OAAO,KAAK,IAAI,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
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;AAmBhD,OAAO,EAAE,WAAW,EAA2B,MAAM,wBAAwB,CAAC;AAsE9E,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"}
|
package/dist/session/media.d.ts
CHANGED
|
@@ -4,6 +4,17 @@ import type * as Scope from "effect/Scope";
|
|
|
4
4
|
import type { Track } from "../contract.js";
|
|
5
5
|
import type { ReactorError } from "../errors.js";
|
|
6
6
|
import type { MediaTrack } from "../PeerTypes.js";
|
|
7
|
+
/**
|
|
8
|
+
* How a frame's `data` lays out its pixels: four bytes per pixel, rows packed
|
|
9
|
+
* without padding, in this channel order. A host declares the format it
|
|
10
|
+
* produces; nothing converts between formats implicitly.
|
|
11
|
+
*/
|
|
12
|
+
export type VideoFormat = "BGRA" | "RGBA";
|
|
13
|
+
/**
|
|
14
|
+
* One decoded video frame. Every subscriber to a track receives the same frame
|
|
15
|
+
* object and the same buffers, so a reader treats them as read-only and copies
|
|
16
|
+
* the bytes before changing them.
|
|
17
|
+
*/
|
|
7
18
|
export interface VideoFrame {
|
|
8
19
|
readonly _tag: "VideoFrame";
|
|
9
20
|
readonly track: string;
|
|
@@ -13,17 +24,36 @@ export interface VideoFrame {
|
|
|
13
24
|
readonly frameId: bigint;
|
|
14
25
|
/** Sender-clock microseconds; zero means absent. */
|
|
15
26
|
readonly timestampMicros: bigint;
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The frame's admission sequence on its track in this generation, from 0,
|
|
29
|
+
* taken before any bounded queue could drop it: a gap between consecutive
|
|
30
|
+
* frames is the count of frames the host dropped there. `recorder` makes the
|
|
31
|
+
* gaps explicit.
|
|
32
|
+
*/
|
|
33
|
+
readonly sequence: bigint;
|
|
34
|
+
/** The pixel layout of `data`; the native host produces `"BGRA"`. */
|
|
35
|
+
readonly format: VideoFormat;
|
|
36
|
+
/**
|
|
37
|
+
* Owned pixel bytes in `format`, `width * height * 4` of them: the whole of
|
|
38
|
+
* an `ArrayBuffer` of their own, so the buffer can be transferred. Retaining
|
|
39
|
+
* a frame never retains native memory.
|
|
40
|
+
*/
|
|
41
|
+
readonly data: Uint8Array<ArrayBuffer>;
|
|
42
|
+
readonly metadata: Uint8Array<ArrayBuffer>;
|
|
19
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* One block of decoded audio, shared read-only across a track's subscribers
|
|
46
|
+
* as a `VideoFrame` is.
|
|
47
|
+
*/
|
|
20
48
|
export interface AudioFrame {
|
|
21
49
|
readonly _tag: "AudioFrame";
|
|
22
50
|
readonly track: string;
|
|
23
51
|
readonly sampleRate: number;
|
|
24
52
|
readonly channels: number;
|
|
25
|
-
/**
|
|
26
|
-
readonly
|
|
53
|
+
/** The block's admission sequence on its track in this generation, as a `VideoFrame`'s. */
|
|
54
|
+
readonly sequence: bigint;
|
|
55
|
+
/** Owned, interleaved signed 16-bit PCM samples, in an `ArrayBuffer` of their own. */
|
|
56
|
+
readonly samples: Int16Array<ArrayBuffer>;
|
|
27
57
|
}
|
|
28
58
|
/** Observed transport pressure, scoped to one connection generation. */
|
|
29
59
|
export interface MediaPressure {
|
|
@@ -37,6 +67,13 @@ export interface MediaPressure {
|
|
|
37
67
|
readonly pendingRequests: number;
|
|
38
68
|
readonly deliveredVideo: bigint;
|
|
39
69
|
readonly deliveredAudio: bigint;
|
|
70
|
+
/**
|
|
71
|
+
* Readers of this generation's tracks that fell behind their per-reader
|
|
72
|
+
* bound. Each such reader failed with `Overflow` and missed every frame
|
|
73
|
+
* after it: the loss a recorder cannot see in `droppedVideo`/`droppedAudio`,
|
|
74
|
+
* which count what the transport discarded before any reader.
|
|
75
|
+
*/
|
|
76
|
+
readonly readerOverflows: bigint;
|
|
40
77
|
}
|
|
41
78
|
/** A peer capability. It owns its bounded buffers and source termination. */
|
|
42
79
|
export interface RawMedia {
|
|
@@ -45,7 +82,17 @@ export interface RawMedia {
|
|
|
45
82
|
readonly snapshot: Effect.Effect<MediaPressure, ReactorError>;
|
|
46
83
|
}
|
|
47
84
|
/**
|
|
48
|
-
* A generation's streams end or fail with their source.
|
|
85
|
+
* A generation's streams end or fail with their source.
|
|
86
|
+
*
|
|
87
|
+
* Two ways to consume a track over one generation:
|
|
88
|
+
* - **Recorder:** read the stream directly. Every element is an admitted
|
|
89
|
+
* frame. Loss before admission shows as a rise in `droppedVideo` or
|
|
90
|
+
* `droppedAudio`; a reader that falls behind its bound fails with
|
|
91
|
+
* `Overflow` (and counts in `readerOverflows`); the generation's end is
|
|
92
|
+
* `retired`.
|
|
93
|
+
* - **Preview:** keep only the newest frame, per consumer, with
|
|
94
|
+
* `Stream.buffer({ capacity: 1, strategy: "sliding" })`. It never overflows
|
|
95
|
+
* and never delays other readers. Reconnect creates a new
|
|
49
96
|
* value; it never silently replaces the source underneath an existing reader.
|
|
50
97
|
*/
|
|
51
98
|
export interface MediaGeneration extends RawMedia {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/session/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/session/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KA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AW,eAAe;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACrD,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACvF,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC1F,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACxE,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC9F,QAAQ,CAAC,aAAa,EAAE,CACtB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,KAClB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;CACxC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Stream from "effect/Stream";
|
|
2
|
+
/** A recorder's view of one track: each frame, and each run the host dropped, in place. */
|
|
3
|
+
export type Recorded<F> = {
|
|
4
|
+
readonly _tag: "Frame";
|
|
5
|
+
readonly frame: F;
|
|
6
|
+
} | {
|
|
7
|
+
readonly _tag: "Lost";
|
|
8
|
+
/** The sequence of the last frame received before the loss. */
|
|
9
|
+
readonly after: bigint;
|
|
10
|
+
/** How many frames the host dropped there. */
|
|
11
|
+
readonly count: bigint;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Every frame a track stream delivers, with a `Lost` element wherever the host
|
|
15
|
+
* dropped frames between two it delivered: their admission sequences are not
|
|
16
|
+
* consecutive. The view starts at the first frame received, so frames before
|
|
17
|
+
* a reader subscribed are not loss. A sequence that goes back marks a new
|
|
18
|
+
* generation, such as an orchestration's next source, and starts a new run.
|
|
19
|
+
* Read one track: each track numbers its own frames.
|
|
20
|
+
*/
|
|
21
|
+
export declare const recorder: <F extends {
|
|
22
|
+
readonly sequence: bigint;
|
|
23
|
+
}, E, R>(frames: Stream.Stream<F, E, R>) => Stream.Stream<Recorded<F>, E, R>;
|
|
24
|
+
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../src/session/recorder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,2FAA2F;AAC3F,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC7C;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EAAE,CAAC,UAC5D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAc/B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Stream from "effect/Stream";
|
|
2
|
+
/**
|
|
3
|
+
* Every frame a track stream delivers, with a `Lost` element wherever the host
|
|
4
|
+
* dropped frames between two it delivered: their admission sequences are not
|
|
5
|
+
* consecutive. The view starts at the first frame received, so frames before
|
|
6
|
+
* a reader subscribed are not loss. A sequence that goes back marks a new
|
|
7
|
+
* generation, such as an orchestration's next source, and starts a new run.
|
|
8
|
+
* Read one track: each track numbers its own frames.
|
|
9
|
+
*/
|
|
10
|
+
export const recorder = (frames) => frames.pipe(Stream.mapAccum(() => undefined, (last, frame) => {
|
|
11
|
+
const received = { _tag: "Frame", frame };
|
|
12
|
+
if (last === undefined || frame.sequence <= last || frame.sequence === last + 1n)
|
|
13
|
+
return [frame.sequence, [received]];
|
|
14
|
+
return [
|
|
15
|
+
frame.sequence,
|
|
16
|
+
[{ _tag: "Lost", after: last, count: frame.sequence - last - 1n }, received],
|
|
17
|
+
];
|
|
18
|
+
}));
|
|
19
|
+
//# sourceMappingURL=recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../../src/session/recorder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAaxC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,MAA8B,EACI,EAAE,CACpC,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,QAAQ,CACb,GAAuB,EAAE,CAAC,SAAS,EACnC,CAAC,IAAI,EAAE,KAAK,EAAiD,EAAE;IAC7D,MAAM,QAAQ,GAAgB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACvD,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,GAAG,EAAE;QAC9E,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtC,OAAO;QACL,KAAK,CAAC,QAAQ;QACd,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC;KAC7E,CAAC;AACJ,CAAC,CACF,CACF,CAAC"}
|