reactor-effect-client 0.2.0 → 0.3.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.
Files changed (219) hide show
  1. package/README.md +66 -6
  2. package/dist/FetchHttp.js +1 -1
  3. package/dist/FetchHttp.js.map +1 -1
  4. package/dist/PeerFactory.d.ts +13 -2
  5. package/dist/PeerFactory.d.ts.map +1 -1
  6. package/dist/PeerFactory.js.map +1 -1
  7. package/dist/PeerTypes.d.ts +2 -2
  8. package/dist/PeerTypes.d.ts.map +1 -1
  9. package/dist/Sequence.d.ts +18 -14
  10. package/dist/Sequence.d.ts.map +1 -1
  11. package/dist/Sequence.js +117 -122
  12. package/dist/Sequence.js.map +1 -1
  13. package/dist/SessionTypes.d.ts +172 -15
  14. package/dist/SessionTypes.d.ts.map +1 -1
  15. package/dist/SessionTypes.js +18 -1
  16. package/dist/SessionTypes.js.map +1 -1
  17. package/dist/bytes.js +3 -3
  18. package/dist/bytes.js.map +1 -1
  19. package/dist/contract.d.ts +120 -29
  20. package/dist/contract.d.ts.map +1 -1
  21. package/dist/contract.js +105 -73
  22. package/dist/contract.js.map +1 -1
  23. package/dist/coordinator/_internal/client.d.ts +111 -17
  24. package/dist/coordinator/_internal/client.d.ts.map +1 -1
  25. package/dist/coordinator/_internal/client.js +187 -74
  26. package/dist/coordinator/_internal/client.js.map +1 -1
  27. package/dist/coordinator/_internal/recording.d.ts +33 -0
  28. package/dist/coordinator/_internal/recording.d.ts.map +1 -0
  29. package/dist/coordinator/_internal/recording.js +123 -0
  30. package/dist/coordinator/_internal/recording.js.map +1 -0
  31. package/dist/coordinator/_internal/response.d.ts.map +1 -1
  32. package/dist/coordinator/_internal/response.js +5 -7
  33. package/dist/coordinator/_internal/response.js.map +1 -1
  34. package/dist/coordinator/_internal/schemas.d.ts +40 -6
  35. package/dist/coordinator/_internal/schemas.d.ts.map +1 -1
  36. package/dist/coordinator/_internal/schemas.js +94 -64
  37. package/dist/coordinator/_internal/schemas.js.map +1 -1
  38. package/dist/coordinator/index.d.ts +14 -2
  39. package/dist/coordinator/index.d.ts.map +1 -1
  40. package/dist/coordinator/index.js +14 -18
  41. package/dist/coordinator/index.js.map +1 -1
  42. package/dist/correlation.d.ts +15 -0
  43. package/dist/correlation.d.ts.map +1 -1
  44. package/dist/correlation.js +26 -8
  45. package/dist/correlation.js.map +1 -1
  46. package/dist/duration.d.ts +25 -0
  47. package/dist/duration.d.ts.map +1 -0
  48. package/dist/duration.js +47 -0
  49. package/dist/duration.js.map +1 -0
  50. package/dist/errors.d.ts +1264 -49
  51. package/dist/errors.d.ts.map +1 -1
  52. package/dist/errors.js +698 -46
  53. package/dist/errors.js.map +1 -1
  54. package/dist/h3/_internal/client.d.ts +2 -2
  55. package/dist/h3/_internal/client.d.ts.map +1 -1
  56. package/dist/h3/_internal/client.js +280 -146
  57. package/dist/h3/_internal/client.js.map +1 -1
  58. package/dist/h3/_internal/contracts.d.ts.map +1 -1
  59. package/dist/h3/_internal/contracts.js +2 -2
  60. package/dist/h3/_internal/contracts.js.map +1 -1
  61. package/dist/h3/_internal/deployment.d.ts.map +1 -1
  62. package/dist/h3/_internal/deployment.js +5 -4
  63. package/dist/h3/_internal/deployment.js.map +1 -1
  64. package/dist/h3/_internal/evidence.js +1 -1
  65. package/dist/h3/_internal/evidence.js.map +1 -1
  66. package/dist/h3/_internal/operations.d.ts +58 -0
  67. package/dist/h3/_internal/operations.d.ts.map +1 -0
  68. package/dist/h3/_internal/operations.js +268 -0
  69. package/dist/h3/_internal/operations.js.map +1 -0
  70. package/dist/h3/_internal/references.d.ts.map +1 -1
  71. package/dist/h3/_internal/references.js +3 -8
  72. package/dist/h3/_internal/references.js.map +1 -1
  73. package/dist/h3/_internal/request.js +1 -1
  74. package/dist/h3/_internal/request.js.map +1 -1
  75. package/dist/h3/_internal/retained.d.ts +22 -0
  76. package/dist/h3/_internal/retained.d.ts.map +1 -0
  77. package/dist/h3/_internal/retained.js +89 -0
  78. package/dist/h3/_internal/retained.js.map +1 -0
  79. package/dist/h3/_internal/state.d.ts +15 -1
  80. package/dist/h3/_internal/state.d.ts.map +1 -1
  81. package/dist/h3/_internal/state.js +69 -29
  82. package/dist/h3/_internal/state.js.map +1 -1
  83. package/dist/h3/index.d.ts +1 -1
  84. package/dist/h3/index.d.ts.map +1 -1
  85. package/dist/h3/messages.d.ts +118 -109
  86. package/dist/h3/messages.d.ts.map +1 -1
  87. package/dist/h3/messages.js +73 -51
  88. package/dist/h3/messages.js.map +1 -1
  89. package/dist/h3/types.d.ts +109 -13
  90. package/dist/h3/types.d.ts.map +1 -1
  91. package/dist/host.d.ts +6 -6
  92. package/dist/host.d.ts.map +1 -1
  93. package/dist/host.js +4 -5
  94. package/dist/host.js.map +1 -1
  95. package/dist/index.d.ts +11 -5
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +5 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/json.d.ts +13 -6
  100. package/dist/json.d.ts.map +1 -1
  101. package/dist/json.js +34 -14
  102. package/dist/json.js.map +1 -1
  103. package/dist/media-stream.d.ts.map +1 -1
  104. package/dist/media-stream.js +9 -11
  105. package/dist/media-stream.js.map +1 -1
  106. package/dist/observation.d.ts +9 -0
  107. package/dist/observation.d.ts.map +1 -1
  108. package/dist/observation.js +20 -18
  109. package/dist/observation.js.map +1 -1
  110. package/dist/orchestration/h3-source.d.ts +32 -4
  111. package/dist/orchestration/h3-source.d.ts.map +1 -1
  112. package/dist/orchestration/h3-source.js +47 -14
  113. package/dist/orchestration/h3-source.js.map +1 -1
  114. package/dist/orchestration/index.d.ts +9 -6
  115. package/dist/orchestration/index.d.ts.map +1 -1
  116. package/dist/orchestration/index.js +5 -3
  117. package/dist/orchestration/index.js.map +1 -1
  118. package/dist/orchestration/media-buffer.d.ts +12 -4
  119. package/dist/orchestration/media-buffer.d.ts.map +1 -1
  120. package/dist/orchestration/media-buffer.js +31 -11
  121. package/dist/orchestration/media-buffer.js.map +1 -1
  122. package/dist/orchestration/open-h3.d.ts +65 -0
  123. package/dist/orchestration/open-h3.d.ts.map +1 -0
  124. package/dist/orchestration/open-h3.js +65 -0
  125. package/dist/orchestration/open-h3.js.map +1 -0
  126. package/dist/orchestration/references.d.ts +5 -1
  127. package/dist/orchestration/references.d.ts.map +1 -1
  128. package/dist/orchestration/references.js +37 -34
  129. package/dist/orchestration/references.js.map +1 -1
  130. package/dist/orchestration/renewal-state.js +1 -1
  131. package/dist/orchestration/renewal-state.js.map +1 -1
  132. package/dist/orchestration/renewal.d.ts +64 -64
  133. package/dist/orchestration/renewal.d.ts.map +1 -1
  134. package/dist/orchestration/renewal.js +149 -88
  135. package/dist/orchestration/renewal.js.map +1 -1
  136. package/dist/orchestration/request.d.ts +11 -12
  137. package/dist/orchestration/request.d.ts.map +1 -1
  138. package/dist/orchestration/request.js +63 -66
  139. package/dist/orchestration/request.js.map +1 -1
  140. package/dist/orchestration/routing.d.ts.map +1 -1
  141. package/dist/orchestration/routing.js +17 -14
  142. package/dist/orchestration/routing.js.map +1 -1
  143. package/dist/orchestration/source-slot.d.ts +15 -5
  144. package/dist/orchestration/source-slot.d.ts.map +1 -1
  145. package/dist/orchestration/source-slot.js +40 -21
  146. package/dist/orchestration/source-slot.js.map +1 -1
  147. package/dist/orchestration/types.d.ts +594 -39
  148. package/dist/orchestration/types.d.ts.map +1 -1
  149. package/dist/orchestration/types.js +20 -0
  150. package/dist/orchestration/types.js.map +1 -1
  151. package/dist/protobuf.js +2 -2
  152. package/dist/protobuf.js.map +1 -1
  153. package/dist/session/_internal/acquire.d.ts +4 -6
  154. package/dist/session/_internal/acquire.d.ts.map +1 -1
  155. package/dist/session/_internal/acquire.js +40 -50
  156. package/dist/session/_internal/acquire.js.map +1 -1
  157. package/dist/session/_internal/cleanup.d.ts +2 -1
  158. package/dist/session/_internal/cleanup.d.ts.map +1 -1
  159. package/dist/session/_internal/cleanup.js +23 -15
  160. package/dist/session/_internal/cleanup.js.map +1 -1
  161. package/dist/session/_internal/lifecycle.d.ts +5 -0
  162. package/dist/session/_internal/lifecycle.d.ts.map +1 -1
  163. package/dist/session/_internal/lifecycle.js +16 -6
  164. package/dist/session/_internal/lifecycle.js.map +1 -1
  165. package/dist/session/_internal/remote.d.ts.map +1 -1
  166. package/dist/session/_internal/remote.js +16 -7
  167. package/dist/session/_internal/remote.js.map +1 -1
  168. package/dist/session/_internal/uploads.d.ts +4 -1
  169. package/dist/session/_internal/uploads.d.ts.map +1 -1
  170. package/dist/session/_internal/uploads.js +25 -27
  171. package/dist/session/_internal/uploads.js.map +1 -1
  172. package/dist/session/commands.d.ts +1 -21
  173. package/dist/session/commands.d.ts.map +1 -1
  174. package/dist/session/commands.js +1 -12
  175. package/dist/session/commands.js.map +1 -1
  176. package/dist/session/files.d.ts +10 -2
  177. package/dist/session/files.d.ts.map +1 -1
  178. package/dist/session/files.js +11 -16
  179. package/dist/session/files.js.map +1 -1
  180. package/dist/session/index.d.ts +6 -6
  181. package/dist/session/index.d.ts.map +1 -1
  182. package/dist/session/index.js.map +1 -1
  183. package/dist/session/media.d.ts +53 -6
  184. package/dist/session/media.d.ts.map +1 -1
  185. package/dist/session/recorder.d.ts +24 -0
  186. package/dist/session/recorder.d.ts.map +1 -0
  187. package/dist/session/recorder.js +19 -0
  188. package/dist/session/recorder.js.map +1 -0
  189. package/dist/session.d.ts +5 -4
  190. package/dist/session.d.ts.map +1 -1
  191. package/dist/session.js +213 -110
  192. package/dist/session.js.map +1 -1
  193. package/dist/simulation/_internal/source.d.ts.map +1 -1
  194. package/dist/simulation/_internal/source.js +57 -48
  195. package/dist/simulation/_internal/source.js.map +1 -1
  196. package/dist/simulation/index.d.ts +4 -5
  197. package/dist/simulation/index.d.ts.map +1 -1
  198. package/dist/simulation/index.js +3 -4
  199. package/dist/simulation/index.js.map +1 -1
  200. package/dist/simulation/types.d.ts +16 -2
  201. package/dist/simulation/types.d.ts.map +1 -1
  202. package/dist/stats.d.ts +19 -0
  203. package/dist/stats.d.ts.map +1 -1
  204. package/dist/stats.js +79 -8
  205. package/dist/stats.js.map +1 -1
  206. package/package.json +5 -4
  207. package/notices/owned-webrtc/Effect-MIT.txt +0 -21
  208. package/notices/owned-webrtc/IETF.txt +0 -43
  209. package/notices/owned-webrtc/LICENSE +0 -21
  210. package/notices/owned-webrtc/UPSTREAM.md +0 -20
  211. package/notices/owned-webrtc/VP8-ADAPTATION.md +0 -32
  212. package/notices/owned-webrtc/VP8-AUTHORS.txt +0 -42
  213. package/notices/owned-webrtc/VP8-LICENSE.txt +0 -25
  214. package/notices/owned-webrtc/VP8-PATENTS.txt +0 -21
  215. package/notices/owned-webrtc/Werift-MIT.txt +0 -21
  216. package/notices/owned-webrtc/libvpx-v1.12.0-LICENSE.txt +0 -28
  217. package/notices/owned-webrtc/libvpx-v1.12.0-PATENTS.txt +0 -22
  218. package/notices/owned-webrtc/rfc3711.txt +0 -3139
  219. package/notices/owned-webrtc/str0m-MIT.txt +0 -7
@@ -1,13 +1,16 @@
1
1
  import * as Context from "effect/Context";
2
2
  import * as Data from "effect/Data";
3
+ import type * as Duration from "effect/Duration";
3
4
  import type * as Effect from "effect/Effect";
4
5
  import type * as Option from "effect/Option";
5
6
  import type * as Result from "effect/Result";
7
+ import * as Schema from "effect/Schema";
8
+ import type * as Scope from "effect/Scope";
6
9
  import type * as Stream from "effect/Stream";
7
- import type { ReactorError } from "../errors.js";
10
+ import type { ReactorError, ReactorFailure } from "../errors.js";
11
+ import type { ObservationOptions } from "../observation.js";
8
12
  import type { Clip } from "../h3/messages.js";
9
- import type { CommandFailure } from "../session/commands.js";
10
- import type { CloseReport } from "../SessionTypes.js";
13
+ import type { CommandFailure, PolicyFailure } from "../errors.js";
11
14
  import type { AudioFrame, VideoFrame, MediaPressure } from "../session/media.js";
12
15
  import type { Submission } from "../Submission.js";
13
16
  import type { Affinity } from "../Sequence.js";
@@ -131,7 +134,7 @@ export type EngineEvent = {
131
134
  readonly at: number;
132
135
  } | {
133
136
  readonly _tag: "SessionFailed";
134
- readonly failure: ReactorError;
137
+ readonly failure: ReactorFailure;
135
138
  };
136
139
  export declare const EngineEvent: {
137
140
  readonly $is: <Tag extends "Building" | "Ended" | "Failed" | "Queued" | "Ready" | "SessionFailed" | "Started" | "Starved">(tag: Tag) => (u: unknown) => u is Extract<{
@@ -180,7 +183,7 @@ export declare const EngineEvent: {
180
183
  readonly _tag: Tag;
181
184
  }> | Extract<{
182
185
  readonly _tag: "SessionFailed";
183
- readonly failure: ReactorError;
186
+ readonly failure: ReactorFailure;
184
187
  }, {
185
188
  readonly _tag: Tag;
186
189
  }>;
@@ -221,7 +224,7 @@ export declare const EngineEvent: {
221
224
  }, "_tag">;
222
225
  readonly SessionFailed: Data.TaggedEnum.ConstructorFrom<{
223
226
  readonly _tag: "SessionFailed";
224
- readonly failure: ReactorError;
227
+ readonly failure: ReactorFailure;
225
228
  }, "_tag">;
226
229
  readonly Started: Data.TaggedEnum.ConstructorFrom<{
227
230
  readonly _tag: "Started";
@@ -235,23 +238,66 @@ export declare const EngineEvent: {
235
238
  }, "_tag">;
236
239
  };
237
240
  export type RemoveOutcome = "unstarted" | "in_flight" | "generation" | "ready";
238
- export type EnqueueError = CommandFailure;
239
- export type CommandError = CommandFailure;
241
+ /**
242
+ * What an orchestration command can fail with: a dispatched or undispatched
243
+ * command's `CommandFailure`, or a local `PolicyFailure` refusal. Both carry
244
+ * `context.outcome`, so a caller reads the dispatch evidence without narrowing.
245
+ */
246
+ export type EngineError = CommandFailure | PolicyFailure;
247
+ /**
248
+ * An engine's state and every event after it, with no gap between them: the
249
+ * subscription is acquired before the state is read. An event may repeat what
250
+ * `initial` already reflects, so apply events idempotently by `clipId`. The
251
+ * stream is bounded per observer like any observation; after an `Overflow`,
252
+ * observe again for a fresh state and subscription.
253
+ */
254
+ export interface EngineObservation {
255
+ readonly initial: EngineState;
256
+ readonly events: Stream.Stream<EngineEvent, ReactorError>;
257
+ }
258
+ export type ObserveEngine = (options?: ObservationOptions) => Effect.Effect<EngineObservation, ReactorError, Scope.Scope>;
240
259
  export interface EngineShape {
241
- readonly prepare: (request: ClipRequest) => Effect.Effect<Submission<ClipId, CommandFailure>, CommandFailure>;
242
- readonly enqueue: (request: ClipRequest) => Effect.Effect<ClipId, CommandFailure>;
260
+ readonly prepare: (request: ClipRequest) => Effect.Effect<Submission<ClipId, EngineError>, EngineError>;
261
+ readonly enqueue: (request: ClipRequest) => Effect.Effect<ClipId, EngineError>;
243
262
  readonly state: Effect.Effect<EngineState>;
263
+ /** Later events only, subscribed when the stream runs; use `observe` to pair them with a state. */
244
264
  readonly events: Stream.Stream<EngineEvent, ReactorError>;
245
- readonly failure: Effect.Effect<ReactorError>;
246
- readonly setAutoplay: (enabled: boolean) => Effect.Effect<void, CommandFailure>;
247
- readonly pauseAndStop: Effect.Effect<void, CommandFailure>;
248
- readonly remove: (id: ClipId) => Effect.Effect<RemoveOutcome, CommandFailure>;
249
- readonly move: (id: ClipId, position: number, queue: "generation" | "playout") => Effect.Effect<void, CommandFailure>;
250
- readonly setCanvas: (canvas: Canvas) => Effect.Effect<void, CommandFailure>;
265
+ readonly observe: ObserveEngine;
266
+ /**
267
+ * The terminal failure, as it was raised: a session's `ReactorError`, a
268
+ * replacement's `AcquisitionFailure` with its cleanup, or the failed command.
269
+ */
270
+ readonly failure: Effect.Effect<ReactorFailure>;
271
+ readonly setAutoplay: (enabled: boolean) => Effect.Effect<void, EngineError>;
272
+ readonly pauseAndStop: Effect.Effect<void, EngineError>;
273
+ readonly remove: (id: ClipId) => Effect.Effect<RemoveOutcome, EngineError>;
274
+ readonly move: (id: ClipId, position: number, queue: "generation" | "playout") => Effect.Effect<void, EngineError>;
275
+ readonly setCanvas: (canvas: Canvas) => Effect.Effect<void, EngineError>;
251
276
  }
277
+ /**
278
+ * An orchestration's recovering media output, one logical track per kind that
279
+ * continues across reconnects and source replacements, and ends with the
280
+ * orchestration's terminal failure.
281
+ *
282
+ * - Consumption is mandatory: while it runs, the orchestration buffers what the
283
+ * reader has not taken (by default 96 video frames and 192,000 audio
284
+ * samples; see `maxQueuedVideoFrames` and `maxQueuedAudioSamples`), and an
285
+ * output that stays undrained past that fails the orchestration with
286
+ * `Overflow`. That failure is terminal.
287
+ * - Each output has one reader at a time. A second concurrent reader fails
288
+ * with `AlreadyReading` rather than silently splitting the frames; a reader
289
+ * that ends releases the output, and a later reader resumes from what is
290
+ * retained. A preview that wants only the newest frame derives it per
291
+ * consumer with `Stream.buffer({ capacity: 1, strategy: "sliding" })`.
292
+ * - `pressure` reports the loss of the logical output: `droppedVideo`,
293
+ * `droppedAudio` and `readerOverflows` accumulate across generations and
294
+ * across source replacements, counting each source only while it fed this
295
+ * output. A total that cannot be read fails `pressure` with `InvalidState`
296
+ * rather than reporting zero.
297
+ */
252
298
  export interface MediaShape {
253
- readonly video: Stream.Stream<VideoFrame, ReactorError>;
254
- readonly audio: Stream.Stream<AudioFrame, ReactorError>;
299
+ readonly video: Stream.Stream<VideoFrame, ReactorFailure>;
300
+ readonly audio: Stream.Stream<AudioFrame, ReactorFailure>;
255
301
  readonly pressure: Effect.Effect<MediaPressure, ReactorError>;
256
302
  readonly videoFramesPerSecond: number;
257
303
  }
@@ -262,27 +308,531 @@ export type MediaState = {
262
308
  } | {
263
309
  readonly _tag: "Recovering";
264
310
  readonly sessionId: string;
265
- readonly cause: ReactorError;
311
+ readonly cause: ReactorFailure;
266
312
  } | {
267
313
  readonly _tag: "Failed";
268
- readonly cause: ReactorError;
314
+ readonly cause: ReactorFailure;
269
315
  } | {
270
316
  readonly _tag: "Closed";
271
317
  };
272
- export interface MediaSource extends MediaShape {
318
+ export interface MediaTail {
319
+ readonly video: {
320
+ readonly framesPerSecond: number;
321
+ readonly expectedFrames: number;
322
+ readonly receivedFrames: number;
323
+ readonly status: "not-started" | "count-complete" | "incomplete";
324
+ };
325
+ readonly audio: {
326
+ readonly receivedSamples: number;
327
+ readonly status: "unverified";
328
+ };
329
+ readonly sourceDrops: {
330
+ readonly video: bigint | null;
331
+ readonly audio: bigint | null;
332
+ };
333
+ readonly forwarded: {
334
+ readonly queuedVideoFrames: number;
335
+ readonly queuedAudioSamples: number;
336
+ };
337
+ }
338
+ export type Renewal = {
339
+ readonly _tag: "Opened";
340
+ readonly sessionId: string;
341
+ readonly lifetime: Duration.Duration;
342
+ } | {
343
+ readonly _tag: "Prepared";
344
+ } | {
345
+ readonly _tag: "SetupFailed";
346
+ readonly reason: string;
347
+ readonly consecutive: number;
348
+ } | {
349
+ readonly _tag: "Recovering";
350
+ readonly sessionId: string;
351
+ readonly reason: string;
352
+ } | {
353
+ readonly _tag: "Reconnected";
354
+ readonly sessionId: string;
355
+ readonly generation: bigint;
356
+ } | {
357
+ readonly _tag: "Switched";
358
+ readonly sessionId: string;
359
+ readonly ageSeconds: number;
360
+ readonly tail: MediaTail;
361
+ } | {
362
+ readonly _tag: "Replaced";
363
+ readonly reason: string;
364
+ readonly lostClips: number;
365
+ readonly sessionId: string;
366
+ readonly ageSeconds: number;
367
+ readonly tail: MediaTail;
368
+ } | {
369
+ readonly _tag: "Failed";
370
+ readonly reason: string;
371
+ };
372
+ /**
373
+ * One handle's observation, in the order its changes happened: engine events,
374
+ * renewal events and media-state transitions from a single stream, so a
375
+ * `Replaced` follows the `Failed` events of the clips it lost and no media
376
+ * state arrives out of order.
377
+ */
378
+ export type HandleEvent = {
379
+ readonly _tag: "Engine";
380
+ readonly event: EngineEvent;
381
+ } | {
382
+ readonly _tag: "Renewal";
383
+ readonly event: Renewal;
384
+ } | {
385
+ readonly _tag: "Media";
386
+ readonly state: MediaState;
387
+ };
388
+ /**
389
+ * The handle's current engine and media state, and every handle event after
390
+ * it. The subscription is acquired before the state is read, so no event falls
391
+ * between them; an event may repeat what `initial` already reflects.
392
+ */
393
+ export interface HandleObservation {
394
+ readonly initial: {
395
+ readonly engine: EngineState;
396
+ readonly media: MediaState;
397
+ };
398
+ readonly events: Stream.Stream<HandleEvent, ReactorError>;
399
+ }
400
+ export interface MediaSource {
401
+ readonly video: Stream.Stream<VideoFrame, ReactorError>;
402
+ readonly audio: Stream.Stream<AudioFrame, ReactorError>;
403
+ readonly pressure: Effect.Effect<MediaPressure, ReactorError>;
404
+ readonly videoFramesPerSecond: number;
273
405
  readonly generation: bigint;
274
406
  }
275
- export interface PolicyCleanup {
276
- readonly operation: string;
277
- readonly result: Result.Result<void, CommandFailure>;
407
+ export declare const PolicyCleanup: Schema.Struct<{
408
+ readonly operation: Schema.String;
409
+ readonly result: Schema.Result<Schema.Void, Schema.Union<readonly [Schema.decodeTo<Schema.declare<CommandFailure, CommandFailure>, Schema.Codec<{
410
+ readonly _tag: "CommandFailure";
411
+ readonly message: string;
412
+ readonly reason: {
413
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
414
+ readonly message: string;
415
+ } | {
416
+ readonly _tag: "Http";
417
+ readonly message: string;
418
+ readonly status?: number;
419
+ readonly retryAfterMillis?: number;
420
+ } | {
421
+ readonly _tag: "RecorderDisabled" | "Remote";
422
+ readonly message: string;
423
+ readonly remoteCode?: string;
424
+ } | {
425
+ readonly _tag: "Native";
426
+ readonly message: string;
427
+ readonly status?: number;
428
+ } | {
429
+ readonly _tag: "IceFailed";
430
+ readonly message: string;
431
+ readonly pairs: number;
432
+ readonly candidateTypes: readonly string[];
433
+ } | {
434
+ readonly _tag: "TransportFailed";
435
+ readonly message: string;
436
+ readonly pairs: number;
437
+ } | {
438
+ readonly _tag: "ClipEnded";
439
+ readonly message: string;
440
+ readonly clipId: string;
441
+ readonly lifecycle: "clip_failed" | "clip_popped";
442
+ readonly transportGeneration: string;
443
+ };
444
+ readonly context: {
445
+ readonly operation?: string;
446
+ readonly requestId?: string;
447
+ readonly sessionId?: string;
448
+ readonly generation?: string;
449
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
450
+ };
451
+ }, unknown, never, never>, never, never>, Schema.decodeTo<Schema.declare<PolicyFailure, PolicyFailure>, Schema.Codec<{
452
+ readonly _tag: "PolicyFailure";
453
+ readonly message: string;
454
+ readonly reason: {
455
+ readonly _tag: "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ContinuationUnavailable" | "IdentityExhausted" | "InvalidRequest" | "NotFound" | "OwnerConflict" | "PositionConflict" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "SubmissionCapacity";
456
+ readonly message: string;
457
+ } | {
458
+ readonly _tag: "Missing";
459
+ readonly message: string;
460
+ readonly purpose: "anchor" | "continuation" | "session_anchor";
461
+ } | {
462
+ readonly _tag: "Sequence";
463
+ readonly message: string;
464
+ readonly sequenceId: string;
465
+ readonly code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
466
+ };
467
+ readonly context: {
468
+ readonly operation?: string;
469
+ readonly requestId?: string;
470
+ readonly sessionId?: string;
471
+ readonly generation?: string;
472
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
473
+ };
474
+ }, unknown, never, never>, never, never>]>>;
475
+ }>;
476
+ export interface PolicyCleanup extends Schema.Schema.Type<typeof PolicyCleanup> {
278
477
  }
279
- export interface SourceCleanup {
478
+ export declare const SourceCleanup: Schema.Struct<{
280
479
  /** The unmodified lifecycle owner's canonical cleanup evidence. */
281
- readonly lease: CloseReport;
282
- readonly policy: readonly PolicyCleanup[];
480
+ readonly lease: Schema.Struct<{
481
+ readonly localClosed: Schema.Boolean;
482
+ readonly allocation: Schema.Literals<readonly ["none", "known", "unknown"]>;
483
+ readonly ownership: Schema.optionalKey<Schema.Literals<readonly ["owned", "attached"]>>;
484
+ readonly sessionId: Schema.optionalKey<Schema.String>;
485
+ readonly remote: Schema.Struct<{
486
+ readonly attempted: Schema.Boolean;
487
+ readonly responseReceived: Schema.Boolean;
488
+ readonly confirmed: Schema.Boolean;
489
+ readonly evidence: Schema.NullOr<Schema.Literals<readonly ["absent", "terminal"]>>;
490
+ readonly deleteStatus: Schema.NullOr<Schema.Int>;
491
+ readonly state: Schema.NullOr<Schema.String>;
492
+ readonly error: Schema.optionalKey<Schema.decodeTo<Schema.declare<ReactorError, ReactorError>, Schema.Codec<{
493
+ readonly _tag: "ReactorError";
494
+ readonly message: string;
495
+ readonly reason: {
496
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
497
+ readonly message: string;
498
+ } | {
499
+ readonly _tag: "Http";
500
+ readonly message: string;
501
+ readonly status?: number;
502
+ readonly retryAfterMillis?: number;
503
+ } | {
504
+ readonly _tag: "RecorderDisabled" | "Remote";
505
+ readonly message: string;
506
+ readonly remoteCode?: string;
507
+ } | {
508
+ readonly _tag: "Native";
509
+ readonly message: string;
510
+ readonly status?: number;
511
+ } | {
512
+ readonly _tag: "IceFailed";
513
+ readonly message: string;
514
+ readonly pairs: number;
515
+ readonly candidateTypes: readonly string[];
516
+ } | {
517
+ readonly _tag: "TransportFailed";
518
+ readonly message: string;
519
+ readonly pairs: number;
520
+ } | {
521
+ readonly _tag: "ClipEnded";
522
+ readonly message: string;
523
+ readonly clipId: string;
524
+ readonly lifecycle: "clip_failed" | "clip_popped";
525
+ readonly transportGeneration: string;
526
+ };
527
+ readonly context: {
528
+ readonly operation?: string;
529
+ readonly requestId?: string;
530
+ readonly sessionId?: string;
531
+ readonly generation?: string;
532
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
533
+ };
534
+ }, unknown, never, never>, never, never>>;
535
+ }>;
536
+ readonly unpublishSubmitted: Schema.$Array<Schema.String>;
537
+ readonly unresolvedPublications: Schema.$Array<Schema.String>;
538
+ readonly localErrors: Schema.$Array<Schema.decodeTo<Schema.declare<ReactorError, ReactorError>, Schema.Codec<{
539
+ readonly _tag: "ReactorError";
540
+ readonly message: string;
541
+ readonly reason: {
542
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
543
+ readonly message: string;
544
+ } | {
545
+ readonly _tag: "Http";
546
+ readonly message: string;
547
+ readonly status?: number;
548
+ readonly retryAfterMillis?: number;
549
+ } | {
550
+ readonly _tag: "RecorderDisabled" | "Remote";
551
+ readonly message: string;
552
+ readonly remoteCode?: string;
553
+ } | {
554
+ readonly _tag: "Native";
555
+ readonly message: string;
556
+ readonly status?: number;
557
+ } | {
558
+ readonly _tag: "IceFailed";
559
+ readonly message: string;
560
+ readonly pairs: number;
561
+ readonly candidateTypes: readonly string[];
562
+ } | {
563
+ readonly _tag: "TransportFailed";
564
+ readonly message: string;
565
+ readonly pairs: number;
566
+ } | {
567
+ readonly _tag: "ClipEnded";
568
+ readonly message: string;
569
+ readonly clipId: string;
570
+ readonly lifecycle: "clip_failed" | "clip_popped";
571
+ readonly transportGeneration: string;
572
+ };
573
+ readonly context: {
574
+ readonly operation?: string;
575
+ readonly requestId?: string;
576
+ readonly sessionId?: string;
577
+ readonly generation?: string;
578
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
579
+ };
580
+ }, unknown, never, never>, never, never>>;
581
+ }>;
582
+ readonly policy: Schema.$Array<Schema.Struct<{
583
+ readonly operation: Schema.String;
584
+ readonly result: Schema.Result<Schema.Void, Schema.Union<readonly [Schema.decodeTo<Schema.declare<CommandFailure, CommandFailure>, Schema.Codec<{
585
+ readonly _tag: "CommandFailure";
586
+ readonly message: string;
587
+ readonly reason: {
588
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
589
+ readonly message: string;
590
+ } | {
591
+ readonly _tag: "Http";
592
+ readonly message: string;
593
+ readonly status?: number;
594
+ readonly retryAfterMillis?: number;
595
+ } | {
596
+ readonly _tag: "RecorderDisabled" | "Remote";
597
+ readonly message: string;
598
+ readonly remoteCode?: string;
599
+ } | {
600
+ readonly _tag: "Native";
601
+ readonly message: string;
602
+ readonly status?: number;
603
+ } | {
604
+ readonly _tag: "IceFailed";
605
+ readonly message: string;
606
+ readonly pairs: number;
607
+ readonly candidateTypes: readonly string[];
608
+ } | {
609
+ readonly _tag: "TransportFailed";
610
+ readonly message: string;
611
+ readonly pairs: number;
612
+ } | {
613
+ readonly _tag: "ClipEnded";
614
+ readonly message: string;
615
+ readonly clipId: string;
616
+ readonly lifecycle: "clip_failed" | "clip_popped";
617
+ readonly transportGeneration: string;
618
+ };
619
+ readonly context: {
620
+ readonly operation?: string;
621
+ readonly requestId?: string;
622
+ readonly sessionId?: string;
623
+ readonly generation?: string;
624
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
625
+ };
626
+ }, unknown, never, never>, never, never>, Schema.decodeTo<Schema.declare<PolicyFailure, PolicyFailure>, Schema.Codec<{
627
+ readonly _tag: "PolicyFailure";
628
+ readonly message: string;
629
+ readonly reason: {
630
+ readonly _tag: "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ContinuationUnavailable" | "IdentityExhausted" | "InvalidRequest" | "NotFound" | "OwnerConflict" | "PositionConflict" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "SubmissionCapacity";
631
+ readonly message: string;
632
+ } | {
633
+ readonly _tag: "Missing";
634
+ readonly message: string;
635
+ readonly purpose: "anchor" | "continuation" | "session_anchor";
636
+ } | {
637
+ readonly _tag: "Sequence";
638
+ readonly message: string;
639
+ readonly sequenceId: string;
640
+ readonly code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
641
+ };
642
+ readonly context: {
643
+ readonly operation?: string;
644
+ readonly requestId?: string;
645
+ readonly sessionId?: string;
646
+ readonly generation?: string;
647
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
648
+ };
649
+ }, unknown, never, never>, never, never>]>>;
650
+ }>>;
651
+ }>;
652
+ export interface SourceCleanup extends Schema.Schema.Type<typeof SourceCleanup> {
283
653
  }
284
- export interface CleanupReport {
285
- readonly sessions: readonly SourceCleanup[];
654
+ /**
655
+ * An orchestration's cleanup evidence. As a Schema it encodes for persistence
656
+ * (`Schema.toCodecJson(CleanupReport)` for JSON); its failures encode as
657
+ * diagnostic JSON, without provider text.
658
+ */
659
+ export declare const CleanupReport: Schema.Struct<{
660
+ readonly sessions: Schema.$Array<Schema.Struct<{
661
+ /** The unmodified lifecycle owner's canonical cleanup evidence. */
662
+ readonly lease: Schema.Struct<{
663
+ readonly localClosed: Schema.Boolean;
664
+ readonly allocation: Schema.Literals<readonly ["none", "known", "unknown"]>;
665
+ readonly ownership: Schema.optionalKey<Schema.Literals<readonly ["owned", "attached"]>>;
666
+ readonly sessionId: Schema.optionalKey<Schema.String>;
667
+ readonly remote: Schema.Struct<{
668
+ readonly attempted: Schema.Boolean;
669
+ readonly responseReceived: Schema.Boolean;
670
+ readonly confirmed: Schema.Boolean;
671
+ readonly evidence: Schema.NullOr<Schema.Literals<readonly ["absent", "terminal"]>>;
672
+ readonly deleteStatus: Schema.NullOr<Schema.Int>;
673
+ readonly state: Schema.NullOr<Schema.String>;
674
+ readonly error: Schema.optionalKey<Schema.decodeTo<Schema.declare<ReactorError, ReactorError>, Schema.Codec<{
675
+ readonly _tag: "ReactorError";
676
+ readonly message: string;
677
+ readonly reason: {
678
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
679
+ readonly message: string;
680
+ } | {
681
+ readonly _tag: "Http";
682
+ readonly message: string;
683
+ readonly status?: number;
684
+ readonly retryAfterMillis?: number;
685
+ } | {
686
+ readonly _tag: "RecorderDisabled" | "Remote";
687
+ readonly message: string;
688
+ readonly remoteCode?: string;
689
+ } | {
690
+ readonly _tag: "Native";
691
+ readonly message: string;
692
+ readonly status?: number;
693
+ } | {
694
+ readonly _tag: "IceFailed";
695
+ readonly message: string;
696
+ readonly pairs: number;
697
+ readonly candidateTypes: readonly string[];
698
+ } | {
699
+ readonly _tag: "TransportFailed";
700
+ readonly message: string;
701
+ readonly pairs: number;
702
+ } | {
703
+ readonly _tag: "ClipEnded";
704
+ readonly message: string;
705
+ readonly clipId: string;
706
+ readonly lifecycle: "clip_failed" | "clip_popped";
707
+ readonly transportGeneration: string;
708
+ };
709
+ readonly context: {
710
+ readonly operation?: string;
711
+ readonly requestId?: string;
712
+ readonly sessionId?: string;
713
+ readonly generation?: string;
714
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
715
+ };
716
+ }, unknown, never, never>, never, never>>;
717
+ }>;
718
+ readonly unpublishSubmitted: Schema.$Array<Schema.String>;
719
+ readonly unresolvedPublications: Schema.$Array<Schema.String>;
720
+ readonly localErrors: Schema.$Array<Schema.decodeTo<Schema.declare<ReactorError, ReactorError>, Schema.Codec<{
721
+ readonly _tag: "ReactorError";
722
+ readonly message: string;
723
+ readonly reason: {
724
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
725
+ readonly message: string;
726
+ } | {
727
+ readonly _tag: "Http";
728
+ readonly message: string;
729
+ readonly status?: number;
730
+ readonly retryAfterMillis?: number;
731
+ } | {
732
+ readonly _tag: "RecorderDisabled" | "Remote";
733
+ readonly message: string;
734
+ readonly remoteCode?: string;
735
+ } | {
736
+ readonly _tag: "Native";
737
+ readonly message: string;
738
+ readonly status?: number;
739
+ } | {
740
+ readonly _tag: "IceFailed";
741
+ readonly message: string;
742
+ readonly pairs: number;
743
+ readonly candidateTypes: readonly string[];
744
+ } | {
745
+ readonly _tag: "TransportFailed";
746
+ readonly message: string;
747
+ readonly pairs: number;
748
+ } | {
749
+ readonly _tag: "ClipEnded";
750
+ readonly message: string;
751
+ readonly clipId: string;
752
+ readonly lifecycle: "clip_failed" | "clip_popped";
753
+ readonly transportGeneration: string;
754
+ };
755
+ readonly context: {
756
+ readonly operation?: string;
757
+ readonly requestId?: string;
758
+ readonly sessionId?: string;
759
+ readonly generation?: string;
760
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
761
+ };
762
+ }, unknown, never, never>, never, never>>;
763
+ }>;
764
+ readonly policy: Schema.$Array<Schema.Struct<{
765
+ readonly operation: Schema.String;
766
+ readonly result: Schema.Result<Schema.Void, Schema.Union<readonly [Schema.decodeTo<Schema.declare<CommandFailure, CommandFailure>, Schema.Codec<{
767
+ readonly _tag: "CommandFailure";
768
+ readonly message: string;
769
+ readonly reason: {
770
+ readonly _tag: "Aborted" | "AlreadyReading" | "ChannelClosed" | "Closed" | "Disconnected" | "Indeterminate" | "InvalidInput" | "InvalidState" | "Overflow" | "Protocol" | "SdpRejected" | "Shutdown" | "TerminalSession" | "Timeout" | "UnexpectedReply" | "UnsupportedCapability" | "UnsupportedHost" | "Upload" | "VersionMismatch";
771
+ readonly message: string;
772
+ } | {
773
+ readonly _tag: "Http";
774
+ readonly message: string;
775
+ readonly status?: number;
776
+ readonly retryAfterMillis?: number;
777
+ } | {
778
+ readonly _tag: "RecorderDisabled" | "Remote";
779
+ readonly message: string;
780
+ readonly remoteCode?: string;
781
+ } | {
782
+ readonly _tag: "Native";
783
+ readonly message: string;
784
+ readonly status?: number;
785
+ } | {
786
+ readonly _tag: "IceFailed";
787
+ readonly message: string;
788
+ readonly pairs: number;
789
+ readonly candidateTypes: readonly string[];
790
+ } | {
791
+ readonly _tag: "TransportFailed";
792
+ readonly message: string;
793
+ readonly pairs: number;
794
+ } | {
795
+ readonly _tag: "ClipEnded";
796
+ readonly message: string;
797
+ readonly clipId: string;
798
+ readonly lifecycle: "clip_failed" | "clip_popped";
799
+ readonly transportGeneration: string;
800
+ };
801
+ readonly context: {
802
+ readonly operation?: string;
803
+ readonly requestId?: string;
804
+ readonly sessionId?: string;
805
+ readonly generation?: string;
806
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
807
+ };
808
+ }, unknown, never, never>, never, never>, Schema.decodeTo<Schema.declare<PolicyFailure, PolicyFailure>, Schema.Codec<{
809
+ readonly _tag: "PolicyFailure";
810
+ readonly message: string;
811
+ readonly reason: {
812
+ readonly _tag: "AnchorUnavailable" | "AnnotationCapacity" | "Busy" | "ContinuationUnavailable" | "IdentityExhausted" | "InvalidRequest" | "NotFound" | "OwnerConflict" | "PositionConflict" | "QueueChanged" | "QueueFull" | "RouteChanged" | "SessionClosed" | "SessionRecovering" | "SessionRetired" | "SubmissionCapacity";
813
+ readonly message: string;
814
+ } | {
815
+ readonly _tag: "Missing";
816
+ readonly message: string;
817
+ readonly purpose: "anchor" | "continuation" | "session_anchor";
818
+ } | {
819
+ readonly _tag: "Sequence";
820
+ readonly message: string;
821
+ readonly sequenceId: string;
822
+ readonly code: "capacity" | "indeterminate" | "member-capacity" | "member-duplicate" | "member-missing" | "missing" | "not-releasable" | "owner-mismatch" | "retired" | "sealed" | "sealing";
823
+ };
824
+ readonly context: {
825
+ readonly operation?: string;
826
+ readonly requestId?: string;
827
+ readonly sessionId?: string;
828
+ readonly generation?: string;
829
+ readonly outcome?: "not-submitted" | "replied" | "unknown";
830
+ };
831
+ }, unknown, never, never>, never, never>]>>;
832
+ }>>;
833
+ }>>;
834
+ }>;
835
+ export interface CleanupReport extends Schema.Schema.Type<typeof CleanupReport> {
286
836
  }
287
837
  /** Resolved by the one router; the full request remains a local annotation. */
288
838
  export interface RoutedRequest {
@@ -290,8 +840,8 @@ export interface RoutedRequest {
290
840
  readonly position: number | undefined;
291
841
  }
292
842
  export interface EnqueueHooks {
293
- readonly commit?: (submissionId: string) => Effect.Effect<void, CommandFailure>;
294
- readonly result?: (submissionId: string, result: Result.Result<ClipId, CommandFailure>) => Effect.Effect<void>;
843
+ readonly commit?: (submissionId: string) => Effect.Effect<void, EngineError>;
844
+ readonly result?: (submissionId: string, result: Result.Result<ClipId, EngineError>) => Effect.Effect<void>;
295
845
  }
296
846
  /**
297
847
  * One physical provider view or an explicit production simulator. It owns no
@@ -301,21 +851,24 @@ export interface Source {
301
851
  readonly id: string;
302
852
  readonly state: Effect.Effect<EngineState>;
303
853
  readonly events: Stream.Stream<EngineEvent, ReactorError>;
304
- readonly prepareRouted: (request: RoutedRequest, hooks?: EnqueueHooks) => Effect.Effect<Submission<ClipId, CommandFailure>, CommandFailure>;
854
+ readonly observe: ObserveEngine;
855
+ readonly prepareRouted: (request: RoutedRequest, hooks?: EnqueueHooks) => Effect.Effect<Submission<ClipId, EngineError>, EngineError>;
305
856
  readonly media: Effect.Effect<MediaSource, ReactorError>;
306
- readonly reconnect: Effect.Effect<void, ReactorError>;
307
- readonly refresh: Effect.Effect<void, CommandFailure>;
308
- readonly setAutoplay: (enabled: boolean) => Effect.Effect<void, CommandFailure>;
309
- readonly stop: Effect.Effect<void, CommandFailure>;
310
- readonly remove: (id: ClipId) => Effect.Effect<RemoveOutcome, CommandFailure>;
311
- readonly move: (id: ClipId, position: number) => Effect.Effect<void, CommandFailure>;
312
- readonly setCanvas: (canvas: Canvas) => Effect.Effect<void, CommandFailure>;
857
+ readonly reconnect: Effect.Effect<void, ReactorError | CommandFailure>;
858
+ readonly refresh: Effect.Effect<void, EngineError>;
859
+ readonly setAutoplay: (enabled: boolean) => Effect.Effect<void, EngineError>;
860
+ readonly stop: Effect.Effect<void, EngineError>;
861
+ readonly remove: (id: ClipId) => Effect.Effect<RemoveOutcome, EngineError>;
862
+ readonly move: (id: ClipId, position: number) => Effect.Effect<void, EngineError>;
863
+ readonly setCanvas: (canvas: Canvas) => Effect.Effect<void, EngineError>;
313
864
  readonly close: Effect.Effect<SourceCleanup>;
314
865
  }
315
866
  export interface HandleShape {
316
867
  readonly engine: EngineShape;
317
868
  readonly media: MediaShape;
318
869
  readonly mediaState: Effect.Effect<MediaState>;
870
+ /** Engine, renewal and media changes in one ordered stream, after the current state. */
871
+ readonly observe: (options?: ObservationOptions) => Effect.Effect<HandleObservation, ReactorError, Scope.Scope>;
319
872
  readonly sessionId: Effect.Effect<Option.Option<string>>;
320
873
  readonly close: Effect.Effect<CleanupReport>;
321
874
  readonly cleanup: Effect.Effect<Option.Option<CleanupReport>>;
@@ -330,5 +883,7 @@ export declare class Media extends Media_base {
330
883
  declare const Handle_base: Context.ServiceClass<Handle, "reactor-effect-client/Orchestration/Handle", HandleShape>;
331
884
  export declare class Handle extends Handle_base {
332
885
  }
886
+ /** The three services of one handle, so its facets can never come from two orchestrations. */
887
+ export declare const handleContext: (handle: HandleShape) => Context.Context<Engine | Media | Handle>;
333
888
  export {};
334
889
  //# sourceMappingURL=types.d.ts.map