reactor-effect-client 0.0.0-reserved.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +29 -0
  3. package/README.md +124 -2
  4. package/dist/FetchHttp.d.ts +9 -0
  5. package/dist/FetchHttp.d.ts.map +1 -0
  6. package/dist/FetchHttp.js +63 -0
  7. package/dist/FetchHttp.js.map +1 -0
  8. package/dist/PeerFactory.d.ts +15 -0
  9. package/dist/PeerFactory.d.ts.map +1 -0
  10. package/dist/PeerFactory.js +4 -0
  11. package/dist/PeerFactory.js.map +1 -0
  12. package/dist/PeerTypes.d.ts +64 -0
  13. package/dist/PeerTypes.d.ts.map +1 -0
  14. package/dist/PeerTypes.js +2 -0
  15. package/dist/PeerTypes.js.map +1 -0
  16. package/dist/Sequence.d.ts +81 -0
  17. package/dist/Sequence.d.ts.map +1 -0
  18. package/dist/Sequence.js +215 -0
  19. package/dist/Sequence.js.map +1 -0
  20. package/dist/SessionTypes.d.ts +164 -0
  21. package/dist/SessionTypes.d.ts.map +1 -0
  22. package/dist/SessionTypes.js +2 -0
  23. package/dist/SessionTypes.js.map +1 -0
  24. package/dist/Submission.d.ts +42 -0
  25. package/dist/Submission.d.ts.map +1 -0
  26. package/dist/Submission.js +52 -0
  27. package/dist/Submission.js.map +1 -0
  28. package/dist/bytes.d.ts +6 -0
  29. package/dist/bytes.d.ts.map +1 -0
  30. package/dist/bytes.js +32 -0
  31. package/dist/bytes.js.map +1 -0
  32. package/dist/contract.d.ts +58 -0
  33. package/dist/contract.d.ts.map +1 -0
  34. package/dist/contract.js +87 -0
  35. package/dist/contract.js.map +1 -0
  36. package/dist/coordinator/_internal/client.d.ts +127 -0
  37. package/dist/coordinator/_internal/client.d.ts.map +1 -0
  38. package/dist/coordinator/_internal/client.js +450 -0
  39. package/dist/coordinator/_internal/client.js.map +1 -0
  40. package/dist/coordinator/_internal/response.d.ts +15 -0
  41. package/dist/coordinator/_internal/response.d.ts.map +1 -0
  42. package/dist/coordinator/_internal/response.js +57 -0
  43. package/dist/coordinator/_internal/response.js.map +1 -0
  44. package/dist/coordinator/_internal/schemas.d.ts +51 -0
  45. package/dist/coordinator/_internal/schemas.d.ts.map +1 -0
  46. package/dist/coordinator/_internal/schemas.js +170 -0
  47. package/dist/coordinator/_internal/schemas.js.map +1 -0
  48. package/dist/coordinator/index.d.ts +28 -0
  49. package/dist/coordinator/index.d.ts.map +1 -0
  50. package/dist/coordinator/index.js +25 -0
  51. package/dist/coordinator/index.js.map +1 -0
  52. package/dist/correlation.d.ts +32 -0
  53. package/dist/correlation.d.ts.map +1 -0
  54. package/dist/correlation.js +113 -0
  55. package/dist/correlation.js.map +1 -0
  56. package/dist/errors.d.ts +88 -0
  57. package/dist/errors.d.ts.map +1 -0
  58. package/dist/errors.js +93 -0
  59. package/dist/errors.js.map +1 -0
  60. package/dist/h3/_internal/client.d.ts +9 -0
  61. package/dist/h3/_internal/client.d.ts.map +1 -0
  62. package/dist/h3/_internal/client.js +510 -0
  63. package/dist/h3/_internal/client.js.map +1 -0
  64. package/dist/h3/_internal/contracts.d.ts +123 -0
  65. package/dist/h3/_internal/contracts.d.ts.map +1 -0
  66. package/dist/h3/_internal/contracts.js +113 -0
  67. package/dist/h3/_internal/contracts.js.map +1 -0
  68. package/dist/h3/_internal/deployment.d.ts +8 -0
  69. package/dist/h3/_internal/deployment.d.ts.map +1 -0
  70. package/dist/h3/_internal/deployment.js +132 -0
  71. package/dist/h3/_internal/deployment.js.map +1 -0
  72. package/dist/h3/_internal/evidence.d.ts +17 -0
  73. package/dist/h3/_internal/evidence.d.ts.map +1 -0
  74. package/dist/h3/_internal/evidence.js +48 -0
  75. package/dist/h3/_internal/evidence.js.map +1 -0
  76. package/dist/h3/_internal/references.d.ts +18 -0
  77. package/dist/h3/_internal/references.d.ts.map +1 -0
  78. package/dist/h3/_internal/references.js +186 -0
  79. package/dist/h3/_internal/references.js.map +1 -0
  80. package/dist/h3/_internal/request.d.ts +16 -0
  81. package/dist/h3/_internal/request.d.ts.map +1 -0
  82. package/dist/h3/_internal/request.js +79 -0
  83. package/dist/h3/_internal/request.js.map +1 -0
  84. package/dist/h3/_internal/state.d.ts +30 -0
  85. package/dist/h3/_internal/state.d.ts.map +1 -0
  86. package/dist/h3/_internal/state.js +243 -0
  87. package/dist/h3/_internal/state.js.map +1 -0
  88. package/dist/h3/index.d.ts +10 -0
  89. package/dist/h3/index.d.ts.map +1 -0
  90. package/dist/h3/index.js +7 -0
  91. package/dist/h3/index.js.map +1 -0
  92. package/dist/h3/messages.d.ts +310 -0
  93. package/dist/h3/messages.d.ts.map +1 -0
  94. package/dist/h3/messages.js +114 -0
  95. package/dist/h3/messages.js.map +1 -0
  96. package/dist/h3/profile.d.ts +109 -0
  97. package/dist/h3/profile.d.ts.map +1 -0
  98. package/dist/h3/profile.js +70 -0
  99. package/dist/h3/profile.js.map +1 -0
  100. package/dist/h3/types.d.ts +173 -0
  101. package/dist/h3/types.d.ts.map +1 -0
  102. package/dist/h3/types.js +2 -0
  103. package/dist/h3/types.js.map +1 -0
  104. package/dist/host.d.ts +25 -0
  105. package/dist/host.d.ts.map +1 -0
  106. package/dist/host.js +20 -0
  107. package/dist/host.js.map +1 -0
  108. package/dist/index.d.ts +17 -0
  109. package/dist/index.d.ts.map +1 -0
  110. package/dist/index.js +8 -0
  111. package/dist/index.js.map +1 -0
  112. package/dist/json.d.ts +18 -0
  113. package/dist/json.d.ts.map +1 -0
  114. package/dist/json.js +123 -0
  115. package/dist/json.js.map +1 -0
  116. package/dist/media-stream.d.ts +10 -0
  117. package/dist/media-stream.d.ts.map +1 -0
  118. package/dist/media-stream.js +20 -0
  119. package/dist/media-stream.js.map +1 -0
  120. package/dist/observation.d.ts +26 -0
  121. package/dist/observation.d.ts.map +1 -0
  122. package/dist/observation.js +106 -0
  123. package/dist/observation.js.map +1 -0
  124. package/dist/orchestration/h3-source.d.ts +30 -0
  125. package/dist/orchestration/h3-source.d.ts.map +1 -0
  126. package/dist/orchestration/h3-source.js +303 -0
  127. package/dist/orchestration/h3-source.js.map +1 -0
  128. package/dist/orchestration/index.d.ts +12 -0
  129. package/dist/orchestration/index.d.ts.map +1 -0
  130. package/dist/orchestration/index.js +9 -0
  131. package/dist/orchestration/index.js.map +1 -0
  132. package/dist/orchestration/media-buffer.d.ts +23 -0
  133. package/dist/orchestration/media-buffer.d.ts.map +1 -0
  134. package/dist/orchestration/media-buffer.js +73 -0
  135. package/dist/orchestration/media-buffer.js.map +1 -0
  136. package/dist/orchestration/queries.d.ts +10 -0
  137. package/dist/orchestration/queries.d.ts.map +1 -0
  138. package/dist/orchestration/queries.js +40 -0
  139. package/dist/orchestration/queries.js.map +1 -0
  140. package/dist/orchestration/references.d.ts +16 -0
  141. package/dist/orchestration/references.d.ts.map +1 -0
  142. package/dist/orchestration/references.js +76 -0
  143. package/dist/orchestration/references.js.map +1 -0
  144. package/dist/orchestration/renewal-state.d.ts +58 -0
  145. package/dist/orchestration/renewal-state.d.ts.map +1 -0
  146. package/dist/orchestration/renewal-state.js +60 -0
  147. package/dist/orchestration/renewal-state.js.map +1 -0
  148. package/dist/orchestration/renewal.d.ts +76 -0
  149. package/dist/orchestration/renewal.d.ts.map +1 -0
  150. package/dist/orchestration/renewal.js +633 -0
  151. package/dist/orchestration/renewal.js.map +1 -0
  152. package/dist/orchestration/request.d.ts +53 -0
  153. package/dist/orchestration/request.d.ts.map +1 -0
  154. package/dist/orchestration/request.js +122 -0
  155. package/dist/orchestration/request.js.map +1 -0
  156. package/dist/orchestration/routing.d.ts +21 -0
  157. package/dist/orchestration/routing.d.ts.map +1 -0
  158. package/dist/orchestration/routing.js +90 -0
  159. package/dist/orchestration/routing.js.map +1 -0
  160. package/dist/orchestration/source-slot.d.ts +99 -0
  161. package/dist/orchestration/source-slot.d.ts.map +1 -0
  162. package/dist/orchestration/source-slot.js +206 -0
  163. package/dist/orchestration/source-slot.js.map +1 -0
  164. package/dist/orchestration/types.d.ts +334 -0
  165. package/dist/orchestration/types.d.ts.map +1 -0
  166. package/dist/orchestration/types.js +11 -0
  167. package/dist/orchestration/types.js.map +1 -0
  168. package/dist/protobuf.d.ts +63 -0
  169. package/dist/protobuf.d.ts.map +1 -0
  170. package/dist/protobuf.js +252 -0
  171. package/dist/protobuf.js.map +1 -0
  172. package/dist/session/_internal/acquire.d.ts +23 -0
  173. package/dist/session/_internal/acquire.d.ts.map +1 -0
  174. package/dist/session/_internal/acquire.js +167 -0
  175. package/dist/session/_internal/acquire.js.map +1 -0
  176. package/dist/session/_internal/cleanup.d.ts +18 -0
  177. package/dist/session/_internal/cleanup.d.ts.map +1 -0
  178. package/dist/session/_internal/cleanup.js +94 -0
  179. package/dist/session/_internal/cleanup.js.map +1 -0
  180. package/dist/session/_internal/lifecycle.d.ts +62 -0
  181. package/dist/session/_internal/lifecycle.d.ts.map +1 -0
  182. package/dist/session/_internal/lifecycle.js +132 -0
  183. package/dist/session/_internal/lifecycle.js.map +1 -0
  184. package/dist/session/_internal/remote.d.ts +28 -0
  185. package/dist/session/_internal/remote.d.ts.map +1 -0
  186. package/dist/session/_internal/remote.js +61 -0
  187. package/dist/session/_internal/remote.js.map +1 -0
  188. package/dist/session/_internal/uploads.d.ts +4 -0
  189. package/dist/session/_internal/uploads.d.ts.map +1 -0
  190. package/dist/session/_internal/uploads.js +33 -0
  191. package/dist/session/_internal/uploads.js.map +1 -0
  192. package/dist/session/commands.d.ts +22 -0
  193. package/dist/session/commands.d.ts.map +1 -0
  194. package/dist/session/commands.js +13 -0
  195. package/dist/session/commands.js.map +1 -0
  196. package/dist/session/files.d.ts +15 -0
  197. package/dist/session/files.d.ts.map +1 -0
  198. package/dist/session/files.js +54 -0
  199. package/dist/session/files.js.map +1 -0
  200. package/dist/session/index.d.ts +76 -0
  201. package/dist/session/index.d.ts.map +1 -0
  202. package/dist/session/index.js +16 -0
  203. package/dist/session/index.js.map +1 -0
  204. package/dist/session/media.d.ts +67 -0
  205. package/dist/session/media.d.ts.map +1 -0
  206. package/dist/session/media.js +2 -0
  207. package/dist/session/media.js.map +1 -0
  208. package/dist/session.d.ts +104 -0
  209. package/dist/session.d.ts.map +1 -0
  210. package/dist/session.js +872 -0
  211. package/dist/session.js.map +1 -0
  212. package/dist/simulation/_internal/source.d.ts +12 -0
  213. package/dist/simulation/_internal/source.d.ts.map +1 -0
  214. package/dist/simulation/_internal/source.js +477 -0
  215. package/dist/simulation/_internal/source.js.map +1 -0
  216. package/dist/simulation/index.d.ts +14 -0
  217. package/dist/simulation/index.d.ts.map +1 -0
  218. package/dist/simulation/index.js +13 -0
  219. package/dist/simulation/index.js.map +1 -0
  220. package/dist/simulation/types.d.ts +29 -0
  221. package/dist/simulation/types.d.ts.map +1 -0
  222. package/dist/simulation/types.js +2 -0
  223. package/dist/simulation/types.js.map +1 -0
  224. package/dist/stats.d.ts +33 -0
  225. package/dist/stats.d.ts.map +1 -0
  226. package/dist/stats.js +134 -0
  227. package/dist/stats.js.map +1 -0
  228. package/dist/testing/Faults.d.ts +4 -0
  229. package/dist/testing/Faults.d.ts.map +1 -0
  230. package/dist/testing/Faults.js +7 -0
  231. package/dist/testing/Faults.js.map +1 -0
  232. package/dist/testing/Png.d.ts +3 -0
  233. package/dist/testing/Png.d.ts.map +1 -0
  234. package/dist/testing/Png.js +68 -0
  235. package/dist/testing/Png.js.map +1 -0
  236. package/dist/testing/index.d.ts +3 -0
  237. package/dist/testing/index.d.ts.map +1 -0
  238. package/dist/testing/index.js +3 -0
  239. package/dist/testing/index.js.map +1 -0
  240. package/dist/wire.d.ts +7 -0
  241. package/dist/wire.d.ts.map +1 -0
  242. package/dist/wire.generated.d.ts +305 -0
  243. package/dist/wire.generated.d.ts.map +1 -0
  244. package/dist/wire.generated.js +1257 -0
  245. package/dist/wire.generated.js.map +1 -0
  246. package/dist/wire.js +5 -0
  247. package/dist/wire.js.map +1 -0
  248. package/notices/effect-LICENSE +21 -0
  249. package/notices/google-protobuf-LICENSE +32 -0
  250. package/notices/owned-webrtc/Effect-MIT.txt +21 -0
  251. package/notices/owned-webrtc/IETF.txt +43 -0
  252. package/notices/owned-webrtc/LICENSE +21 -0
  253. package/notices/owned-webrtc/UPSTREAM.md +20 -0
  254. package/notices/owned-webrtc/VP8-ADAPTATION.md +32 -0
  255. package/notices/owned-webrtc/VP8-AUTHORS.txt +42 -0
  256. package/notices/owned-webrtc/VP8-LICENSE.txt +25 -0
  257. package/notices/owned-webrtc/VP8-PATENTS.txt +21 -0
  258. package/notices/owned-webrtc/Werift-MIT.txt +21 -0
  259. package/notices/owned-webrtc/libvpx-v1.12.0-LICENSE.txt +28 -0
  260. package/notices/owned-webrtc/libvpx-v1.12.0-PATENTS.txt +22 -0
  261. package/notices/owned-webrtc/rfc3711.txt +3139 -0
  262. package/notices/owned-webrtc/str0m-MIT.txt +7 -0
  263. package/notices/owned-webrtc-LICENSE +21 -0
  264. package/notices/reactor-runtime-LICENSE +201 -0
  265. package/notices/reactor-runtime-NOTICE +5 -0
  266. package/notices/reactor-sdk-LICENSE +201 -0
  267. package/package.json +62 -4
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Reactor Technologies, Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,29 @@
1
+ reactor-effect-client
2
+
3
+ This independent SDK is not an official Reactor SDK.
4
+
5
+ The canonical wire definitions and selected protocol behavior derive from:
6
+ - reactor-client-sdks, commit 24f1865b48f03354b15402731f1b92e90ceee92a
7
+ - reactor-runtime, commit 8e98536c6daedca298700dc45cbb5fd9e3676f16
8
+ Their upstream licenses and notices are retained under notices/.
9
+ The repository's packages/client/wire/proto directory contains the selected
10
+ canonical protocol sources. The generated wire module also incorporates
11
+ Google's protobuf Struct descriptor; see notices/google-protobuf-LICENSE.
12
+
13
+ Session, correlation and observation implementations incorporate the
14
+ user-supplied reactor-effect-client reference source. Reusable H3, coordinator,
15
+ reference and engine behavior is extracted from the user's the-show source.
16
+ The extracted package does not depend on the-show or ship its application policy.
17
+
18
+ Effect is MIT-licensed. The package declares Effect as a peer dependency; its
19
+ license is retained in notices/effect-LICENSE. Development tooling and
20
+ node_modules are excluded from the npm package.
21
+
22
+ The reference archive's limited TypeScript WebRTC/codec implementation is not
23
+ part of this package's production graph. Retained owned-webrtc notices document
24
+ the supplied reference and vector provenance; they do not indicate that a second
25
+ WebRTC engine is shipped or supported.
26
+
27
+ Host transports are separate packages: reactor-effect-browser uses the browser's
28
+ built-in WebRTC implementation, and reactor-effect-native carries the Rust
29
+ bridge and its libwebrtc attribution.
package/README.md CHANGED
@@ -1,5 +1,127 @@
1
1
  # reactor-effect-client
2
2
 
3
- This namespace-only bootstrap package enables npm trusted publishing for [mannyc2/reactor-effect-client](https://github.com/mannyc2/reactor-effect-client).
3
+ An independent Effect SDK for scoped Reactor sessions, H3 provider state and explicit orchestration. This is the portable core of the [reactor-effect workspace](https://github.com/mannyc2/reactor-effect-client); browser and native transports are the separate `reactor-effect-browser` and `reactor-effect-native` packages.
4
4
 
5
- It contains no SDK, executable code, scripts, or dependencies. Wait for the first qualified SDK release before installing.
5
+ One canonical `Session` owns each allocation or attachment, its commands, connection generations, and cleanup evidence. Host packages select transport capabilities. H3 consumes that same session and exposes provider state. Applications opt into the separate orchestration and simulation modules when they need scheduling, sequence affinity, or renewal.
6
+
7
+ This is not an official Reactor SDK. Protocol material is attributed in [NOTICE](./NOTICE) and [`notices/`](./notices/).
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install reactor-effect-client effect@4.0.0-rc.115
13
+ ```
14
+
15
+ Effect `4.0.0-rc.115` is an exact peer dependency. Every module in this package is portable: importing it selects no host and loads no native code. Add `reactor-effect-browser` or `reactor-effect-native` for a transport.
16
+
17
+ ## Modules
18
+
19
+ | Import | Purpose |
20
+ | ------------------------------------- | ---------------------------------------------------------------------------------------------- |
21
+ | `reactor-effect-client` | Canonical `Client`, `Session`, `make`/`layer`, errors, `Coordinator`, `Peers`, and `FetchHttp` |
22
+ | `reactor-effect-client/h3` | H3 provider contract, state/queue/clip evidence, controls, and image validation |
23
+ | `reactor-effect-client/orchestration` | Scheduling, renewal, source adaptation, references, submissions, and sequences |
24
+ | `reactor-effect-client/simulation` | Production simulation source, factory, and Effect service layer |
25
+ | `reactor-effect-client/testing` | Reusable fault and PNG fixtures |
26
+ | `reactor-effect-client/wire` | Generated protocol messages and wire encoding/decoding |
27
+ | `reactor-effect-client/host` | Host transport extension surface used by the first-party host packages |
28
+
29
+ These seven paths are the complete public export map. Internal file layout does not create additional supported deep imports. `/host` is published for `reactor-effect-browser` and `reactor-effect-native`, which pin this exact version; applications compose hosts through those packages and never need it.
30
+
31
+ ## Session ownership
32
+
33
+ The root exports the `Client` service and its `make` and `layer` constructors. They require Effect HTTP and crypto services plus a `PeerFactory`. `create` allocates a remote session; `attach` identifies an existing session without taking ownership of its remote lifetime. Both return the same scope-owned `Session` contract, and `session.connect` starts WebRTC. `createConnected` and `attachConnected` combine those steps and clean up a partial acquisition before reporting failure.
34
+
35
+ Releasing an owned session attempts and independently confirms remote termination. Releasing an attached session closes its local resources and publication claims. `session.close` returns a `CloseReport` that retains local cleanup errors and remote termination uncertainty. Supervisors can inspect that evidence without allocating another owner.
36
+
37
+ ```ts
38
+ import { Effect, Redacted } from "effect";
39
+ import * as Reactor from "reactor-effect-client";
40
+
41
+ const useSession = Effect.gen(function* () {
42
+ const client = yield* Reactor.Client;
43
+ const session = yield* client.create({
44
+ model: "your-model",
45
+ jwt: Redacted.make("session-token"),
46
+ });
47
+
48
+ yield* session.connect;
49
+ return yield* session.current;
50
+ });
51
+ ```
52
+
53
+ The surrounding application supplies the `Client` layer and Effect platform services. Credentials, HTTP policy, scopes, and host transport selection stay visible in composition. A host package supplies the `PeerFactory`:
54
+
55
+ ```ts
56
+ import { Effect, Layer } from "effect";
57
+ import * as NodeServices from "@effect/platform-node/NodeServices";
58
+ import * as Reactor from "reactor-effect-client";
59
+ import * as Native from "reactor-effect-native";
60
+
61
+ const clientLayer = Reactor.layer().pipe(
62
+ Layer.provide(Layer.mergeAll(Reactor.FetchHttp.layer, NodeServices.layer, Native.layer())),
63
+ );
64
+
65
+ // useSession is the operation above. Acquiring a real session can be billable;
66
+ // the repository's ordinary verification uses controlled local peers instead.
67
+ const main = Effect.scoped(useSession).pipe(Effect.provide(clientLayer));
68
+ ```
69
+
70
+ `Native.make(configuration, nativeOptions)` and `Browser.make(configuration)` also construct the canonical factory with their host peer already selected. Constructing a factory makes no allocation. HTTP and crypto services remain explicit. The root session constructor has no filesystem or path requirement.
71
+
72
+ Browser and native media values stay bound to their negotiated generation. A reconnect creates a new generation; existing readers end or fail with their source. Applications obtain the new media generation explicitly, or opt into orchestration's recovering media streams.
73
+
74
+ ## Coordinator helpers
75
+
76
+ `Coordinator` is a namespace on the root export. `Coordinator.make(configuration)` provides pricing, bounded token minting, session inspection, and termination reports through Effect HTTP services. Constructing this client makes no network request and requires no peer implementation.
77
+
78
+ ## H3 provider
79
+
80
+ `H3.make(session, options)` consumes an already connected canonical `Session`. It checks the deployment contract and exposes provider state, queue and clip messages, observations, command replies, and locally correlated acceptance evidence. Provider facts remain visible even when another client authored the clip. A command ACK establishes receipt; state changes require the corresponding model evidence.
81
+
82
+ ```ts
83
+ import { Effect } from "effect";
84
+ import type { Session } from "reactor-effect-client";
85
+ import * as H3 from "reactor-effect-client/h3";
86
+
87
+ const enqueueClip = (session: Session) =>
88
+ Effect.gen(function* () {
89
+ const provider = yield* H3.make(session);
90
+ return yield* provider.enqueue({
91
+ prompt: "A slow camera move through a sunlit garden",
92
+ seconds: 5,
93
+ });
94
+ });
95
+ ```
96
+
97
+ Use a session created with `H3.modelName`. The adapter targets the documented `0.5.5` prompt-and-images subset of `reactor/h3-reference-to-video-turbo-realtime`. Prompt-only requests are supported. Image references accept owned bytes or explicit upload references; H3 itself requires no filesystem or path services. Reference-audio input is unsupported, and FastH3 `startingFrame`/`endingFrame` fields are absent from this contract.
98
+
99
+ The adapter exposes autoplay, flush, playback, reset, and other model controls as explicit operations. Creating it does not change those policies or initiate reconnect. Request `metadata` is a provider string; orchestration keeps its richer application annotation separately.
100
+
101
+ ## Orchestration and simulation
102
+
103
+ `reactor-effect-client/orchestration` owns opt-in scheduling, sequence routing, renewal, and recovering media. `fromH3` adapts a provider into a physical source, and `make({ open, ...options })` returns a handle with `engine`, `media`, `mediaState`, sequence operations, and joined cleanup reports. The `open` effect supplies each source and its lifetime budget. Application scheduling, pricing, persona, and show policy stay outside the session and H3 layers.
104
+
105
+ `ClipRequest.sameSessionAs` targets the physical session that owns a known clip, including one already ready or playing, while leaving queue position unchanged. `before` requests insertion ahead of a clip still in the generation queue. Source affinity, insertion anchors, continuation, and sequence ownership must agree; missing, conflicting, retired, or recovering ownership fails locally with a `not-submitted` outcome. This keeps a dependent request on its required session during renewal without inventing an insertion point.
106
+
107
+ `Orchestration.Submission` models an inert prepared operation. Preparation may be interrupted before commit; once execution commits, callers joining or abandoning the result do not replay the dispatch. `CommandFailure.context` distinguishes `not-submitted`, `unknown`, and `replied` outcomes independently of the transport error category.
108
+
109
+ `Orchestration.Sequences` owns bounded sequence affinity and explicit member outcomes. Partial admission is represented member-by-member as accepted, rejected, or indeterminate, and a sequence remains bound to one owner until it is sealed/retired and explicitly released.
110
+
111
+ `reactor-effect-client/simulation` provides `make` and `layerSim` over the same orchestration engine and media contracts. Its source and renderer hooks support unpaid local execution and controlled failures. Reusable fault and image fixtures are available through the separate `reactor-effect-client/testing` entry point.
112
+
113
+ ## Wire module
114
+
115
+ `reactor-effect-client/wire` is generated from the tracked canonical protocol sources under [`wire/`](./wire/README.md) by `wire/generate.py` (CPython 3.13, standard library only). `bun run generate:check` fails on any byte difference; `bun run generate:wire` rewrites the module. Do not format the generated file or edit it independently of its inputs.
116
+
117
+ ## Declarations without DOM types
118
+
119
+ Effect `4.0.0-rc.115` itself references the global `TextDecoderOptions` type in its channel declarations. A strict Node project that deliberately omits DOM types may need to declare that standard interface. The workspace's installed-package check first proves this is the sole upstream diagnostic, then applies a test-only declaration; it does not enable `skipLibCheck` or hide SDK declaration errors.
120
+
121
+ ## Development
122
+
123
+ This package is built and tested from the workspace root; see the repository [CONTRIBUTING](https://github.com/mannyc2/reactor-effect-client/blob/main/CONTRIBUTING.md). Inside `packages/client`, `bun test` runs the portable suites and `bun run typecheck` checks the source closure both with browser types and with Node types.
124
+
125
+ ## License
126
+
127
+ Apache-2.0. Third-party and derived-source notices are retained in [NOTICE](./NOTICE) and [`notices/`](./notices/).
@@ -0,0 +1,9 @@
1
+ import * as Layer from "effect/Layer";
2
+ import * as HttpClient from "effect/unstable/http/HttpClient";
3
+ /**
4
+ * A Fetch implementation of Effect's HttpClient. The small response adaptation
5
+ * owns both cancellation and reader-lock release, and preserves an empty body
6
+ * as zero bytes. Applications may supply another HttpClient implementation.
7
+ */
8
+ export declare const layer: Layer.Layer<HttpClient.HttpClient, never, never>;
9
+ //# sourceMappingURL=FetchHttp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchHttp.d.ts","sourceRoot":"","sources":["../src/FetchHttp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAO9D;;;;GAIG;AACH,eAAO,MAAM,KAAK,kDA+DjB,CAAC"}
@@ -0,0 +1,63 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Layer from "effect/Layer";
3
+ import * as Stream from "effect/Stream";
4
+ import * as HttpClient from "effect/unstable/http/HttpClient";
5
+ import * as HttpClientError from "effect/unstable/http/HttpClientError";
6
+ import * as HttpClientResponse from "effect/unstable/http/HttpClientResponse";
7
+ import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
8
+ import { fromOwnedReadableStream } from "./media-stream.js";
9
+ import { ReactorError } from "./errors.js";
10
+ /**
11
+ * A Fetch implementation of Effect's HttpClient. The small response adaptation
12
+ * owns both cancellation and reader-lock release, and preserves an empty body
13
+ * as zero bytes. Applications may supply another HttpClient implementation.
14
+ */
15
+ export const layer = Layer.effect(HttpClient.HttpClient, Effect.gen(function* () {
16
+ const fetch = yield* FetchHttpClient.Fetch;
17
+ return HttpClient.make((request, url, signal) => {
18
+ const send = (body) => Effect.tryPromise({
19
+ try: () => fetch(url, {
20
+ method: request.method,
21
+ headers: request.headers,
22
+ ...(body === undefined ? {} : { body }),
23
+ signal,
24
+ credentials: "omit",
25
+ redirect: "error",
26
+ // Node requires this option for streaming request bodies. It is ignored
27
+ // by browsers, and is not part of the portable coordinator contract.
28
+ ...(body instanceof ReadableStream ? { duplex: "half" } : {}),
29
+ }),
30
+ catch: (cause) => new HttpClientError.HttpClientError({
31
+ reason: new HttpClientError.TransportError({ request, cause }),
32
+ }),
33
+ }).pipe(Effect.map((source) => {
34
+ const response = HttpClientResponse.fromWeb(request, source);
35
+ const stream = source.body === null
36
+ ? Stream.empty
37
+ : fromOwnedReadableStream({
38
+ evaluate: () => source.body,
39
+ onError: (cause) => new ReactorError("Http", "HTTP response body failed", { detail: cause }),
40
+ }).pipe(Stream.mapError((cause) => new HttpClientError.HttpClientError({
41
+ reason: new HttpClientError.DecodeError({ request, response, cause }),
42
+ })));
43
+ // Retain the official response's public accessors and identity; only its
44
+ // stream owns the additional reader-release contract.
45
+ return Object.create(response, {
46
+ stream: { get: () => stream },
47
+ });
48
+ }));
49
+ switch (request.body._tag) {
50
+ case "Raw":
51
+ return send(request.body.body);
52
+ case "Uint8Array":
53
+ return send(new Uint8Array(request.body.body));
54
+ case "FormData":
55
+ return send(request.body.formData);
56
+ case "Stream":
57
+ return Stream.toReadableStreamEffect(request.body.stream).pipe(Effect.flatMap(send));
58
+ default:
59
+ return send(undefined);
60
+ }
61
+ });
62
+ }));
63
+ //# sourceMappingURL=FetchHttp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchHttp.js","sourceRoot":"","sources":["../src/FetchHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KA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,YAAY;gBACf,OAAO,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACjD,KAAK,UAAU;gBACb,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrC,KAAK,QAAQ;gBACX,OAAO,MAAM,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACvF;gBACE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import * as Context from "effect/Context";
2
+ import type * as Effect from "effect/Effect";
3
+ import type { Peer } from "./PeerTypes.js";
4
+ import type { ReactorError } from "./errors.js";
5
+ export interface PeerFactoryShape {
6
+ /** Validate host support before allocating a remote session. */
7
+ readonly check: Effect.Effect<void, ReactorError>;
8
+ /** A fresh transport for each connection generation. No Reactor orchestration. */
9
+ readonly make: () => Peer;
10
+ }
11
+ declare const PeerFactory_base: Context.ServiceClass<PeerFactory, "reactor-effect-client/PeerFactory", PeerFactoryShape>;
12
+ export declare class PeerFactory extends PeerFactory_base {
13
+ }
14
+ export type { Peer, PeerEvent, Prepared, Channel } from "./PeerTypes.js";
15
+ //# sourceMappingURL=PeerFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeerFactory.d.ts","sourceRoot":"","sources":["../src/PeerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAClD,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;CAC3B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import * as Context from "effect/Context";
2
+ export class PeerFactory extends Context.Service()("reactor-effect-client/PeerFactory") {
3
+ }
4
+ //# sourceMappingURL=PeerFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeerFactory.js","sourceRoot":"","sources":["../src/PeerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAY1C,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,EAAiC,CAC/E,mCAAmC,CACpC;CAAG"}
@@ -0,0 +1,64 @@
1
+ import type * as Effect from "effect/Effect";
2
+ import type * as Scope from "effect/Scope";
3
+ import type { ReactorError } from "./errors.js";
4
+ import type { IceCandidate, IceServer, Mapping, Track } from "./contract.js";
5
+ import type { RawMedia } from "./session/media.js";
6
+ export type Channel = "control" | "data";
7
+ export type PeerState = "new" | "connecting" | "connected" | "disconnected" | "failed" | "closed";
8
+ /** Minimal track lifetime contract. Native peers expose owned frames instead. */
9
+ export interface MediaTrack {
10
+ readonly kind: string;
11
+ readonly readyState: "live" | "ended";
12
+ clone(): MediaTrack;
13
+ stop(): void;
14
+ }
15
+ export type PeerEvent = {
16
+ readonly type: "state";
17
+ readonly state: PeerState;
18
+ } | {
19
+ readonly type: "channel";
20
+ readonly channel: Channel;
21
+ readonly open: boolean;
22
+ } | {
23
+ readonly type: "message";
24
+ readonly channel: Channel;
25
+ readonly bytes: Uint8Array;
26
+ } | {
27
+ readonly type: "ice";
28
+ readonly candidate?: IceCandidate;
29
+ } | {
30
+ readonly type: "track";
31
+ readonly name: string;
32
+ readonly mid: string;
33
+ } | {
34
+ readonly type: "decoded";
35
+ readonly kind: "video" | "audio";
36
+ readonly name: string;
37
+ readonly mid: string;
38
+ } | {
39
+ readonly type: "error";
40
+ readonly error: ReactorError;
41
+ };
42
+ export interface Prepared {
43
+ readonly sdp: string;
44
+ readonly mapping: readonly Mapping[];
45
+ }
46
+ /** Transport only. Coordinator allocation and Reactor protocol state remain session-owned. */
47
+ export interface Peer {
48
+ readonly rawMedia?: RawMedia;
49
+ readonly shutdown?: () => Effect.Effect<void, ReactorError>;
50
+ readonly nativeTracks?: boolean;
51
+ readonly mediaSupported?: boolean;
52
+ prepare(servers: readonly IceServer[], tracks: readonly Track[], emit: (event: PeerEvent) => void): Effect.Effect<Prepared, ReactorError, Scope.Scope>;
53
+ answer(sdp: string): Effect.Effect<void, ReactorError>;
54
+ /** Local submission/transport acknowledgement is never a Reactor application reply. */
55
+ send(channel: Channel, bytes: Uint8Array<ArrayBuffer>): Effect.Effect<void, ReactorError>;
56
+ close(): void;
57
+ lease(name: string): MediaTrack;
58
+ release(track: MediaTrack): void;
59
+ direction(name: string, active: boolean): Effect.Effect<void, ReactorError>;
60
+ replace(name: string, track: MediaTrack | null): Effect.Effect<void, ReactorError>;
61
+ maxBitrate(name: string, bitsPerSecond: number): Effect.Effect<void, ReactorError>;
62
+ stats(): Effect.Effect<readonly unknown[], ReactorError>;
63
+ }
64
+ //# sourceMappingURL=PeerTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeerTypes.d.ts","sourceRoot":"","sources":["../src/PeerTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,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AAE,UAAU,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC5E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACnF,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACnF,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;CAC1D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PeerTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeerTypes.js","sourceRoot":"","sources":["../src/PeerTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,81 @@
1
+ import { Effect } from "effect";
2
+ export type SequenceStatus = "open" | "sealed" | "indeterminate" | "retired";
3
+ export type MemberOutcome = {
4
+ readonly _tag: "Accepted";
5
+ readonly memberId: string;
6
+ readonly clipId: string;
7
+ readonly index: number;
8
+ readonly final: boolean;
9
+ } | {
10
+ readonly _tag: "Rejected";
11
+ readonly memberId: string;
12
+ readonly reason: string | undefined;
13
+ } | {
14
+ readonly _tag: "Indeterminate";
15
+ readonly memberId: string;
16
+ readonly reason: string | undefined;
17
+ };
18
+ export interface SequenceSnapshot<Owner> {
19
+ readonly id: string;
20
+ readonly owner: Owner;
21
+ readonly status: SequenceStatus;
22
+ readonly acceptedCount: number;
23
+ readonly rejectedCount: number;
24
+ readonly indeterminateCount: number;
25
+ readonly pendingCount: number;
26
+ readonly sealRequested: boolean;
27
+ readonly members: ReadonlyArray<MemberOutcome>;
28
+ }
29
+ declare const InvalidSequenceOptions_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
30
+ readonly _tag: "InvalidSequenceOptions";
31
+ } & Readonly<A>;
32
+ export declare class InvalidSequenceOptions extends InvalidSequenceOptions_base<{
33
+ readonly reason: string;
34
+ }> {
35
+ }
36
+ declare const SequenceError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
37
+ readonly _tag: "SequenceError";
38
+ } & Readonly<A>;
39
+ export declare class SequenceError extends SequenceError_base<{
40
+ readonly sequenceId: string;
41
+ readonly reason: "capacity" | "member-capacity" | "owner-mismatch" | "sealed" | "sealing" | "indeterminate" | "retired" | "missing" | "member-missing" | "member-duplicate" | "not-releasable";
42
+ }> {
43
+ }
44
+ export interface Affinity<Owner> {
45
+ readonly get: (id: string) => Effect.Effect<SequenceSnapshot<Owner> | undefined>;
46
+ readonly snapshots: Effect.Effect<ReadonlyArray<SequenceSnapshot<Owner>>>;
47
+ /** Bind no later than the first member dispatch. Existing ownership never changes. */
48
+ readonly bind: (id: string, owner: Owner) => Effect.Effect<Owner, SequenceError>;
49
+ /** Register one member whose remote outcome is not yet known. */
50
+ readonly begin: (id: string, memberId: string) => Effect.Effect<void, SequenceError>;
51
+ readonly accepted: (id: string, memberId: string, clipId: string, final?: boolean) => Effect.Effect<void, SequenceError>;
52
+ readonly rejected: (id: string, memberId: string, reason?: string, final?: boolean) => Effect.Effect<void, SequenceError>;
53
+ readonly uncertain: (id: string, memberId: string, reason?: string) => Effect.Effect<void, SequenceError>;
54
+ /**
55
+ * Stop admitting members. With no pending member this seals immediately;
56
+ * otherwise the sequence seals after every already-started member resolves.
57
+ */
58
+ readonly seal: (id: string) => Effect.Effect<void, SequenceError>;
59
+ /** Session death retires known sequences and makes still-pending members indeterminate. */
60
+ readonly retire: (owner: Owner) => Effect.Effect<void>;
61
+ /**
62
+ * Explicitly acknowledge that an indeterminate sequence has been accounted
63
+ * for externally. Its history stays queryable as Retired until release.
64
+ */
65
+ readonly acknowledgeIndeterminate: (id: string) => Effect.Effect<void, SequenceError>;
66
+ /** Explicit cleanup after history has been consumed. Open/unknown/pending work is retained. */
67
+ readonly release: (id: string) => Effect.Effect<void, SequenceError>;
68
+ readonly size: Effect.Effect<number>;
69
+ }
70
+ export interface Options<Owner> {
71
+ readonly maxEntries?: number;
72
+ readonly maxMembers?: number;
73
+ readonly sameOwner?: (left: Owner, right: Owner) => boolean;
74
+ }
75
+ /**
76
+ * Bounded sequence-affinity state. Unresolved work is never evicted to admit
77
+ * another sequence or member; callers explicitly account and release history.
78
+ */
79
+ export declare const makeAffinity: <Owner>(options?: Options<Owner>) => Effect.Effect<Affinity<Owner>, InvalidSequenceOptions>;
80
+ export {};
81
+ //# sourceMappingURL=Sequence.d.ts.map