@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.
- package/dist/assessment/document.d.ts +1 -1
- package/dist/assessment/document.js +1 -1
- package/dist/assessment/figure.d.ts +1 -1
- package/dist/assessment/figure.js +1 -1
- package/dist/assessment/fit.d.ts +3 -3
- package/dist/assessment/fit.js +3 -3
- package/dist/assessment/locales.d.ts +1 -1
- package/dist/assessment/scoring.d.ts +1 -1
- package/dist/assessment/scoring.js +1 -1
- package/dist/cache/content.d.ts +1 -1
- package/dist/cache/content.js +1 -1
- package/dist/content.d.ts +3 -2
- package/dist/graph/identity.d.ts +1 -1
- package/dist/graph/identity.js +1 -1
- package/dist/hash/sha256.d.ts +16 -0
- package/dist/hash/sha256.js +164 -0
- package/dist/hash/stream.d.ts +7 -5
- package/dist/hash/stream.js +13 -18
- package/dist/math/boundary.js +3 -22
- package/dist/math/bounds.d.ts +1 -1
- package/dist/math/collision.d.ts +1 -1
- package/dist/math/coordinate.d.ts +6 -5
- package/dist/math/coordinate.js +2 -2
- package/dist/math/edge.d.ts +11 -0
- package/dist/math/edge.js +74 -0
- package/dist/math/formula/compile.d.ts +1 -1
- package/dist/math/formula/compile.js +1 -1
- package/dist/math/formula/contour.d.ts +1 -1
- package/dist/math/formula/contour.js +1 -1
- package/dist/math/formula/field.js +1 -1
- package/dist/math/formula/mesh.d.ts +1 -1
- package/dist/math/formula/mesh.js +1 -1
- package/dist/math/formula/names.d.ts +1 -1
- package/dist/math/formula/names.js +1 -1
- package/dist/math/formula/parse.d.ts +1 -1
- package/dist/math/formula/parse.js +1 -1
- package/dist/math/formula/plane.d.ts +2 -2
- package/dist/math/formula/plane.js +3 -3
- package/dist/math/formula/reader.d.ts +2 -1
- package/dist/math/formula/reader.js +1 -1
- package/dist/math/formula/region.d.ts +2 -2
- package/dist/math/formula/region.js +3 -3
- package/dist/math/formula/sample.d.ts +1 -1
- package/dist/math/formula/scan.d.ts +1 -1
- package/dist/math/formula/scan.js +1 -1
- package/dist/math/formula/slider.d.ts +2 -2
- package/dist/math/formula/slider.js +1 -1
- package/dist/math/formula/space.d.ts +1 -1
- package/dist/math/formula/space.js +1 -1
- package/dist/math/graph.d.ts +9 -0
- package/dist/math/graph.js +66 -0
- package/dist/math/plane.js +6 -0
- package/dist/math/precision.d.ts +1 -1
- package/dist/math/precision.js +1 -1
- package/dist/math/resolution.js +1 -1
- package/dist/math/scene.d.ts +2 -2
- package/dist/math/shape.d.ts +392 -0
- package/dist/math/shape.js +59 -0
- package/dist/math/straight.d.ts +13 -0
- package/dist/math/straight.js +26 -0
- package/dist/math/vector.d.ts +1 -1
- package/dist/preview/spec.js +1 -1
- package/dist/program/curriculum.d.ts +1 -1
- package/dist/program/curriculum.js +1 -1
- package/dist/program/snapshot/digest.d.ts +1 -1
- package/dist/program/snapshot/digest.js +2 -2
- package/dist/program/snapshot/hash.d.ts +2 -2
- package/dist/projection/digest.d.ts +1 -1
- package/dist/projection/digest.js +1 -1
- package/dist/projection/hash.js +1 -1
- package/dist/projection/material.d.ts +1 -1
- package/dist/projection/material.js +1 -1
- package/dist/projection/verify.js +1 -1
- package/dist/quran/identity.d.ts +2 -1
- package/dist/quran/provenance.d.ts +2 -2
- package/dist/quran/provenance.js +1 -1
- package/dist/quran/snapshot/hash.d.ts +1 -1
- package/dist/quran/snapshot/row/hash.d.ts +1 -1
- package/dist/quran/snapshot/row/hash.js +1 -1
- package/dist/quran/snapshot/spec.js +1 -1
- package/dist/quran/source.d.ts +2 -2
- package/dist/release/current/evidence.d.ts +1 -1
- package/dist/release/current/evidence.js +1 -1
- package/dist/release/current/state.d.ts +1 -1
- package/dist/release/current/state.js +1 -1
- package/dist/release/head.js +1 -1
- package/dist/release/items.d.ts +1 -1
- package/dist/release/items.js +1 -1
- package/dist/release/policy.d.ts +1 -1
- package/dist/release/policy.js +1 -1
- package/dist/release/result/digest.d.ts +3 -3
- package/dist/release/result/digest.js +2 -2
- package/dist/release/rollback/digest.d.ts +1 -1
- package/dist/release/rollback/digest.js +1 -1
- package/dist/release/route/digest.d.ts +1 -1
- package/dist/release/route/digest.js +1 -1
- package/dist/release/snapshot/evidence/assessment.d.ts +1 -1
- package/dist/release/snapshot/evidence/assessment.js +1 -1
- package/dist/release/snapshot/evidence/program.d.ts +1 -1
- package/dist/release/snapshot/evidence/program.js +1 -1
- package/dist/release/snapshot/evidence/quran.d.ts +1 -1
- package/dist/release/snapshot/evidence/quran.js +1 -1
- package/dist/release/snapshot/evidence/requirement.d.ts +3 -2
- package/dist/release/snapshot/evidence/requirement.js +1 -1
- package/dist/release/snapshot/spec.d.ts +2 -2
- package/dist/release/snapshot/spec.js +1 -1
- package/dist/release/snapshot/verify.d.ts +1 -1
- package/dist/release/snapshot/verify.js +1 -1
- package/dist/release/spec.d.ts +1 -1
- package/dist/release/verify.d.ts +1 -1
- package/dist/release/verify.js +1 -1
- package/dist/renderer/compatibility.d.ts +1 -1
- package/dist/renderer/compatibility.js +2 -2
- package/dist/renderer/contract.d.ts +1 -1
- package/dist/renderer/contract.js +1 -1
- package/dist/runtime/spec.js +2 -2
- package/dist/signature/spec.d.ts +3 -2
- package/dist/signature/verify.d.ts +2 -1
- package/dist/transport/request.d.ts +1 -1
- package/dist/visual/base/math.d.ts +1 -1
- package/dist/visual/base/media.d.ts +1 -1
- package/dist/visual/biology/bacteria.d.ts +1 -1
- package/dist/visual/biology/bacteria.js +1 -1
- package/dist/visual/biology/blood.d.ts +91 -0
- package/dist/visual/biology/blood.js +55 -0
- package/dist/visual/biology/cell.d.ts +1 -1
- package/dist/visual/biology/climate.d.ts +1 -1
- package/dist/visual/biology/climate.js +1 -1
- package/dist/visual/biology/ecology.d.ts +1 -1
- package/dist/visual/biology/heart.d.ts +92 -0
- package/dist/visual/biology/heart.js +54 -0
- package/dist/visual/biology/mitochondrion.d.ts +91 -0
- package/dist/visual/biology/mitochondrion.js +45 -0
- package/dist/visual/biology/muscle.d.ts +103 -0
- package/dist/visual/biology/muscle.js +62 -0
- package/dist/visual/biology/neuron.d.ts +97 -0
- package/dist/visual/biology/neuron.js +48 -0
- package/dist/visual/biology/paddy.d.ts +100 -0
- package/dist/visual/biology/paddy.js +54 -0
- package/dist/visual/biology/physiology.d.ts +1 -1
- package/dist/visual/biology/physiology.js +1 -1
- package/dist/visual/biology/plant.d.ts +1 -1
- package/dist/visual/biology/plant.js +1 -1
- package/dist/visual/biology/synapse.d.ts +101 -0
- package/dist/visual/biology/synapse.js +46 -0
- package/dist/visual/biology/vessel.d.ts +104 -0
- package/dist/visual/biology/vessel.js +60 -0
- package/dist/visual/biology/yeast.d.ts +108 -0
- package/dist/visual/biology/yeast.js +61 -0
- package/dist/visual/biology.d.ts +1 -1
- package/dist/visual/catalog.d.ts +2177 -778
- package/dist/visual/catalog.js +28 -0
- package/dist/visual/chemistry/atom.d.ts +1 -1
- package/dist/visual/chemistry/atom.js +1 -1
- package/dist/visual/chemistry/balance.d.ts +1 -1
- package/dist/visual/chemistry/balance.js +1 -1
- package/dist/visual/chemistry/bonding.d.ts +1 -1
- package/dist/visual/chemistry/discovery.d.ts +1 -1
- package/dist/visual/chemistry/electrochemistry.d.ts +1 -1
- package/dist/visual/chemistry/electrochemistry.js +1 -1
- package/dist/visual/chemistry/electron.d.ts +1 -1
- package/dist/visual/chemistry/electron.js +1 -1
- package/dist/visual/chemistry/laws.d.ts +1 -1
- package/dist/visual/chemistry/laws.js +1 -1
- package/dist/visual/chemistry/particles.d.ts +1 -1
- package/dist/visual/chemistry/periodic.d.ts +1 -1
- package/dist/visual/chemistry/periodic.js +1 -1
- package/dist/visual/chemistry/rate.d.ts +1 -1
- package/dist/visual/chemistry/rate.js +1 -1
- package/dist/visual/chemistry/reaction.d.ts +1 -1
- package/dist/visual/chemistry/reaction.js +1 -1
- package/dist/visual/chemistry/titration.d.ts +1 -1
- package/dist/visual/chemistry/titration.js +1 -1
- package/dist/visual/mathematics/chance.d.ts +1 -1
- package/dist/visual/mathematics/chance.js +1 -1
- package/dist/visual/mathematics/chart.d.ts +1 -1
- package/dist/visual/mathematics/charts.d.ts +1 -1
- package/dist/visual/mathematics/function.d.ts +1 -1
- package/dist/visual/mathematics/journey.d.ts +118 -0
- package/dist/visual/mathematics/journey.js +125 -0
- package/dist/visual/mathematics/logic.d.ts +90 -0
- package/dist/visual/mathematics/logic.js +49 -0
- package/dist/visual/mathematics/network.d.ts +101 -0
- package/dist/visual/mathematics/network.js +97 -0
- package/dist/visual/mathematics/numeral.d.ts +82 -1
- package/dist/visual/mathematics/numeral.js +49 -1
- package/dist/visual/mathematics/sets.d.ts +92 -0
- package/dist/visual/mathematics/sets.js +95 -0
- package/dist/visual/physics/braking.d.ts +1 -1
- package/dist/visual/physics/braking.js +1 -1
- package/dist/visual/physics/circuit.d.ts +1 -1
- package/dist/visual/physics/circular.d.ts +1 -1
- package/dist/visual/physics/circular.js +1 -1
- package/dist/visual/physics/dynamics.d.ts +1 -1
- package/dist/visual/physics/dynamics.js +1 -1
- package/dist/visual/physics/efficiency.d.ts +1 -1
- package/dist/visual/physics/efficiency.js +1 -1
- package/dist/visual/physics/electronics.d.ts +1 -1
- package/dist/visual/physics/falling.d.ts +1 -1
- package/dist/visual/physics/falling.js +1 -1
- package/dist/visual/physics/field.d.ts +1 -1
- package/dist/visual/physics/fluid.d.ts +1 -1
- package/dist/visual/physics/fluid.js +1 -1
- package/dist/visual/physics/force.d.ts +1 -1
- package/dist/visual/physics/gravity.d.ts +1 -1
- package/dist/visual/physics/heat.d.ts +1 -1
- package/dist/visual/physics/heat.js +1 -1
- package/dist/visual/physics/instrument.d.ts +1 -1
- package/dist/visual/physics/light.d.ts +1 -1
- package/dist/visual/physics/light.js +1 -1
- package/dist/visual/physics/measurement.d.ts +1 -1
- package/dist/visual/physics/measurement.js +1 -1
- package/dist/visual/physics/motion.d.ts +1 -1
- package/dist/visual/physics/nuclear.d.ts +1 -1
- package/dist/visual/physics/parabolic.d.ts +1 -1
- package/dist/visual/physics/position.d.ts +1 -1
- package/dist/visual/physics/position.js +1 -1
- package/dist/visual/physics/power.d.ts +1 -1
- package/dist/visual/physics/power.js +1 -1
- package/dist/visual/physics/precision.d.ts +1 -1
- package/dist/visual/physics/precision.js +1 -1
- package/dist/visual/physics/product.d.ts +1 -1
- package/dist/visual/physics/reading.d.ts +1 -1
- package/dist/visual/physics/reading.js +1 -1
- package/dist/visual/physics/record.d.ts +1 -1
- package/dist/visual/physics/record.js +1 -1
- package/dist/visual/physics/relative.d.ts +1 -1
- package/dist/visual/physics/relative.js +1 -1
- package/dist/visual/physics/solar.d.ts +1 -1
- package/dist/visual/physics/solar.js +1 -1
- package/dist/visual/physics/thermodynamics.d.ts +117 -0
- package/dist/visual/physics/thermodynamics.js +95 -0
- package/dist/visual/physics/vector.d.ts +1 -1
- package/dist/visual/physics/vector.js +1 -1
- package/dist/visual/physics/velocity.d.ts +1 -1
- package/dist/visual/physics/wave.d.ts +1 -1
- package/dist/visual/politics.d.ts +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { Array as Arr, Effect } from "effect";
|
|
|
2
2
|
import { canonicalizeLearningGraphIdentity } from "#contracts/graph/spec";
|
|
3
3
|
import { hashText } from "#contracts/hash/text";
|
|
4
4
|
import { canonicalizeQuranAttribution } from "#contracts/quran/attribution";
|
|
5
|
-
import { QuranSnapshotRowSchema
|
|
5
|
+
import { QuranSnapshotRowSchema } from "#contracts/quran/snapshot/row";
|
|
6
6
|
import { encodeJsonText } from "#contracts/text/json";
|
|
7
7
|
const ROW_DOMAIN = "nakafa.aksara.quran-row";
|
|
8
8
|
/** Serializes one published translation list in signed field order. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Array as Arr, Schema } from "effect";
|
|
2
2
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
3
|
-
import { ActiveAppLocaleListSchema, AppLocaleSchema
|
|
3
|
+
import { ActiveAppLocaleListSchema, AppLocaleSchema } from "#contracts/locale";
|
|
4
4
|
import { quranSourceFileCount } from "#contracts/quran/source";
|
|
5
5
|
import { QURAN_ATTRIBUTION_COUNT, QURAN_SURAH_COUNT, QURAN_VERSE_COUNT, } from "#contracts/quran/spec";
|
|
6
6
|
import { encodeJsonText } from "#contracts/text/json";
|
package/dist/quran/source.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { ActiveAppLocaleList } from "#contracts/locale";
|
|
3
|
+
import type { QuranSourceId } from "#contracts/quran/identity";
|
|
4
4
|
/** Derives the exact source identities required by one active locale set. */
|
|
5
5
|
export declare function quranSourceIds(activeAppLocales: ActiveAppLocaleList): readonly [QuranSourceId, QuranSourceId, ...QuranSourceId[]];
|
|
6
6
|
/** Counts exact source files required by one active locale set. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RollbackContentReleaseBundle } from "#contracts/release/lifecycle";
|
|
3
3
|
/** Compares canonical signed locale lists without erasing their role. */
|
|
4
4
|
export declare function hasSameAppLocales(left: readonly string[], right: readonly string[]): boolean;
|
|
5
5
|
/** Exact active release retained for base selection and crash recovery. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Array as Arr, Schema } from "effect";
|
|
2
|
-
import { ContentReleaseBundleSchema
|
|
2
|
+
import { ContentReleaseBundleSchema } from "#contracts/release/lifecycle";
|
|
3
3
|
import { hasSameContentSnapshots, snapshotRowCount, } from "#contracts/release/snapshot/spec";
|
|
4
4
|
import { PublicationReceiptSchema } from "#contracts/release/spec";
|
|
5
5
|
/** Compares canonical signed locale lists without erasing their role. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RollbackContentReleaseBundle } from "#contracts/release/lifecycle";
|
|
3
3
|
/** Exact durable release bundle currently owning one invisible slot. */
|
|
4
4
|
export declare const StagedContentReleaseSchema: Schema.Struct<{
|
|
5
5
|
readonly release: Schema.Struct<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { ActiveContentReleaseSchema, hasSameAppLocales, } from "#contracts/release/current/evidence";
|
|
3
|
-
import { ContentReleaseBundleSchema
|
|
3
|
+
import { ContentReleaseBundleSchema } from "#contracts/release/lifecycle";
|
|
4
4
|
import { EMPTY_RESULT_CATALOG_DIGEST } from "#contracts/release/result/spec";
|
|
5
5
|
import { hasSameContentSnapshots, invertContentSnapshots, } from "#contracts/release/snapshot/spec";
|
|
6
6
|
const StagedReleasePhaseSchema = Schema.Literals([
|
package/dist/release/head.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Array as Arr, Schema } from "effect";
|
|
2
|
-
import { ContentFamilySchema, compareContentHeads
|
|
2
|
+
import { ContentFamilySchema, compareContentHeads } from "#contracts/content";
|
|
3
3
|
import { ContentDeliveryClassSchema } from "#contracts/delivery";
|
|
4
4
|
import { ContentKeySchema, CorpusSourcePathSchema, PublicPathSchema, ReleaseIdSchema, Sha256HashSchema, } from "#contracts/ids";
|
|
5
5
|
import { ArtifactLocaleSchema } from "#contracts/locale";
|
package/dist/release/items.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { ContentReleaseManifest } from "#contracts/release/spec";
|
|
3
3
|
declare const ReleaseItemDecodeError_base: Schema.Class<ReleaseItemDecodeError, Schema.TaggedStruct<"ReleaseItemDecodeError", {
|
|
4
4
|
readonly itemOffset: Schema.Finite;
|
|
5
5
|
}>, import("effect/Cause").YieldableError & {
|
package/dist/release/items.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ReleaseIdSchema } from "#contracts/ids";
|
|
|
4
4
|
import { ReleaseCountSchema } from "#contracts/release/count";
|
|
5
5
|
import { digestItems } from "#contracts/release/digest";
|
|
6
6
|
import { ReleaseDigestMismatchFields } from "#contracts/release/mismatch";
|
|
7
|
-
import { ContentReleaseItemSchema
|
|
7
|
+
import { ContentReleaseItemSchema } from "#contracts/release/spec";
|
|
8
8
|
/** One release item failed strict wire decoding. */
|
|
9
9
|
export class ReleaseItemDecodeError extends Schema.TaggedError()("ReleaseItemDecodeError", { itemOffset: ReleaseCountSchema }) {
|
|
10
10
|
}
|
package/dist/release/policy.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import type { Sha256Hash } from "#contracts/ids";
|
|
3
3
|
import type { ContentSnapshotManifest } from "#contracts/release/snapshot/data";
|
|
4
|
-
import {
|
|
4
|
+
import type { PublicationScope } from "#contracts/release/snapshot/scope";
|
|
5
5
|
/** Renderer proof required immediately before one candidate activation. */
|
|
6
6
|
export declare const RendererPreflightSchema: Schema.Literals<readonly ["compatible", "exact"]>;
|
|
7
7
|
export type RendererPreflight = typeof RendererPreflightSchema.Type;
|
package/dist/release/policy.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Array as Arr, Effect, Schema } from "effect";
|
|
|
2
2
|
import { ContentFamilySchema } from "#contracts/content";
|
|
3
3
|
import { ActiveAppLocaleListSchema } from "#contracts/locale";
|
|
4
4
|
import { hasSameAppLocales } from "#contracts/release/current/evidence";
|
|
5
|
-
import { ContentSnapshotKindSchema
|
|
5
|
+
import { ContentSnapshotKindSchema } from "#contracts/release/snapshot/scope";
|
|
6
6
|
const ClosureFieldSchema = Schema.Literals([
|
|
7
7
|
"activeAppLocales",
|
|
8
8
|
"manifest",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import type { PublicPath, ReleaseId, Sha256HashSchema } from "#contracts/ids";
|
|
3
|
+
import type { ArtifactLocale } from "#contracts/locale";
|
|
4
|
+
import type { ContentHead } from "#contracts/release/head";
|
|
5
5
|
declare const ResultCatalogOrderError_base: Schema.Class<ResultCatalogOrderError, Schema.TaggedStruct<"ResultCatalogOrderError", {
|
|
6
6
|
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de", "ms"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
7
7
|
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect, MutableHashSet, Schema, Stream } from "effect";
|
|
2
2
|
import { ContentHeadIdentitySchema, compareContentHeads, routeIdentity, } from "#contracts/content";
|
|
3
3
|
import { DigestStream } from "#contracts/hash/stream";
|
|
4
|
-
import { PublicPathSchema, ReleaseIdSchema
|
|
4
|
+
import { PublicPathSchema, ReleaseIdSchema } from "#contracts/ids";
|
|
5
5
|
import { AppLocaleSchema } from "#contracts/locale";
|
|
6
|
-
import { canonicalizeContentHead
|
|
6
|
+
import { canonicalizeContentHead } from "#contracts/release/head";
|
|
7
7
|
import { ReleaseCountMismatchFields, ReleaseDigestMismatchFields, } from "#contracts/release/mismatch";
|
|
8
8
|
import { RESULT_CATALOG_DIGEST_DOMAIN } from "#contracts/release/result/spec";
|
|
9
9
|
/** A result catalog is duplicated or outside canonical content-head order. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RollbackSnapshotEntry } from "#contracts/release/rollback/spec";
|
|
3
3
|
import type { ContentReleaseManifest } from "#contracts/release/spec";
|
|
4
4
|
declare const RollbackSnapshotCountMismatchError_base: Schema.Class<RollbackSnapshotCountMismatchError, Schema.TaggedStruct<"RollbackSnapshotCountMismatchError", {
|
|
5
5
|
readonly actualCount: Schema.Finite;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
2
|
import { DigestStream } from "#contracts/hash/stream";
|
|
3
3
|
import { ReleaseCountMismatchFields, ReleaseDigestMismatchFields, } from "#contracts/release/mismatch";
|
|
4
|
-
import { canonicalizeRollbackSnapshotEntry
|
|
4
|
+
import { canonicalizeRollbackSnapshotEntry } from "#contracts/release/rollback/spec";
|
|
5
5
|
const ROLLBACK_SNAPSHOT_DIGEST_DOMAIN = "nakafa.aksara.rollback-snapshot";
|
|
6
6
|
/** A replayed rollback snapshot has a different signed entry count. */
|
|
7
7
|
export class RollbackSnapshotCountMismatchError extends Schema.TaggedError()("RollbackSnapshotCountMismatchError", { ...ReleaseCountMismatchFields }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Stream } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { ContentRouteItem } from "#contracts/release/route/spec";
|
|
3
3
|
/** Keeps incremental route digest state private to one release preparation. */
|
|
4
4
|
declare class RouteDigestState {
|
|
5
5
|
#private;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Stream } from "effect";
|
|
2
2
|
import { DigestStream } from "#contracts/hash/stream";
|
|
3
|
-
import { canonicalizeContentRouteItem
|
|
3
|
+
import { canonicalizeContentRouteItem } from "#contracts/release/route/spec";
|
|
4
4
|
const CONTENT_ROUTE_DIGEST_DOMAIN = "nakafa.aksara.content-routes";
|
|
5
5
|
/** Keeps incremental route digest state private to one release preparation. */
|
|
6
6
|
class RouteDigestState {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { SnapshotRowSource } from "#contracts/release/snapshot/evidence/requirement";
|
|
3
3
|
/**
|
|
4
4
|
* Verifies an assessment snapshot against its rows: the hash and the order of
|
|
5
5
|
* every row, the count of each kind, the digest over all of them, the closure
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Result, Stream } from "effect";
|
|
2
2
|
import { verifyAssessmentClosure } from "#contracts/assessment/closure";
|
|
3
3
|
import { ASSESSMENT_ROW_KINDS, assessmentRowCount, digestAssessmentRows, makeAssessmentSnapshot, } from "#contracts/assessment/snapshot";
|
|
4
|
-
import { requireSnapshotEvidence
|
|
4
|
+
import { requireSnapshotEvidence } from "#contracts/release/snapshot/evidence/requirement";
|
|
5
5
|
/** Selects the assessment records of a row stream while preserving source failures. */
|
|
6
6
|
function assessmentRecords(rows) {
|
|
7
7
|
return rows.pipe(Stream.filterMap((row) => row.family === "assessment" ? Result.succeed(row.record) : Result.failVoid));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { SnapshotRowSource } from "#contracts/release/snapshot/evidence/requirement";
|
|
3
3
|
/** Verifies all program row and snapshot identity evidence. */
|
|
4
4
|
export declare const verifyProgramSnapshotRows: <E, R>(snapshot: {
|
|
5
5
|
readonly family: "program";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Result, Stream } from "effect";
|
|
2
2
|
import { digestProgramRows } from "#contracts/program/snapshot/digest";
|
|
3
3
|
import { verifyProgramSnapshotHash } from "#contracts/program/snapshot/hash";
|
|
4
|
-
import { requireSnapshotEvidence
|
|
4
|
+
import { requireSnapshotEvidence } from "#contracts/release/snapshot/evidence/requirement";
|
|
5
5
|
/** Selects current program rows while preserving source failures. */
|
|
6
6
|
function programRows(rows) {
|
|
7
7
|
return rows.pipe(Stream.filterMap((row) => row.family === "program" ? Result.succeed(row.record) : Result.failVoid));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { SnapshotRowSource } from "#contracts/release/snapshot/evidence/requirement";
|
|
3
3
|
/** Verifies all Quran row, digest, binding, and snapshot evidence. */
|
|
4
4
|
export declare const verifyQuranSnapshotRows: <E, R>(snapshot: {
|
|
5
5
|
readonly family: "quran";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Result, Stream } from "effect";
|
|
2
2
|
import { digestQuranRows } from "#contracts/quran/snapshot/digest";
|
|
3
3
|
import { verifyQuranSnapshotHash } from "#contracts/quran/snapshot/hash";
|
|
4
|
-
import { requireSnapshotEvidence
|
|
4
|
+
import { requireSnapshotEvidence } from "#contracts/release/snapshot/evidence/requirement";
|
|
5
5
|
/** Selects and binds current Quran rows to the manifest identity. */
|
|
6
6
|
function quranRows(rows, snapshotId) {
|
|
7
7
|
return rows.pipe(Stream.filterMap((row) => row.family === "quran" ? Result.succeed(row.record) : Result.failVoid), Stream.mapEffect((record) => requireSnapshotEvidence({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Stream } from "effect";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
2
3
|
import type { Sha256Hash } from "#contracts/ids";
|
|
3
4
|
import type { ContentSnapshotRow } from "#contracts/release/snapshot/data";
|
|
4
|
-
import {
|
|
5
|
+
import type { ContentSnapshotKind } from "#contracts/release/snapshot/scope";
|
|
5
6
|
declare const SnapshotEvidenceError_base: Schema.Class<SnapshotEvidenceError, Schema.TaggedStruct<"SnapshotEvidenceError", {
|
|
6
7
|
readonly actual: Schema.String;
|
|
7
8
|
readonly expected: Schema.String;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { ContentSnapshotKindSchema
|
|
2
|
+
import { ContentSnapshotKindSchema } from "#contracts/release/snapshot/scope";
|
|
3
3
|
/** Signed snapshot evidence differs from its authenticated row stream. */
|
|
4
4
|
export class SnapshotEvidenceError extends Schema.TaggedError()("SnapshotEvidenceError", {
|
|
5
5
|
actual: Schema.String,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Signed structured snapshot transition contracts. */
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { Sha256Hash } from "#contracts/ids";
|
|
4
|
+
import type { PublicationScope } from "#contracts/release/snapshot/scope";
|
|
5
5
|
/** Canonical digest for a release that stages no structured snapshot rows. */
|
|
6
6
|
export declare const EMPTY_SNAPSHOT_ROW_DIGEST: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
7
7
|
declare const ContentSnapshotModeSchema: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Signed structured snapshot transition contracts. */
|
|
2
2
|
import { Array as Arr, Record as Rec, Schema } from "effect";
|
|
3
3
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
4
|
-
import { ContentSnapshotKindSchema
|
|
4
|
+
import { ContentSnapshotKindSchema } from "#contracts/release/snapshot/scope";
|
|
5
5
|
import { encodeJsonText } from "#contracts/text/json";
|
|
6
6
|
/** Canonical digest for a release that stages no structured snapshot rows. */
|
|
7
7
|
export const EMPTY_SNAPSHOT_ROW_DIGEST = Sha256HashSchema.make("sha256:eb27aa7f59e41b14a3f76d951c5a50cb954a19f3f6e6c44bc21a733f606e888f");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { ContentSnapshotSet } from "#contracts/release/snapshot/spec";
|
|
3
3
|
declare const SnapshotManifestDecodeError_base: Schema.Class<SnapshotManifestDecodeError, Schema.TaggedStruct<"SnapshotManifestDecodeError", {
|
|
4
4
|
readonly manifestIndex: Schema.Int;
|
|
5
5
|
}>, import("effect/Cause").YieldableError & {
|
|
@@ -2,7 +2,7 @@ import { Effect, MutableRef, Option, Schema, Stream } from "effect";
|
|
|
2
2
|
import { assessmentRowCount } from "#contracts/assessment/snapshot";
|
|
3
3
|
import { ContentSnapshotManifestSchema, ContentSnapshotRowSchema, } from "#contracts/release/snapshot/data";
|
|
4
4
|
import { verifySnapshotRows } from "#contracts/release/snapshot/evidence";
|
|
5
|
-
import { ContentSnapshotKindSchema
|
|
5
|
+
import { ContentSnapshotKindSchema } from "#contracts/release/snapshot/scope";
|
|
6
6
|
import { ContentSnapshotSetSchema, inheritContentSnapshots, replaceContentSnapshot, snapshotRowCount, } from "#contracts/release/snapshot/spec";
|
|
7
7
|
const StreamIndexSchema = Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0)));
|
|
8
8
|
/** One replacement manifest failed strict wire decoding. */
|
package/dist/release/spec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { AppLocale } from "#contracts/locale";
|
|
3
3
|
/** Semantic wire identity of the current localized content release. */
|
|
4
4
|
export declare const CONTENT_RELEASE_FORMAT = "localized-content-release";
|
|
5
5
|
/** One immutable artifact selected for a locale-specific content head. */
|
package/dist/release/verify.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { ContentReleaseBundle, RollbackContentReleaseBundle } from "#contracts/release/lifecycle";
|
|
3
3
|
declare const ReleaseVerificationDecodeError_base: Schema.Class<ReleaseVerificationDecodeError, Schema.TaggedStruct<"ReleaseVerificationDecodeError", {
|
|
4
4
|
readonly message: Schema.Literal<"Release verification input does not satisfy its exact wire contract.">;
|
|
5
5
|
}>, import("effect/Cause").YieldableError & {
|
package/dist/release/verify.js
CHANGED
|
@@ -3,7 +3,7 @@ import { hashContentReleaseManifest } from "#contracts/release/hash";
|
|
|
3
3
|
import { ContentReleaseBundleSchema, RollbackContentReleaseBundleSchema, } from "#contracts/release/lifecycle";
|
|
4
4
|
import { ReleaseHashMismatchFields } from "#contracts/release/mismatch";
|
|
5
5
|
import { canonicalizeContentReleaseSigningInput } from "#contracts/release/signing";
|
|
6
|
-
import { SignedContentReleaseSchema
|
|
6
|
+
import { SignedContentReleaseSchema } from "#contracts/release/spec";
|
|
7
7
|
import { validateRendererManifestHash } from "#contracts/renderer/manifest";
|
|
8
8
|
import { verifyEd25519Signature } from "#contracts/signature/verify";
|
|
9
9
|
/** Unknown release input did not exactly satisfy its signed wire contract. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { ArtifactRendererComponentMissingError, ArtifactRendererDomainUnpublishedError } from "#contracts/artifact/spec";
|
|
3
3
|
import type { CompiledContentPayload } from "#contracts/content";
|
|
4
|
-
import {
|
|
4
|
+
import type { RendererManifestEnvelope } from "#contracts/renderer/contract";
|
|
5
5
|
declare const RendererManifestDomainUnpublishedError_base: Schema.Class<RendererManifestDomainUnpublishedError, Schema.TaggedStruct<"RendererManifestDomainUnpublishedError", {
|
|
6
6
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
7
7
|
}>, import("effect/Cause").YieldableError & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Array as Arr, Effect, HashSet, Schema } from "effect";
|
|
2
2
|
import { ArtifactRendererComponentMissingError, ArtifactRendererDomainUnpublishedError, } from "#contracts/artifact/spec";
|
|
3
|
-
import { RendererComponentNameSchema
|
|
4
|
-
import { selectRendererDomainCapability
|
|
3
|
+
import { RendererComponentNameSchema } from "#contracts/renderer/component";
|
|
4
|
+
import { selectRendererDomainCapability } from "#contracts/renderer/contract";
|
|
5
5
|
import { RendererDomainSchema } from "#contracts/renderer/domain";
|
|
6
6
|
import { validateRendererManifestHash } from "#contracts/renderer/manifest";
|
|
7
7
|
const RendererCapabilityScopeSchema = Schema.Union([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RendererComponents } from "#contracts/renderer/component";
|
|
3
3
|
/** Stable format for the one current domain-scoped renderer manifest. */
|
|
4
4
|
export declare const RENDERER_MANIFEST_FORMAT = "nakafa-mdx-renderer";
|
|
5
5
|
/** One route-domain component contract with an exact real domain name. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Array as Arr, Effect, HashSet, Option, Order, Schema } from "effect";
|
|
2
2
|
import { Sha256MismatchFields } from "#contracts/errors";
|
|
3
3
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
4
|
-
import { RendererComponentsSchema
|
|
4
|
+
import { RendererComponentsSchema } from "#contracts/renderer/component";
|
|
5
5
|
import { RENDERER_DOMAINS, RendererDomainSchema, } from "#contracts/renderer/domain";
|
|
6
6
|
import { encodeJsonText } from "#contracts/text/json";
|
|
7
7
|
/** Stable format for the one current domain-scoped renderer manifest. */
|
package/dist/runtime/spec.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { SignedContentArtifactSchema
|
|
2
|
+
import { SignedContentArtifactSchema } from "#contracts/content";
|
|
3
3
|
import { decodeContract } from "#contracts/decode";
|
|
4
4
|
import { CorpusSourcePathSchema, PublicPathSchema, ReleaseIdSchema, Sha256HashSchema, } from "#contracts/ids";
|
|
5
5
|
import { AppLocaleSchema } from "#contracts/locale";
|
|
6
|
-
import { ContentProjectionSchema
|
|
6
|
+
import { ContentProjectionSchema } from "#contracts/projection/spec";
|
|
7
7
|
import { SignedContentReleaseSchema } from "#contracts/release/spec";
|
|
8
8
|
import { RendererManifestEnvelopeSchema } from "#contracts/renderer/contract";
|
|
9
9
|
import { ContentRuntimeFailureSchema, ContentRuntimeMissingSchema, } from "#contracts/runtime/result";
|
package/dist/signature/spec.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context, Schema } from "effect";
|
|
3
|
+
import type { SigningKeyId } from "#contracts/ids";
|
|
3
4
|
/** Authenticated object whose Ed25519 signature is being checked. */
|
|
4
5
|
export declare const ContentSignatureSubjectSchema: Schema.Literals<readonly ["artifact", "release"]>;
|
|
5
6
|
export type ContentSignatureSubject = typeof ContentSignatureSubjectSchema.Type;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { Ed25519Signature, SigningKeyId } from "#contracts/ids";
|
|
3
|
-
import {
|
|
3
|
+
import type { ContentSignatureSubject } from "#contracts/signature/spec";
|
|
4
|
+
import { ContentVerificationKeyResolver, PublicKeyParseError, PublicKeyTypeError, SignatureCheckError, SignatureInvalidError } from "#contracts/signature/spec";
|
|
4
5
|
/** Resolves trust and verifies domain-separated canonical bytes with Ed25519. */
|
|
5
6
|
export declare const verifyEd25519Signature: (input: {
|
|
6
7
|
readonly keyId: SigningKeyId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RollbackContentReleaseBundle } from "#contracts/release/lifecycle";
|
|
3
3
|
/** Complete stable operation vocabulary shared by requests and diagnostics. */
|
|
4
4
|
export declare const PublicationOperationSchema: Schema.Literals<readonly ["abort", "accept", "activate", "activateRecovery", "cleanup", "current", "headPage", "recovery", "rollbackPage", "routePage", "stageArtifactBatch", "stageGroup", "stageItemBatch", "stageProjectionBatch", "stageRecovery", "stageRelease", "stageRouteBatch", "stageSnapshot", "stageSnapshotBatch", "status", "verify"]>;
|
|
5
5
|
export type PublicationOperation = typeof PublicationOperationSchema.Type;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
3
|
/** The most visible characters a label anchored in the scene shows (`visibleLength`). */
|
|
4
4
|
export declare const LABEL_CHARACTERS = 32;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
3
|
/** The media components: a diagram from its source and an embedded video. */
|
|
4
4
|
export declare function mediaVisuals<E>(rich: RichSlot<E>): {
|
|
5
5
|
Mermaid: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { byIds, cardFields, TextSchema
|
|
2
|
+
import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
|
|
3
3
|
import { figure } from "#contracts/visual/entry";
|
|
4
4
|
/**
|
|
5
5
|
* Props of `BinaryFissionLab`: one cell of Escherichia coli on agar becomes a
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The blood labs. The named group is answer state. */
|
|
4
|
+
export declare function bloodVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
BloodTypingLab: 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 labels: Schema.Struct<{
|
|
76
|
+
readonly clumped: RichSlot<E>;
|
|
77
|
+
readonly group: Schema.optionalKey<RichSlot<E>>;
|
|
78
|
+
readonly groups: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["A", "B", "AB", "O"]>, RichSlot<E>>>;
|
|
79
|
+
readonly sample: Schema.Trimmed;
|
|
80
|
+
readonly sera: Schema.$Record<Schema.Literals<readonly ["a", "b", "d"]>, RichSlot<E>>;
|
|
81
|
+
readonly smooth: RichSlot<E>;
|
|
82
|
+
readonly time: RichSlot<E>;
|
|
83
|
+
readonly view: Schema.Trimmed;
|
|
84
|
+
}>;
|
|
85
|
+
readonly samples: Schema.NonEmptyArray<Schema.Struct<{
|
|
86
|
+
readonly group: Schema.Literals<readonly ["A", "B", "AB", "O"]>;
|
|
87
|
+
readonly name: Schema.Trimmed;
|
|
88
|
+
readonly rhesus: Schema.Literals<readonly ["positive", "negative"]>;
|
|
89
|
+
}>>;
|
|
90
|
+
}>, "figure">;
|
|
91
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
/** The ABO blood groups. */
|
|
5
|
+
const GROUPS = ["A", "B", "AB", "O"];
|
|
6
|
+
/**
|
|
7
|
+
* How many samples one grouping tile tests: its twelve cavities hold four
|
|
8
|
+
* rows of anti-A, anti-B and anti-D.
|
|
9
|
+
*/
|
|
10
|
+
const TILE_ROWS = 4;
|
|
11
|
+
/**
|
|
12
|
+
* One blood sample on the tile: its name, its ABO group, and whether its red
|
|
13
|
+
* cells carry the Rhesus D antigen. The tile shows only how each drop reacts
|
|
14
|
+
* with each antiserum, never the group by name.
|
|
15
|
+
*/
|
|
16
|
+
const SampleSchema = Schema.Struct({
|
|
17
|
+
group: Schema.Literals(GROUPS),
|
|
18
|
+
name: TextSchema,
|
|
19
|
+
rhesus: Schema.Literals(["positive", "negative"]),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* The samples on one tile: one to four, each in its own row and named once,
|
|
23
|
+
* since the name labels its row and its choice in the toolbar.
|
|
24
|
+
*/
|
|
25
|
+
const SamplesSchema = Schema.NonEmptyArray(SampleSchema).check(Schema.isMaxLength(TILE_ROWS), Schema.makeFilter((samples) => Arr.dedupe(Arr.map(samples, (sample) => sample.name)).length ===
|
|
26
|
+
samples.length, { message: "Expected every sample to have its own name." }));
|
|
27
|
+
/**
|
|
28
|
+
* Props of `BloodTypingLab`: each sample tested with anti-A, anti-B and
|
|
29
|
+
* anti-D sera on a white porcelain tile, the slide test read a minute after
|
|
30
|
+
* mixing. `labels.time` names that minute's clock. Naming the group the drops
|
|
31
|
+
* point to is the result a question asks for, so `labels.group` and
|
|
32
|
+
* `labels.groups` are answer state.
|
|
33
|
+
*/
|
|
34
|
+
function bloodTypingLab(rich) {
|
|
35
|
+
return Schema.Struct({
|
|
36
|
+
...cardFields(rich),
|
|
37
|
+
labels: Schema.Struct({
|
|
38
|
+
clumped: rich,
|
|
39
|
+
group: Schema.optionalKey(rich),
|
|
40
|
+
groups: Schema.optionalKey(byIds(GROUPS, rich)),
|
|
41
|
+
sample: TextSchema,
|
|
42
|
+
sera: byIds(["a", "b", "d"], rich),
|
|
43
|
+
smooth: rich,
|
|
44
|
+
time: rich,
|
|
45
|
+
view: TextSchema,
|
|
46
|
+
}),
|
|
47
|
+
samples: SamplesSchema,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** The blood labs. The named group is answer state. */
|
|
51
|
+
export function bloodVisuals(rich) {
|
|
52
|
+
return {
|
|
53
|
+
BloodTypingLab: figure(bloodTypingLab(rich), answerAt(["labels", "group"], ["labels", "groups"])),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
3
|
/**
|
|
4
4
|
* The props of the cell and DNA labs. No prop states the conclusion a lab leads
|
|
5
5
|
* to, so none holds answer state.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { byIds, cardFields, TextSchema
|
|
2
|
+
import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
|
|
3
3
|
import { figure } from "#contracts/visual/entry";
|
|
4
4
|
/** Props of `CarbonBudgetLab`: the air as a bathtub. */
|
|
5
5
|
function carbonBudgetLab(rich) {
|