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
@@ -5,76 +5,81 @@ export declare const Clip: Schema.Struct<{
5
5
  readonly clip_id: Schema.String;
6
6
  readonly prompt: Schema.String;
7
7
  readonly metadata: Schema.String;
8
- readonly frames: Schema.Number;
9
- readonly seconds: Schema.Number;
10
- readonly seed: Schema.Number;
8
+ readonly frames: Schema.Int;
9
+ readonly seconds: Schema.Finite;
10
+ readonly seed: Schema.Natural;
11
11
  readonly ready: Schema.Boolean;
12
12
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
13
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
13
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
14
14
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
15
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
15
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
16
16
  }>;
17
17
  export type Clip = typeof Clip.Type;
18
+ /**
19
+ * A clip is in at most one queue position. A retained history entry may
20
+ * describe a clip that is still in playout, but duplicate positions within the
21
+ * queues, or within the history, are ambiguous.
22
+ */
18
23
  export declare const Queue: Schema.Struct<{
19
24
  readonly generation: Schema.$Array<Schema.Struct<{
20
25
  readonly clip_id: Schema.String;
21
26
  readonly prompt: Schema.String;
22
27
  readonly metadata: Schema.String;
23
- readonly frames: Schema.Number;
24
- readonly seconds: Schema.Number;
25
- readonly seed: Schema.Number;
28
+ readonly frames: Schema.Int;
29
+ readonly seconds: Schema.Finite;
30
+ readonly seed: Schema.Natural;
26
31
  readonly ready: Schema.Boolean;
27
32
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
28
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
33
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
29
34
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
30
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
35
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
31
36
  }>>;
32
37
  readonly playout: Schema.$Array<Schema.Struct<{
33
38
  readonly clip_id: Schema.String;
34
39
  readonly prompt: Schema.String;
35
40
  readonly metadata: Schema.String;
36
- readonly frames: Schema.Number;
37
- readonly seconds: Schema.Number;
38
- readonly seed: Schema.Number;
41
+ readonly frames: Schema.Int;
42
+ readonly seconds: Schema.Finite;
43
+ readonly seed: Schema.Natural;
39
44
  readonly ready: Schema.Boolean;
40
45
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
41
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
46
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
42
47
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
43
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
48
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
44
49
  }>>;
45
50
  readonly history: Schema.$Array<Schema.Struct<{
46
51
  readonly clip_id: Schema.String;
47
52
  readonly prompt: Schema.String;
48
53
  readonly metadata: Schema.String;
49
- readonly frames: Schema.Number;
50
- readonly seconds: Schema.Number;
51
- readonly seed: Schema.Number;
54
+ readonly frames: Schema.Int;
55
+ readonly seconds: Schema.Finite;
56
+ readonly seed: Schema.Natural;
52
57
  readonly ready: Schema.Boolean;
53
58
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
54
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
59
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
55
60
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
56
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
61
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
57
62
  }>>;
58
63
  }>;
59
64
  export type Queue = typeof Queue.Type;
60
65
  export declare const State: Schema.Struct<{
61
- readonly clip_seconds: Schema.Number;
62
- readonly clip_seconds_min: Schema.Number;
63
- readonly clip_seconds_max: Schema.Number;
64
- readonly seed: Schema.Number;
66
+ readonly clip_seconds: Schema.Finite;
67
+ readonly clip_seconds_min: Schema.Finite;
68
+ readonly clip_seconds_max: Schema.Finite;
69
+ readonly seed: Schema.Natural;
65
70
  readonly autoplay: Schema.Boolean;
66
71
  readonly flush_on_clip_end: Schema.Boolean;
67
72
  readonly aspect: Schema.String;
68
- readonly width: Schema.Number;
69
- readonly height: Schema.Number;
73
+ readonly width: Schema.Int;
74
+ readonly height: Schema.Int;
70
75
  readonly playing: Schema.Boolean;
71
76
  readonly playing_clip_id: Schema.NullOr<Schema.String>;
72
- readonly generation_queued: Schema.Number;
73
- readonly generation_capacity: Schema.Number;
74
- readonly playout_queued: Schema.Number;
75
- readonly playout_capacity: Schema.Number;
76
- readonly clips_played: Schema.Number;
77
- readonly seconds_sent: Schema.Number;
77
+ readonly generation_queued: Schema.Natural;
78
+ readonly generation_capacity: Schema.Int;
79
+ readonly playout_queued: Schema.Natural;
80
+ readonly playout_capacity: Schema.Int;
81
+ readonly clips_played: Schema.Natural;
82
+ readonly seconds_sent: Schema.Finite;
78
83
  readonly valid_commands: Schema.$Array<Schema.String>;
79
84
  }>;
80
85
  export type State = typeof State.Type;
@@ -84,14 +89,14 @@ export declare const Payloads: {
84
89
  readonly clip_id: Schema.String;
85
90
  readonly prompt: Schema.String;
86
91
  readonly metadata: Schema.String;
87
- readonly frames: Schema.Number;
88
- readonly seconds: Schema.Number;
89
- readonly seed: Schema.Number;
92
+ readonly frames: Schema.Int;
93
+ readonly seconds: Schema.Finite;
94
+ readonly seed: Schema.Natural;
90
95
  readonly ready: Schema.Boolean;
91
96
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
92
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
97
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
93
98
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
94
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
99
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
95
100
  }>;
96
101
  }>;
97
102
  readonly clip_moved: Schema.Struct<{
@@ -99,31 +104,31 @@ export declare const Payloads: {
99
104
  readonly clip_id: Schema.String;
100
105
  readonly prompt: Schema.String;
101
106
  readonly metadata: Schema.String;
102
- readonly frames: Schema.Number;
103
- readonly seconds: Schema.Number;
104
- readonly seed: Schema.Number;
107
+ readonly frames: Schema.Int;
108
+ readonly seconds: Schema.Finite;
109
+ readonly seed: Schema.Natural;
105
110
  readonly ready: Schema.Boolean;
106
111
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
107
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
112
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
108
113
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
109
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
114
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
110
115
  }>;
111
116
  readonly queue: Schema.Literals<readonly ["generation", "playout"]>;
112
- readonly position: Schema.Number;
117
+ readonly position: Schema.Natural;
113
118
  }>;
114
119
  readonly clip_popped: Schema.Struct<{
115
120
  readonly clip: Schema.Struct<{
116
121
  readonly clip_id: Schema.String;
117
122
  readonly prompt: Schema.String;
118
123
  readonly metadata: Schema.String;
119
- readonly frames: Schema.Number;
120
- readonly seconds: Schema.Number;
121
- readonly seed: Schema.Number;
124
+ readonly frames: Schema.Int;
125
+ readonly seconds: Schema.Finite;
126
+ readonly seed: Schema.Natural;
122
127
  readonly ready: Schema.Boolean;
123
128
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
124
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
129
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
125
130
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
126
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
131
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
127
132
  }>;
128
133
  }>;
129
134
  readonly clip_generated: Schema.Struct<{
@@ -131,14 +136,14 @@ export declare const Payloads: {
131
136
  readonly clip_id: Schema.String;
132
137
  readonly prompt: Schema.String;
133
138
  readonly metadata: Schema.String;
134
- readonly frames: Schema.Number;
135
- readonly seconds: Schema.Number;
136
- readonly seed: Schema.Number;
139
+ readonly frames: Schema.Int;
140
+ readonly seconds: Schema.Finite;
141
+ readonly seed: Schema.Natural;
137
142
  readonly ready: Schema.Boolean;
138
143
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
139
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
144
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
140
145
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
141
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
146
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
142
147
  }>;
143
148
  }>;
144
149
  readonly clip_failed: Schema.Struct<{
@@ -146,14 +151,14 @@ export declare const Payloads: {
146
151
  readonly clip_id: Schema.String;
147
152
  readonly prompt: Schema.String;
148
153
  readonly metadata: Schema.String;
149
- readonly frames: Schema.Number;
150
- readonly seconds: Schema.Number;
151
- readonly seed: Schema.Number;
154
+ readonly frames: Schema.Int;
155
+ readonly seconds: Schema.Finite;
156
+ readonly seed: Schema.Natural;
152
157
  readonly ready: Schema.Boolean;
153
158
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
154
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
159
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
155
160
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
156
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
161
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
157
162
  }>;
158
163
  readonly reason: Schema.String;
159
164
  }>;
@@ -162,14 +167,14 @@ export declare const Payloads: {
162
167
  readonly clip_id: Schema.String;
163
168
  readonly prompt: Schema.String;
164
169
  readonly metadata: Schema.String;
165
- readonly frames: Schema.Number;
166
- readonly seconds: Schema.Number;
167
- readonly seed: Schema.Number;
170
+ readonly frames: Schema.Int;
171
+ readonly seconds: Schema.Finite;
172
+ readonly seed: Schema.Natural;
168
173
  readonly ready: Schema.Boolean;
169
174
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
170
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
175
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
171
176
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
172
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
177
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
173
178
  }>;
174
179
  }>;
175
180
  readonly clip_finished: Schema.Struct<{
@@ -177,92 +182,92 @@ export declare const Payloads: {
177
182
  readonly clip_id: Schema.String;
178
183
  readonly prompt: Schema.String;
179
184
  readonly metadata: Schema.String;
180
- readonly frames: Schema.Number;
181
- readonly seconds: Schema.Number;
182
- readonly seed: Schema.Number;
185
+ readonly frames: Schema.Int;
186
+ readonly seconds: Schema.Finite;
187
+ readonly seed: Schema.Natural;
183
188
  readonly ready: Schema.Boolean;
184
189
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
185
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
190
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
186
191
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
187
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
192
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
188
193
  }>;
189
- readonly seconds_sent: Schema.Number;
194
+ readonly seconds_sent: Schema.Finite;
190
195
  }>;
191
196
  readonly clip_stopped: Schema.Struct<{
192
197
  readonly clip: Schema.Struct<{
193
198
  readonly clip_id: Schema.String;
194
199
  readonly prompt: Schema.String;
195
200
  readonly metadata: Schema.String;
196
- readonly frames: Schema.Number;
197
- readonly seconds: Schema.Number;
198
- readonly seed: Schema.Number;
201
+ readonly frames: Schema.Int;
202
+ readonly seconds: Schema.Finite;
203
+ readonly seed: Schema.Natural;
199
204
  readonly ready: Schema.Boolean;
200
205
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
201
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
206
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
202
207
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
203
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
208
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
204
209
  }>;
205
- readonly seconds_sent: Schema.Number;
210
+ readonly seconds_sent: Schema.Finite;
206
211
  }>;
207
212
  readonly queue_update: Schema.Struct<{
208
213
  readonly generation: Schema.$Array<Schema.Struct<{
209
214
  readonly clip_id: Schema.String;
210
215
  readonly prompt: Schema.String;
211
216
  readonly metadata: Schema.String;
212
- readonly frames: Schema.Number;
213
- readonly seconds: Schema.Number;
214
- readonly seed: Schema.Number;
217
+ readonly frames: Schema.Int;
218
+ readonly seconds: Schema.Finite;
219
+ readonly seed: Schema.Natural;
215
220
  readonly ready: Schema.Boolean;
216
221
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
217
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
222
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
218
223
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
219
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
224
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
220
225
  }>>;
221
226
  readonly playout: Schema.$Array<Schema.Struct<{
222
227
  readonly clip_id: Schema.String;
223
228
  readonly prompt: Schema.String;
224
229
  readonly metadata: Schema.String;
225
- readonly frames: Schema.Number;
226
- readonly seconds: Schema.Number;
227
- readonly seed: Schema.Number;
230
+ readonly frames: Schema.Int;
231
+ readonly seconds: Schema.Finite;
232
+ readonly seed: Schema.Natural;
228
233
  readonly ready: Schema.Boolean;
229
234
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
230
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
235
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
231
236
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
232
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
237
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
233
238
  }>>;
234
239
  readonly history: Schema.$Array<Schema.Struct<{
235
240
  readonly clip_id: Schema.String;
236
241
  readonly prompt: Schema.String;
237
242
  readonly metadata: Schema.String;
238
- readonly frames: Schema.Number;
239
- readonly seconds: Schema.Number;
240
- readonly seed: Schema.Number;
243
+ readonly frames: Schema.Int;
244
+ readonly seconds: Schema.Finite;
245
+ readonly seed: Schema.Natural;
241
246
  readonly ready: Schema.Boolean;
242
247
  readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
243
- readonly reference_image_count: Schema.optionalKey<Schema.Number>;
248
+ readonly reference_image_count: Schema.optionalKey<Schema.Natural>;
244
249
  readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
245
- readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
250
+ readonly reference_audio_count: Schema.optionalKey<Schema.Natural>;
246
251
  }>>;
247
252
  }>;
248
253
  readonly state_update: Schema.Struct<{
249
- readonly clip_seconds: Schema.Number;
250
- readonly clip_seconds_min: Schema.Number;
251
- readonly clip_seconds_max: Schema.Number;
252
- readonly seed: Schema.Number;
254
+ readonly clip_seconds: Schema.Finite;
255
+ readonly clip_seconds_min: Schema.Finite;
256
+ readonly clip_seconds_max: Schema.Finite;
257
+ readonly seed: Schema.Natural;
253
258
  readonly autoplay: Schema.Boolean;
254
259
  readonly flush_on_clip_end: Schema.Boolean;
255
260
  readonly aspect: Schema.String;
256
- readonly width: Schema.Number;
257
- readonly height: Schema.Number;
261
+ readonly width: Schema.Int;
262
+ readonly height: Schema.Int;
258
263
  readonly playing: Schema.Boolean;
259
264
  readonly playing_clip_id: Schema.NullOr<Schema.String>;
260
- readonly generation_queued: Schema.Number;
261
- readonly generation_capacity: Schema.Number;
262
- readonly playout_queued: Schema.Number;
263
- readonly playout_capacity: Schema.Number;
264
- readonly clips_played: Schema.Number;
265
- readonly seconds_sent: Schema.Number;
265
+ readonly generation_queued: Schema.Natural;
266
+ readonly generation_capacity: Schema.Int;
267
+ readonly playout_queued: Schema.Natural;
268
+ readonly playout_capacity: Schema.Int;
269
+ readonly clips_played: Schema.Natural;
270
+ readonly seconds_sent: Schema.Finite;
266
271
  readonly valid_commands: Schema.$Array<Schema.String>;
267
272
  }>;
268
273
  readonly command_error: Schema.Struct<{
@@ -270,16 +275,16 @@ export declare const Payloads: {
270
275
  readonly reason: Schema.String;
271
276
  }>;
272
277
  readonly seed_accepted: Schema.Struct<{
273
- readonly seed: Schema.Number;
278
+ readonly seed: Schema.Natural;
274
279
  }>;
275
280
  readonly clip_length_accepted: Schema.Struct<{
276
- readonly clip_seconds: Schema.Number;
277
- readonly frames: Schema.Number;
281
+ readonly clip_seconds: Schema.Finite;
282
+ readonly frames: Schema.Int;
278
283
  }>;
279
284
  readonly canvas_accepted: Schema.Struct<{
280
285
  readonly aspect: Schema.String;
281
- readonly width: Schema.Number;
282
- readonly height: Schema.Number;
286
+ readonly width: Schema.Int;
287
+ readonly height: Schema.Int;
283
288
  }>;
284
289
  readonly autoplay_accepted: Schema.Struct<{
285
290
  readonly enabled: Schema.Boolean;
@@ -288,7 +293,7 @@ export declare const Payloads: {
288
293
  readonly enabled: Schema.Boolean;
289
294
  }>;
290
295
  readonly session_reset: Schema.Struct<{
291
- readonly cleared_clips: Schema.Number;
296
+ readonly cleared_clips: Schema.Natural;
292
297
  readonly was_playing: Schema.Boolean;
293
298
  }>;
294
299
  };
@@ -305,6 +310,10 @@ export type DecodedMessage = Message | {
305
310
  readonly name: string;
306
311
  readonly data: JsonObject | undefined;
307
312
  };
308
- /** Unknown events remain observable. A known message never accepts a partial payload. */
313
+ /**
314
+ * Unknown events remain observable. A known message never accepts a partial
315
+ * payload: its Schema, cross-field rules included, rejects it as Protocol, and
316
+ * a bug in these checks stays a defect.
317
+ */
309
318
  export declare const decodeMessage: (type: string, input: unknown) => DecodedMessage;
310
319
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/h3/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAW7C,kFAAkF;AAClF,eAAO,MAAM,IAAI;;;;;;;;;;;;EAYf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC;AAEpC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAEtC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;EAmBhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK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,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE;CACpE,CAAC,WAAW,CAAC,CAAC;AACf,MAAM,MAAM,cAAc,GACtB,OAAO,GACP;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC;AAiB/F;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,SAAS,OAAO,KAAG,cAU5D,CAAC"}
@@ -1,9 +1,8 @@
1
+ import * as Result from "effect/Result";
1
2
  import * as Schema from "effect/Schema";
2
3
  import { ReactorError } from "../errors.js";
3
4
  import { jsonObject } from "../json.js";
4
- const NumberValue = Schema.Number.check(Schema.isFinite());
5
- const Integer = NumberValue.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
6
- const Positive = Integer.check(Schema.isGreaterThan(0));
5
+ const Positive = Schema.Int.check(Schema.isGreaterThan(0));
7
6
  const Id = Schema.String.check(Schema.isUUID());
8
7
  /** Required fields follow the H3 Reference Turbo Realtime 0.5.5 documentation. */
9
8
  export const Clip = Schema.Struct({
@@ -11,24 +10,50 @@ export const Clip = Schema.Struct({
11
10
  prompt: Schema.String,
12
11
  metadata: Schema.String,
13
12
  frames: Positive,
14
- seconds: NumberValue.check(Schema.isGreaterThan(0)),
15
- seed: Integer,
13
+ seconds: Schema.Finite.check(Schema.isGreaterThan(0)),
14
+ seed: Schema.Natural,
16
15
  ready: Schema.Boolean,
17
16
  has_reference_image: Schema.optionalKey(Schema.Boolean),
18
- reference_image_count: Schema.optionalKey(Integer),
17
+ reference_image_count: Schema.optionalKey(Schema.Natural),
19
18
  has_reference_audio: Schema.optionalKey(Schema.Boolean),
20
- reference_audio_count: Schema.optionalKey(Integer),
19
+ reference_audio_count: Schema.optionalKey(Schema.Natural),
21
20
  });
21
+ /** The first repeated clip id in `clips`, as its index. */
22
+ const repeated = (clips, seen = new Set()) => {
23
+ for (const [index, clip] of clips.entries()) {
24
+ if (seen.has(clip.clip_id))
25
+ return index;
26
+ seen.add(clip.clip_id);
27
+ }
28
+ return -1;
29
+ };
30
+ /**
31
+ * A clip is in at most one queue position. A retained history entry may
32
+ * describe a clip that is still in playout, but duplicate positions within the
33
+ * queues, or within the history, are ambiguous.
34
+ */
22
35
  export const Queue = Schema.Struct({
23
36
  generation: Schema.Array(Clip),
24
37
  playout: Schema.Array(Clip),
25
38
  history: Schema.Array(Clip),
26
- });
39
+ }).check(Schema.makeFilter((queue) => {
40
+ const queued = new Set();
41
+ const generation = repeated(queue.generation, queued);
42
+ if (generation >= 0)
43
+ return { path: ["generation", generation, "clip_id"], issue: "clip is queued twice" };
44
+ const playout = repeated(queue.playout, queued);
45
+ if (playout >= 0)
46
+ return { path: ["playout", playout, "clip_id"], issue: "clip is queued twice" };
47
+ const history = repeated(queue.history);
48
+ if (history >= 0)
49
+ return { path: ["history", history, "clip_id"], issue: "clip is in history twice" };
50
+ return undefined;
51
+ }));
27
52
  export const State = Schema.Struct({
28
- clip_seconds: NumberValue,
29
- clip_seconds_min: NumberValue,
30
- clip_seconds_max: NumberValue,
31
- seed: Integer,
53
+ clip_seconds: Schema.Finite,
54
+ clip_seconds_min: Schema.Finite,
55
+ clip_seconds_max: Schema.Finite,
56
+ seed: Schema.Natural,
32
57
  autoplay: Schema.Boolean,
33
58
  flush_on_clip_end: Schema.Boolean,
34
59
  aspect: Schema.String,
@@ -36,36 +61,47 @@ export const State = Schema.Struct({
36
61
  height: Positive,
37
62
  playing: Schema.Boolean,
38
63
  playing_clip_id: Schema.NullOr(Id),
39
- generation_queued: Integer,
64
+ generation_queued: Schema.Natural,
40
65
  generation_capacity: Positive,
41
- playout_queued: Integer,
66
+ playout_queued: Schema.Natural,
42
67
  playout_capacity: Positive,
43
- clips_played: Integer,
44
- seconds_sent: NumberValue.check(Schema.isGreaterThanOrEqualTo(0)),
68
+ clips_played: Schema.Natural,
69
+ seconds_sent: Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)),
45
70
  valid_commands: Schema.Array(Schema.String),
46
- });
71
+ }).check(Schema.makeFilter((state) => {
72
+ const issues = [];
73
+ if (state.clip_seconds_min <= 0)
74
+ issues.push({ path: ["clip_seconds_min"], issue: "must be positive" });
75
+ if (state.clip_seconds_max < state.clip_seconds_min)
76
+ issues.push({ path: ["clip_seconds_max"], issue: "must be at least clip_seconds_min" });
77
+ if (state.clip_seconds <= 0)
78
+ issues.push({ path: ["clip_seconds"], issue: "must be positive" });
79
+ if (state.playing !== (state.playing_clip_id !== null))
80
+ issues.push({ path: ["playing_clip_id"], issue: "must be set exactly while playing" });
81
+ return issues;
82
+ }));
47
83
  export const Payloads = {
48
84
  clip_queued: Schema.Struct({ clip: Clip }),
49
85
  clip_moved: Schema.Struct({
50
86
  clip: Clip,
51
87
  queue: Schema.Literals(["generation", "playout"]),
52
- position: Integer,
88
+ position: Schema.Natural,
53
89
  }),
54
90
  clip_popped: Schema.Struct({ clip: Clip }),
55
91
  clip_generated: Schema.Struct({ clip: Clip }),
56
92
  clip_failed: Schema.Struct({ clip: Clip, reason: Schema.String }),
57
93
  clip_started: Schema.Struct({ clip: Clip }),
58
- clip_finished: Schema.Struct({ clip: Clip, seconds_sent: NumberValue }),
59
- clip_stopped: Schema.Struct({ clip: Clip, seconds_sent: NumberValue }),
94
+ clip_finished: Schema.Struct({ clip: Clip, seconds_sent: Schema.Finite }),
95
+ clip_stopped: Schema.Struct({ clip: Clip, seconds_sent: Schema.Finite }),
60
96
  queue_update: Queue,
61
97
  state_update: State,
62
98
  command_error: Schema.Struct({ command: Schema.String, reason: Schema.String }),
63
- seed_accepted: Schema.Struct({ seed: Integer }),
64
- clip_length_accepted: Schema.Struct({ clip_seconds: NumberValue, frames: Positive }),
99
+ seed_accepted: Schema.Struct({ seed: Schema.Natural }),
100
+ clip_length_accepted: Schema.Struct({ clip_seconds: Schema.Finite, frames: Positive }),
65
101
  canvas_accepted: Schema.Struct({ aspect: Schema.String, width: Positive, height: Positive }),
66
102
  autoplay_accepted: Schema.Struct({ enabled: Schema.Boolean }),
67
103
  flush_accepted: Schema.Struct({ enabled: Schema.Boolean }),
68
- session_reset: Schema.Struct({ cleared_clips: Integer, was_playing: Schema.Boolean }),
104
+ session_reset: Schema.Struct({ cleared_clips: Schema.Natural, was_playing: Schema.Boolean }),
69
105
  };
70
106
  const freeze = (value) => {
71
107
  if (value !== null && typeof value === "object") {
@@ -75,7 +111,16 @@ const freeze = (value) => {
75
111
  }
76
112
  return value;
77
113
  };
78
- /** Unknown events remain observable. A known message never accepts a partial payload. */
114
+ /** The `SchemaError`, which names the path but no input value, stays in `detail`. */
115
+ const malformed = (type, cause) => ReactorError.fromCode("Protocol", `H3 ${type} payload is malformed`, {
116
+ operation: "h3 observation",
117
+ detail: cause,
118
+ });
119
+ /**
120
+ * Unknown events remain observable. A known message never accepts a partial
121
+ * payload: its Schema, cross-field rules included, rejects it as Protocol, and
122
+ * a bug in these checks stays a defect.
123
+ */
79
124
  export const decodeMessage = (type, input) => {
80
125
  if (!Object.hasOwn(Payloads, type))
81
126
  return Object.freeze({
@@ -83,32 +128,9 @@ export const decodeMessage = (type, input) => {
83
128
  name: type,
84
129
  data: input === undefined ? undefined : jsonObject(input),
85
130
  });
86
- try {
87
- const schema = Payloads[type];
88
- const data = Schema.decodeUnknownSync(schema)(input);
89
- const message = { type, data };
90
- if (message.type === "state_update") {
91
- const state = message.data;
92
- if (state.clip_seconds_min <= 0 ||
93
- state.clip_seconds_max < state.clip_seconds_min ||
94
- state.clip_seconds <= 0 ||
95
- state.playing !== (state.playing_clip_id !== null))
96
- throw new Error("inconsistent state");
97
- }
98
- if (message.type === "queue_update") {
99
- const queued = [...message.data.generation, ...message.data.playout].map((clip) => clip.clip_id);
100
- const history = message.data.history.map((clip) => clip.clip_id);
101
- // A retained history entry may describe a clip that is still in playout;
102
- // duplicate positions within queues/history remain ambiguous.
103
- if (new Set(queued).size !== queued.length || new Set(history).size !== history.length)
104
- throw new Error("duplicate queue identity");
105
- }
106
- return freeze(message);
107
- }
108
- catch {
109
- throw new ReactorError("Protocol", `H3 ${type} payload is malformed`, {
110
- operation: "h3 observation",
111
- });
112
- }
131
+ const decoded = Schema.decodeUnknownResult(Payloads[type])(input);
132
+ if (Result.isFailure(decoded))
133
+ throw malformed(type, decoded.failure);
134
+ return freeze({ type, data: decoded.success });
113
135
  };
114
136
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/h3/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC3D,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAC/B,MAAM,CAAC,KAAK,EAAE,EACd,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAChC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CACpD,CAAC;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAEhD,kFAAkF;AAClF,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,QAAQ,EAAE,MAAM,CAA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