@nakafa/aksara-contracts 8.4.0 → 8.8.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 (238) hide show
  1. package/dist/assessment/document.d.ts +1 -1
  2. package/dist/assessment/document.js +1 -1
  3. package/dist/assessment/figure.d.ts +1 -1
  4. package/dist/assessment/figure.js +1 -1
  5. package/dist/assessment/fit.d.ts +3 -3
  6. package/dist/assessment/fit.js +3 -3
  7. package/dist/assessment/locales.d.ts +1 -1
  8. package/dist/assessment/scoring.d.ts +1 -1
  9. package/dist/assessment/scoring.js +1 -1
  10. package/dist/cache/content.d.ts +1 -1
  11. package/dist/cache/content.js +1 -1
  12. package/dist/content.d.ts +3 -2
  13. package/dist/graph/identity.d.ts +1 -1
  14. package/dist/graph/identity.js +1 -1
  15. package/dist/hash/sha256.d.ts +16 -0
  16. package/dist/hash/sha256.js +164 -0
  17. package/dist/hash/stream.d.ts +7 -5
  18. package/dist/hash/stream.js +13 -18
  19. package/dist/math/boundary.js +3 -22
  20. package/dist/math/bounds.d.ts +1 -1
  21. package/dist/math/collision.d.ts +1 -1
  22. package/dist/math/coordinate.d.ts +6 -5
  23. package/dist/math/coordinate.js +2 -2
  24. package/dist/math/edge.d.ts +11 -0
  25. package/dist/math/edge.js +74 -0
  26. package/dist/math/formula/compile.d.ts +1 -1
  27. package/dist/math/formula/compile.js +1 -1
  28. package/dist/math/formula/contour.d.ts +1 -1
  29. package/dist/math/formula/contour.js +1 -1
  30. package/dist/math/formula/field.js +1 -1
  31. package/dist/math/formula/mesh.d.ts +1 -1
  32. package/dist/math/formula/mesh.js +1 -1
  33. package/dist/math/formula/names.d.ts +1 -1
  34. package/dist/math/formula/names.js +1 -1
  35. package/dist/math/formula/parse.d.ts +1 -1
  36. package/dist/math/formula/parse.js +1 -1
  37. package/dist/math/formula/plane.d.ts +2 -2
  38. package/dist/math/formula/plane.js +3 -3
  39. package/dist/math/formula/reader.d.ts +2 -1
  40. package/dist/math/formula/reader.js +1 -1
  41. package/dist/math/formula/region.d.ts +2 -2
  42. package/dist/math/formula/region.js +3 -3
  43. package/dist/math/formula/sample.d.ts +1 -1
  44. package/dist/math/formula/scan.d.ts +1 -1
  45. package/dist/math/formula/scan.js +1 -1
  46. package/dist/math/formula/slider.d.ts +2 -2
  47. package/dist/math/formula/slider.js +1 -1
  48. package/dist/math/formula/space.d.ts +1 -1
  49. package/dist/math/formula/space.js +1 -1
  50. package/dist/math/graph.d.ts +9 -0
  51. package/dist/math/graph.js +66 -0
  52. package/dist/math/plane.js +6 -0
  53. package/dist/math/precision.d.ts +1 -1
  54. package/dist/math/precision.js +1 -1
  55. package/dist/math/resolution.js +1 -1
  56. package/dist/math/scene.d.ts +2 -2
  57. package/dist/math/shape.d.ts +392 -0
  58. package/dist/math/shape.js +59 -0
  59. package/dist/math/straight.d.ts +13 -0
  60. package/dist/math/straight.js +26 -0
  61. package/dist/math/vector.d.ts +1 -1
  62. package/dist/preview/spec.js +1 -1
  63. package/dist/program/curriculum.d.ts +1 -1
  64. package/dist/program/curriculum.js +1 -1
  65. package/dist/program/snapshot/digest.d.ts +1 -1
  66. package/dist/program/snapshot/digest.js +2 -2
  67. package/dist/program/snapshot/hash.d.ts +2 -2
  68. package/dist/projection/digest.d.ts +1 -1
  69. package/dist/projection/digest.js +1 -1
  70. package/dist/projection/hash.js +1 -1
  71. package/dist/projection/material.d.ts +1 -1
  72. package/dist/projection/material.js +1 -1
  73. package/dist/projection/verify.js +1 -1
  74. package/dist/quran/identity.d.ts +2 -1
  75. package/dist/quran/provenance.d.ts +2 -2
  76. package/dist/quran/provenance.js +1 -1
  77. package/dist/quran/snapshot/hash.d.ts +1 -1
  78. package/dist/quran/snapshot/row/hash.d.ts +1 -1
  79. package/dist/quran/snapshot/row/hash.js +1 -1
  80. package/dist/quran/snapshot/spec.js +1 -1
  81. package/dist/quran/source.d.ts +2 -2
  82. package/dist/release/current/evidence.d.ts +1 -1
  83. package/dist/release/current/evidence.js +1 -1
  84. package/dist/release/current/state.d.ts +1 -1
  85. package/dist/release/current/state.js +1 -1
  86. package/dist/release/head.js +1 -1
  87. package/dist/release/items.d.ts +1 -1
  88. package/dist/release/items.js +1 -1
  89. package/dist/release/policy.d.ts +1 -1
  90. package/dist/release/policy.js +1 -1
  91. package/dist/release/result/digest.d.ts +3 -3
  92. package/dist/release/result/digest.js +2 -2
  93. package/dist/release/rollback/digest.d.ts +1 -1
  94. package/dist/release/rollback/digest.js +1 -1
  95. package/dist/release/route/digest.d.ts +1 -1
  96. package/dist/release/route/digest.js +1 -1
  97. package/dist/release/snapshot/evidence/assessment.d.ts +1 -1
  98. package/dist/release/snapshot/evidence/assessment.js +1 -1
  99. package/dist/release/snapshot/evidence/program.d.ts +1 -1
  100. package/dist/release/snapshot/evidence/program.js +1 -1
  101. package/dist/release/snapshot/evidence/quran.d.ts +1 -1
  102. package/dist/release/snapshot/evidence/quran.js +1 -1
  103. package/dist/release/snapshot/evidence/requirement.d.ts +3 -2
  104. package/dist/release/snapshot/evidence/requirement.js +1 -1
  105. package/dist/release/snapshot/spec.d.ts +2 -2
  106. package/dist/release/snapshot/spec.js +1 -1
  107. package/dist/release/snapshot/verify.d.ts +1 -1
  108. package/dist/release/snapshot/verify.js +1 -1
  109. package/dist/release/spec.d.ts +1 -1
  110. package/dist/release/verify.d.ts +1 -1
  111. package/dist/release/verify.js +1 -1
  112. package/dist/renderer/compatibility.d.ts +1 -1
  113. package/dist/renderer/compatibility.js +2 -2
  114. package/dist/renderer/contract.d.ts +1 -1
  115. package/dist/renderer/contract.js +1 -1
  116. package/dist/runtime/spec.js +2 -2
  117. package/dist/signature/spec.d.ts +3 -2
  118. package/dist/signature/verify.d.ts +2 -1
  119. package/dist/transport/request.d.ts +1 -1
  120. package/dist/visual/base/math.d.ts +1 -1
  121. package/dist/visual/base/media.d.ts +1 -1
  122. package/dist/visual/biology/bacteria.d.ts +1 -1
  123. package/dist/visual/biology/bacteria.js +1 -1
  124. package/dist/visual/biology/blood.d.ts +91 -0
  125. package/dist/visual/biology/blood.js +55 -0
  126. package/dist/visual/biology/cell.d.ts +1 -1
  127. package/dist/visual/biology/climate.d.ts +1 -1
  128. package/dist/visual/biology/climate.js +1 -1
  129. package/dist/visual/biology/ecology.d.ts +1 -1
  130. package/dist/visual/biology/heart.d.ts +92 -0
  131. package/dist/visual/biology/heart.js +54 -0
  132. package/dist/visual/biology/mitochondrion.d.ts +91 -0
  133. package/dist/visual/biology/mitochondrion.js +45 -0
  134. package/dist/visual/biology/muscle.d.ts +103 -0
  135. package/dist/visual/biology/muscle.js +62 -0
  136. package/dist/visual/biology/neuron.d.ts +97 -0
  137. package/dist/visual/biology/neuron.js +48 -0
  138. package/dist/visual/biology/paddy.d.ts +100 -0
  139. package/dist/visual/biology/paddy.js +54 -0
  140. package/dist/visual/biology/physiology.d.ts +1 -1
  141. package/dist/visual/biology/physiology.js +1 -1
  142. package/dist/visual/biology/plant.d.ts +1 -1
  143. package/dist/visual/biology/plant.js +1 -1
  144. package/dist/visual/biology/synapse.d.ts +101 -0
  145. package/dist/visual/biology/synapse.js +46 -0
  146. package/dist/visual/biology/vessel.d.ts +104 -0
  147. package/dist/visual/biology/vessel.js +60 -0
  148. package/dist/visual/biology/yeast.d.ts +108 -0
  149. package/dist/visual/biology/yeast.js +61 -0
  150. package/dist/visual/biology.d.ts +1 -1
  151. package/dist/visual/catalog.d.ts +2177 -778
  152. package/dist/visual/catalog.js +28 -0
  153. package/dist/visual/chemistry/atom.d.ts +1 -1
  154. package/dist/visual/chemistry/atom.js +1 -1
  155. package/dist/visual/chemistry/balance.d.ts +1 -1
  156. package/dist/visual/chemistry/balance.js +1 -1
  157. package/dist/visual/chemistry/bonding.d.ts +1 -1
  158. package/dist/visual/chemistry/discovery.d.ts +1 -1
  159. package/dist/visual/chemistry/electrochemistry.d.ts +1 -1
  160. package/dist/visual/chemistry/electrochemistry.js +1 -1
  161. package/dist/visual/chemistry/electron.d.ts +1 -1
  162. package/dist/visual/chemistry/electron.js +1 -1
  163. package/dist/visual/chemistry/laws.d.ts +1 -1
  164. package/dist/visual/chemistry/laws.js +1 -1
  165. package/dist/visual/chemistry/particles.d.ts +1 -1
  166. package/dist/visual/chemistry/periodic.d.ts +1 -1
  167. package/dist/visual/chemistry/periodic.js +1 -1
  168. package/dist/visual/chemistry/rate.d.ts +1 -1
  169. package/dist/visual/chemistry/rate.js +1 -1
  170. package/dist/visual/chemistry/reaction.d.ts +1 -1
  171. package/dist/visual/chemistry/reaction.js +1 -1
  172. package/dist/visual/chemistry/titration.d.ts +1 -1
  173. package/dist/visual/chemistry/titration.js +1 -1
  174. package/dist/visual/mathematics/chance.d.ts +1 -1
  175. package/dist/visual/mathematics/chance.js +1 -1
  176. package/dist/visual/mathematics/chart.d.ts +1 -1
  177. package/dist/visual/mathematics/charts.d.ts +1 -1
  178. package/dist/visual/mathematics/function.d.ts +1 -1
  179. package/dist/visual/mathematics/journey.d.ts +118 -0
  180. package/dist/visual/mathematics/journey.js +125 -0
  181. package/dist/visual/mathematics/logic.d.ts +90 -0
  182. package/dist/visual/mathematics/logic.js +49 -0
  183. package/dist/visual/mathematics/network.d.ts +101 -0
  184. package/dist/visual/mathematics/network.js +97 -0
  185. package/dist/visual/mathematics/numeral.d.ts +82 -1
  186. package/dist/visual/mathematics/numeral.js +49 -1
  187. package/dist/visual/mathematics/sets.d.ts +92 -0
  188. package/dist/visual/mathematics/sets.js +95 -0
  189. package/dist/visual/physics/braking.d.ts +1 -1
  190. package/dist/visual/physics/braking.js +1 -1
  191. package/dist/visual/physics/circuit.d.ts +1 -1
  192. package/dist/visual/physics/circular.d.ts +1 -1
  193. package/dist/visual/physics/circular.js +1 -1
  194. package/dist/visual/physics/dynamics.d.ts +1 -1
  195. package/dist/visual/physics/dynamics.js +1 -1
  196. package/dist/visual/physics/efficiency.d.ts +1 -1
  197. package/dist/visual/physics/efficiency.js +1 -1
  198. package/dist/visual/physics/electronics.d.ts +1 -1
  199. package/dist/visual/physics/falling.d.ts +1 -1
  200. package/dist/visual/physics/falling.js +1 -1
  201. package/dist/visual/physics/field.d.ts +1 -1
  202. package/dist/visual/physics/fluid.d.ts +1 -1
  203. package/dist/visual/physics/fluid.js +1 -1
  204. package/dist/visual/physics/force.d.ts +1 -1
  205. package/dist/visual/physics/gravity.d.ts +1 -1
  206. package/dist/visual/physics/heat.d.ts +1 -1
  207. package/dist/visual/physics/heat.js +1 -1
  208. package/dist/visual/physics/instrument.d.ts +1 -1
  209. package/dist/visual/physics/light.d.ts +1 -1
  210. package/dist/visual/physics/light.js +1 -1
  211. package/dist/visual/physics/measurement.d.ts +1 -1
  212. package/dist/visual/physics/measurement.js +1 -1
  213. package/dist/visual/physics/motion.d.ts +1 -1
  214. package/dist/visual/physics/nuclear.d.ts +1 -1
  215. package/dist/visual/physics/parabolic.d.ts +1 -1
  216. package/dist/visual/physics/position.d.ts +1 -1
  217. package/dist/visual/physics/position.js +1 -1
  218. package/dist/visual/physics/power.d.ts +1 -1
  219. package/dist/visual/physics/power.js +1 -1
  220. package/dist/visual/physics/precision.d.ts +1 -1
  221. package/dist/visual/physics/precision.js +1 -1
  222. package/dist/visual/physics/product.d.ts +1 -1
  223. package/dist/visual/physics/reading.d.ts +1 -1
  224. package/dist/visual/physics/reading.js +1 -1
  225. package/dist/visual/physics/record.d.ts +1 -1
  226. package/dist/visual/physics/record.js +1 -1
  227. package/dist/visual/physics/relative.d.ts +1 -1
  228. package/dist/visual/physics/relative.js +1 -1
  229. package/dist/visual/physics/solar.d.ts +1 -1
  230. package/dist/visual/physics/solar.js +1 -1
  231. package/dist/visual/physics/thermodynamics.d.ts +117 -0
  232. package/dist/visual/physics/thermodynamics.js +95 -0
  233. package/dist/visual/physics/vector.d.ts +1 -1
  234. package/dist/visual/physics/vector.js +1 -1
  235. package/dist/visual/physics/velocity.d.ts +1 -1
  236. package/dist/visual/physics/wave.d.ts +1 -1
  237. package/dist/visual/politics.d.ts +1 -1
  238. package/package.json +2 -2
@@ -5,11 +5,20 @@ import { mathVisuals } from "#contracts/visual/base/math";
5
5
  import { mediaVisuals } from "#contracts/visual/base/media";
6
6
  import { biologyVisuals } from "#contracts/visual/biology";
7
7
  import { bacteriaVisuals } from "#contracts/visual/biology/bacteria";
8
+ import { bloodVisuals } from "#contracts/visual/biology/blood";
8
9
  import { cellVisuals } from "#contracts/visual/biology/cell";
9
10
  import { climateVisuals } from "#contracts/visual/biology/climate";
10
11
  import { ecologyVisuals } from "#contracts/visual/biology/ecology";
12
+ import { heartVisuals } from "#contracts/visual/biology/heart";
13
+ import { mitochondrionVisuals } from "#contracts/visual/biology/mitochondrion";
14
+ import { muscleVisuals } from "#contracts/visual/biology/muscle";
15
+ import { neuronVisuals } from "#contracts/visual/biology/neuron";
16
+ import { paddyVisuals } from "#contracts/visual/biology/paddy";
11
17
  import { physiologyVisuals } from "#contracts/visual/biology/physiology";
12
18
  import { plantVisuals } from "#contracts/visual/biology/plant";
19
+ import { synapseVisuals } from "#contracts/visual/biology/synapse";
20
+ import { vesselVisuals } from "#contracts/visual/biology/vessel";
21
+ import { yeastVisuals } from "#contracts/visual/biology/yeast";
13
22
  import { atomVisuals } from "#contracts/visual/chemistry/atom";
14
23
  import { balanceVisuals } from "#contracts/visual/chemistry/balance";
15
24
  import { bondingVisuals } from "#contracts/visual/chemistry/bonding";
@@ -26,7 +35,11 @@ import { chanceVisuals } from "#contracts/visual/mathematics/chance";
26
35
  import { chartVisuals } from "#contracts/visual/mathematics/charts";
27
36
  import { functionVisuals } from "#contracts/visual/mathematics/function";
28
37
  import { geometryVisuals } from "#contracts/visual/mathematics/geometry";
38
+ import { journeyVisuals } from "#contracts/visual/mathematics/journey";
39
+ import { logicVisuals } from "#contracts/visual/mathematics/logic";
40
+ import { networkVisuals } from "#contracts/visual/mathematics/network";
29
41
  import { numeralVisuals } from "#contracts/visual/mathematics/numeral";
42
+ import { setVisuals } from "#contracts/visual/mathematics/sets";
30
43
  import { brakingVisuals } from "#contracts/visual/physics/braking";
31
44
  import { circuitVisuals } from "#contracts/visual/physics/circuit";
32
45
  import { circularVisuals } from "#contracts/visual/physics/circular";
@@ -53,6 +66,7 @@ import { readingVisuals } from "#contracts/visual/physics/reading";
53
66
  import { recordVisuals } from "#contracts/visual/physics/record";
54
67
  import { relativeVisuals } from "#contracts/visual/physics/relative";
55
68
  import { solarVisuals } from "#contracts/visual/physics/solar";
69
+ import { thermodynamicsVisuals } from "#contracts/visual/physics/thermodynamics";
56
70
  import { vectorVisuals } from "#contracts/visual/physics/vector";
57
71
  import { velocityVisuals } from "#contracts/visual/physics/velocity";
58
72
  import { waveVisuals } from "#contracts/visual/physics/wave";
@@ -85,7 +99,11 @@ export function visualCatalog(rich) {
85
99
  ...chartVisuals(rich),
86
100
  ...functionVisuals(rich),
87
101
  ...geometryVisuals(rich),
102
+ ...journeyVisuals(rich),
103
+ ...logicVisuals(rich),
104
+ ...networkVisuals(rich),
88
105
  ...numeralVisuals(rich),
106
+ ...setVisuals(rich),
89
107
  ...measurementVisuals(rich),
90
108
  ...motionVisuals(rich),
91
109
  ...parabolicVisuals(rich),
@@ -96,6 +114,15 @@ export function visualCatalog(rich) {
96
114
  ...ecologyVisuals(rich),
97
115
  ...physiologyVisuals(rich),
98
116
  ...plantVisuals(rich),
117
+ ...heartVisuals(rich),
118
+ ...vesselVisuals(rich),
119
+ ...bloodVisuals(rich),
120
+ ...neuronVisuals(rich),
121
+ ...synapseVisuals(rich),
122
+ ...mitochondrionVisuals(rich),
123
+ ...muscleVisuals(rich),
124
+ ...yeastVisuals(rich),
125
+ ...paddyVisuals(rich),
99
126
  ...balanceVisuals(rich),
100
127
  ...bondingVisuals(rich),
101
128
  ...discoveryVisuals(rich),
@@ -120,6 +147,7 @@ export function visualCatalog(rich) {
120
147
  ...fluidVisuals(rich),
121
148
  ...gravityVisuals(rich),
122
149
  ...heatVisuals(rich),
150
+ ...thermodynamicsVisuals(rich),
123
151
  ...lightVisuals(rich),
124
152
  ...nuclearVisuals(rich),
125
153
  ...readingVisuals(rich),
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /** The atoms the shell model lab can show. */
4
4
  export declare const SHELL_SAMPLES: readonly ["neon", "magnesium", "chlorine", "argon", "potassium", "calcium"];
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The cutting stages of the ancient atom thought experiment. */
5
5
  const ANCIENT_LEVELS = [
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The props of the mass conservation and equation balancing labs. No prop
5
5
  * states the conclusion a lab leads to, so none holds answer state.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { figure } from "#contracts/visual/entry";
4
4
  /**
5
5
  * Props of `FizzBalanceLab`: baking soda drops into vinegar in a flask that
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The props of the labs of orbitals, ions, and bonds. No prop states the
5
5
  * conclusion a lab leads to, so none holds answer state.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The props of the labs of the experiments that found atomic structure. No prop
5
5
  * states the conclusion a lab leads to, so none holds answer state.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /** The electrochemistry labs. */
4
4
  export declare function electrochemistryVisuals<E>(rich: RichSlot<E>): {
5
5
  ChemicalCellLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The aqueous electrolytes an electrolysis cell can hold. */
5
5
  const ELECTROLYTES = [
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The electron labs. A sample note states the configuration it leads to, and
5
5
  * a tendency states how the atom reacts, so both are answer state.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The atoms the electron configuration lab can show. */
5
5
  const CONFIGURATION_SAMPLES = [
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The labs of the basic chemical laws. A ratio, a leftover, and a calculation
5
5
  * state the result each law predicts, so they are answer state.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The reactions of the law of combining volumes. */
5
5
  const COMBINING_MODES = [
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The particle labs. A category and a reading say what a particle is, a note
5
5
  * says what an isotope shows, and a summary says what a property means, so
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The periodic table labs. A focus detail explains what a part of the table
5
5
  * shares, and a trend and its cause state how a property changes and why, so
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The parts of the periodic table the table lab can focus on. */
5
5
  const TABLE_FOCUSES = [
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /** The rate of reaction labs. */
4
4
  export declare function rateVisuals<E>(rich: RichSlot<E>): {
5
5
  GasRateLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** How finely a solid reactant is divided. */
5
5
  const SOLIDS = ["chips", "granules", "powder"];
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The reaction labs. A meaning says what a cue tells, an equation and its
5
5
  * check balance a reaction, so they are answer state.
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The cues that show a reaction happened. */
5
5
  const REACTION_CUES = ["gas", "precipitate", "color", "energy"];
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /** The volumetric analysis labs. */
4
4
  export declare function titrationVisuals<E>(rich: RichSlot<E>): {
5
5
  TitrationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** What the burette can deliver. */
5
5
  const TITRANTS = [
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /** The probability labs, where a random experiment runs many times. */
4
4
  export declare function chanceVisuals<E>(rich: RichSlot<E>): {
5
5
  DiceRollLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
@@ -1,5 +1,5 @@
1
1
  import { Array as Arr, Schema } from "effect";
2
- import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
3
  import { answerAt, figure } from "#contracts/visual/entry";
4
4
  /** The marble glazes the jar can hold. */
5
5
  const MARBLE_COLORS = ["red", "blue", "green", "yellow", "white"];
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * Props of `Chart`: categories along one axis and one or more series of
5
5
  * values drawn as bars or lines over them, the data of a bar chart, a line
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The charts of data and functions. A regression line and its residuals are
5
5
  * the result of fitting the points, so they are answer state; the data a chart
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { type RichSlot } from "#contracts/visual/card";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
3
  /**
4
4
  * The visuals of functions, relations, and sequences. The output of the
5
5
  * inverse machine is the value the reader would compute, so it is answer
@@ -0,0 +1,118 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /** The motion-graph labs, where a journey is read from its distance-time graph. */
4
+ export declare function journeyVisuals<E>(rich: RichSlot<E>): {
5
+ JourneyGraphLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
6
+ readonly description: RichSlot<E>;
7
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
8
+ readonly attrs: {
9
+ readonly latex: string;
10
+ };
11
+ readonly type: "mathInline";
12
+ } | {
13
+ readonly marks?: readonly [{
14
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
15
+ } | {
16
+ readonly attrs: {
17
+ readonly href: string;
18
+ };
19
+ readonly type: "link";
20
+ } | {
21
+ readonly attrs: {
22
+ readonly variant: "success" | "warning" | null;
23
+ };
24
+ readonly type: "highlight";
25
+ }, ...({
26
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
27
+ } | {
28
+ readonly attrs: {
29
+ readonly href: string;
30
+ };
31
+ readonly type: "link";
32
+ } | {
33
+ readonly attrs: {
34
+ readonly variant: "success" | "warning" | null;
35
+ };
36
+ readonly type: "highlight";
37
+ })[]];
38
+ readonly text: string;
39
+ readonly type: "text";
40
+ }, ...({
41
+ readonly attrs: {
42
+ readonly latex: string;
43
+ };
44
+ readonly type: "mathInline";
45
+ } | {
46
+ readonly marks?: readonly [{
47
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
48
+ } | {
49
+ readonly attrs: {
50
+ readonly href: string;
51
+ };
52
+ readonly type: "link";
53
+ } | {
54
+ readonly attrs: {
55
+ readonly variant: "success" | "warning" | null;
56
+ };
57
+ readonly type: "highlight";
58
+ }, ...({
59
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
60
+ } | {
61
+ readonly attrs: {
62
+ readonly href: string;
63
+ };
64
+ readonly type: "link";
65
+ } | {
66
+ readonly attrs: {
67
+ readonly variant: "success" | "warning" | null;
68
+ };
69
+ readonly type: "highlight";
70
+ })[]];
71
+ readonly text: string;
72
+ readonly type: "text";
73
+ })[]], E, never, never>>;
74
+ readonly title: RichSlot<E>;
75
+ readonly bus: Schema.Struct<{
76
+ readonly legs: Schema.NonEmptyArray<Schema.Struct<{
77
+ readonly change: Schema.Finite;
78
+ readonly minutes: Schema.Int;
79
+ }>>;
80
+ readonly name: Schema.Trimmed;
81
+ }>;
82
+ readonly labels: Schema.Struct<{
83
+ readonly average: RichSlot<E>;
84
+ readonly axes: Schema.Struct<{
85
+ readonly distance: Schema.Trimmed;
86
+ readonly time: Schema.Trimmed;
87
+ }>;
88
+ readonly distance: RichSlot<E>;
89
+ readonly meeting: Schema.optionalKey<RichSlot<E>>;
90
+ readonly motion: Schema.$Record<Schema.Literals<readonly ["away", "back", "still"]>, RichSlot<E>>;
91
+ readonly parts: Schema.Trimmed;
92
+ readonly speed: RichSlot<E>;
93
+ readonly time: Schema.Trimmed;
94
+ readonly units: Schema.Struct<{
95
+ readonly distance: Schema.Trimmed;
96
+ readonly speed: Schema.Trimmed;
97
+ readonly time: Schema.Trimmed;
98
+ }>;
99
+ readonly viewLabel: Schema.Trimmed;
100
+ readonly whole: Schema.Trimmed;
101
+ }>;
102
+ readonly second: Schema.optionalKey<Schema.Struct<{
103
+ readonly depart: Schema.Int;
104
+ readonly from: Schema.Finite;
105
+ readonly legs: Schema.NonEmptyArray<Schema.Struct<{
106
+ readonly change: Schema.Finite;
107
+ readonly minutes: Schema.Int;
108
+ }>>;
109
+ readonly name: Schema.Trimmed;
110
+ }>>;
111
+ readonly showMeeting: Schema.optionalKey<Schema.Boolean>;
112
+ readonly showSpeeds: Schema.optionalKey<Schema.Boolean>;
113
+ readonly stops: Schema.optionalKey<Schema.$Array<Schema.Struct<{
114
+ readonly at: Schema.Finite;
115
+ readonly name: Schema.Trimmed;
116
+ }>>>;
117
+ }>, "figure">;
118
+ };
@@ -0,0 +1,125 @@
1
+ import { Array as Arr, Schema } from "effect";
2
+ import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
3
+ import { answerAt, figure } from "#contracts/visual/entry";
4
+ /** How a leg moves: away from the start, back toward it, or not at all. */
5
+ const MOTIONS = ["away", "back", "still"];
6
+ /** The most legs one traveller drives, so the toolbar's leg picker fits a phone. */
7
+ const LEG_LIMIT = 5;
8
+ /** A whole number of minutes, at least zero. */
9
+ const MinuteSchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
10
+ /** A distance from the start of the road in kilometres, never behind it. */
11
+ const DistanceSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
12
+ /** One leg: how many whole minutes it lasts, and how it changes the distance from the start, in kilometres. */
13
+ const LegSchema = Schema.Struct({
14
+ change: Schema.Finite,
15
+ minutes: Schema.Int.check(Schema.isGreaterThan(0)),
16
+ });
17
+ /** A traveller's legs in order, one to five of them. */
18
+ const LegsSchema = Schema.NonEmptyArray(LegSchema).check(Schema.isMaxLength(LEG_LIMIT));
19
+ /** The bus: it leaves the start of the road at minute 0. */
20
+ const BusSchema = Schema.Struct({ legs: LegsSchema, name: TextSchema });
21
+ /** A second traveller on the same road, leaving at its own minute and place. */
22
+ const SecondSchema = Schema.Struct({
23
+ depart: MinuteSchema,
24
+ from: DistanceSchema,
25
+ legs: LegsSchema,
26
+ name: TextSchema,
27
+ });
28
+ /** A named place on the road, such as a stop, at its distance from the start. */
29
+ const StopSchema = Schema.Struct({ at: DistanceSchema, name: TextSchema });
30
+ /** Whether a distance is written to at most one decimal place, as the graph's readouts print it. */
31
+ function inTenths(value) {
32
+ return Math.abs(value * 10 - Math.round(value * 10)) < 1e-9;
33
+ }
34
+ /** The distances from the start after each leg, beginning at `from`. */
35
+ function distancesAfter(from, legs) {
36
+ return Arr.scan(legs, from, (distance, leg) => distance + leg.change);
37
+ }
38
+ /** Whether a traveller's legs keep it on the road, never behind its start. */
39
+ function staysOnRoad(from, legs) {
40
+ return Arr.every(distancesAfter(from, legs), (distance) => distance >= 0);
41
+ }
42
+ /** Where the bus is at a minute: it moves steadily through each leg and waits at the end of its last. */
43
+ function busAt(legs, minute) {
44
+ return Arr.reduce(legs, { distance: 0, start: 0 }, (state, leg) => {
45
+ const into = Math.min(Math.max(minute - state.start, 0), leg.minutes);
46
+ return {
47
+ distance: state.distance + (leg.change * into) / leg.minutes,
48
+ start: state.start + leg.minutes,
49
+ };
50
+ }).distance;
51
+ }
52
+ /** Whether the second traveller sets off apart from the bus, so their first meeting is a real crossing. */
53
+ function startsApart(legs, second) {
54
+ return (second === undefined ||
55
+ Math.abs(busAt(legs, second.depart) - second.from) > 1e-9);
56
+ }
57
+ /** Whether the stops sit at distinct places within the stretch the bus drives. */
58
+ function stopsOnRoute(legs, stops) {
59
+ const farthest = Math.max(...distancesAfter(0, legs));
60
+ const places = Arr.map(stops, ({ at }) => at);
61
+ return (Arr.dedupe(places).length === places.length &&
62
+ Arr.every(places, (at) => at <= farthest));
63
+ }
64
+ /**
65
+ * Whether the journey draws a graph the lab can read: every change in
66
+ * tenths of a kilometre, at least one leg of the bus moving, both travellers
67
+ * staying on the road, a second traveller setting off apart from the bus,
68
+ * and the stops on the bus's stretch of road.
69
+ */
70
+ function isJourney(bus, second, stops) {
71
+ const legs = Arr.appendAll(bus.legs, second?.legs ?? []);
72
+ return (Arr.every(legs, ({ change }) => inTenths(change)) &&
73
+ Arr.some(bus.legs, ({ change }) => change !== 0) &&
74
+ staysOnRoad(0, bus.legs) &&
75
+ (second === undefined || staysOnRoad(second.from, second.legs)) &&
76
+ startsApart(bus.legs, second) &&
77
+ stopsOnRoute(bus.legs, stops));
78
+ }
79
+ /**
80
+ * Props of `JourneyGraphLab`: a bus drives one straight road through its
81
+ * `stops` while its distance-time graph draws itself on graph paper beside
82
+ * the road, the paper's distance axis running the same way and to the same
83
+ * scale as the road. Each leg is a segment named by its corners O, A, B and
84
+ * on; picking one draws its rise and run, and the footer works out its speed
85
+ * as distance over time, while the whole journey shows its average speed.
86
+ * An optional `second` traveller has its own line, and where the two lines
87
+ * first cross they meet. Speeds are in the unit per hour, worked out from
88
+ * kilometres and minutes. With `showSpeeds`, the footer shows each speed,
89
+ * and with `showMeeting` the meeting time and place and its mark on the
90
+ * graph, so both are answer state.
91
+ */
92
+ function journeyGraphLab(rich) {
93
+ return figure(Schema.Struct({
94
+ ...cardFields(rich),
95
+ bus: BusSchema,
96
+ labels: Schema.Struct({
97
+ average: rich,
98
+ axes: Schema.Struct({ distance: TextSchema, time: TextSchema }),
99
+ distance: rich,
100
+ meeting: Schema.optionalKey(rich),
101
+ motion: byIds(MOTIONS, rich),
102
+ parts: TextSchema,
103
+ speed: rich,
104
+ time: TextSchema,
105
+ units: Schema.Struct({
106
+ distance: TextSchema,
107
+ speed: TextSchema,
108
+ time: TextSchema,
109
+ }),
110
+ viewLabel: TextSchema,
111
+ whole: TextSchema,
112
+ }),
113
+ second: Schema.optionalKey(SecondSchema),
114
+ showMeeting: Schema.optionalKey(Schema.Boolean),
115
+ showSpeeds: Schema.optionalKey(Schema.Boolean),
116
+ stops: Schema.optionalKey(Schema.Array(StopSchema)),
117
+ }).check(Schema.makeFilter(({ bus, labels, second, stops = [] }) => isJourney(bus, second, stops) &&
118
+ (second === undefined || labels.meeting !== undefined), {
119
+ message: "Expected changes in tenths of a kilometre, a bus that moves, travellers that never go behind the start, a second traveller that sets off apart from the bus with a meeting label, and stops at distinct places on the bus's stretch.",
120
+ })), answerAt(["showSpeeds"], ["showMeeting"]));
121
+ }
122
+ /** The motion-graph labs, where a journey is read from its distance-time graph. */
123
+ export function journeyVisuals(rich) {
124
+ return { JourneyGraphLab: journeyGraphLab(rich) };
125
+ }
@@ -0,0 +1,90 @@
1
+ import { Schema } from "effect";
2
+ import type { RichSlot } from "#contracts/visual/card";
3
+ /** The logic labs, where the truth of a compound statement is read. */
4
+ export declare function logicVisuals<E>(rich: RichSlot<E>): {
5
+ SwitchLogicLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
6
+ readonly description: RichSlot<E>;
7
+ readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
8
+ readonly attrs: {
9
+ readonly latex: string;
10
+ };
11
+ readonly type: "mathInline";
12
+ } | {
13
+ readonly marks?: readonly [{
14
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
15
+ } | {
16
+ readonly attrs: {
17
+ readonly href: string;
18
+ };
19
+ readonly type: "link";
20
+ } | {
21
+ readonly attrs: {
22
+ readonly variant: "success" | "warning" | null;
23
+ };
24
+ readonly type: "highlight";
25
+ }, ...({
26
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
27
+ } | {
28
+ readonly attrs: {
29
+ readonly href: string;
30
+ };
31
+ readonly type: "link";
32
+ } | {
33
+ readonly attrs: {
34
+ readonly variant: "success" | "warning" | null;
35
+ };
36
+ readonly type: "highlight";
37
+ })[]];
38
+ readonly text: string;
39
+ readonly type: "text";
40
+ }, ...({
41
+ readonly attrs: {
42
+ readonly latex: string;
43
+ };
44
+ readonly type: "mathInline";
45
+ } | {
46
+ readonly marks?: readonly [{
47
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
48
+ } | {
49
+ readonly attrs: {
50
+ readonly href: string;
51
+ };
52
+ readonly type: "link";
53
+ } | {
54
+ readonly attrs: {
55
+ readonly variant: "success" | "warning" | null;
56
+ };
57
+ readonly type: "highlight";
58
+ }, ...({
59
+ readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
60
+ } | {
61
+ readonly attrs: {
62
+ readonly href: string;
63
+ };
64
+ readonly type: "link";
65
+ } | {
66
+ readonly attrs: {
67
+ readonly variant: "success" | "warning" | null;
68
+ };
69
+ readonly type: "highlight";
70
+ })[]];
71
+ readonly text: string;
72
+ readonly type: "text";
73
+ })[]], E, never, never>>;
74
+ readonly title: RichSlot<E>;
75
+ readonly modes: Schema.NonEmptyArray<Schema.Literals<readonly ["and", "or", "not"]>>;
76
+ readonly startMode: Schema.optionalKey<Schema.Literals<readonly ["and", "or", "not"]>>;
77
+ readonly labels: Schema.Struct<{
78
+ readonly compounds: Schema.$Record<Schema.Literals<readonly ["and", "or", "not"]>, RichSlot<E>>;
79
+ readonly false: Schema.Trimmed;
80
+ readonly mode: Schema.Trimmed;
81
+ readonly modes: Schema.$Record<Schema.Literals<readonly ["and", "or", "not"]>, Schema.Trimmed>;
82
+ readonly p: RichSlot<E>;
83
+ readonly q: RichSlot<E>;
84
+ readonly switches: Schema.Trimmed;
85
+ readonly true: Schema.Trimmed;
86
+ readonly viewLabel: Schema.Trimmed;
87
+ }>;
88
+ readonly showTable: Schema.optionalKey<Schema.Boolean>;
89
+ }>, "figure">;
90
+ };