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/notices/owned-webrtc/str0m-MIT.txt +0 -7
package/dist/errors.d.ts
CHANGED
|
@@ -1,88 +1,1303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client's error algebra. Four wrapper classes, each with its own `_tag`,
|
|
3
|
+
* carry a tagged `reason` (handled with `Effect.catchReason`, `catchReasons`
|
|
4
|
+
* and `unwrapReason`) and a `context` of cross-cutting evidence: the operation
|
|
5
|
+
* and its dispatch outcome.
|
|
6
|
+
*
|
|
7
|
+
* Privacy: `message` is written by the library and never contains provider or
|
|
8
|
+
* payload text, so spans and logs that record it stay payload-free. Provider
|
|
9
|
+
* text lives only in fields for explicit inspection: `body` on `Http` and
|
|
10
|
+
* `Remote`, the Redacted `backendMessage` on `Native`, and `context.detail`.
|
|
11
|
+
* Diagnostic JSON (`toJSON`) leaves all three out. Only a cause the library
|
|
12
|
+
* authored becomes the native `cause`: each wrapper hoists its reason, and a
|
|
13
|
+
* reason never holds a raw cause, because exporters such as OtlpTracer render
|
|
14
|
+
* the whole cause chain. A response body, a wire message, native backend text
|
|
15
|
+
* or a `JSON.parse` SyntaxError (whose message quotes its input) stays in
|
|
16
|
+
* `detail` or a typed field.
|
|
17
|
+
*/
|
|
18
|
+
import * as Duration from "effect/Duration";
|
|
19
|
+
import * as Effect from "effect/Effect";
|
|
20
|
+
import * as Result from "effect/Result";
|
|
1
21
|
import * as Schema from "effect/Schema";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
22
|
+
import { SequenceCode } from "./Sequence.js";
|
|
23
|
+
import type { CloseReport } from "./SessionTypes.js";
|
|
24
|
+
/**
|
|
25
|
+
* The client's four failure classes share this marker so one guard recognizes
|
|
26
|
+
* each of them, although each has its own `_tag` (the ClusterError precedent).
|
|
27
|
+
*/
|
|
28
|
+
declare const TypeId: "~reactor-effect-client/ReactorFailure";
|
|
29
|
+
/** The codes whose reason carries nothing beyond a library-written message. */
|
|
30
|
+
export declare const FailureCode: Schema.Literals<readonly ["InvalidInput", "Protocol", "VersionMismatch", "UnsupportedHost", "UnsupportedCapability", "InvalidState", "TerminalSession", "Timeout", "Disconnected", "Aborted", "Overflow", "UnexpectedReply", "Upload", "Closed", "AlreadyReading", "Shutdown", "SdpRejected", "ChannelClosed", "Indeterminate"]>;
|
|
31
|
+
export type FailureCode = typeof FailureCode.Type;
|
|
32
|
+
declare const Failure_base: Schema.Class<Failure, Schema.Struct<{
|
|
33
|
+
readonly _tag: Schema.Literals<readonly ["InvalidInput", "Protocol", "VersionMismatch", "UnsupportedHost", "UnsupportedCapability", "InvalidState", "TerminalSession", "Timeout", "Disconnected", "Aborted", "Overflow", "UnexpectedReply", "Upload", "Closed", "AlreadyReading", "Shutdown", "SdpRejected", "ChannelClosed", "Indeterminate"]>;
|
|
7
34
|
readonly message: Schema.String;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
35
|
+
}>, import("effect/Cause").YieldableError>;
|
|
36
|
+
/** One reason class whose `_tag` is the code (the PlatformError.SystemError precedent). */
|
|
37
|
+
export declare class Failure extends Failure_base {
|
|
38
|
+
/** Local backpressure (`Overflow`) and a lost connection may succeed on a later attempt. */
|
|
39
|
+
get isRetryable(): boolean;
|
|
40
|
+
}
|
|
41
|
+
declare const Http_base: Schema.Class<Http, Schema.Struct<{
|
|
42
|
+
readonly _tag: Schema.tag<"Http">;
|
|
43
|
+
readonly message: Schema.String;
|
|
44
|
+
readonly status: Schema.optionalKey<Schema.Int>;
|
|
45
|
+
/** The response's `Retry-After`, when it named a delay. */
|
|
46
|
+
readonly retryAfter: Schema.optionalKey<Schema.Duration>;
|
|
47
|
+
/** The response body, for explicit inspection only. */
|
|
48
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
49
|
+
}>, import("effect/Cause").YieldableError>;
|
|
50
|
+
/** A coordinator HTTP failure; `status` is absent when no response arrived. */
|
|
51
|
+
export declare class Http extends Http_base {
|
|
52
|
+
/**
|
|
53
|
+
* No response arrived, or the coordinator refused for now: 408, 429, 503, or
|
|
54
|
+
* any status that named a Retry-After delay.
|
|
55
|
+
*/
|
|
56
|
+
get isRetryable(): boolean;
|
|
57
|
+
/** Diagnostic JSON: the body stays out. */
|
|
58
|
+
toJSON(): {
|
|
59
|
+
_tag: "Http";
|
|
60
|
+
message: string;
|
|
61
|
+
status?: number;
|
|
62
|
+
retryAfterMillis?: number;
|
|
63
|
+
candidateTypes?: never;
|
|
64
|
+
pairs?: never;
|
|
65
|
+
clipId?: never;
|
|
66
|
+
lifecycle?: never;
|
|
67
|
+
transportGeneration?: never;
|
|
68
|
+
purpose?: never;
|
|
69
|
+
sequenceId?: never;
|
|
70
|
+
code?: never;
|
|
71
|
+
} | {
|
|
72
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
73
|
+
message: string;
|
|
74
|
+
remoteCode?: string;
|
|
75
|
+
candidateTypes?: never;
|
|
76
|
+
pairs?: never;
|
|
77
|
+
clipId?: never;
|
|
78
|
+
lifecycle?: never;
|
|
79
|
+
transportGeneration?: never;
|
|
80
|
+
purpose?: never;
|
|
81
|
+
sequenceId?: never;
|
|
82
|
+
code?: never;
|
|
83
|
+
} | {
|
|
84
|
+
_tag: "Native";
|
|
85
|
+
message: string;
|
|
86
|
+
status?: number;
|
|
87
|
+
candidateTypes?: never;
|
|
88
|
+
pairs?: never;
|
|
89
|
+
clipId?: never;
|
|
90
|
+
lifecycle?: never;
|
|
91
|
+
transportGeneration?: never;
|
|
92
|
+
purpose?: never;
|
|
93
|
+
sequenceId?: never;
|
|
94
|
+
code?: never;
|
|
95
|
+
} | {
|
|
96
|
+
_tag: "IceFailed";
|
|
97
|
+
message: string;
|
|
98
|
+
pairs: number;
|
|
99
|
+
candidateTypes: readonly string[];
|
|
100
|
+
clipId?: never;
|
|
101
|
+
lifecycle?: never;
|
|
102
|
+
transportGeneration?: never;
|
|
103
|
+
purpose?: never;
|
|
104
|
+
sequenceId?: never;
|
|
105
|
+
code?: never;
|
|
106
|
+
} | {
|
|
107
|
+
candidateTypes?: never;
|
|
108
|
+
_tag: "TransportFailed";
|
|
109
|
+
message: string;
|
|
110
|
+
pairs: number;
|
|
111
|
+
clipId?: never;
|
|
112
|
+
lifecycle?: never;
|
|
113
|
+
transportGeneration?: never;
|
|
114
|
+
purpose?: never;
|
|
115
|
+
sequenceId?: never;
|
|
116
|
+
code?: never;
|
|
117
|
+
} | {
|
|
118
|
+
candidateTypes?: never;
|
|
119
|
+
pairs?: never;
|
|
120
|
+
_tag: "ClipEnded";
|
|
121
|
+
message: string;
|
|
122
|
+
clipId: string;
|
|
123
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
124
|
+
transportGeneration: string;
|
|
125
|
+
purpose?: never;
|
|
126
|
+
sequenceId?: never;
|
|
127
|
+
code?: never;
|
|
128
|
+
} | {
|
|
129
|
+
candidateTypes?: never;
|
|
130
|
+
pairs?: never;
|
|
131
|
+
clipId?: never;
|
|
132
|
+
lifecycle?: never;
|
|
133
|
+
transportGeneration?: never;
|
|
134
|
+
_tag: "Missing";
|
|
135
|
+
message: string;
|
|
136
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
137
|
+
sequenceId?: never;
|
|
138
|
+
code?: never;
|
|
139
|
+
} | {
|
|
140
|
+
candidateTypes?: never;
|
|
141
|
+
pairs?: never;
|
|
142
|
+
clipId?: never;
|
|
143
|
+
lifecycle?: never;
|
|
144
|
+
transportGeneration?: never;
|
|
145
|
+
purpose?: never;
|
|
146
|
+
_tag: "Sequence";
|
|
147
|
+
message: string;
|
|
148
|
+
sequenceId: string;
|
|
149
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
150
|
+
} | {
|
|
151
|
+
candidateTypes?: never;
|
|
152
|
+
pairs?: never;
|
|
153
|
+
clipId?: never;
|
|
154
|
+
lifecycle?: never;
|
|
155
|
+
transportGeneration?: never;
|
|
156
|
+
purpose?: never;
|
|
157
|
+
sequenceId?: never;
|
|
158
|
+
code?: never;
|
|
159
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
160
|
+
message: string;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
declare const Remote_base: Schema.Class<Remote, Schema.Struct<{
|
|
164
|
+
readonly _tag: Schema.Literals<readonly ["Remote", "RecorderDisabled"]>;
|
|
165
|
+
readonly message: Schema.String;
|
|
166
|
+
/** The provider's own error code, verbatim. */
|
|
167
|
+
readonly remoteCode: Schema.optionalKey<Schema.String>;
|
|
168
|
+
/** The provider's error text, for explicit inspection only. */
|
|
169
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
170
|
+
}>, import("effect/Cause").YieldableError>;
|
|
171
|
+
/**
|
|
172
|
+
* The provider replied with an error or a refusal. `RecorderDisabled` is a
|
|
173
|
+
* clip failure recognized from its reason, the one documented classification
|
|
174
|
+
* of provider text.
|
|
175
|
+
*/
|
|
176
|
+
export declare class Remote extends Remote_base {
|
|
177
|
+
/** The provider refused; the same request would be refused again. */
|
|
178
|
+
get isRetryable(): boolean;
|
|
179
|
+
/** Diagnostic JSON: the body stays out. */
|
|
180
|
+
toJSON(): {
|
|
181
|
+
_tag: "Http";
|
|
182
|
+
message: string;
|
|
183
|
+
status?: number;
|
|
184
|
+
retryAfterMillis?: number;
|
|
185
|
+
candidateTypes?: never;
|
|
186
|
+
pairs?: never;
|
|
187
|
+
clipId?: never;
|
|
188
|
+
lifecycle?: never;
|
|
189
|
+
transportGeneration?: never;
|
|
190
|
+
purpose?: never;
|
|
191
|
+
sequenceId?: never;
|
|
192
|
+
code?: never;
|
|
193
|
+
} | {
|
|
194
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
195
|
+
message: string;
|
|
196
|
+
remoteCode?: string;
|
|
197
|
+
candidateTypes?: never;
|
|
198
|
+
pairs?: never;
|
|
199
|
+
clipId?: never;
|
|
200
|
+
lifecycle?: never;
|
|
201
|
+
transportGeneration?: never;
|
|
202
|
+
purpose?: never;
|
|
203
|
+
sequenceId?: never;
|
|
204
|
+
code?: never;
|
|
205
|
+
} | {
|
|
206
|
+
_tag: "Native";
|
|
207
|
+
message: string;
|
|
208
|
+
status?: number;
|
|
209
|
+
candidateTypes?: never;
|
|
210
|
+
pairs?: never;
|
|
211
|
+
clipId?: never;
|
|
212
|
+
lifecycle?: never;
|
|
213
|
+
transportGeneration?: never;
|
|
214
|
+
purpose?: never;
|
|
215
|
+
sequenceId?: never;
|
|
216
|
+
code?: never;
|
|
217
|
+
} | {
|
|
218
|
+
_tag: "IceFailed";
|
|
219
|
+
message: string;
|
|
220
|
+
pairs: number;
|
|
221
|
+
candidateTypes: readonly string[];
|
|
222
|
+
clipId?: never;
|
|
223
|
+
lifecycle?: never;
|
|
224
|
+
transportGeneration?: never;
|
|
225
|
+
purpose?: never;
|
|
226
|
+
sequenceId?: never;
|
|
227
|
+
code?: never;
|
|
228
|
+
} | {
|
|
229
|
+
candidateTypes?: never;
|
|
230
|
+
_tag: "TransportFailed";
|
|
231
|
+
message: string;
|
|
232
|
+
pairs: number;
|
|
233
|
+
clipId?: never;
|
|
234
|
+
lifecycle?: never;
|
|
235
|
+
transportGeneration?: never;
|
|
236
|
+
purpose?: never;
|
|
237
|
+
sequenceId?: never;
|
|
238
|
+
code?: never;
|
|
239
|
+
} | {
|
|
240
|
+
candidateTypes?: never;
|
|
241
|
+
pairs?: never;
|
|
242
|
+
_tag: "ClipEnded";
|
|
243
|
+
message: string;
|
|
244
|
+
clipId: string;
|
|
245
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
246
|
+
transportGeneration: string;
|
|
247
|
+
purpose?: never;
|
|
248
|
+
sequenceId?: never;
|
|
249
|
+
code?: never;
|
|
250
|
+
} | {
|
|
251
|
+
candidateTypes?: never;
|
|
252
|
+
pairs?: never;
|
|
253
|
+
clipId?: never;
|
|
254
|
+
lifecycle?: never;
|
|
255
|
+
transportGeneration?: never;
|
|
256
|
+
_tag: "Missing";
|
|
257
|
+
message: string;
|
|
258
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
259
|
+
sequenceId?: never;
|
|
260
|
+
code?: never;
|
|
261
|
+
} | {
|
|
262
|
+
candidateTypes?: never;
|
|
263
|
+
pairs?: never;
|
|
264
|
+
clipId?: never;
|
|
265
|
+
lifecycle?: never;
|
|
266
|
+
transportGeneration?: never;
|
|
267
|
+
purpose?: never;
|
|
268
|
+
_tag: "Sequence";
|
|
269
|
+
message: string;
|
|
270
|
+
sequenceId: string;
|
|
271
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
272
|
+
} | {
|
|
273
|
+
candidateTypes?: never;
|
|
274
|
+
pairs?: never;
|
|
275
|
+
clipId?: never;
|
|
276
|
+
lifecycle?: never;
|
|
277
|
+
transportGeneration?: never;
|
|
278
|
+
purpose?: never;
|
|
279
|
+
sequenceId?: never;
|
|
280
|
+
code?: never;
|
|
281
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
282
|
+
message: string;
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
declare const Native_base: Schema.Class<Native, Schema.Struct<{
|
|
286
|
+
readonly _tag: Schema.tag<"Native">;
|
|
287
|
+
readonly message: Schema.String;
|
|
288
|
+
readonly status: Schema.optionalKey<Schema.Int>;
|
|
289
|
+
/**
|
|
290
|
+
* libwebrtc's own text. It can contain peer SDP or caller-supplied signaling
|
|
291
|
+
* material, so it is Redacted and refuses JSON encoding.
|
|
292
|
+
*/
|
|
293
|
+
readonly backendMessage: Schema.optionalKey<Schema.Redacted<Schema.String>>;
|
|
294
|
+
}>, import("effect/Cause").YieldableError>;
|
|
295
|
+
/** A native bridge failure; `status` is the ABI's failure class when one was returned. */
|
|
296
|
+
export declare class Native extends Native_base {
|
|
297
|
+
get isRetryable(): boolean;
|
|
298
|
+
/** Diagnostic JSON: the backend text stays out. */
|
|
299
|
+
toJSON(): {
|
|
300
|
+
_tag: "Http";
|
|
301
|
+
message: string;
|
|
302
|
+
status?: number;
|
|
303
|
+
retryAfterMillis?: number;
|
|
304
|
+
candidateTypes?: never;
|
|
305
|
+
pairs?: never;
|
|
306
|
+
clipId?: never;
|
|
307
|
+
lifecycle?: never;
|
|
308
|
+
transportGeneration?: never;
|
|
309
|
+
purpose?: never;
|
|
310
|
+
sequenceId?: never;
|
|
311
|
+
code?: never;
|
|
312
|
+
} | {
|
|
313
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
314
|
+
message: string;
|
|
315
|
+
remoteCode?: string;
|
|
316
|
+
candidateTypes?: never;
|
|
317
|
+
pairs?: never;
|
|
318
|
+
clipId?: never;
|
|
319
|
+
lifecycle?: never;
|
|
320
|
+
transportGeneration?: never;
|
|
321
|
+
purpose?: never;
|
|
322
|
+
sequenceId?: never;
|
|
323
|
+
code?: never;
|
|
324
|
+
} | {
|
|
325
|
+
_tag: "Native";
|
|
326
|
+
message: string;
|
|
327
|
+
status?: number;
|
|
328
|
+
candidateTypes?: never;
|
|
329
|
+
pairs?: never;
|
|
330
|
+
clipId?: never;
|
|
331
|
+
lifecycle?: never;
|
|
332
|
+
transportGeneration?: never;
|
|
333
|
+
purpose?: never;
|
|
334
|
+
sequenceId?: never;
|
|
335
|
+
code?: never;
|
|
336
|
+
} | {
|
|
337
|
+
_tag: "IceFailed";
|
|
338
|
+
message: string;
|
|
339
|
+
pairs: number;
|
|
340
|
+
candidateTypes: readonly string[];
|
|
341
|
+
clipId?: never;
|
|
342
|
+
lifecycle?: never;
|
|
343
|
+
transportGeneration?: never;
|
|
344
|
+
purpose?: never;
|
|
345
|
+
sequenceId?: never;
|
|
346
|
+
code?: never;
|
|
347
|
+
} | {
|
|
348
|
+
candidateTypes?: never;
|
|
349
|
+
_tag: "TransportFailed";
|
|
350
|
+
message: string;
|
|
351
|
+
pairs: number;
|
|
352
|
+
clipId?: never;
|
|
353
|
+
lifecycle?: never;
|
|
354
|
+
transportGeneration?: never;
|
|
355
|
+
purpose?: never;
|
|
356
|
+
sequenceId?: never;
|
|
357
|
+
code?: never;
|
|
358
|
+
} | {
|
|
359
|
+
candidateTypes?: never;
|
|
360
|
+
pairs?: never;
|
|
361
|
+
_tag: "ClipEnded";
|
|
362
|
+
message: string;
|
|
363
|
+
clipId: string;
|
|
364
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
365
|
+
transportGeneration: string;
|
|
366
|
+
purpose?: never;
|
|
367
|
+
sequenceId?: never;
|
|
368
|
+
code?: never;
|
|
369
|
+
} | {
|
|
370
|
+
candidateTypes?: never;
|
|
371
|
+
pairs?: never;
|
|
372
|
+
clipId?: never;
|
|
373
|
+
lifecycle?: never;
|
|
374
|
+
transportGeneration?: never;
|
|
375
|
+
_tag: "Missing";
|
|
376
|
+
message: string;
|
|
377
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
378
|
+
sequenceId?: never;
|
|
379
|
+
code?: never;
|
|
380
|
+
} | {
|
|
381
|
+
candidateTypes?: never;
|
|
382
|
+
pairs?: never;
|
|
383
|
+
clipId?: never;
|
|
384
|
+
lifecycle?: never;
|
|
385
|
+
transportGeneration?: never;
|
|
386
|
+
purpose?: never;
|
|
387
|
+
_tag: "Sequence";
|
|
388
|
+
message: string;
|
|
389
|
+
sequenceId: string;
|
|
390
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
391
|
+
} | {
|
|
392
|
+
candidateTypes?: never;
|
|
393
|
+
pairs?: never;
|
|
394
|
+
clipId?: never;
|
|
395
|
+
lifecycle?: never;
|
|
396
|
+
transportGeneration?: never;
|
|
397
|
+
purpose?: never;
|
|
398
|
+
sequenceId?: never;
|
|
399
|
+
code?: never;
|
|
400
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
401
|
+
message: string;
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
declare const IceFailed_base: Schema.Class<IceFailed, Schema.Struct<{
|
|
405
|
+
readonly _tag: Schema.tag<"IceFailed">;
|
|
406
|
+
readonly message: Schema.String;
|
|
407
|
+
/** Candidate pairs the connection's statistics listed. */
|
|
408
|
+
readonly pairs: Schema.Int;
|
|
409
|
+
/** The local candidate types gathered, such as `host` or `relay`. */
|
|
410
|
+
readonly candidateTypes: Schema.$Array<Schema.String>;
|
|
411
|
+
}>, import("effect/Cause").YieldableError>;
|
|
412
|
+
/** No ICE candidate pair worked. */
|
|
413
|
+
export declare class IceFailed extends IceFailed_base {
|
|
414
|
+
get isRetryable(): boolean;
|
|
415
|
+
}
|
|
416
|
+
declare const TransportFailed_base: Schema.Class<TransportFailed, Schema.Struct<{
|
|
417
|
+
readonly _tag: Schema.tag<"TransportFailed">;
|
|
418
|
+
readonly message: Schema.String;
|
|
419
|
+
/** Candidate pairs the connection's statistics listed. */
|
|
420
|
+
readonly pairs: Schema.Int;
|
|
421
|
+
}>, import("effect/Cause").YieldableError>;
|
|
422
|
+
/** ICE connectivity succeeded and the DTLS or SCTP transport above it failed. */
|
|
423
|
+
export declare class TransportFailed extends TransportFailed_base {
|
|
424
|
+
get isRetryable(): boolean;
|
|
425
|
+
}
|
|
426
|
+
declare const ClipEnded_base: Schema.Class<ClipEnded, Schema.Struct<{
|
|
427
|
+
readonly _tag: Schema.tag<"ClipEnded">;
|
|
428
|
+
readonly message: Schema.String;
|
|
429
|
+
readonly clipId: Schema.String;
|
|
430
|
+
/** The lifecycle message that ended the clip. */
|
|
431
|
+
readonly lifecycle: Schema.Literals<readonly ["clip_failed", "clip_popped"]>;
|
|
432
|
+
/** The transport generation whose evidence ended it. */
|
|
433
|
+
readonly transportGeneration: Schema.BigInt;
|
|
434
|
+
}>, import("effect/Cause").YieldableError>;
|
|
435
|
+
/**
|
|
436
|
+
* A clip ended before it reached the phase awaited: it failed, or it was
|
|
437
|
+
* popped from the queue, first.
|
|
438
|
+
*/
|
|
439
|
+
export declare class ClipEnded extends ClipEnded_base {
|
|
440
|
+
get isRetryable(): boolean;
|
|
441
|
+
}
|
|
442
|
+
export declare const ReactorErrorReason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
443
|
+
export type ReactorErrorReason = typeof ReactorErrorReason.Type;
|
|
444
|
+
/** Every reason tag a ReactorError, CommandFailure or AcquisitionFailure can carry. */
|
|
445
|
+
export declare const ErrorCode: Schema.Literals<readonly ["InvalidInput", "Protocol", "VersionMismatch", "UnsupportedHost", "UnsupportedCapability", "InvalidState", "TerminalSession", "Timeout", "Disconnected", "Aborted", "Overflow", "UnexpectedReply", "Upload", "Closed", "AlreadyReading", "Shutdown", "SdpRejected", "ChannelClosed", "Indeterminate", "Http", "Remote", "RecorderDisabled", "Native", "IceFailed", "TransportFailed", "ClipEnded"]>;
|
|
446
|
+
export type ErrorCode = ReactorErrorReason["_tag"];
|
|
447
|
+
/** The codes a reason can be built from with a message alone. */
|
|
448
|
+
export type MessageCode = Exclude<ErrorCode, "IceFailed" | "TransportFailed" | "ClipEnded">;
|
|
449
|
+
export type RemoteOutcome = "not-submitted" | "unknown" | "replied";
|
|
14
450
|
export declare const ErrorContext: Schema.Struct<{
|
|
15
451
|
readonly operation: Schema.optionalKey<Schema.String>;
|
|
16
452
|
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
17
453
|
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
18
454
|
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
19
455
|
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
456
|
+
/**
|
|
457
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
458
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
459
|
+
* diagnostic JSON leaves it out.
|
|
460
|
+
*/
|
|
25
461
|
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
26
462
|
}>;
|
|
27
463
|
export type ErrorContext = typeof ErrorContext.Type;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
464
|
+
/** Dispatch evidence proving that a request was never handed to the remote. */
|
|
465
|
+
export declare const NotSubmitted: Schema.Struct<{
|
|
466
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
467
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
468
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
469
|
+
/**
|
|
470
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
471
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
472
|
+
* diagnostic JSON leaves it out.
|
|
473
|
+
*/
|
|
474
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
475
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
476
|
+
readonly operation: Schema.String;
|
|
477
|
+
}>;
|
|
478
|
+
export type NotSubmitted = typeof NotSubmitted.Type;
|
|
479
|
+
/** Dispatch evidence is independent of the failure's transport category. */
|
|
480
|
+
export declare const CommandContext: Schema.Union<readonly [Schema.Struct<{
|
|
481
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
482
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
483
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
484
|
+
/**
|
|
485
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
486
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
487
|
+
* diagnostic JSON leaves it out.
|
|
488
|
+
*/
|
|
489
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
490
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
491
|
+
readonly operation: Schema.String;
|
|
492
|
+
}>, Schema.Struct<{
|
|
493
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
494
|
+
/**
|
|
495
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
496
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
497
|
+
* diagnostic JSON leaves it out.
|
|
498
|
+
*/
|
|
499
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
500
|
+
readonly outcome: Schema.Literals<readonly ["unknown", "replied"]>;
|
|
501
|
+
readonly operation: Schema.String;
|
|
502
|
+
readonly requestId: Schema.String;
|
|
503
|
+
readonly generation: Schema.BigInt;
|
|
504
|
+
}>]>;
|
|
505
|
+
export type CommandContext = typeof CommandContext.Type;
|
|
506
|
+
/** Local admission refusals that carry only a message. */
|
|
507
|
+
export declare const RefusalCode: Schema.Literals<readonly ["QueueFull", "SessionRecovering", "SessionClosed", "SessionRetired", "NotFound", "OwnerConflict", "Busy", "InvalidRequest", "PositionConflict", "QueueChanged", "RouteChanged", "AnchorUnavailable", "ContinuationUnavailable", "AnnotationCapacity", "SubmissionCapacity", "IdentityExhausted"]>;
|
|
508
|
+
export type RefusalCode = typeof RefusalCode.Type;
|
|
509
|
+
declare const Refusal_base: Schema.Class<Refusal, Schema.Struct<{
|
|
510
|
+
readonly _tag: Schema.Literals<readonly ["QueueFull", "SessionRecovering", "SessionClosed", "SessionRetired", "NotFound", "OwnerConflict", "Busy", "InvalidRequest", "PositionConflict", "QueueChanged", "RouteChanged", "AnchorUnavailable", "ContinuationUnavailable", "AnnotationCapacity", "SubmissionCapacity", "IdentityExhausted"]>;
|
|
511
|
+
readonly message: Schema.String;
|
|
512
|
+
}>, import("effect/Cause").YieldableError>;
|
|
513
|
+
/** A local refusal whose `_tag` is its code. */
|
|
514
|
+
export declare class Refusal extends Refusal_base {
|
|
515
|
+
/** A full queue and a recovering session are backpressure: the request can wait. */
|
|
516
|
+
get isRetryable(): boolean;
|
|
33
517
|
}
|
|
518
|
+
declare const Missing_base: Schema.Class<Missing, Schema.Struct<{
|
|
519
|
+
readonly _tag: Schema.tag<"Missing">;
|
|
520
|
+
/** The field: `before` (anchor), `sameSessionAs` (session_anchor) or `continueFrom`. */
|
|
521
|
+
readonly purpose: Schema.Literals<readonly ["anchor", "session_anchor", "continuation"]>;
|
|
522
|
+
}>, import("effect/Cause").YieldableError>;
|
|
523
|
+
/** A request field names a clip that no session is known to own. */
|
|
524
|
+
export declare class Missing extends Missing_base {
|
|
525
|
+
get message(): string;
|
|
526
|
+
get isRetryable(): boolean;
|
|
527
|
+
}
|
|
528
|
+
declare const SequenceRefusal_base: Schema.Class<SequenceRefusal, Schema.Struct<{
|
|
529
|
+
readonly _tag: Schema.tag<"Sequence">;
|
|
530
|
+
readonly sequenceId: Schema.String;
|
|
531
|
+
readonly code: Schema.Literals<readonly ["capacity", "member-capacity", "owner-mismatch", "sealed", "sealing", "indeterminate", "retired", "missing", "member-missing", "member-duplicate", "not-releasable"]>;
|
|
532
|
+
}>, import("effect/Cause").YieldableError>;
|
|
533
|
+
/** Sequence affinity refused the request; `code` is the SequenceError code. */
|
|
534
|
+
export declare class SequenceRefusal extends SequenceRefusal_base {
|
|
535
|
+
get message(): string;
|
|
536
|
+
get isRetryable(): boolean;
|
|
537
|
+
}
|
|
538
|
+
export declare const PolicyReason: Schema.Union<readonly [typeof Refusal, typeof Missing, typeof SequenceRefusal]>;
|
|
539
|
+
export type PolicyReason = typeof PolicyReason.Type;
|
|
34
540
|
declare const ReactorError_base: Schema.Class<ReactorError, Schema.TaggedStruct<"ReactorError", {
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly context: Schema.Struct<{
|
|
541
|
+
readonly reason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
542
|
+
readonly context: Schema.withConstructorDefault<Schema.Struct<{
|
|
38
543
|
readonly operation: Schema.optionalKey<Schema.String>;
|
|
39
544
|
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
40
545
|
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
41
546
|
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
42
547
|
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
548
|
+
/**
|
|
549
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
550
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
551
|
+
* diagnostic JSON leaves it out.
|
|
552
|
+
*/
|
|
48
553
|
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
49
|
-
}>;
|
|
50
|
-
readonly nativeError: Schema.optionalKey<Schema.Struct<{
|
|
51
|
-
readonly code: Schema.String;
|
|
52
|
-
readonly message: Schema.String;
|
|
53
|
-
readonly recoverable: Schema.Boolean;
|
|
54
|
-
readonly operation: Schema.optionalKey<Schema.String>;
|
|
55
|
-
readonly status: Schema.optionalKey<Schema.Number>;
|
|
56
|
-
readonly retryAfterMs: Schema.optionalKey<Schema.Number>;
|
|
57
554
|
}>>;
|
|
58
555
|
}>, import("effect/Cause").YieldableError>;
|
|
59
|
-
/**
|
|
556
|
+
/**
|
|
557
|
+
* A failure category never implies a mutation was rolled back. Inspect
|
|
558
|
+
* `context.outcome`, and route on `reason._tag`.
|
|
559
|
+
*
|
|
560
|
+
* Construct it from its fields, as with any Schema class (`context` defaults
|
|
561
|
+
* to empty), or with `ReactorError.fromCode`.
|
|
562
|
+
*/
|
|
60
563
|
export declare class ReactorError extends ReactorError_base {
|
|
61
|
-
|
|
62
|
-
|
|
564
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
565
|
+
/** The reason is library-authored, so it is the native cause (the AiError precedent). */
|
|
566
|
+
readonly cause: ClipEnded | Failure | Http | IceFailed | Native | Remote | TransportFailed;
|
|
567
|
+
get message(): string;
|
|
568
|
+
/**
|
|
569
|
+
* Whether a later attempt may succeed. Never true when `context.outcome` is
|
|
570
|
+
* "unknown": the remote may already have applied the first attempt.
|
|
571
|
+
*/
|
|
572
|
+
get isRetryable(): boolean;
|
|
573
|
+
/** The delay the remote asked for, when it named one (the AiError precedent). */
|
|
574
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
575
|
+
/** Whether `u` is a `ReactorError`, and not one of the other client failures. */
|
|
576
|
+
static is(u: unknown): u is ReactorError;
|
|
577
|
+
/** A failure whose reason is `code` with a library-written `message`. */
|
|
578
|
+
static fromCode(code: MessageCode, message: string, context?: ErrorContext): ReactorError;
|
|
579
|
+
toJSON(): {
|
|
580
|
+
_tag: string;
|
|
581
|
+
message: string;
|
|
582
|
+
reason: {
|
|
583
|
+
_tag: "Http";
|
|
584
|
+
message: string;
|
|
585
|
+
status?: number;
|
|
586
|
+
retryAfterMillis?: number;
|
|
587
|
+
candidateTypes?: never;
|
|
588
|
+
pairs?: never;
|
|
589
|
+
clipId?: never;
|
|
590
|
+
lifecycle?: never;
|
|
591
|
+
transportGeneration?: never;
|
|
592
|
+
purpose?: never;
|
|
593
|
+
sequenceId?: never;
|
|
594
|
+
code?: never;
|
|
595
|
+
} | {
|
|
596
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
597
|
+
message: string;
|
|
598
|
+
remoteCode?: string;
|
|
599
|
+
candidateTypes?: never;
|
|
600
|
+
pairs?: never;
|
|
601
|
+
clipId?: never;
|
|
602
|
+
lifecycle?: never;
|
|
603
|
+
transportGeneration?: never;
|
|
604
|
+
purpose?: never;
|
|
605
|
+
sequenceId?: never;
|
|
606
|
+
code?: never;
|
|
607
|
+
} | {
|
|
608
|
+
_tag: "Native";
|
|
609
|
+
message: string;
|
|
610
|
+
status?: number;
|
|
611
|
+
candidateTypes?: never;
|
|
612
|
+
pairs?: never;
|
|
613
|
+
clipId?: never;
|
|
614
|
+
lifecycle?: never;
|
|
615
|
+
transportGeneration?: never;
|
|
616
|
+
purpose?: never;
|
|
617
|
+
sequenceId?: never;
|
|
618
|
+
code?: never;
|
|
619
|
+
} | {
|
|
620
|
+
_tag: "IceFailed";
|
|
621
|
+
message: string;
|
|
622
|
+
pairs: number;
|
|
623
|
+
candidateTypes: readonly string[];
|
|
624
|
+
clipId?: never;
|
|
625
|
+
lifecycle?: never;
|
|
626
|
+
transportGeneration?: never;
|
|
627
|
+
purpose?: never;
|
|
628
|
+
sequenceId?: never;
|
|
629
|
+
code?: never;
|
|
630
|
+
} | {
|
|
631
|
+
candidateTypes?: never;
|
|
632
|
+
_tag: "TransportFailed";
|
|
633
|
+
message: string;
|
|
634
|
+
pairs: number;
|
|
635
|
+
clipId?: never;
|
|
636
|
+
lifecycle?: never;
|
|
637
|
+
transportGeneration?: never;
|
|
638
|
+
purpose?: never;
|
|
639
|
+
sequenceId?: never;
|
|
640
|
+
code?: never;
|
|
641
|
+
} | {
|
|
642
|
+
candidateTypes?: never;
|
|
643
|
+
pairs?: never;
|
|
644
|
+
_tag: "ClipEnded";
|
|
645
|
+
message: string;
|
|
646
|
+
clipId: string;
|
|
647
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
648
|
+
transportGeneration: string;
|
|
649
|
+
purpose?: never;
|
|
650
|
+
sequenceId?: never;
|
|
651
|
+
code?: never;
|
|
652
|
+
} | {
|
|
653
|
+
candidateTypes?: never;
|
|
654
|
+
pairs?: never;
|
|
655
|
+
clipId?: never;
|
|
656
|
+
lifecycle?: never;
|
|
657
|
+
transportGeneration?: never;
|
|
658
|
+
_tag: "Missing";
|
|
659
|
+
message: string;
|
|
660
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
661
|
+
sequenceId?: never;
|
|
662
|
+
code?: never;
|
|
663
|
+
} | {
|
|
664
|
+
candidateTypes?: never;
|
|
665
|
+
pairs?: never;
|
|
666
|
+
clipId?: never;
|
|
667
|
+
lifecycle?: never;
|
|
668
|
+
transportGeneration?: never;
|
|
669
|
+
purpose?: never;
|
|
670
|
+
_tag: "Sequence";
|
|
671
|
+
message: string;
|
|
672
|
+
sequenceId: string;
|
|
673
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
674
|
+
} | {
|
|
675
|
+
candidateTypes?: never;
|
|
676
|
+
pairs?: never;
|
|
677
|
+
clipId?: never;
|
|
678
|
+
lifecycle?: never;
|
|
679
|
+
transportGeneration?: never;
|
|
680
|
+
purpose?: never;
|
|
681
|
+
sequenceId?: never;
|
|
682
|
+
code?: never;
|
|
683
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
684
|
+
message: string;
|
|
685
|
+
};
|
|
686
|
+
context: {
|
|
687
|
+
operation?: string;
|
|
688
|
+
requestId?: string;
|
|
689
|
+
sessionId?: string;
|
|
690
|
+
outcome?: "not-submitted" | "replied" | "unknown";
|
|
691
|
+
generation?: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
declare const CommandFailure_base: Schema.Class<CommandFailure, Schema.TaggedStruct<"CommandFailure", {
|
|
696
|
+
readonly reason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
697
|
+
readonly context: Schema.Union<readonly [Schema.Struct<{
|
|
698
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
699
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
700
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
701
|
+
/**
|
|
702
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
703
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
704
|
+
* diagnostic JSON leaves it out.
|
|
705
|
+
*/
|
|
706
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
707
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
708
|
+
readonly operation: Schema.String;
|
|
709
|
+
}>, Schema.Struct<{
|
|
710
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
711
|
+
/**
|
|
712
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
713
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
714
|
+
* diagnostic JSON leaves it out.
|
|
715
|
+
*/
|
|
716
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
717
|
+
readonly outcome: Schema.Literals<readonly ["unknown", "replied"]>;
|
|
718
|
+
readonly operation: Schema.String;
|
|
719
|
+
readonly requestId: Schema.String;
|
|
720
|
+
readonly generation: Schema.BigInt;
|
|
721
|
+
}>]>;
|
|
722
|
+
}>, import("effect/Cause").YieldableError>;
|
|
723
|
+
/** Every failed command carries the dispatch evidence established by its owner. */
|
|
724
|
+
export declare class CommandFailure extends CommandFailure_base {
|
|
725
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
726
|
+
readonly cause: ClipEnded | Failure | Http | IceFailed | Native | Remote | TransportFailed;
|
|
727
|
+
get message(): string;
|
|
728
|
+
/**
|
|
729
|
+
* Whether a later attempt may succeed. Never true when `context.outcome` is
|
|
730
|
+
* "unknown": the remote may already have applied the first attempt.
|
|
731
|
+
*/
|
|
732
|
+
get isRetryable(): boolean;
|
|
733
|
+
/** The delay the remote asked for, when it named one (the AiError precedent). */
|
|
734
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
735
|
+
/** Whether `u` is a `CommandFailure`. */
|
|
736
|
+
static is(u: unknown): u is CommandFailure;
|
|
737
|
+
/** `error`'s reason, with the dispatch evidence its command established. */
|
|
738
|
+
static from(error: ReactorFailure, context: CommandContext): CommandFailure;
|
|
63
739
|
toJSON(): {
|
|
64
|
-
_tag:
|
|
65
|
-
code: "Aborted" | "AlreadyReading" | "Closed" | "Disconnected" | "Http" | "InvalidInput" | "InvalidState" | "Native" | "Overflow" | "Protocol" | "RecorderDisabled" | "Remote" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
740
|
+
_tag: string;
|
|
66
741
|
message: string;
|
|
742
|
+
reason: {
|
|
743
|
+
_tag: "Http";
|
|
744
|
+
message: string;
|
|
745
|
+
status?: number;
|
|
746
|
+
retryAfterMillis?: number;
|
|
747
|
+
candidateTypes?: never;
|
|
748
|
+
pairs?: never;
|
|
749
|
+
clipId?: never;
|
|
750
|
+
lifecycle?: never;
|
|
751
|
+
transportGeneration?: never;
|
|
752
|
+
purpose?: never;
|
|
753
|
+
sequenceId?: never;
|
|
754
|
+
code?: never;
|
|
755
|
+
} | {
|
|
756
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
757
|
+
message: string;
|
|
758
|
+
remoteCode?: string;
|
|
759
|
+
candidateTypes?: never;
|
|
760
|
+
pairs?: never;
|
|
761
|
+
clipId?: never;
|
|
762
|
+
lifecycle?: never;
|
|
763
|
+
transportGeneration?: never;
|
|
764
|
+
purpose?: never;
|
|
765
|
+
sequenceId?: never;
|
|
766
|
+
code?: never;
|
|
767
|
+
} | {
|
|
768
|
+
_tag: "Native";
|
|
769
|
+
message: string;
|
|
770
|
+
status?: number;
|
|
771
|
+
candidateTypes?: never;
|
|
772
|
+
pairs?: never;
|
|
773
|
+
clipId?: never;
|
|
774
|
+
lifecycle?: never;
|
|
775
|
+
transportGeneration?: never;
|
|
776
|
+
purpose?: never;
|
|
777
|
+
sequenceId?: never;
|
|
778
|
+
code?: never;
|
|
779
|
+
} | {
|
|
780
|
+
_tag: "IceFailed";
|
|
781
|
+
message: string;
|
|
782
|
+
pairs: number;
|
|
783
|
+
candidateTypes: readonly string[];
|
|
784
|
+
clipId?: never;
|
|
785
|
+
lifecycle?: never;
|
|
786
|
+
transportGeneration?: never;
|
|
787
|
+
purpose?: never;
|
|
788
|
+
sequenceId?: never;
|
|
789
|
+
code?: never;
|
|
790
|
+
} | {
|
|
791
|
+
candidateTypes?: never;
|
|
792
|
+
_tag: "TransportFailed";
|
|
793
|
+
message: string;
|
|
794
|
+
pairs: number;
|
|
795
|
+
clipId?: never;
|
|
796
|
+
lifecycle?: never;
|
|
797
|
+
transportGeneration?: never;
|
|
798
|
+
purpose?: never;
|
|
799
|
+
sequenceId?: never;
|
|
800
|
+
code?: never;
|
|
801
|
+
} | {
|
|
802
|
+
candidateTypes?: never;
|
|
803
|
+
pairs?: never;
|
|
804
|
+
_tag: "ClipEnded";
|
|
805
|
+
message: string;
|
|
806
|
+
clipId: string;
|
|
807
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
808
|
+
transportGeneration: string;
|
|
809
|
+
purpose?: never;
|
|
810
|
+
sequenceId?: never;
|
|
811
|
+
code?: never;
|
|
812
|
+
} | {
|
|
813
|
+
candidateTypes?: never;
|
|
814
|
+
pairs?: never;
|
|
815
|
+
clipId?: never;
|
|
816
|
+
lifecycle?: never;
|
|
817
|
+
transportGeneration?: never;
|
|
818
|
+
_tag: "Missing";
|
|
819
|
+
message: string;
|
|
820
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
821
|
+
sequenceId?: never;
|
|
822
|
+
code?: never;
|
|
823
|
+
} | {
|
|
824
|
+
candidateTypes?: never;
|
|
825
|
+
pairs?: never;
|
|
826
|
+
clipId?: never;
|
|
827
|
+
lifecycle?: never;
|
|
828
|
+
transportGeneration?: never;
|
|
829
|
+
purpose?: never;
|
|
830
|
+
_tag: "Sequence";
|
|
831
|
+
message: string;
|
|
832
|
+
sequenceId: string;
|
|
833
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
834
|
+
} | {
|
|
835
|
+
candidateTypes?: never;
|
|
836
|
+
pairs?: never;
|
|
837
|
+
clipId?: never;
|
|
838
|
+
lifecycle?: never;
|
|
839
|
+
transportGeneration?: never;
|
|
840
|
+
purpose?: never;
|
|
841
|
+
sequenceId?: never;
|
|
842
|
+
code?: never;
|
|
843
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
844
|
+
message: string;
|
|
845
|
+
};
|
|
67
846
|
context: {
|
|
68
847
|
operation?: string;
|
|
69
848
|
requestId?: string;
|
|
70
849
|
sessionId?: string;
|
|
71
850
|
outcome?: "not-submitted" | "replied" | "unknown";
|
|
851
|
+
generation?: string;
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
declare const AcquisitionFailure_base: Schema.Class<AcquisitionFailure, Schema.TaggedStruct<"AcquisitionFailure", {
|
|
856
|
+
readonly reason: Schema.Union<readonly [typeof Failure, typeof Http, typeof Remote, typeof Native, typeof IceFailed, typeof TransportFailed, typeof ClipEnded]>;
|
|
857
|
+
readonly context: Schema.withConstructorDefault<Schema.Struct<{
|
|
858
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
859
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
860
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
861
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
862
|
+
readonly outcome: Schema.optionalKey<Schema.Literals<readonly ["not-submitted", "unknown", "replied"]>>;
|
|
863
|
+
/**
|
|
864
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
865
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
866
|
+
* diagnostic JSON leaves it out.
|
|
867
|
+
*/
|
|
868
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
869
|
+
}>>;
|
|
870
|
+
readonly cleanup: Schema.declare<CloseReport, CloseReport>;
|
|
871
|
+
}>, import("effect/Cause").YieldableError>;
|
|
872
|
+
/** A failed acquisition still returns the lifetime evidence of its partial lease. */
|
|
873
|
+
export declare class AcquisitionFailure extends AcquisitionFailure_base {
|
|
874
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
875
|
+
readonly cause: ClipEnded | Failure | Http | IceFailed | Native | Remote | TransportFailed;
|
|
876
|
+
get message(): string;
|
|
877
|
+
/**
|
|
878
|
+
* Whether a later attempt may succeed. Never true when `context.outcome` is
|
|
879
|
+
* "unknown": the remote may already have applied the first attempt.
|
|
880
|
+
*/
|
|
881
|
+
get isRetryable(): boolean;
|
|
882
|
+
/** The delay the remote asked for, when it named one (the AiError precedent). */
|
|
883
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
884
|
+
/** Whether `u` is an `AcquisitionFailure`. */
|
|
885
|
+
static is(u: unknown): u is AcquisitionFailure;
|
|
886
|
+
/** `error`'s reason and context, with the cleanup its partial lease reported. */
|
|
887
|
+
static from(error: ReactorFailure, cleanup: CloseReport): AcquisitionFailure;
|
|
888
|
+
toJSON(): {
|
|
889
|
+
_tag: string;
|
|
890
|
+
message: string;
|
|
891
|
+
reason: {
|
|
892
|
+
_tag: "Http";
|
|
893
|
+
message: string;
|
|
72
894
|
status?: number;
|
|
73
|
-
|
|
895
|
+
retryAfterMillis?: number;
|
|
896
|
+
candidateTypes?: never;
|
|
897
|
+
pairs?: never;
|
|
898
|
+
clipId?: never;
|
|
899
|
+
lifecycle?: never;
|
|
900
|
+
transportGeneration?: never;
|
|
901
|
+
purpose?: never;
|
|
902
|
+
sequenceId?: never;
|
|
903
|
+
code?: never;
|
|
904
|
+
} | {
|
|
905
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
906
|
+
message: string;
|
|
74
907
|
remoteCode?: string;
|
|
908
|
+
candidateTypes?: never;
|
|
909
|
+
pairs?: never;
|
|
910
|
+
clipId?: never;
|
|
911
|
+
lifecycle?: never;
|
|
912
|
+
transportGeneration?: never;
|
|
913
|
+
purpose?: never;
|
|
914
|
+
sequenceId?: never;
|
|
915
|
+
code?: never;
|
|
916
|
+
} | {
|
|
917
|
+
_tag: "Native";
|
|
918
|
+
message: string;
|
|
919
|
+
status?: number;
|
|
920
|
+
candidateTypes?: never;
|
|
921
|
+
pairs?: never;
|
|
922
|
+
clipId?: never;
|
|
923
|
+
lifecycle?: never;
|
|
924
|
+
transportGeneration?: never;
|
|
925
|
+
purpose?: never;
|
|
926
|
+
sequenceId?: never;
|
|
927
|
+
code?: never;
|
|
928
|
+
} | {
|
|
929
|
+
_tag: "IceFailed";
|
|
930
|
+
message: string;
|
|
931
|
+
pairs: number;
|
|
932
|
+
candidateTypes: readonly string[];
|
|
933
|
+
clipId?: never;
|
|
934
|
+
lifecycle?: never;
|
|
935
|
+
transportGeneration?: never;
|
|
936
|
+
purpose?: never;
|
|
937
|
+
sequenceId?: never;
|
|
938
|
+
code?: never;
|
|
939
|
+
} | {
|
|
940
|
+
candidateTypes?: never;
|
|
941
|
+
_tag: "TransportFailed";
|
|
942
|
+
message: string;
|
|
943
|
+
pairs: number;
|
|
944
|
+
clipId?: never;
|
|
945
|
+
lifecycle?: never;
|
|
946
|
+
transportGeneration?: never;
|
|
947
|
+
purpose?: never;
|
|
948
|
+
sequenceId?: never;
|
|
949
|
+
code?: never;
|
|
950
|
+
} | {
|
|
951
|
+
candidateTypes?: never;
|
|
952
|
+
pairs?: never;
|
|
953
|
+
_tag: "ClipEnded";
|
|
954
|
+
message: string;
|
|
955
|
+
clipId: string;
|
|
956
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
957
|
+
transportGeneration: string;
|
|
958
|
+
purpose?: never;
|
|
959
|
+
sequenceId?: never;
|
|
960
|
+
code?: never;
|
|
961
|
+
} | {
|
|
962
|
+
candidateTypes?: never;
|
|
963
|
+
pairs?: never;
|
|
964
|
+
clipId?: never;
|
|
965
|
+
lifecycle?: never;
|
|
966
|
+
transportGeneration?: never;
|
|
967
|
+
_tag: "Missing";
|
|
968
|
+
message: string;
|
|
969
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
970
|
+
sequenceId?: never;
|
|
971
|
+
code?: never;
|
|
972
|
+
} | {
|
|
973
|
+
candidateTypes?: never;
|
|
974
|
+
pairs?: never;
|
|
975
|
+
clipId?: never;
|
|
976
|
+
lifecycle?: never;
|
|
977
|
+
transportGeneration?: never;
|
|
978
|
+
purpose?: never;
|
|
979
|
+
_tag: "Sequence";
|
|
980
|
+
message: string;
|
|
981
|
+
sequenceId: string;
|
|
982
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
983
|
+
} | {
|
|
984
|
+
candidateTypes?: never;
|
|
985
|
+
pairs?: never;
|
|
986
|
+
clipId?: never;
|
|
987
|
+
lifecycle?: never;
|
|
988
|
+
transportGeneration?: never;
|
|
989
|
+
purpose?: never;
|
|
990
|
+
sequenceId?: never;
|
|
991
|
+
code?: never;
|
|
992
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
993
|
+
message: string;
|
|
994
|
+
};
|
|
995
|
+
context: {
|
|
996
|
+
operation?: string;
|
|
997
|
+
requestId?: string;
|
|
998
|
+
sessionId?: string;
|
|
999
|
+
outcome?: "not-submitted" | "replied" | "unknown";
|
|
75
1000
|
generation?: string;
|
|
76
1001
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
declare const PolicyFailure_base: Schema.Class<PolicyFailure, Schema.TaggedStruct<"PolicyFailure", {
|
|
1005
|
+
readonly reason: Schema.Union<readonly [typeof Refusal, typeof Missing, typeof SequenceRefusal]>;
|
|
1006
|
+
readonly context: Schema.Struct<{
|
|
1007
|
+
readonly requestId: Schema.optionalKey<Schema.String>;
|
|
1008
|
+
readonly sessionId: Schema.optionalKey<Schema.String>;
|
|
1009
|
+
readonly generation: Schema.optionalKey<Schema.BigInt>;
|
|
1010
|
+
/**
|
|
1011
|
+
* The underlying cause or diagnostic record, for explicit inspection only. It
|
|
1012
|
+
* may hold provider or payload text, so it is never the native `cause` and
|
|
1013
|
+
* diagnostic JSON leaves it out.
|
|
1014
|
+
*/
|
|
1015
|
+
readonly detail: Schema.optionalKey<Schema.Unknown>;
|
|
1016
|
+
readonly outcome: Schema.Literal<"not-submitted">;
|
|
1017
|
+
readonly operation: Schema.String;
|
|
1018
|
+
}>;
|
|
1019
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1020
|
+
/** Local admission is a policy decision, with explicit proof of no dispatch. */
|
|
1021
|
+
export declare class PolicyFailure extends PolicyFailure_base {
|
|
1022
|
+
readonly [TypeId]: "~reactor-effect-client/ReactorFailure";
|
|
1023
|
+
readonly cause: Missing | Refusal | SequenceRefusal;
|
|
1024
|
+
get message(): string;
|
|
1025
|
+
/**
|
|
1026
|
+
* Whether a later attempt may succeed: a full queue or a recovering session.
|
|
1027
|
+
* Nothing was dispatched, so the outcome never stands in the way.
|
|
1028
|
+
*/
|
|
1029
|
+
get isRetryable(): boolean;
|
|
1030
|
+
/** A local refusal names no delay. */
|
|
1031
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
1032
|
+
/** Whether `u` is a `PolicyFailure`. */
|
|
1033
|
+
static is(u: unknown): u is PolicyFailure;
|
|
1034
|
+
/** A local refusal of `operation`, which was therefore never dispatched. */
|
|
1035
|
+
static refuse(code: RefusalCode, message: string, operation?: string, cause?: unknown): PolicyFailure;
|
|
1036
|
+
/** A refusal because the clip a request field names has no known owner. */
|
|
1037
|
+
static missing(purpose: Missing["purpose"], operation?: string): PolicyFailure;
|
|
1038
|
+
/** A refusal by sequence affinity, with its SequenceError code. */
|
|
1039
|
+
static sequence(sequenceId: string, code: SequenceCode, operation?: string): PolicyFailure;
|
|
1040
|
+
toJSON(): {
|
|
1041
|
+
_tag: string;
|
|
1042
|
+
message: string;
|
|
1043
|
+
reason: {
|
|
1044
|
+
_tag: "Http";
|
|
1045
|
+
message: string;
|
|
1046
|
+
status?: number;
|
|
1047
|
+
retryAfterMillis?: number;
|
|
1048
|
+
candidateTypes?: never;
|
|
1049
|
+
pairs?: never;
|
|
1050
|
+
clipId?: never;
|
|
1051
|
+
lifecycle?: never;
|
|
1052
|
+
transportGeneration?: never;
|
|
1053
|
+
purpose?: never;
|
|
1054
|
+
sequenceId?: never;
|
|
1055
|
+
code?: never;
|
|
1056
|
+
} | {
|
|
1057
|
+
_tag: "RecorderDisabled" | "Remote";
|
|
1058
|
+
message: string;
|
|
1059
|
+
remoteCode?: string;
|
|
1060
|
+
candidateTypes?: never;
|
|
1061
|
+
pairs?: never;
|
|
1062
|
+
clipId?: never;
|
|
1063
|
+
lifecycle?: never;
|
|
1064
|
+
transportGeneration?: never;
|
|
1065
|
+
purpose?: never;
|
|
1066
|
+
sequenceId?: never;
|
|
1067
|
+
code?: never;
|
|
1068
|
+
} | {
|
|
1069
|
+
_tag: "Native";
|
|
1070
|
+
message: string;
|
|
1071
|
+
status?: number;
|
|
1072
|
+
candidateTypes?: never;
|
|
1073
|
+
pairs?: never;
|
|
1074
|
+
clipId?: never;
|
|
1075
|
+
lifecycle?: never;
|
|
1076
|
+
transportGeneration?: never;
|
|
1077
|
+
purpose?: never;
|
|
1078
|
+
sequenceId?: never;
|
|
1079
|
+
code?: never;
|
|
1080
|
+
} | {
|
|
1081
|
+
_tag: "IceFailed";
|
|
1082
|
+
message: string;
|
|
1083
|
+
pairs: number;
|
|
1084
|
+
candidateTypes: readonly string[];
|
|
1085
|
+
clipId?: never;
|
|
1086
|
+
lifecycle?: never;
|
|
1087
|
+
transportGeneration?: never;
|
|
1088
|
+
purpose?: never;
|
|
1089
|
+
sequenceId?: never;
|
|
1090
|
+
code?: never;
|
|
1091
|
+
} | {
|
|
1092
|
+
candidateTypes?: never;
|
|
1093
|
+
_tag: "TransportFailed";
|
|
1094
|
+
message: string;
|
|
1095
|
+
pairs: number;
|
|
1096
|
+
clipId?: never;
|
|
1097
|
+
lifecycle?: never;
|
|
1098
|
+
transportGeneration?: never;
|
|
1099
|
+
purpose?: never;
|
|
1100
|
+
sequenceId?: never;
|
|
1101
|
+
code?: never;
|
|
1102
|
+
} | {
|
|
1103
|
+
candidateTypes?: never;
|
|
1104
|
+
pairs?: never;
|
|
1105
|
+
_tag: "ClipEnded";
|
|
1106
|
+
message: string;
|
|
1107
|
+
clipId: string;
|
|
1108
|
+
lifecycle: "clip_failed" | "clip_popped";
|
|
1109
|
+
transportGeneration: string;
|
|
1110
|
+
purpose?: never;
|
|
1111
|
+
sequenceId?: never;
|
|
1112
|
+
code?: never;
|
|
1113
|
+
} | {
|
|
1114
|
+
candidateTypes?: never;
|
|
1115
|
+
pairs?: never;
|
|
1116
|
+
clipId?: never;
|
|
1117
|
+
lifecycle?: never;
|
|
1118
|
+
transportGeneration?: never;
|
|
1119
|
+
_tag: "Missing";
|
|
1120
|
+
message: string;
|
|
1121
|
+
purpose: "anchor" | "continuation" | "session_anchor";
|
|
1122
|
+
sequenceId?: never;
|
|
1123
|
+
code?: never;
|
|
1124
|
+
} | {
|
|
1125
|
+
candidateTypes?: never;
|
|
1126
|
+
pairs?: never;
|
|
1127
|
+
clipId?: never;
|
|
1128
|
+
lifecycle?: never;
|
|
1129
|
+
transportGeneration?: never;
|
|
1130
|
+
purpose?: never;
|
|
1131
|
+
_tag: "Sequence";
|
|
1132
|
+
message: string;
|
|
1133
|
+
sequenceId: string;
|
|
1134
|
+
code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
1135
|
+
} | {
|
|
1136
|
+
candidateTypes?: never;
|
|
1137
|
+
pairs?: never;
|
|
1138
|
+
clipId?: never;
|
|
1139
|
+
lifecycle?: never;
|
|
1140
|
+
transportGeneration?: never;
|
|
1141
|
+
purpose?: never;
|
|
1142
|
+
sequenceId?: never;
|
|
1143
|
+
code?: never;
|
|
1144
|
+
_tag: "Aborted" | "AlreadyReading" | "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ChannelClosed" | "Closed" | "ContinuationUnavailable" | "Disconnected" | "IdentityExhausted" | "Indeterminate" | "InvalidInput" | "InvalidRequest" | "InvalidState" | "NotFound" | "Overflow" | "OwnerConflict" | "PositionConflict" | "Protocol" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SdpRejected" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "Shutdown" | "SubmissionCapacity" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
1145
|
+
message: string;
|
|
1146
|
+
};
|
|
1147
|
+
context: {
|
|
1148
|
+
operation?: string;
|
|
1149
|
+
requestId?: string;
|
|
1150
|
+
sessionId?: string;
|
|
1151
|
+
outcome?: "not-submitted" | "replied" | "unknown";
|
|
1152
|
+
generation?: string;
|
|
81
1153
|
};
|
|
82
1154
|
};
|
|
83
1155
|
}
|
|
84
|
-
/**
|
|
85
|
-
export declare const
|
|
1156
|
+
/** A `ReactorError` as its diagnostic JSON. */
|
|
1157
|
+
export declare const ReactorErrorFromJson: Schema.decodeTo<Schema.declare<ReactorError, ReactorError>, Schema.Codec<{
|
|
1158
|
+
readonly _tag: "ReactorError";
|
|
1159
|
+
readonly message: string;
|
|
1160
|
+
readonly reason: {
|
|
1161
|
+
readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
1162
|
+
readonly message: string;
|
|
1163
|
+
} | {
|
|
1164
|
+
readonly _tag: "Http";
|
|
1165
|
+
readonly message: string;
|
|
1166
|
+
readonly status?: number;
|
|
1167
|
+
readonly retryAfterMillis?: number;
|
|
1168
|
+
} | {
|
|
1169
|
+
readonly _tag: "RecorderDisabled" | "Remote";
|
|
1170
|
+
readonly message: string;
|
|
1171
|
+
readonly remoteCode?: string;
|
|
1172
|
+
} | {
|
|
1173
|
+
readonly _tag: "Native";
|
|
1174
|
+
readonly message: string;
|
|
1175
|
+
readonly status?: number;
|
|
1176
|
+
} | {
|
|
1177
|
+
readonly _tag: "IceFailed";
|
|
1178
|
+
readonly message: string;
|
|
1179
|
+
readonly pairs: number;
|
|
1180
|
+
readonly candidateTypes: readonly string[];
|
|
1181
|
+
} | {
|
|
1182
|
+
readonly _tag: "TransportFailed";
|
|
1183
|
+
readonly message: string;
|
|
1184
|
+
readonly pairs: number;
|
|
1185
|
+
} | {
|
|
1186
|
+
readonly _tag: "ClipEnded";
|
|
1187
|
+
readonly message: string;
|
|
1188
|
+
readonly clipId: string;
|
|
1189
|
+
readonly lifecycle: "clip_failed" | "clip_popped";
|
|
1190
|
+
readonly transportGeneration: string;
|
|
1191
|
+
};
|
|
1192
|
+
readonly context: {
|
|
1193
|
+
readonly operation?: string;
|
|
1194
|
+
readonly requestId?: string;
|
|
1195
|
+
readonly sessionId?: string;
|
|
1196
|
+
readonly generation?: string;
|
|
1197
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
1198
|
+
};
|
|
1199
|
+
}, unknown, never, never>, never, never>;
|
|
1200
|
+
/** A `CommandFailure` as its diagnostic JSON. */
|
|
1201
|
+
export declare const CommandFailureFromJson: Schema.decodeTo<Schema.declare<CommandFailure, CommandFailure>, Schema.Codec<{
|
|
1202
|
+
readonly _tag: "CommandFailure";
|
|
1203
|
+
readonly message: string;
|
|
1204
|
+
readonly reason: {
|
|
1205
|
+
readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
|
|
1206
|
+
readonly message: string;
|
|
1207
|
+
} | {
|
|
1208
|
+
readonly _tag: "Http";
|
|
1209
|
+
readonly message: string;
|
|
1210
|
+
readonly status?: number;
|
|
1211
|
+
readonly retryAfterMillis?: number;
|
|
1212
|
+
} | {
|
|
1213
|
+
readonly _tag: "RecorderDisabled" | "Remote";
|
|
1214
|
+
readonly message: string;
|
|
1215
|
+
readonly remoteCode?: string;
|
|
1216
|
+
} | {
|
|
1217
|
+
readonly _tag: "Native";
|
|
1218
|
+
readonly message: string;
|
|
1219
|
+
readonly status?: number;
|
|
1220
|
+
} | {
|
|
1221
|
+
readonly _tag: "IceFailed";
|
|
1222
|
+
readonly message: string;
|
|
1223
|
+
readonly pairs: number;
|
|
1224
|
+
readonly candidateTypes: readonly string[];
|
|
1225
|
+
} | {
|
|
1226
|
+
readonly _tag: "TransportFailed";
|
|
1227
|
+
readonly message: string;
|
|
1228
|
+
readonly pairs: number;
|
|
1229
|
+
} | {
|
|
1230
|
+
readonly _tag: "ClipEnded";
|
|
1231
|
+
readonly message: string;
|
|
1232
|
+
readonly clipId: string;
|
|
1233
|
+
readonly lifecycle: "clip_failed" | "clip_popped";
|
|
1234
|
+
readonly transportGeneration: string;
|
|
1235
|
+
};
|
|
1236
|
+
readonly context: {
|
|
1237
|
+
readonly operation?: string;
|
|
1238
|
+
readonly requestId?: string;
|
|
1239
|
+
readonly sessionId?: string;
|
|
1240
|
+
readonly generation?: string;
|
|
1241
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
1242
|
+
};
|
|
1243
|
+
}, unknown, never, never>, never, never>;
|
|
1244
|
+
/** A `PolicyFailure` as its diagnostic JSON. */
|
|
1245
|
+
export declare const PolicyFailureFromJson: Schema.decodeTo<Schema.declare<PolicyFailure, PolicyFailure>, Schema.Codec<{
|
|
1246
|
+
readonly _tag: "PolicyFailure";
|
|
1247
|
+
readonly message: string;
|
|
1248
|
+
readonly reason: {
|
|
1249
|
+
readonly _tag: "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ContinuationUnavailable" | "IdentityExhausted" | "InvalidRequest" | "NotFound" | "OwnerConflict" | "PositionConflict" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "SubmissionCapacity";
|
|
1250
|
+
readonly message: string;
|
|
1251
|
+
} | {
|
|
1252
|
+
readonly _tag: "Missing";
|
|
1253
|
+
readonly message: string;
|
|
1254
|
+
readonly purpose: "anchor" | "continuation" | "session_anchor";
|
|
1255
|
+
} | {
|
|
1256
|
+
readonly _tag: "Sequence";
|
|
1257
|
+
readonly message: string;
|
|
1258
|
+
readonly sequenceId: string;
|
|
1259
|
+
readonly code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
|
|
1260
|
+
};
|
|
1261
|
+
readonly context: {
|
|
1262
|
+
readonly operation?: string;
|
|
1263
|
+
readonly requestId?: string;
|
|
1264
|
+
readonly sessionId?: string;
|
|
1265
|
+
readonly generation?: string;
|
|
1266
|
+
readonly outcome?: "not-submitted" | "replied" | "unknown";
|
|
1267
|
+
};
|
|
1268
|
+
}, unknown, never, never>, never, never>;
|
|
1269
|
+
/** Any failure this client raises. Each class keeps its own `_tag`. */
|
|
1270
|
+
export type ReactorFailure = ReactorError | CommandFailure | AcquisitionFailure | PolicyFailure;
|
|
1271
|
+
/**
|
|
1272
|
+
* Whether `u` is one of the client's failures. A passthrough that re-raises a
|
|
1273
|
+
* known failure uses this guard or a class's `is`, never `instanceof
|
|
1274
|
+
* ReactorError`, so the evidence a class carries (the dispatch outcome,
|
|
1275
|
+
* `AcquisitionFailure.cleanup`) is kept instead of re-wrapped.
|
|
1276
|
+
*/
|
|
1277
|
+
export declare const isReactorFailure: (u: unknown) => u is ReactorFailure;
|
|
1278
|
+
/**
|
|
1279
|
+
* Runs a synchronous parser or check that rejects by throwing a ReactorError,
|
|
1280
|
+
* and returns that rejection as the Result's failure. Anything else it throws
|
|
1281
|
+
* is a bug and propagates, so it stays a defect rather than becoming a typed
|
|
1282
|
+
* failure.
|
|
1283
|
+
*/
|
|
1284
|
+
export declare const parse: <A>(evaluate: () => A) => Result.Result<A, ReactorError>;
|
|
1285
|
+
/** `parse`, lifted with `Effect.fromResult`: a rejection fails it and a bug is a defect. */
|
|
1286
|
+
export declare const parsed: <A>(evaluate: () => A) => Effect.Effect<A, ReactorError>;
|
|
1287
|
+
/**
|
|
1288
|
+
* A rejected caller input: `InvalidInput`, never submitted, whatever category
|
|
1289
|
+
* the parser that rejected it uses for remote data.
|
|
1290
|
+
*/
|
|
1291
|
+
export declare const invalidInput: (error: ReactorError, operation?: string) => ReactorError;
|
|
1292
|
+
/** `parsed` for caller input: a rejection is `invalidInput`. */
|
|
1293
|
+
export declare const parsedInput: <A>(evaluate: () => A, operation?: string) => Effect.Effect<A, ReactorError>;
|
|
1294
|
+
/**
|
|
1295
|
+
* A platform call's expected exception (a DOMException, a rejected browser
|
|
1296
|
+
* promise, a native library call), as a failure of the category `code`; the
|
|
1297
|
+
* exception stays in the inspection-only `detail`. Parsers and checks use
|
|
1298
|
+
* `parse` instead, so a bug in them stays a defect.
|
|
1299
|
+
*/
|
|
1300
|
+
export declare const errorOf: (cause: unknown, code: MessageCode, operation?: string) => ReactorError;
|
|
86
1301
|
export declare const positiveLimit: (value: number, name: string, maximum?: number) => number;
|
|
87
1302
|
export {};
|
|
88
1303
|
//# sourceMappingURL=errors.d.ts.map
|