@nakafa/aksara-contracts 8.13.0 → 8.14.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.
@@ -0,0 +1,282 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /**
4
+ * Membrane transport labs covering ATP-driven carrier pumps and osmotic
5
+ * plasmolysis across plant and animal cells.
6
+ */
7
+ export declare function membraneVisuals<E>(rich: RichSlot<E>): {
8
+ ActiveTransportPumpLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
9
+ readonly description: RichSlot<E>;
10
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
11
+ readonly marks?: readonly [{
12
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
13
+ } | {
14
+ readonly attrs: {
15
+ readonly href: string;
16
+ };
17
+ readonly type: "link";
18
+ } | {
19
+ readonly attrs: {
20
+ readonly variant: "success" | "warning" | null;
21
+ };
22
+ readonly type: "highlight";
23
+ }, ...({
24
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
25
+ } | {
26
+ readonly attrs: {
27
+ readonly href: string;
28
+ };
29
+ readonly type: "link";
30
+ } | {
31
+ readonly attrs: {
32
+ readonly variant: "success" | "warning" | null;
33
+ };
34
+ readonly type: "highlight";
35
+ })[]];
36
+ readonly text: string;
37
+ readonly type: "text";
38
+ } | {
39
+ readonly attrs: {
40
+ readonly latex: string;
41
+ };
42
+ readonly marks?: readonly [{
43
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
44
+ } | {
45
+ readonly attrs: {
46
+ readonly href: string;
47
+ };
48
+ readonly type: "link";
49
+ } | {
50
+ readonly attrs: {
51
+ readonly variant: "success" | "warning" | null;
52
+ };
53
+ readonly type: "highlight";
54
+ }, ...({
55
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
56
+ } | {
57
+ readonly attrs: {
58
+ readonly href: string;
59
+ };
60
+ readonly type: "link";
61
+ } | {
62
+ readonly attrs: {
63
+ readonly variant: "success" | "warning" | null;
64
+ };
65
+ readonly type: "highlight";
66
+ })[]];
67
+ readonly type: "mathInline";
68
+ }, ...({
69
+ readonly marks?: readonly [{
70
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
71
+ } | {
72
+ readonly attrs: {
73
+ readonly href: string;
74
+ };
75
+ readonly type: "link";
76
+ } | {
77
+ readonly attrs: {
78
+ readonly variant: "success" | "warning" | null;
79
+ };
80
+ readonly type: "highlight";
81
+ }, ...({
82
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
83
+ } | {
84
+ readonly attrs: {
85
+ readonly href: string;
86
+ };
87
+ readonly type: "link";
88
+ } | {
89
+ readonly attrs: {
90
+ readonly variant: "success" | "warning" | null;
91
+ };
92
+ readonly type: "highlight";
93
+ })[]];
94
+ readonly text: string;
95
+ readonly type: "text";
96
+ } | {
97
+ readonly attrs: {
98
+ readonly latex: string;
99
+ };
100
+ readonly marks?: readonly [{
101
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
102
+ } | {
103
+ readonly attrs: {
104
+ readonly href: string;
105
+ };
106
+ readonly type: "link";
107
+ } | {
108
+ readonly attrs: {
109
+ readonly variant: "success" | "warning" | null;
110
+ };
111
+ readonly type: "highlight";
112
+ }, ...({
113
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
114
+ } | {
115
+ readonly attrs: {
116
+ readonly href: string;
117
+ };
118
+ readonly type: "link";
119
+ } | {
120
+ readonly attrs: {
121
+ readonly variant: "success" | "warning" | null;
122
+ };
123
+ readonly type: "highlight";
124
+ })[]];
125
+ readonly type: "mathInline";
126
+ })[]], E, never, never>>;
127
+ readonly title: RichSlot<E>;
128
+ readonly gradient: Schema.Struct<{
129
+ readonly max: Schema.Finite;
130
+ readonly min: Schema.Finite;
131
+ readonly value: Schema.Finite;
132
+ }>;
133
+ readonly labels: Schema.Struct<{
134
+ readonly atpUse: Schema.optionalKey<RichSlot<E>>;
135
+ readonly direction: Schema.optionalKey<RichSlot<E>>;
136
+ readonly directions: Schema.$Record<Schema.Literals<readonly ["downGradient", "againstGradient"]>, Schema.Trimmed>;
137
+ readonly gradient: Schema.Trimmed;
138
+ readonly mode: Schema.Trimmed;
139
+ readonly modes: Schema.$Record<Schema.Literals<readonly ["simpleDiffusion", "facilitated", "activePump"]>, Schema.optionalKey<Schema.Struct<{
140
+ readonly mechanism: RichSlot<E>;
141
+ readonly name: Schema.Trimmed;
142
+ }>>>;
143
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["bilayer", "channelProtein", "carrierPump", "solute", "atp", "adp"]>, Schema.Trimmed>;
144
+ readonly view: Schema.Trimmed;
145
+ }>;
146
+ readonly modes: Schema.NonEmptyArray<Schema.Literals<readonly ["simpleDiffusion", "facilitated", "activePump"]>>;
147
+ }>, "figure">;
148
+ PlasmolysisCellLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
149
+ readonly description: RichSlot<E>;
150
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
151
+ readonly marks?: readonly [{
152
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
153
+ } | {
154
+ readonly attrs: {
155
+ readonly href: string;
156
+ };
157
+ readonly type: "link";
158
+ } | {
159
+ readonly attrs: {
160
+ readonly variant: "success" | "warning" | null;
161
+ };
162
+ readonly type: "highlight";
163
+ }, ...({
164
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
165
+ } | {
166
+ readonly attrs: {
167
+ readonly href: string;
168
+ };
169
+ readonly type: "link";
170
+ } | {
171
+ readonly attrs: {
172
+ readonly variant: "success" | "warning" | null;
173
+ };
174
+ readonly type: "highlight";
175
+ })[]];
176
+ readonly text: string;
177
+ readonly type: "text";
178
+ } | {
179
+ readonly attrs: {
180
+ readonly latex: string;
181
+ };
182
+ readonly marks?: readonly [{
183
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
184
+ } | {
185
+ readonly attrs: {
186
+ readonly href: string;
187
+ };
188
+ readonly type: "link";
189
+ } | {
190
+ readonly attrs: {
191
+ readonly variant: "success" | "warning" | null;
192
+ };
193
+ readonly type: "highlight";
194
+ }, ...({
195
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
196
+ } | {
197
+ readonly attrs: {
198
+ readonly href: string;
199
+ };
200
+ readonly type: "link";
201
+ } | {
202
+ readonly attrs: {
203
+ readonly variant: "success" | "warning" | null;
204
+ };
205
+ readonly type: "highlight";
206
+ })[]];
207
+ readonly type: "mathInline";
208
+ }, ...({
209
+ readonly marks?: readonly [{
210
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
211
+ } | {
212
+ readonly attrs: {
213
+ readonly href: string;
214
+ };
215
+ readonly type: "link";
216
+ } | {
217
+ readonly attrs: {
218
+ readonly variant: "success" | "warning" | null;
219
+ };
220
+ readonly type: "highlight";
221
+ }, ...({
222
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
223
+ } | {
224
+ readonly attrs: {
225
+ readonly href: string;
226
+ };
227
+ readonly type: "link";
228
+ } | {
229
+ readonly attrs: {
230
+ readonly variant: "success" | "warning" | null;
231
+ };
232
+ readonly type: "highlight";
233
+ })[]];
234
+ readonly text: string;
235
+ readonly type: "text";
236
+ } | {
237
+ readonly attrs: {
238
+ readonly latex: string;
239
+ };
240
+ readonly marks?: readonly [{
241
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
242
+ } | {
243
+ readonly attrs: {
244
+ readonly href: string;
245
+ };
246
+ readonly type: "link";
247
+ } | {
248
+ readonly attrs: {
249
+ readonly variant: "success" | "warning" | null;
250
+ };
251
+ readonly type: "highlight";
252
+ }, ...({
253
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
254
+ } | {
255
+ readonly attrs: {
256
+ readonly href: string;
257
+ };
258
+ readonly type: "link";
259
+ } | {
260
+ readonly attrs: {
261
+ readonly variant: "success" | "warning" | null;
262
+ };
263
+ readonly type: "highlight";
264
+ })[]];
265
+ readonly type: "mathInline";
266
+ })[]], E, never, never>>;
267
+ readonly title: RichSlot<E>;
268
+ readonly cells: Schema.NonEmptyArray<Schema.Literals<readonly ["plant", "redBlood"]>>;
269
+ readonly labels: Schema.Struct<{
270
+ readonly cell: Schema.Trimmed;
271
+ readonly cells: Schema.$Record<Schema.Literals<readonly ["plant", "redBlood"]>, Schema.optionalKey<Schema.Trimmed>>;
272
+ readonly outcome: Schema.optionalKey<RichSlot<E>>;
273
+ readonly outcomes: Schema.$Record<Schema.Literals<readonly ["turgid", "plasmolysed", "haemolysed", "crenated", "normal"]>, Schema.Trimmed>;
274
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["cellWall", "membrane", "vacuole", "cytoplasm", "waterArrow"]>, Schema.Trimmed>;
275
+ readonly solution: Schema.Trimmed;
276
+ readonly solutions: Schema.$Record<Schema.Literals<readonly ["hypotonic", "isotonic", "hypertonic"]>, Schema.optionalKey<Schema.Trimmed>>;
277
+ readonly view: Schema.Trimmed;
278
+ readonly waterFlow: Schema.optionalKey<RichSlot<E>>;
279
+ }>;
280
+ readonly solutions: Schema.NonEmptyArray<Schema.Literals<readonly ["hypotonic", "isotonic", "hypertonic"]>>;
281
+ }>, "figure">;
282
+ };
@@ -0,0 +1,87 @@
1
+ import { Schema } from "effect";
2
+ import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** A non-negative finite measure for concentration gradient controls. */
5
+ const NonNegativeSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
6
+ /** A strictly positive finite upper bound for gradient sliders. */
7
+ const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
8
+ /** A non-negative slider whose minimum sits below its maximum. */
9
+ const GradientSliderSchema = Schema.Struct({
10
+ max: PositiveSchema,
11
+ min: NonNegativeSchema,
12
+ value: NonNegativeSchema,
13
+ }).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
14
+ message: "Expected a gradient range whose minimum is below its maximum, with the starting value between them.",
15
+ }));
16
+ const TRANSPORT_MODES = [
17
+ "simpleDiffusion",
18
+ "facilitated",
19
+ "activePump",
20
+ ];
21
+ const CELL_KINDS = ["plant", "redBlood"];
22
+ const TONICITIES = ["hypotonic", "isotonic", "hypertonic"];
23
+ /**
24
+ * Props of `ActiveTransportPumpLab`: a 3D phospholipid bilayer contrasting
25
+ * simple diffusion, facilitated diffusion through channel proteins, and
26
+ * ATP-driven carrier pumps moving solutes against a concentration gradient.
27
+ * ATP usage and direction readouts are optional answer state.
28
+ */
29
+ function activeTransportPumpLab(rich) {
30
+ return figure(Schema.Struct({
31
+ ...cardFields(rich),
32
+ gradient: GradientSliderSchema,
33
+ labels: Schema.Struct({
34
+ atpUse: Schema.optionalKey(rich),
35
+ direction: Schema.optionalKey(rich),
36
+ directions: byIds(["downGradient", "againstGradient"], TextSchema),
37
+ gradient: TextSchema,
38
+ mode: TextSchema,
39
+ modes: byPickedIds(TRANSPORT_MODES, Schema.Struct({
40
+ mechanism: rich,
41
+ name: TextSchema,
42
+ })),
43
+ parts: byIds(["bilayer", "channelProtein", "carrierPump", "solute", "atp", "adp"], TextSchema),
44
+ view: TextSchema,
45
+ }),
46
+ modes: Schema.NonEmptyArray(Schema.Literals(TRANSPORT_MODES)).check(Schema.isUnique()),
47
+ }).check(Schema.makeFilter(({ labels, modes }) => namesEach(modes, labels.modes), {
48
+ message: "Expected a name and mechanism note for every membrane transport mode shown, and no other.",
49
+ })), answerAt(["labels", "atpUse"], ["labels", "direction"]));
50
+ }
51
+ /**
52
+ * Props of `PlasmolysisCellLab`: a 3D plant cell and red blood cell compared
53
+ * across hypotonic, isotonic, and hypertonic solutions showing turgor,
54
+ * plasmolysis, haemolysis, and crenation. Cell outcome and net water-flow
55
+ * readouts are optional answer state.
56
+ */
57
+ function plasmolysisCellLab(rich) {
58
+ return figure(Schema.Struct({
59
+ ...cardFields(rich),
60
+ cells: Schema.NonEmptyArray(Schema.Literals(CELL_KINDS)).check(Schema.isUnique()),
61
+ labels: Schema.Struct({
62
+ cell: TextSchema,
63
+ cells: byPickedIds(CELL_KINDS, TextSchema),
64
+ outcome: Schema.optionalKey(rich),
65
+ outcomes: byIds(["turgid", "plasmolysed", "haemolysed", "crenated", "normal"], TextSchema),
66
+ parts: byIds(["cellWall", "membrane", "vacuole", "cytoplasm", "waterArrow"], TextSchema),
67
+ solution: TextSchema,
68
+ solutions: byPickedIds(TONICITIES, TextSchema),
69
+ view: TextSchema,
70
+ waterFlow: Schema.optionalKey(rich),
71
+ }),
72
+ solutions: Schema.NonEmptyArray(Schema.Literals(TONICITIES)).check(Schema.isUnique()),
73
+ }).check(Schema.makeFilter(({ cells, labels, solutions }) => namesEach(cells, labels.cells) &&
74
+ namesEach(solutions, labels.solutions), {
75
+ message: "Expected a name for every cell kind and tonicity solution shown, and no other.",
76
+ })), answerAt(["labels", "outcome"], ["labels", "waterFlow"]));
77
+ }
78
+ /**
79
+ * Membrane transport labs covering ATP-driven carrier pumps and osmotic
80
+ * plasmolysis across plant and animal cells.
81
+ */
82
+ export function membraneVisuals(rich) {
83
+ return {
84
+ ActiveTransportPumpLab: activeTransportPumpLab(rich),
85
+ PlasmolysisCellLab: plasmolysisCellLab(rich),
86
+ };
87
+ }
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import type { RichSlot } from "#contracts/visual/card";
3
- /** The neuron labs. The read-out travel time is answer state. */
3
+ /** The neuron and spinal reflex labs. */
4
4
  export declare function neuronVisuals<E>(rich: RichSlot<E>): {
5
5
  NeuronImpulseLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
6
6
  readonly description: RichSlot<E>;
@@ -144,4 +144,139 @@ export declare function neuronVisuals<E>(rich: RichSlot<E>): {
144
144
  }>;
145
145
  readonly length: Schema.Finite;
146
146
  }>, "figure">;
147
+ ReflexArcLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
148
+ readonly description: RichSlot<E>;
149
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
150
+ readonly marks?: readonly [{
151
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
152
+ } | {
153
+ readonly attrs: {
154
+ readonly href: string;
155
+ };
156
+ readonly type: "link";
157
+ } | {
158
+ readonly attrs: {
159
+ readonly variant: "success" | "warning" | null;
160
+ };
161
+ readonly type: "highlight";
162
+ }, ...({
163
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
164
+ } | {
165
+ readonly attrs: {
166
+ readonly href: string;
167
+ };
168
+ readonly type: "link";
169
+ } | {
170
+ readonly attrs: {
171
+ readonly variant: "success" | "warning" | null;
172
+ };
173
+ readonly type: "highlight";
174
+ })[]];
175
+ readonly text: string;
176
+ readonly type: "text";
177
+ } | {
178
+ readonly attrs: {
179
+ readonly latex: string;
180
+ };
181
+ readonly marks?: readonly [{
182
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
183
+ } | {
184
+ readonly attrs: {
185
+ readonly href: string;
186
+ };
187
+ readonly type: "link";
188
+ } | {
189
+ readonly attrs: {
190
+ readonly variant: "success" | "warning" | null;
191
+ };
192
+ readonly type: "highlight";
193
+ }, ...({
194
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
195
+ } | {
196
+ readonly attrs: {
197
+ readonly href: string;
198
+ };
199
+ readonly type: "link";
200
+ } | {
201
+ readonly attrs: {
202
+ readonly variant: "success" | "warning" | null;
203
+ };
204
+ readonly type: "highlight";
205
+ })[]];
206
+ readonly type: "mathInline";
207
+ }, ...({
208
+ readonly marks?: readonly [{
209
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
210
+ } | {
211
+ readonly attrs: {
212
+ readonly href: string;
213
+ };
214
+ readonly type: "link";
215
+ } | {
216
+ readonly attrs: {
217
+ readonly variant: "success" | "warning" | null;
218
+ };
219
+ readonly type: "highlight";
220
+ }, ...({
221
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
222
+ } | {
223
+ readonly attrs: {
224
+ readonly href: string;
225
+ };
226
+ readonly type: "link";
227
+ } | {
228
+ readonly attrs: {
229
+ readonly variant: "success" | "warning" | null;
230
+ };
231
+ readonly type: "highlight";
232
+ })[]];
233
+ readonly text: string;
234
+ readonly type: "text";
235
+ } | {
236
+ readonly attrs: {
237
+ readonly latex: string;
238
+ };
239
+ readonly marks?: readonly [{
240
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
241
+ } | {
242
+ readonly attrs: {
243
+ readonly href: string;
244
+ };
245
+ readonly type: "link";
246
+ } | {
247
+ readonly attrs: {
248
+ readonly variant: "success" | "warning" | null;
249
+ };
250
+ readonly type: "highlight";
251
+ }, ...({
252
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
253
+ } | {
254
+ readonly attrs: {
255
+ readonly href: string;
256
+ };
257
+ readonly type: "link";
258
+ } | {
259
+ readonly attrs: {
260
+ readonly variant: "success" | "warning" | null;
261
+ };
262
+ readonly type: "highlight";
263
+ })[]];
264
+ readonly type: "mathInline";
265
+ })[]], E, never, never>>;
266
+ readonly title: RichSlot<E>;
267
+ readonly labels: Schema.Struct<{
268
+ readonly parts: Schema.$Record<Schema.Literals<readonly ["receptor", "sensoryNeuron", "dorsalRoot", "relayNeuron", "greyMatter", "whiteMatter", "ventralRoot", "motorNeuron", "effector"]>, Schema.Trimmed>;
269
+ readonly pathway: Schema.optionalKey<RichSlot<E>>;
270
+ readonly reflex: Schema.Trimmed;
271
+ readonly reflexes: Schema.$Record<Schema.Literals<readonly ["withdrawal", "kneeJerk"]>, Schema.optionalKey<Schema.Struct<{
272
+ readonly name: Schema.Trimmed;
273
+ readonly response: RichSlot<E>;
274
+ readonly stimulus: RichSlot<E>;
275
+ }>>>;
276
+ readonly step: Schema.Trimmed;
277
+ readonly synapses: Schema.optionalKey<RichSlot<E>>;
278
+ readonly view: Schema.Trimmed;
279
+ }>;
280
+ readonly reflexes: Schema.NonEmptyArray<Schema.Literals<readonly ["withdrawal", "kneeJerk"]>>;
281
+ }>, "figure">;
147
282
  };
@@ -1,6 +1,7 @@
1
1
  import { Schema } from "effect";
2
- import { cardFields, TextSchema } from "#contracts/visual/card";
2
+ import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
+ const REFLEX_TYPES = ["withdrawal", "kneeJerk"];
4
5
  /** A length or a diameter the lab divides by: a finite number above zero. */
5
6
  const PositiveSchema = Schema.Finite.check(Schema.isGreaterThan(0));
6
7
  /** One nerve fibre the reader can send an impulse along. */
@@ -40,9 +41,47 @@ function neuronImpulseLab(rich) {
40
41
  length: PositiveSchema,
41
42
  });
42
43
  }
43
- /** The neuron labs. The read-out travel time is answer state. */
44
+ /**
45
+ * Props of `ReflexArcLab`: a 3D spinal-cord transverse cross-section and limb
46
+ * reflex arc comparing three-neuron withdrawal and two-neuron knee-jerk
47
+ * pathways from receptor to effector. Pathway sequence and synapse count
48
+ * readouts are optional answer state.
49
+ */
50
+ function reflexArcLab(rich) {
51
+ return figure(Schema.Struct({
52
+ ...cardFields(rich),
53
+ labels: Schema.Struct({
54
+ parts: byIds([
55
+ "receptor",
56
+ "sensoryNeuron",
57
+ "dorsalRoot",
58
+ "relayNeuron",
59
+ "greyMatter",
60
+ "whiteMatter",
61
+ "ventralRoot",
62
+ "motorNeuron",
63
+ "effector",
64
+ ], TextSchema),
65
+ pathway: Schema.optionalKey(rich),
66
+ reflex: TextSchema,
67
+ reflexes: byPickedIds(REFLEX_TYPES, Schema.Struct({
68
+ name: TextSchema,
69
+ response: rich,
70
+ stimulus: rich,
71
+ })),
72
+ step: TextSchema,
73
+ synapses: Schema.optionalKey(rich),
74
+ view: TextSchema,
75
+ }),
76
+ reflexes: Schema.NonEmptyArray(Schema.Literals(REFLEX_TYPES)).check(Schema.isUnique()),
77
+ }).check(Schema.makeFilter(({ labels, reflexes }) => namesEach(reflexes, labels.reflexes), {
78
+ message: "Expected a name, stimulus, and response for every reflex arc shown, and no other.",
79
+ })), answerAt(["labels", "pathway"], ["labels", "synapses"]));
80
+ }
81
+ /** The neuron and spinal reflex labs. */
44
82
  export function neuronVisuals(rich) {
45
83
  return {
46
84
  NeuronImpulseLab: figure(neuronImpulseLab(rich), answerAt(["labels", "time"])),
85
+ ReflexArcLab: reflexArcLab(rich),
47
86
  };
48
87
  }