@nakafa/aksara-contracts 5.0.0 → 6.1.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 (99) hide show
  1. package/dist/artifact/integrity.d.ts +2 -2
  2. package/dist/artifact/limits.d.ts +1 -1
  3. package/dist/artifact/source.d.ts +1 -1
  4. package/dist/artifact/spec.d.ts +1 -1
  5. package/dist/artifact/verify.d.ts +1 -1
  6. package/dist/assessment/catalog.d.ts +12 -12
  7. package/dist/assessment/figure.d.ts +468 -0
  8. package/dist/assessment/snapshot.d.ts +24 -24
  9. package/dist/content.d.ts +7 -7
  10. package/dist/graph/family.d.ts +2 -2
  11. package/dist/graph/identity.d.ts +1 -1
  12. package/dist/locale.d.ts +21 -10
  13. package/dist/locale.js +24 -9
  14. package/dist/math/bounds.d.ts +3 -2
  15. package/dist/math/bounds.js +37 -8
  16. package/dist/math/curve.d.ts +42 -0
  17. package/dist/math/curve.js +55 -0
  18. package/dist/math/formula/box.d.ts +61 -0
  19. package/dist/math/formula/box.js +68 -0
  20. package/dist/math/formula/compile.d.ts +11 -0
  21. package/dist/math/formula/compile.js +100 -0
  22. package/dist/math/formula/contour.d.ts +17 -0
  23. package/dist/math/formula/contour.js +162 -0
  24. package/dist/math/formula/field.d.ts +19 -0
  25. package/dist/math/formula/field.js +35 -0
  26. package/dist/math/formula/mesh.d.ts +25 -0
  27. package/dist/math/formula/mesh.js +28 -0
  28. package/dist/math/formula/names.d.ts +4 -0
  29. package/dist/math/formula/names.js +23 -0
  30. package/dist/math/formula/parse.d.ts +10 -0
  31. package/dist/math/formula/parse.js +240 -0
  32. package/dist/math/formula/plane.d.ts +62 -0
  33. package/dist/math/formula/plane.js +175 -0
  34. package/dist/math/formula/reader.d.ts +102 -0
  35. package/dist/math/formula/reader.js +58 -0
  36. package/dist/math/formula/sample.d.ts +14 -0
  37. package/dist/math/formula/sample.js +182 -0
  38. package/dist/math/formula/scope.d.ts +37 -0
  39. package/dist/math/formula/scope.js +137 -0
  40. package/dist/math/formula/space.d.ts +10 -0
  41. package/dist/math/formula/space.js +94 -0
  42. package/dist/math/formula/syntax.d.ts +77 -0
  43. package/dist/math/formula/syntax.js +111 -0
  44. package/dist/math/formula/token.d.ts +43 -0
  45. package/dist/math/formula/token.js +150 -0
  46. package/dist/math/plane.d.ts +85 -0
  47. package/dist/math/plane.js +8 -2
  48. package/dist/math/scene.js +11 -2
  49. package/dist/math/solid.d.ts +124 -0
  50. package/dist/math/solid.js +86 -0
  51. package/dist/math/space.d.ts +213 -0
  52. package/dist/math/space.js +8 -2
  53. package/dist/math/visual.d.ts +454 -0
  54. package/dist/preview/artifact.d.ts +6 -6
  55. package/dist/preview/document.d.ts +13 -13
  56. package/dist/preview/spec.d.ts +49 -49
  57. package/dist/preview/target.d.ts +2 -2
  58. package/dist/program/curriculum.d.ts +2 -2
  59. package/dist/program/snapshot/hash.d.ts +6 -6
  60. package/dist/program/snapshot/row.d.ts +4 -4
  61. package/dist/program/spec.d.ts +2 -2
  62. package/dist/projection/article.d.ts +6 -6
  63. package/dist/projection/digest.d.ts +6 -6
  64. package/dist/projection/hash.d.ts +6 -6
  65. package/dist/projection/material.d.ts +6 -6
  66. package/dist/projection/page.d.ts +6 -6
  67. package/dist/projection/spec.d.ts +7 -7
  68. package/dist/projection/verify.d.ts +6 -6
  69. package/dist/quran/attribution.d.ts +4 -4
  70. package/dist/quran/identity.d.ts +7 -7
  71. package/dist/quran/identity.js +3 -3
  72. package/dist/quran/provenance.d.ts +12 -12
  73. package/dist/quran/snapshot/row/hash.d.ts +39 -39
  74. package/dist/quran/snapshot/row.d.ts +12 -12
  75. package/dist/quran/source.d.ts +7 -7
  76. package/dist/quran/spec.d.ts +1 -1
  77. package/dist/quran/spec.js +3 -3
  78. package/dist/release/canonical.d.ts +2 -2
  79. package/dist/release/digest.d.ts +2 -2
  80. package/dist/release/head.d.ts +9 -9
  81. package/dist/release/items.d.ts +2 -2
  82. package/dist/release/result/digest.d.ts +5 -5
  83. package/dist/release/rollback/digest.d.ts +4 -4
  84. package/dist/release/rollback/spec.d.ts +66 -66
  85. package/dist/release/route/digest.d.ts +2 -2
  86. package/dist/release/route/page.d.ts +4 -4
  87. package/dist/release/route/spec.d.ts +6 -6
  88. package/dist/release/route/verify.d.ts +2 -2
  89. package/dist/release/snapshot/data.d.ts +12 -12
  90. package/dist/release/snapshot/verify.d.ts +22 -22
  91. package/dist/release/spec.d.ts +6 -6
  92. package/dist/runtime/spec.d.ts +23 -23
  93. package/dist/runtime/verify.d.ts +14 -14
  94. package/dist/transport/batch.d.ts +22 -22
  95. package/dist/transport/group.d.ts +69 -69
  96. package/dist/transport/request.d.ts +244 -244
  97. package/dist/transport/response.d.ts +92 -92
  98. package/dist/transport/snapshot.d.ts +24 -24
  99. package/package.json +57 -1
@@ -1,6 +1,109 @@
1
1
  import { Schema } from "effect";
2
2
  /** Mathematical objects supported by a Cartesian space scene. */
3
3
  export declare const SpaceMathObjectSchema: Schema.Union<readonly [Schema.Struct<{
4
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
5
+ readonly id: Schema.String;
6
+ readonly domain: Schema.optionalKey<Schema.Struct<{
7
+ readonly x: Schema.Struct<{
8
+ readonly max: Schema.Finite;
9
+ readonly min: Schema.Finite;
10
+ }>;
11
+ readonly y: Schema.Struct<{
12
+ readonly max: Schema.Finite;
13
+ readonly min: Schema.Finite;
14
+ }>;
15
+ }>>;
16
+ readonly formula: Schema.String;
17
+ readonly kind: Schema.Literal<"function">;
18
+ }>, Schema.Struct<{
19
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
20
+ readonly id: Schema.String;
21
+ readonly kind: Schema.Literal<"parametric">;
22
+ readonly parameter: Schema.Struct<{
23
+ readonly max: Schema.Finite;
24
+ readonly min: Schema.Finite;
25
+ }>;
26
+ readonly x: Schema.String;
27
+ readonly y: Schema.String;
28
+ readonly z: Schema.String;
29
+ }>, Schema.Struct<{
30
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
31
+ readonly id: Schema.String;
32
+ readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
33
+ readonly x: Schema.Finite;
34
+ readonly y: Schema.Finite;
35
+ readonly z: Schema.Finite;
36
+ }>, Schema.Struct<{
37
+ readonly x: Schema.Finite;
38
+ readonly y: Schema.Finite;
39
+ readonly z: Schema.Finite;
40
+ }>, Schema.Struct<{
41
+ readonly x: Schema.Finite;
42
+ readonly y: Schema.Finite;
43
+ readonly z: Schema.Finite;
44
+ }>]>, readonly [Schema.Struct<{
45
+ readonly x: Schema.Finite;
46
+ readonly y: Schema.Finite;
47
+ readonly z: Schema.Finite;
48
+ }>]>;
49
+ readonly kind: Schema.Literal<"prism">;
50
+ readonly offset: Schema.Struct<{
51
+ readonly x: Schema.Finite;
52
+ readonly y: Schema.Finite;
53
+ readonly z: Schema.Finite;
54
+ }>;
55
+ }>, Schema.Struct<{
56
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
57
+ readonly id: Schema.String;
58
+ readonly apex: Schema.Struct<{
59
+ readonly x: Schema.Finite;
60
+ readonly y: Schema.Finite;
61
+ readonly z: Schema.Finite;
62
+ }>;
63
+ readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
64
+ readonly x: Schema.Finite;
65
+ readonly y: Schema.Finite;
66
+ readonly z: Schema.Finite;
67
+ }>, Schema.Struct<{
68
+ readonly x: Schema.Finite;
69
+ readonly y: Schema.Finite;
70
+ readonly z: Schema.Finite;
71
+ }>, Schema.Struct<{
72
+ readonly x: Schema.Finite;
73
+ readonly y: Schema.Finite;
74
+ readonly z: Schema.Finite;
75
+ }>]>, readonly [Schema.Struct<{
76
+ readonly x: Schema.Finite;
77
+ readonly y: Schema.Finite;
78
+ readonly z: Schema.Finite;
79
+ }>]>;
80
+ readonly kind: Schema.Literal<"pyramid">;
81
+ }>, Schema.Struct<{
82
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
83
+ readonly id: Schema.String;
84
+ readonly axis: Schema.Literals<readonly ["x", "y", "z"]>;
85
+ readonly domain: Schema.Struct<{
86
+ readonly max: Schema.Finite;
87
+ readonly min: Schema.Finite;
88
+ }>;
89
+ readonly formula: Schema.String;
90
+ readonly kind: Schema.Literal<"revolution">;
91
+ }>, Schema.Struct<{
92
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
93
+ readonly id: Schema.String;
94
+ readonly kind: Schema.Literal<"surface">;
95
+ readonly u: Schema.Struct<{
96
+ readonly max: Schema.Finite;
97
+ readonly min: Schema.Finite;
98
+ }>;
99
+ readonly v: Schema.Struct<{
100
+ readonly max: Schema.Finite;
101
+ readonly min: Schema.Finite;
102
+ }>;
103
+ readonly x: Schema.String;
104
+ readonly y: Schema.String;
105
+ readonly z: Schema.String;
106
+ }>, Schema.Struct<{
4
107
  readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
5
108
  readonly id: Schema.String;
6
109
  readonly center: Schema.Struct<{
@@ -186,6 +289,109 @@ export declare const SpaceMathVisualSchema: Schema.Struct<{
186
289
  readonly placement: Schema.optionalKey<Schema.Literals<readonly ["above", "above-left", "above-right", "below", "below-left", "below-right", "center", "left", "right"]>>;
187
290
  }>>>;
188
291
  readonly objects: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
292
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
293
+ readonly id: Schema.String;
294
+ readonly domain: Schema.optionalKey<Schema.Struct<{
295
+ readonly x: Schema.Struct<{
296
+ readonly max: Schema.Finite;
297
+ readonly min: Schema.Finite;
298
+ }>;
299
+ readonly y: Schema.Struct<{
300
+ readonly max: Schema.Finite;
301
+ readonly min: Schema.Finite;
302
+ }>;
303
+ }>>;
304
+ readonly formula: Schema.String;
305
+ readonly kind: Schema.Literal<"function">;
306
+ }>, Schema.Struct<{
307
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
308
+ readonly id: Schema.String;
309
+ readonly kind: Schema.Literal<"parametric">;
310
+ readonly parameter: Schema.Struct<{
311
+ readonly max: Schema.Finite;
312
+ readonly min: Schema.Finite;
313
+ }>;
314
+ readonly x: Schema.String;
315
+ readonly y: Schema.String;
316
+ readonly z: Schema.String;
317
+ }>, Schema.Struct<{
318
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
319
+ readonly id: Schema.String;
320
+ readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
321
+ readonly x: Schema.Finite;
322
+ readonly y: Schema.Finite;
323
+ readonly z: Schema.Finite;
324
+ }>, Schema.Struct<{
325
+ readonly x: Schema.Finite;
326
+ readonly y: Schema.Finite;
327
+ readonly z: Schema.Finite;
328
+ }>, Schema.Struct<{
329
+ readonly x: Schema.Finite;
330
+ readonly y: Schema.Finite;
331
+ readonly z: Schema.Finite;
332
+ }>]>, readonly [Schema.Struct<{
333
+ readonly x: Schema.Finite;
334
+ readonly y: Schema.Finite;
335
+ readonly z: Schema.Finite;
336
+ }>]>;
337
+ readonly kind: Schema.Literal<"prism">;
338
+ readonly offset: Schema.Struct<{
339
+ readonly x: Schema.Finite;
340
+ readonly y: Schema.Finite;
341
+ readonly z: Schema.Finite;
342
+ }>;
343
+ }>, Schema.Struct<{
344
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
345
+ readonly id: Schema.String;
346
+ readonly apex: Schema.Struct<{
347
+ readonly x: Schema.Finite;
348
+ readonly y: Schema.Finite;
349
+ readonly z: Schema.Finite;
350
+ }>;
351
+ readonly base: Schema.TupleWithRest<Schema.Tuple<readonly [Schema.Struct<{
352
+ readonly x: Schema.Finite;
353
+ readonly y: Schema.Finite;
354
+ readonly z: Schema.Finite;
355
+ }>, Schema.Struct<{
356
+ readonly x: Schema.Finite;
357
+ readonly y: Schema.Finite;
358
+ readonly z: Schema.Finite;
359
+ }>, Schema.Struct<{
360
+ readonly x: Schema.Finite;
361
+ readonly y: Schema.Finite;
362
+ readonly z: Schema.Finite;
363
+ }>]>, readonly [Schema.Struct<{
364
+ readonly x: Schema.Finite;
365
+ readonly y: Schema.Finite;
366
+ readonly z: Schema.Finite;
367
+ }>]>;
368
+ readonly kind: Schema.Literal<"pyramid">;
369
+ }>, Schema.Struct<{
370
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
371
+ readonly id: Schema.String;
372
+ readonly axis: Schema.Literals<readonly ["x", "y", "z"]>;
373
+ readonly domain: Schema.Struct<{
374
+ readonly max: Schema.Finite;
375
+ readonly min: Schema.Finite;
376
+ }>;
377
+ readonly formula: Schema.String;
378
+ readonly kind: Schema.Literal<"revolution">;
379
+ }>, Schema.Struct<{
380
+ readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
381
+ readonly id: Schema.String;
382
+ readonly kind: Schema.Literal<"surface">;
383
+ readonly u: Schema.Struct<{
384
+ readonly max: Schema.Finite;
385
+ readonly min: Schema.Finite;
386
+ }>;
387
+ readonly v: Schema.Struct<{
388
+ readonly max: Schema.Finite;
389
+ readonly min: Schema.Finite;
390
+ }>;
391
+ readonly x: Schema.String;
392
+ readonly y: Schema.String;
393
+ readonly z: Schema.String;
394
+ }>, Schema.Struct<{
189
395
  readonly appearance: Schema.Literals<readonly ["answer", "construction", "highlight", "primary", "reference", "secondary", "warning"]>;
190
396
  readonly id: Schema.String;
191
397
  readonly center: Schema.Struct<{
@@ -288,6 +494,13 @@ export declare const SpaceMathVisualSchema: Schema.Struct<{
288
494
  readonly z: Schema.Finite;
289
495
  }>;
290
496
  }>]>>;
497
+ readonly parameters: Schema.optionalKey<Schema.$Array<Schema.Struct<{
498
+ readonly max: Schema.Finite;
499
+ readonly min: Schema.Finite;
500
+ readonly name: Schema.String;
501
+ readonly step: Schema.optionalKey<Schema.Finite>;
502
+ readonly value: Schema.Finite;
503
+ }>>>;
291
504
  readonly space: Schema.Literal<"space">;
292
505
  readonly view: Schema.Union<readonly [Schema.Struct<{
293
506
  readonly kind: Schema.Literal<"camera">;
@@ -1,8 +1,11 @@
1
1
  import { Schema } from "effect";
2
2
  import { hasUniquePositions, MathAxisRangeSchema, MathViewPaddingSchema, mathVisualIdentityIssues, PositiveMeasureSchema, SpacePointSchema, sameSpacePoint, } from "#contracts/math/base";
3
3
  import { spaceBoundsIssues } from "#contracts/math/bounds";
4
+ import { FormulaParameterSchema } from "#contracts/math/formula/field";
5
+ import { formulaScopeIssues, parameterScope, spaceFormulaFields, } from "#contracts/math/formula/scope";
4
6
  import { MATH_LINE_MESSAGE, MATH_POLYLINE_MESSAGE, MATH_RAY_MESSAGE, MATH_SEGMENT_MESSAGE, MathObjectFields, mathLabelAnchorFields, } from "#contracts/math/object";
5
7
  import { spaceResolutionIssues } from "#contracts/math/resolution";
8
+ import { SpaceSolidObjectSchemas } from "#contracts/math/solid";
6
9
  import { hasCoplanarArea } from "#contracts/math/vector";
7
10
  const SpacePointObjectSchema = Schema.Struct({
8
11
  ...MathObjectFields,
@@ -62,6 +65,7 @@ const SpaceCuboidObjectSchema = Schema.Struct({
62
65
  });
63
66
  /** Mathematical objects supported by a Cartesian space scene. */
64
67
  export const SpaceMathObjectSchema = Schema.Union([
68
+ ...SpaceSolidObjectSchemas,
65
69
  SpaceCuboidObjectSchema,
66
70
  SpaceLineObjectSchema,
67
71
  SpacePointObjectSchema,
@@ -103,10 +107,12 @@ export const SpaceMathVisualSchema = Schema.Struct({
103
107
  frame: SpaceMathFrameSchema,
104
108
  labels: Schema.optionalKey(Schema.Array(SpaceLabelAnchorSchema)),
105
109
  objects: Schema.NonEmptyArray(SpaceMathObjectSchema),
110
+ parameters: Schema.optionalKey(Schema.Array(FormulaParameterSchema)),
106
111
  space: Schema.Literal("space"),
107
112
  view: SpaceMathViewSchema,
108
- }).pipe(Schema.check(Schema.makeFilter(({ frame, labels = [], objects, view }) => [
113
+ }).pipe(Schema.check(Schema.makeFilter(({ frame, labels = [], objects, parameters = [], view }) => [
109
114
  ...mathVisualIdentityIssues(objects, labels),
110
- ...spaceBoundsIssues(frame, objects, labels, view),
115
+ ...formulaScopeIssues(objects, spaceFormulaFields, parameters),
116
+ ...spaceBoundsIssues(frame, objects, labels, view, parameterScope(parameters)),
111
117
  ...spaceResolutionIssues(frame, objects, labels, view),
112
118
  ])));