@nakafa/aksara-contracts 0.39.0 → 0.41.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/README.md +7 -6
- package/dist/artifact/integrity.d.ts +1 -4
- package/dist/artifact/limits.d.ts +1 -4
- package/dist/artifact/source.d.ts +1 -4
- package/dist/artifact/spec.d.ts +5 -45
- package/dist/artifact/spec.js +2 -20
- package/dist/artifact/verify.d.ts +2 -5
- package/dist/artifact/verify.js +0 -1
- package/dist/content.d.ts +8 -48
- package/dist/content.js +4 -9
- package/dist/preview/artifact.d.ts +1 -1
- package/dist/preview/artifact.js +1 -1
- package/dist/preview/auth.d.ts +3 -20
- package/dist/release/current/evidence.d.ts +9 -63
- package/dist/release/current/state.d.ts +15 -105
- package/dist/release/hash.d.ts +0 -1
- package/dist/release/lifecycle.d.ts +6 -42
- package/dist/release/lifecycle.js +1 -3
- package/dist/release/rollback/spec.d.ts +6 -24
- package/dist/release/signing.js +0 -1
- package/dist/release/spec.d.ts +0 -6
- package/dist/release/spec.js +0 -3
- package/dist/release/verify.d.ts +1 -2
- package/dist/renderer/compatibility.d.ts +10 -46
- package/dist/renderer/compatibility.js +20 -45
- package/dist/renderer/component.d.ts +7 -97
- package/dist/renderer/component.js +15 -93
- package/dist/renderer/contract.d.ts +14 -86
- package/dist/renderer/contract.js +16 -54
- package/dist/renderer/manifest.d.ts +10 -72
- package/dist/renderer/manifest.js +40 -41
- package/dist/runtime/protected/spec.d.ts +13 -76
- package/dist/runtime/protected/verify.d.ts +5 -25
- package/dist/runtime/protected/verify.js +2 -4
- package/dist/runtime/spec.d.ts +12 -75
- package/dist/runtime/verify.d.ts +10 -52
- package/dist/runtime/verify.js +2 -4
- package/dist/transport/batch.d.ts +2 -8
- package/dist/transport/group.d.ts +3 -12
- package/dist/transport/request.d.ts +26 -166
- package/dist/transport/response.d.ts +50 -330
- package/dist/tryout/runtime/verify.d.ts +1 -1
- package/package.json +1 -1
- package/dist/renderer/selection.d.ts +0 -39
- package/dist/renderer/selection.js +0 -87
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @nakafa/aksara-contracts
|
|
2
2
|
|
|
3
3
|
This package defines exact runtime contracts for the Aksara compiler and
|
|
4
|
-
publisher. Nakafa runtime
|
|
4
|
+
publisher. Nakafa runtime consumes the exact published contract: a proven npm
|
|
5
5
|
package, its immutable release archive, and compatible renderer support.
|
|
6
6
|
|
|
7
7
|
This package contains schemas, branded identifiers, canonical wire encodings,
|
|
@@ -68,11 +68,12 @@ live renderer when the deployed manifest hash differs. Non-rendering evidence
|
|
|
68
68
|
verification authenticates the same frozen release and artifact without
|
|
69
69
|
claiming that its consumer can execute the artifact. This directional
|
|
70
70
|
execution check lets an additive live renderer serve an older release only when
|
|
71
|
-
it still publishes the selected domain and
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
it still publishes the selected domain and contains every required component
|
|
72
|
+
name. Every current manifest contains the complete canonical domain set. The same
|
|
73
|
+
contract validates stored and deployed manifests. A renderer-changing release
|
|
74
|
+
remains bound to the exact deployed manifest. A scoped content-only release may
|
|
75
|
+
retain the active frozen manifest only when activation proves the live renderer still publishes every frozen
|
|
76
|
+
domain and contains every frozen component name. The renderer is not a
|
|
76
77
|
third signed value. Current production trusts authenticated
|
|
77
78
|
Convex state for route/head membership, delivery class, and the active pointer;
|
|
78
79
|
a release result digest is not a per-row inclusion proof. This boundary is
|
|
@@ -19,10 +19,7 @@ export declare const verifySignedContentArtifactIntegrity: (input: unknown) => E
|
|
|
19
19
|
readonly plainText: string;
|
|
20
20
|
readonly rawMdx: string;
|
|
21
21
|
readonly rendererDomain: "ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math";
|
|
22
|
-
readonly requiredComponents: readonly
|
|
23
|
-
readonly name: string;
|
|
24
|
-
readonly version: number;
|
|
25
|
-
}[];
|
|
22
|
+
readonly requiredComponents: readonly string[];
|
|
26
23
|
readonly sourceHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
27
24
|
};
|
|
28
25
|
readonly signature: string & import("effect/Brand").Brand<"@NakafaAI/AksaraEd25519Signature">;
|
|
@@ -16,10 +16,7 @@ export declare const validateArtifactByteIntegrity: (artifact: {
|
|
|
16
16
|
readonly plainText: string;
|
|
17
17
|
readonly rawMdx: string;
|
|
18
18
|
readonly rendererDomain: "ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math";
|
|
19
|
-
readonly requiredComponents: readonly
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly version: number;
|
|
22
|
-
}[];
|
|
19
|
+
readonly requiredComponents: readonly string[];
|
|
23
20
|
readonly sourceHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
24
21
|
};
|
|
25
22
|
readonly signature: string & import("effect/Brand").Brand<"@NakafaAI/AksaraEd25519Signature">;
|
|
@@ -13,9 +13,6 @@ export declare const verifyCompiledContentSourceHash: (payload: {
|
|
|
13
13
|
readonly plainText: string;
|
|
14
14
|
readonly rawMdx: string;
|
|
15
15
|
readonly rendererDomain: "ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math";
|
|
16
|
-
readonly requiredComponents: readonly
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly version: number;
|
|
19
|
-
}[];
|
|
16
|
+
readonly requiredComponents: readonly string[];
|
|
20
17
|
readonly sourceHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
21
18
|
}) => Effect.Effect<void, ArtifactSourceHashComputationError | ArtifactSourceHashMismatchError, never>;
|
package/dist/artifact/spec.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* Complete server-only input needed to authenticate one compiled artifact.
|
|
4
|
-
* `rendererContractVersion` comes from the active release because payloads do
|
|
5
|
-
* not duplicate that release-scoped value.
|
|
6
|
-
*/
|
|
2
|
+
/** Complete input needed to authenticate an artifact against its renderer. */
|
|
7
3
|
export declare const ArtifactVerificationRequestSchema: Schema.Struct<{
|
|
8
4
|
readonly artifact: Schema.Struct<{
|
|
9
5
|
readonly artifactHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
@@ -20,41 +16,20 @@ export declare const ArtifactVerificationRequestSchema: Schema.Struct<{
|
|
|
20
16
|
readonly plainText: Schema.String;
|
|
21
17
|
readonly rawMdx: Schema.String;
|
|
22
18
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
23
|
-
readonly requiredComponents: Schema.$Array<Schema.
|
|
24
|
-
readonly name: Schema.String;
|
|
25
|
-
readonly version: Schema.Finite;
|
|
26
|
-
}>>;
|
|
19
|
+
readonly requiredComponents: Schema.$Array<Schema.String>;
|
|
27
20
|
readonly sourceHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
28
21
|
}>;
|
|
29
22
|
readonly signature: Schema.brand<Schema.String, "@NakafaAI/AksaraEd25519Signature">;
|
|
30
23
|
}>;
|
|
31
|
-
readonly rendererContractVersion: Schema.String;
|
|
32
24
|
readonly rendererManifest: Schema.Struct<{
|
|
33
|
-
readonly base: Schema.
|
|
34
|
-
authoringComponents: Schema.$Array<Schema.Struct<{
|
|
35
|
-
readonly name: Schema.String;
|
|
36
|
-
readonly version: Schema.Finite;
|
|
37
|
-
}>>;
|
|
38
|
-
supportedComponents: Schema.$Array<Schema.Struct<{
|
|
39
|
-
readonly name: Schema.String;
|
|
40
|
-
readonly version: Schema.Finite;
|
|
41
|
-
}>>;
|
|
42
|
-
}>;
|
|
25
|
+
readonly base: Schema.$Array<Schema.String>;
|
|
43
26
|
readonly domains: Schema.$Array<Schema.Struct<{
|
|
44
|
-
readonly
|
|
45
|
-
readonly name: Schema.String;
|
|
46
|
-
readonly version: Schema.Finite;
|
|
47
|
-
}>>;
|
|
27
|
+
readonly components: Schema.$Array<Schema.String>;
|
|
48
28
|
readonly name: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
49
|
-
readonly supportedComponents: Schema.$Array<Schema.Struct<{
|
|
50
|
-
readonly name: Schema.String;
|
|
51
|
-
readonly version: Schema.Finite;
|
|
52
|
-
}>>;
|
|
53
29
|
}>>;
|
|
54
|
-
readonly format: Schema.Literal<"nakafa-mdx-renderer
|
|
30
|
+
readonly format: Schema.Literal<"nakafa-mdx-renderer">;
|
|
55
31
|
readonly hash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
56
32
|
readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
|
|
57
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
58
33
|
}>;
|
|
59
34
|
}>;
|
|
60
35
|
export type ArtifactVerificationRequest = typeof ArtifactVerificationRequestSchema.Type;
|
|
@@ -116,13 +91,6 @@ declare const ArtifactSourceHashMismatchError_base: Schema.Class<ArtifactSourceH
|
|
|
116
91
|
/** The authenticated source hash does not identify the complete raw MDX. */
|
|
117
92
|
export declare class ArtifactSourceHashMismatchError extends ArtifactSourceHashMismatchError_base {
|
|
118
93
|
}
|
|
119
|
-
declare const RendererContractVersionMismatchError_base: Schema.Class<RendererContractVersionMismatchError, Schema.TaggedStruct<"RendererContractVersionMismatchError", {
|
|
120
|
-
readonly actualVersion: Schema.String;
|
|
121
|
-
readonly expectedVersion: Schema.String;
|
|
122
|
-
}>, import("effect/Cause").YieldableError>;
|
|
123
|
-
/** The runtime and hash-validated renderer envelope disagree globally. */
|
|
124
|
-
export declare class RendererContractVersionMismatchError extends RendererContractVersionMismatchError_base {
|
|
125
|
-
}
|
|
126
94
|
declare const ArtifactRendererComponentMissingError_base: Schema.Class<ArtifactRendererComponentMissingError, Schema.TaggedStruct<"ArtifactRendererComponentMissingError", {
|
|
127
95
|
readonly componentName: Schema.String;
|
|
128
96
|
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
@@ -130,14 +98,6 @@ declare const ArtifactRendererComponentMissingError_base: Schema.Class<ArtifactR
|
|
|
130
98
|
/** A custom component required by the artifact is absent from the renderer. */
|
|
131
99
|
export declare class ArtifactRendererComponentMissingError extends ArtifactRendererComponentMissingError_base {
|
|
132
100
|
}
|
|
133
|
-
declare const ArtifactRendererVersionUnsupportedError_base: Schema.Class<ArtifactRendererVersionUnsupportedError, Schema.TaggedStruct<"ArtifactRendererVersionUnsupportedError", {
|
|
134
|
-
readonly componentName: Schema.String;
|
|
135
|
-
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
136
|
-
readonly requiredVersion: Schema.Finite;
|
|
137
|
-
}>, import("effect/Cause").YieldableError>;
|
|
138
|
-
/** The renderer does not implement the exact required component version. */
|
|
139
|
-
export declare class ArtifactRendererVersionUnsupportedError extends ArtifactRendererVersionUnsupportedError_base {
|
|
140
|
-
}
|
|
141
101
|
declare const ArtifactRendererDomainUnpublishedError_base: Schema.Class<ArtifactRendererDomainUnpublishedError, Schema.TaggedStruct<"ArtifactRendererDomainUnpublishedError", {
|
|
142
102
|
readonly contentKey: Schema.brand<Schema.String, "@NakafaAI/AksaraContentKey">;
|
|
143
103
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
package/dist/artifact/spec.js
CHANGED
|
@@ -2,16 +2,11 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { SignedContentArtifactSchema } from "#contracts/content";
|
|
3
3
|
import { ContentKeySchema, Sha256HashSchema } from "#contracts/ids";
|
|
4
4
|
import { RendererComponentNameSchema } from "#contracts/renderer/component";
|
|
5
|
-
import {
|
|
5
|
+
import { RendererManifestEnvelopeSchema } from "#contracts/renderer/contract";
|
|
6
6
|
import { RendererDomainSchema } from "#contracts/renderer/domain";
|
|
7
|
-
/**
|
|
8
|
-
* Complete server-only input needed to authenticate one compiled artifact.
|
|
9
|
-
* `rendererContractVersion` comes from the active release because payloads do
|
|
10
|
-
* not duplicate that release-scoped value.
|
|
11
|
-
*/
|
|
7
|
+
/** Complete input needed to authenticate an artifact against its renderer. */
|
|
12
8
|
export const ArtifactVerificationRequestSchema = Schema.Struct({
|
|
13
9
|
artifact: SignedContentArtifactSchema,
|
|
14
|
-
rendererContractVersion: RendererContractVersionSchema,
|
|
15
10
|
rendererManifest: RendererManifestEnvelopeSchema,
|
|
16
11
|
});
|
|
17
12
|
/** Unknown artifact input did not exactly satisfy the verification contract. */
|
|
@@ -65,25 +60,12 @@ export class ArtifactSourceHashMismatchError extends Schema.TaggedError()("Artif
|
|
|
65
60
|
expectedHash: Sha256HashSchema,
|
|
66
61
|
}) {
|
|
67
62
|
}
|
|
68
|
-
/** The runtime and hash-validated renderer envelope disagree globally. */
|
|
69
|
-
export class RendererContractVersionMismatchError extends Schema.TaggedError()("RendererContractVersionMismatchError", {
|
|
70
|
-
actualVersion: RendererContractVersionSchema,
|
|
71
|
-
expectedVersion: RendererContractVersionSchema,
|
|
72
|
-
}) {
|
|
73
|
-
}
|
|
74
63
|
/** A custom component required by the artifact is absent from the renderer. */
|
|
75
64
|
export class ArtifactRendererComponentMissingError extends Schema.TaggedError()("ArtifactRendererComponentMissingError", {
|
|
76
65
|
componentName: RendererComponentNameSchema,
|
|
77
66
|
contentKey: ContentKeySchema,
|
|
78
67
|
}) {
|
|
79
68
|
}
|
|
80
|
-
/** The renderer does not implement the exact required component version. */
|
|
81
|
-
export class ArtifactRendererVersionUnsupportedError extends Schema.TaggedError()("ArtifactRendererVersionUnsupportedError", {
|
|
82
|
-
componentName: RendererComponentNameSchema,
|
|
83
|
-
contentKey: ContentKeySchema,
|
|
84
|
-
requiredVersion: Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThan(0))),
|
|
85
|
-
}) {
|
|
86
|
-
}
|
|
87
69
|
/** The deployed Nakafa app cannot route this artifact's renderer domain. */
|
|
88
70
|
export class ArtifactRendererDomainUnpublishedError extends Schema.TaggedError()("ArtifactRendererDomainUnpublishedError", {
|
|
89
71
|
contentKey: ContentKeySchema,
|
|
@@ -16,11 +16,8 @@ export declare const verifySignedContentArtifact: (input: unknown) => Effect.Eff
|
|
|
16
16
|
readonly plainText: string;
|
|
17
17
|
readonly rawMdx: string;
|
|
18
18
|
readonly rendererDomain: "ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math";
|
|
19
|
-
readonly requiredComponents: readonly
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly version: number;
|
|
22
|
-
}[];
|
|
19
|
+
readonly requiredComponents: readonly string[];
|
|
23
20
|
readonly sourceHash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
24
21
|
};
|
|
25
22
|
readonly signature: string & import("effect/Brand").Brand<"@NakafaAI/AksaraEd25519Signature">;
|
|
26
|
-
}, import("#contracts/artifact/spec").ArtifactCompiledByteLengthMismatchError | import("#contracts/artifact/spec").ArtifactHashComputationError | import("#contracts/artifact/spec").ArtifactHashMismatchError | import("#contracts/artifact/spec").ArtifactPayloadFieldByteLimitError | import("#contracts/artifact/spec").ArtifactRendererComponentMissingError | import("#contracts/artifact/spec").ArtifactRendererDomainUnpublishedError | import("#contracts/artifact/spec").
|
|
23
|
+
}, import("#contracts/artifact/spec").ArtifactCompiledByteLengthMismatchError | import("#contracts/artifact/spec").ArtifactHashComputationError | import("#contracts/artifact/spec").ArtifactHashMismatchError | import("#contracts/artifact/spec").ArtifactPayloadFieldByteLimitError | import("#contracts/artifact/spec").ArtifactRendererComponentMissingError | import("#contracts/artifact/spec").ArtifactRendererDomainUnpublishedError | import("#contracts/artifact/spec").ArtifactSourceHashComputationError | import("#contracts/artifact/spec").ArtifactSourceHashMismatchError | import("#contracts/artifact/spec").ArtifactVerificationByteLimitError | ArtifactVerificationDecodeError | import("../errors.js").ContractDecodeError | import("../signature/spec.js").PublicKeyParseError | import("../signature/spec.js").PublicKeyTypeError | import("../renderer/contract.js").RendererDomainCapabilityMissingError | import("../renderer/contract.js").RendererManifestHashComputeError | import("../renderer/contract.js").RendererManifestHashMismatchError | import("../signature/spec.js").SignatureCheckError | import("../signature/spec.js").SignatureInvalidError | import("../signature/spec.js").SigningKeyNotFoundError | import("../signature/spec.js").SigningKeyResolutionError, import("../signature/spec.js").ContentVerificationKeyResolver>;
|
package/dist/artifact/verify.js
CHANGED
|
@@ -11,7 +11,6 @@ export const verifySignedContentArtifact = Effect.fn("AksaraContracts.verifySign
|
|
|
11
11
|
const artifact = yield* verifySignedContentArtifactIntegrity(request.artifact);
|
|
12
12
|
yield* verifyContentRendererCompatibility({
|
|
13
13
|
payload: artifact.payload,
|
|
14
|
-
rendererContractVersion: request.rendererContractVersion,
|
|
15
14
|
rendererManifest: request.rendererManifest,
|
|
16
15
|
});
|
|
17
16
|
return artifact;
|
package/dist/content.d.ts
CHANGED
|
@@ -44,31 +44,14 @@ export declare const CompileDocumentRequestSchema: Schema.Struct<{
|
|
|
44
44
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
45
45
|
readonly sourcePath: Schema.brand<Schema.String, "@NakafaAI/AksaraCorpusSourcePath">;
|
|
46
46
|
readonly rendererManifest: Schema.Struct<{
|
|
47
|
-
readonly base: Schema.
|
|
48
|
-
authoringComponents: Schema.$Array<Schema.Struct<{
|
|
49
|
-
readonly name: Schema.String;
|
|
50
|
-
readonly version: Schema.Finite;
|
|
51
|
-
}>>;
|
|
52
|
-
supportedComponents: Schema.$Array<Schema.Struct<{
|
|
53
|
-
readonly name: Schema.String;
|
|
54
|
-
readonly version: Schema.Finite;
|
|
55
|
-
}>>;
|
|
56
|
-
}>;
|
|
47
|
+
readonly base: Schema.$Array<Schema.String>;
|
|
57
48
|
readonly domains: Schema.$Array<Schema.Struct<{
|
|
58
|
-
readonly
|
|
59
|
-
readonly name: Schema.String;
|
|
60
|
-
readonly version: Schema.Finite;
|
|
61
|
-
}>>;
|
|
49
|
+
readonly components: Schema.$Array<Schema.String>;
|
|
62
50
|
readonly name: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
63
|
-
readonly supportedComponents: Schema.$Array<Schema.Struct<{
|
|
64
|
-
readonly name: Schema.String;
|
|
65
|
-
readonly version: Schema.Finite;
|
|
66
|
-
}>>;
|
|
67
51
|
}>>;
|
|
68
|
-
readonly format: Schema.Literal<"nakafa-mdx-renderer
|
|
52
|
+
readonly format: Schema.Literal<"nakafa-mdx-renderer">;
|
|
69
53
|
readonly hash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
70
54
|
readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
|
|
71
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
72
55
|
}>;
|
|
73
56
|
}>;
|
|
74
57
|
export type CompileDocumentRequest = typeof CompileDocumentRequestSchema.Type;
|
|
@@ -85,10 +68,7 @@ export declare const CompiledContentPayloadSchema: Schema.Struct<{
|
|
|
85
68
|
readonly plainText: Schema.String;
|
|
86
69
|
readonly rawMdx: Schema.String;
|
|
87
70
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
88
|
-
readonly requiredComponents: Schema.$Array<Schema.
|
|
89
|
-
readonly name: Schema.String;
|
|
90
|
-
readonly version: Schema.Finite;
|
|
91
|
-
}>>;
|
|
71
|
+
readonly requiredComponents: Schema.$Array<Schema.String>;
|
|
92
72
|
readonly sourceHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
93
73
|
}>;
|
|
94
74
|
export type CompiledContentPayload = typeof CompiledContentPayloadSchema.Type;
|
|
@@ -108,10 +88,7 @@ export declare const SignedContentArtifactSchema: Schema.Struct<{
|
|
|
108
88
|
readonly plainText: Schema.String;
|
|
109
89
|
readonly rawMdx: Schema.String;
|
|
110
90
|
readonly rendererDomain: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
111
|
-
readonly requiredComponents: Schema.$Array<Schema.
|
|
112
|
-
readonly name: Schema.String;
|
|
113
|
-
readonly version: Schema.Finite;
|
|
114
|
-
}>>;
|
|
91
|
+
readonly requiredComponents: Schema.$Array<Schema.String>;
|
|
115
92
|
readonly sourceHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
116
93
|
}>;
|
|
117
94
|
readonly signature: Schema.brand<Schema.String, "@NakafaAI/AksaraEd25519Signature">;
|
|
@@ -131,31 +108,14 @@ export declare const decodeCompileDocumentRequest: (input: unknown) => Effect.Ef
|
|
|
131
108
|
readonly rendererDomain: "ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math";
|
|
132
109
|
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
133
110
|
readonly rendererManifest: {
|
|
134
|
-
readonly base:
|
|
135
|
-
readonly authoringComponents: readonly {
|
|
136
|
-
readonly name: string;
|
|
137
|
-
readonly version: number;
|
|
138
|
-
}[];
|
|
139
|
-
readonly supportedComponents: readonly {
|
|
140
|
-
readonly name: string;
|
|
141
|
-
readonly version: number;
|
|
142
|
-
}[];
|
|
143
|
-
};
|
|
111
|
+
readonly base: readonly string[];
|
|
144
112
|
readonly domains: readonly {
|
|
145
|
-
readonly
|
|
146
|
-
readonly name: string;
|
|
147
|
-
readonly version: number;
|
|
148
|
-
}[];
|
|
113
|
+
readonly components: readonly string[];
|
|
149
114
|
readonly name: "ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math";
|
|
150
|
-
readonly supportedComponents: readonly {
|
|
151
|
-
readonly name: string;
|
|
152
|
-
readonly version: number;
|
|
153
|
-
}[];
|
|
154
115
|
}[];
|
|
155
|
-
readonly format: "nakafa-mdx-renderer
|
|
116
|
+
readonly format: "nakafa-mdx-renderer";
|
|
156
117
|
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
157
118
|
readonly publishedDomains: readonly ("ai-ds" | "biology" | "chemistry" | "mathematics" | "physics" | "politics" | "site" | "snbt-general" | "snbt-math" | "snbt-plain" | "snbt-quant" | "tka-math")[];
|
|
158
|
-
readonly rendererContractVersion: "1.0.0";
|
|
159
119
|
};
|
|
160
120
|
}, import("./errors.js").ContractDecodeError, never>;
|
|
161
121
|
/** Strictly decodes one authored source before a publication recompile. */
|
package/dist/content.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect, Schema } from "effect";
|
|
|
2
2
|
import { decodeContract } from "#contracts/decode";
|
|
3
3
|
import { ContentKeySchema, CorpusSourcePathSchema, Ed25519SignatureSchema, Sha256HashSchema, SigningKeyIdSchema, } from "#contracts/ids";
|
|
4
4
|
import { ArtifactLocaleSchema, } from "#contracts/locale";
|
|
5
|
-
import {
|
|
5
|
+
import { RendererComponentsSchema } from "#contracts/renderer/component";
|
|
6
6
|
import { RendererManifestEnvelopeSchema } from "#contracts/renderer/contract";
|
|
7
7
|
import { RendererDomainSchema } from "#contracts/renderer/domain";
|
|
8
8
|
import { compareCodeUnits } from "#contracts/text/order";
|
|
@@ -45,9 +45,7 @@ export const CompileDocumentSourceSchema = Schema.Struct({
|
|
|
45
45
|
export const CompileDocumentRequestSchema = Schema.Struct({
|
|
46
46
|
...CompileDocumentSourceSchema.fields,
|
|
47
47
|
rendererManifest: RendererManifestEnvelopeSchema,
|
|
48
|
-
})
|
|
49
|
-
message: "Expected the selected renderer domain to have a capability.",
|
|
50
|
-
})));
|
|
48
|
+
});
|
|
51
49
|
/** Precompiled trusted payload stored and signed before server-only execution. */
|
|
52
50
|
export const CompiledContentPayloadSchema = Schema.Struct({
|
|
53
51
|
artifactLocale: ArtifactLocaleSchema,
|
|
@@ -61,7 +59,7 @@ export const CompiledContentPayloadSchema = Schema.Struct({
|
|
|
61
59
|
plainText: Schema.String,
|
|
62
60
|
rawMdx: Schema.String,
|
|
63
61
|
rendererDomain: RendererDomainSchema,
|
|
64
|
-
requiredComponents:
|
|
62
|
+
requiredComponents: RendererComponentsSchema,
|
|
65
63
|
sourceHash: Sha256HashSchema,
|
|
66
64
|
});
|
|
67
65
|
/** Immutable compiled payload plus its asymmetric authenticity proof. */
|
|
@@ -86,10 +84,7 @@ export function canonicalizeCompiledContentPayload(payload) {
|
|
|
86
84
|
plainText: payload.plainText,
|
|
87
85
|
rawMdx: payload.rawMdx,
|
|
88
86
|
rendererDomain: payload.rendererDomain,
|
|
89
|
-
requiredComponents: payload.requiredComponents
|
|
90
|
-
name,
|
|
91
|
-
version,
|
|
92
|
-
})),
|
|
87
|
+
requiredComponents: payload.requiredComponents,
|
|
93
88
|
sourceHash: payload.sourceHash,
|
|
94
89
|
});
|
|
95
90
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const LOCAL_PREVIEW_ARTIFACT_PREFIX = "/
|
|
2
|
+
export declare const LOCAL_PREVIEW_ARTIFACT_PREFIX = "/artifacts/";
|
|
3
3
|
/** Builds the one content-addressed path owned by the preview protocol. */
|
|
4
4
|
export declare function localPreviewArtifactPath(artifactHash: string): string;
|
|
5
5
|
/** One signed artifact reference and its exact current renderer projection. */
|
package/dist/preview/artifact.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
3
3
|
import { ContentProjectionSchema } from "#contracts/projection/spec";
|
|
4
|
-
export const LOCAL_PREVIEW_ARTIFACT_PREFIX = "/
|
|
4
|
+
export const LOCAL_PREVIEW_ARTIFACT_PREFIX = "/artifacts/";
|
|
5
5
|
/** Builds the one content-addressed path owned by the preview protocol. */
|
|
6
6
|
export function localPreviewArtifactPath(artifactHash) {
|
|
7
7
|
return `${LOCAL_PREVIEW_ARTIFACT_PREFIX}${encodeURIComponent(artifactHash)}`;
|
package/dist/preview/auth.d.ts
CHANGED
|
@@ -15,31 +15,14 @@ export type PreviewRendererProof = typeof PreviewRendererProofSchema.Type;
|
|
|
15
15
|
export declare const PreviewRendererResponseSchema: Schema.Struct<{
|
|
16
16
|
readonly format: Schema.Literal<"aksara-renderer-auth-v1">;
|
|
17
17
|
readonly manifest: Schema.Struct<{
|
|
18
|
-
readonly base: Schema.
|
|
19
|
-
authoringComponents: Schema.$Array<Schema.Struct<{
|
|
20
|
-
readonly name: Schema.String;
|
|
21
|
-
readonly version: Schema.Finite;
|
|
22
|
-
}>>;
|
|
23
|
-
supportedComponents: Schema.$Array<Schema.Struct<{
|
|
24
|
-
readonly name: Schema.String;
|
|
25
|
-
readonly version: Schema.Finite;
|
|
26
|
-
}>>;
|
|
27
|
-
}>;
|
|
18
|
+
readonly base: Schema.$Array<Schema.String>;
|
|
28
19
|
readonly domains: Schema.$Array<Schema.Struct<{
|
|
29
|
-
readonly
|
|
30
|
-
readonly name: Schema.String;
|
|
31
|
-
readonly version: Schema.Finite;
|
|
32
|
-
}>>;
|
|
20
|
+
readonly components: Schema.$Array<Schema.String>;
|
|
33
21
|
readonly name: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
34
|
-
readonly supportedComponents: Schema.$Array<Schema.Struct<{
|
|
35
|
-
readonly name: Schema.String;
|
|
36
|
-
readonly version: Schema.Finite;
|
|
37
|
-
}>>;
|
|
38
22
|
}>>;
|
|
39
|
-
readonly format: Schema.Literal<"nakafa-mdx-renderer
|
|
23
|
+
readonly format: Schema.Literal<"nakafa-mdx-renderer">;
|
|
40
24
|
readonly hash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
41
25
|
readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
|
|
42
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
43
26
|
}>;
|
|
44
27
|
readonly proof: Schema.String;
|
|
45
28
|
}>;
|
|
@@ -25,7 +25,6 @@ export declare const ActiveContentReleaseSchema: Schema.Struct<{
|
|
|
25
25
|
readonly projectionCount: Schema.Finite;
|
|
26
26
|
readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
27
27
|
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
28
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
29
28
|
readonly rendererManifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
30
29
|
readonly resultCount: Schema.Finite;
|
|
31
30
|
readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
@@ -68,31 +67,14 @@ export declare const ActiveContentReleaseSchema: Schema.Struct<{
|
|
|
68
67
|
readonly signature: Schema.brand<Schema.String, "@NakafaAI/AksaraEd25519Signature">;
|
|
69
68
|
}>;
|
|
70
69
|
readonly rendererManifest: Schema.Struct<{
|
|
71
|
-
readonly base: Schema.
|
|
72
|
-
authoringComponents: Schema.$Array<Schema.Struct<{
|
|
73
|
-
readonly name: Schema.String;
|
|
74
|
-
readonly version: Schema.Finite;
|
|
75
|
-
}>>;
|
|
76
|
-
supportedComponents: Schema.$Array<Schema.Struct<{
|
|
77
|
-
readonly name: Schema.String;
|
|
78
|
-
readonly version: Schema.Finite;
|
|
79
|
-
}>>;
|
|
80
|
-
}>;
|
|
70
|
+
readonly base: Schema.$Array<Schema.String>;
|
|
81
71
|
readonly domains: Schema.$Array<Schema.Struct<{
|
|
82
|
-
readonly
|
|
83
|
-
readonly name: Schema.String;
|
|
84
|
-
readonly version: Schema.Finite;
|
|
85
|
-
}>>;
|
|
72
|
+
readonly components: Schema.$Array<Schema.String>;
|
|
86
73
|
readonly name: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
87
|
-
readonly supportedComponents: Schema.$Array<Schema.Struct<{
|
|
88
|
-
readonly name: Schema.String;
|
|
89
|
-
readonly version: Schema.Finite;
|
|
90
|
-
}>>;
|
|
91
74
|
}>>;
|
|
92
|
-
readonly format: Schema.Literal<"nakafa-mdx-renderer
|
|
75
|
+
readonly format: Schema.Literal<"nakafa-mdx-renderer">;
|
|
93
76
|
readonly hash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
94
77
|
readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
|
|
95
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
96
78
|
}>;
|
|
97
79
|
readonly receipt: Schema.Struct<{
|
|
98
80
|
readonly activatedHeads: Schema.Finite;
|
|
@@ -160,7 +142,6 @@ export declare const ActiveRollbackContentReleaseSchema: Schema.refine<ActiveRol
|
|
|
160
142
|
readonly projectionCount: Schema.Finite;
|
|
161
143
|
readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
162
144
|
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
163
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
164
145
|
readonly rendererManifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
165
146
|
readonly resultCount: Schema.Finite;
|
|
166
147
|
readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
@@ -203,31 +184,14 @@ export declare const ActiveRollbackContentReleaseSchema: Schema.refine<ActiveRol
|
|
|
203
184
|
readonly signature: Schema.brand<Schema.String, "@NakafaAI/AksaraEd25519Signature">;
|
|
204
185
|
}>;
|
|
205
186
|
readonly rendererManifest: Schema.Struct<{
|
|
206
|
-
readonly base: Schema.
|
|
207
|
-
authoringComponents: Schema.$Array<Schema.Struct<{
|
|
208
|
-
readonly name: Schema.String;
|
|
209
|
-
readonly version: Schema.Finite;
|
|
210
|
-
}>>;
|
|
211
|
-
supportedComponents: Schema.$Array<Schema.Struct<{
|
|
212
|
-
readonly name: Schema.String;
|
|
213
|
-
readonly version: Schema.Finite;
|
|
214
|
-
}>>;
|
|
215
|
-
}>;
|
|
187
|
+
readonly base: Schema.$Array<Schema.String>;
|
|
216
188
|
readonly domains: Schema.$Array<Schema.Struct<{
|
|
217
|
-
readonly
|
|
218
|
-
readonly name: Schema.String;
|
|
219
|
-
readonly version: Schema.Finite;
|
|
220
|
-
}>>;
|
|
189
|
+
readonly components: Schema.$Array<Schema.String>;
|
|
221
190
|
readonly name: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
222
|
-
readonly supportedComponents: Schema.$Array<Schema.Struct<{
|
|
223
|
-
readonly name: Schema.String;
|
|
224
|
-
readonly version: Schema.Finite;
|
|
225
|
-
}>>;
|
|
226
191
|
}>>;
|
|
227
|
-
readonly format: Schema.Literal<"nakafa-mdx-renderer
|
|
192
|
+
readonly format: Schema.Literal<"nakafa-mdx-renderer">;
|
|
228
193
|
readonly hash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
229
194
|
readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
|
|
230
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
231
195
|
}>;
|
|
232
196
|
readonly receipt: Schema.Struct<{
|
|
233
197
|
readonly activatedHeads: Schema.Finite;
|
|
@@ -296,7 +260,6 @@ export declare const RecoveryLookupSchema: Schema.Union<readonly [Schema.Struct<
|
|
|
296
260
|
readonly projectionCount: Schema.Finite;
|
|
297
261
|
readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
298
262
|
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
299
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
300
263
|
readonly rendererManifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
301
264
|
readonly resultCount: Schema.Finite;
|
|
302
265
|
readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
@@ -339,31 +302,14 @@ export declare const RecoveryLookupSchema: Schema.Union<readonly [Schema.Struct<
|
|
|
339
302
|
readonly signature: Schema.brand<Schema.String, "@NakafaAI/AksaraEd25519Signature">;
|
|
340
303
|
}>;
|
|
341
304
|
readonly rendererManifest: Schema.Struct<{
|
|
342
|
-
readonly base: Schema.
|
|
343
|
-
authoringComponents: Schema.$Array<Schema.Struct<{
|
|
344
|
-
readonly name: Schema.String;
|
|
345
|
-
readonly version: Schema.Finite;
|
|
346
|
-
}>>;
|
|
347
|
-
supportedComponents: Schema.$Array<Schema.Struct<{
|
|
348
|
-
readonly name: Schema.String;
|
|
349
|
-
readonly version: Schema.Finite;
|
|
350
|
-
}>>;
|
|
351
|
-
}>;
|
|
305
|
+
readonly base: Schema.$Array<Schema.String>;
|
|
352
306
|
readonly domains: Schema.$Array<Schema.Struct<{
|
|
353
|
-
readonly
|
|
354
|
-
readonly name: Schema.String;
|
|
355
|
-
readonly version: Schema.Finite;
|
|
356
|
-
}>>;
|
|
307
|
+
readonly components: Schema.$Array<Schema.String>;
|
|
357
308
|
readonly name: Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>;
|
|
358
|
-
readonly supportedComponents: Schema.$Array<Schema.Struct<{
|
|
359
|
-
readonly name: Schema.String;
|
|
360
|
-
readonly version: Schema.Finite;
|
|
361
|
-
}>>;
|
|
362
309
|
}>>;
|
|
363
|
-
readonly format: Schema.Literal<"nakafa-mdx-renderer
|
|
310
|
+
readonly format: Schema.Literal<"nakafa-mdx-renderer">;
|
|
364
311
|
readonly hash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
365
312
|
readonly publishedDomains: Schema.$Array<Schema.Literals<readonly ["ai-ds", "biology", "chemistry", "mathematics", "physics", "politics", "site", "snbt-general", "snbt-math", "snbt-plain", "snbt-quant", "tka-math"]>>;
|
|
366
|
-
readonly rendererContractVersion: Schema.Literal<"1.0.0">;
|
|
367
313
|
}>;
|
|
368
314
|
readonly receipt: Schema.Struct<{
|
|
369
315
|
readonly activatedHeads: Schema.Finite;
|