@world-engines/scenario-review-snapshot 0.0.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/LICENSE +46 -0
- package/dist/artifact-digest.d.ts +15 -0
- package/dist/artifact-digest.js +831 -0
- package/dist/artifact.d.ts +225 -0
- package/dist/artifact.js +37 -0
- package/dist/bound-view-freeze.d.ts +43 -0
- package/dist/bound-view-freeze.js +114 -0
- package/dist/canonical.d.ts +10 -0
- package/dist/canonical.js +184 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +8 -0
- package/dist/neutral-artifact-assembler.d.ts +180 -0
- package/dist/neutral-artifact-assembler.js +1050 -0
- package/dist/publish-attempt.d.ts +118 -0
- package/dist/publish-attempt.js +33 -0
- package/dist/server-bound-view-compiler.d.ts +26 -0
- package/dist/server-bound-view-compiler.js +34 -0
- package/dist/snapshot.d.ts +5 -0
- package/dist/snapshot.js +701 -0
- package/dist/types.d.ts +112 -0
- package/dist/types.js +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { JsonValue } from "./types.js";
|
|
2
|
+
import type { ViewInteractionManifestV3 } from "@world-engines/tmw/view-interaction-manifest-v3";
|
|
3
|
+
import type { MusicCandidateSourceV3 } from "@world-engines/tmw/music-candidate-set";
|
|
4
|
+
export declare const FROZEN_PUBLISH_INPUT_SCHEMA_VERSION: 1;
|
|
5
|
+
export declare const CAPTURED_REVISION_SCHEMA_VERSION: 3;
|
|
6
|
+
export declare const ARTIFACT_MANIFEST_VERSION_V5: 5;
|
|
7
|
+
export declare const ARTIFACT_PACKAGE_FORMAT_VERSION_V5: 3;
|
|
8
|
+
export declare const LEGACY_ARTIFACT_PACKAGE_FORMAT_VERSION_V5: 2;
|
|
9
|
+
export declare const PUBLISHED_ARTIFACT_HEAD_SCHEMA_VERSION: 1;
|
|
10
|
+
export declare const FROZEN_ARTIFACT_OBJECT_COUNT: 9;
|
|
11
|
+
export declare const FROZEN_DATABASE_DELIVERY_CODEC: "scnb-v2";
|
|
12
|
+
export declare const FROZEN_DATABASE_DELIVERY_MAGIC: 16;
|
|
13
|
+
export declare const FROZEN_DATABASE_DELIVERY_MEDIA_TYPE: "application/vnd.chat.scenario-database.scnb-v2";
|
|
14
|
+
export declare const FROZEN_DATABASE_DELIVERY_RELATIVE_PATH: "database.origin";
|
|
15
|
+
export declare const ARTIFACT_COMPILER_WITNESS_PATHS: Readonly<{
|
|
16
|
+
readonly source_manifest: "__tmw3__/source-manifest.pb";
|
|
17
|
+
readonly target_profile: "__tmw3__/compile-target-profile.json";
|
|
18
|
+
readonly compiler_receipt: "__tmw3__/compiler-receipt.json";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const ARTIFACT_COMPILER_WITNESS_RESERVED_PREFIX: "__tmw3__/";
|
|
21
|
+
export declare const ARTIFACT_COMPILER_WITNESS_OBJECTS: Readonly<{
|
|
22
|
+
readonly source_manifest: Readonly<{
|
|
23
|
+
kind: "source_manifest";
|
|
24
|
+
relative_path: "source-manifest.pb";
|
|
25
|
+
media_type: "application/x-protobuf";
|
|
26
|
+
resource_path: "__tmw3__/source-manifest.pb";
|
|
27
|
+
}>;
|
|
28
|
+
readonly target_profile: Readonly<{
|
|
29
|
+
kind: "compile_target_profile";
|
|
30
|
+
relative_path: "compile-target-profile.json";
|
|
31
|
+
media_type: "application/json";
|
|
32
|
+
resource_path: "__tmw3__/compile-target-profile.json";
|
|
33
|
+
}>;
|
|
34
|
+
readonly compiler_receipt: Readonly<{
|
|
35
|
+
kind: "compiler_receipt";
|
|
36
|
+
relative_path: "compiler-receipt.json";
|
|
37
|
+
media_type: "application/json";
|
|
38
|
+
resource_path: "__tmw3__/compiler-receipt.json";
|
|
39
|
+
}>;
|
|
40
|
+
}>;
|
|
41
|
+
export type Sha256Hex = string;
|
|
42
|
+
/**
|
|
43
|
+
* Creator 对同一次草稿状态的确定性标识。`revision_number` 来自草稿单调版本,
|
|
44
|
+
* `revision_id` 由 capture owner 分配;重试同一 capture 时两者都不得改变。
|
|
45
|
+
*/
|
|
46
|
+
export interface CapturedRevision {
|
|
47
|
+
readonly schema_version: typeof CAPTURED_REVISION_SCHEMA_VERSION;
|
|
48
|
+
readonly owner_id: string;
|
|
49
|
+
readonly scenario_id: string;
|
|
50
|
+
readonly epoch: number;
|
|
51
|
+
readonly revision_number: number;
|
|
52
|
+
readonly revision_id: string;
|
|
53
|
+
readonly source_sha256: Sha256Hex;
|
|
54
|
+
readonly revision_digest: Sha256Hex;
|
|
55
|
+
}
|
|
56
|
+
export interface FrozenSystemPrompt {
|
|
57
|
+
readonly prompt_id: string;
|
|
58
|
+
readonly order: number;
|
|
59
|
+
readonly content: JsonValue;
|
|
60
|
+
}
|
|
61
|
+
export interface FrozenPublishResource {
|
|
62
|
+
readonly path: string;
|
|
63
|
+
readonly media_type: string;
|
|
64
|
+
readonly bytes: Uint8Array;
|
|
65
|
+
}
|
|
66
|
+
export interface FrozenRuntimeIdentity {
|
|
67
|
+
readonly runtime_generation: 3;
|
|
68
|
+
readonly runtime_contract_hash: Sha256Hex;
|
|
69
|
+
readonly runtime_major: number;
|
|
70
|
+
readonly runtime_patch: number;
|
|
71
|
+
readonly runtime_release_id: string;
|
|
72
|
+
readonly protocol_version: number;
|
|
73
|
+
readonly sdk_schema_version: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 一次性 capture 的完整输入。生产 assembler 只能消费该值,不得再次读取 live store。
|
|
77
|
+
*/
|
|
78
|
+
export interface FrozenPublishInput {
|
|
79
|
+
readonly input_schema_version: typeof FROZEN_PUBLISH_INPUT_SCHEMA_VERSION;
|
|
80
|
+
readonly captured_revision: CapturedRevision;
|
|
81
|
+
readonly runtime_contract_hash: Sha256Hex;
|
|
82
|
+
readonly metadata: JsonValue;
|
|
83
|
+
readonly protagonist: JsonValue;
|
|
84
|
+
readonly system_prompts: readonly FrozenSystemPrompt[];
|
|
85
|
+
readonly database_bytes: Uint8Array;
|
|
86
|
+
/** Player 实际下载的密文;明文 `database_bytes` 只供受信审核与 WASM 校验。 */
|
|
87
|
+
readonly database_delivery: FrozenDatabaseDelivery;
|
|
88
|
+
readonly trigger_document: JsonValue;
|
|
89
|
+
readonly compiled_plan: JsonValue;
|
|
90
|
+
readonly view_source_bytes: Uint8Array;
|
|
91
|
+
readonly view_publish_mobile_bytes: Uint8Array;
|
|
92
|
+
readonly view_publish_pc_bytes: Uint8Array;
|
|
93
|
+
readonly view_interaction_mobile: ViewInteractionManifestV3 | null;
|
|
94
|
+
readonly view_interaction_pc: ViewInteractionManifestV3 | null;
|
|
95
|
+
readonly music_candidate_source: MusicCandidateSourceV3;
|
|
96
|
+
readonly retrieval: JsonValue;
|
|
97
|
+
readonly resources: readonly FrozenPublishResource[];
|
|
98
|
+
readonly runtime_identity: FrozenRuntimeIdentity;
|
|
99
|
+
readonly archive_bytes: Uint8Array;
|
|
100
|
+
}
|
|
101
|
+
export interface CanonicalJsonIdentity {
|
|
102
|
+
readonly encoding: "canonical-json-v1";
|
|
103
|
+
readonly size_bytes: number;
|
|
104
|
+
readonly sha256: Sha256Hex;
|
|
105
|
+
}
|
|
106
|
+
export interface BinaryIdentity {
|
|
107
|
+
readonly encoding: "bytes";
|
|
108
|
+
readonly size_bytes: number;
|
|
109
|
+
readonly sha256: Sha256Hex;
|
|
110
|
+
}
|
|
111
|
+
export interface FrozenDatabaseDelivery {
|
|
112
|
+
readonly codec: typeof FROZEN_DATABASE_DELIVERY_CODEC;
|
|
113
|
+
readonly bytes: Uint8Array;
|
|
114
|
+
}
|
|
115
|
+
export interface FrozenDatabaseDeliveryIdentity extends BinaryIdentity {
|
|
116
|
+
readonly codec: typeof FROZEN_DATABASE_DELIVERY_CODEC;
|
|
117
|
+
readonly media_type: typeof FROZEN_DATABASE_DELIVERY_MEDIA_TYPE;
|
|
118
|
+
}
|
|
119
|
+
export interface FrozenResourceIdentity extends BinaryIdentity {
|
|
120
|
+
readonly path: string;
|
|
121
|
+
readonly media_type: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ArtifactV5Core {
|
|
124
|
+
readonly manifest_version: typeof ARTIFACT_MANIFEST_VERSION_V5;
|
|
125
|
+
readonly package_format_version: typeof ARTIFACT_PACKAGE_FORMAT_VERSION_V5;
|
|
126
|
+
readonly scenario_id: string;
|
|
127
|
+
readonly epoch: number;
|
|
128
|
+
readonly runtime_contract_hash: Sha256Hex;
|
|
129
|
+
readonly captured_revision: CapturedRevision;
|
|
130
|
+
readonly frozen_input_sha256: Sha256Hex;
|
|
131
|
+
readonly metadata: CanonicalJsonIdentity;
|
|
132
|
+
readonly protagonist: CanonicalJsonIdentity;
|
|
133
|
+
readonly system_prompts: CanonicalJsonIdentity;
|
|
134
|
+
readonly database: BinaryIdentity;
|
|
135
|
+
readonly database_delivery: FrozenDatabaseDeliveryIdentity;
|
|
136
|
+
readonly trigger_document: CanonicalJsonIdentity;
|
|
137
|
+
readonly compiled_plan: CanonicalJsonIdentity;
|
|
138
|
+
readonly views: {
|
|
139
|
+
readonly source: BinaryIdentity;
|
|
140
|
+
readonly publish_mobile: BinaryIdentity;
|
|
141
|
+
readonly publish_pc: BinaryIdentity;
|
|
142
|
+
};
|
|
143
|
+
readonly view_interaction: {
|
|
144
|
+
readonly mobile: CanonicalJsonIdentity;
|
|
145
|
+
readonly pc: CanonicalJsonIdentity;
|
|
146
|
+
};
|
|
147
|
+
readonly music_candidate_source: CanonicalJsonIdentity;
|
|
148
|
+
readonly retrieval: CanonicalJsonIdentity;
|
|
149
|
+
readonly resources: {
|
|
150
|
+
readonly manifest: CanonicalJsonIdentity;
|
|
151
|
+
readonly entries: readonly FrozenResourceIdentity[];
|
|
152
|
+
};
|
|
153
|
+
readonly runtime: {
|
|
154
|
+
readonly identity: FrozenRuntimeIdentity;
|
|
155
|
+
readonly canonical: CanonicalJsonIdentity;
|
|
156
|
+
};
|
|
157
|
+
readonly archive: BinaryIdentity;
|
|
158
|
+
}
|
|
159
|
+
export interface ArtifactV5 extends ArtifactV5Core {
|
|
160
|
+
readonly canonical_digest: Sha256Hex;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Package V2 缺少 immutable database delivery 身份,只能由隔离 legacy reader
|
|
164
|
+
* 展示;该类型故意不满足 ArtifactV5,禁止进入 verified publish/player seam。
|
|
165
|
+
*/
|
|
166
|
+
export interface LegacyArtifactV5Package2Read {
|
|
167
|
+
readonly verification: "legacy_unverified";
|
|
168
|
+
readonly manifest_version: typeof ARTIFACT_MANIFEST_VERSION_V5;
|
|
169
|
+
readonly package_format_version: typeof LEGACY_ARTIFACT_PACKAGE_FORMAT_VERSION_V5;
|
|
170
|
+
readonly scenario_id: string;
|
|
171
|
+
readonly canonical_digest: Sha256Hex;
|
|
172
|
+
readonly raw_manifest: JsonValue;
|
|
173
|
+
}
|
|
174
|
+
export type FrozenArtifactObjectKind = "database" | "trigger_document" | "compiled_plan" | "view_interaction_mobile" | "view_interaction_pc" | "music_candidate_source" | "source_manifest" | "compile_target_profile" | "compiler_receipt";
|
|
175
|
+
export interface FrozenArtifactObjectIdentity extends BinaryIdentity {
|
|
176
|
+
readonly kind: FrozenArtifactObjectKind;
|
|
177
|
+
readonly relative_path: string;
|
|
178
|
+
readonly media_type: string;
|
|
179
|
+
}
|
|
180
|
+
export interface FrozenArtifactObject extends FrozenArtifactObjectIdentity {
|
|
181
|
+
readonly bytes: Uint8Array;
|
|
182
|
+
}
|
|
183
|
+
export interface ArtifactCompilerWitnessIdentity {
|
|
184
|
+
readonly source_manifest: FrozenArtifactObjectIdentity & {
|
|
185
|
+
readonly kind: "source_manifest";
|
|
186
|
+
readonly relative_path: "source-manifest.pb";
|
|
187
|
+
readonly media_type: "application/x-protobuf";
|
|
188
|
+
};
|
|
189
|
+
readonly target_profile: FrozenArtifactObjectIdentity & {
|
|
190
|
+
readonly kind: "compile_target_profile";
|
|
191
|
+
readonly relative_path: "compile-target-profile.json";
|
|
192
|
+
readonly media_type: "application/json";
|
|
193
|
+
};
|
|
194
|
+
readonly compiler_receipt: FrozenArtifactObjectIdentity & {
|
|
195
|
+
readonly kind: "compiler_receipt";
|
|
196
|
+
readonly relative_path: "compiler-receipt.json";
|
|
197
|
+
readonly media_type: "application/json";
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/** submit 的唯一 payload;Coordinator 不得要求调用方另行写对象或重读 live source。 */
|
|
201
|
+
export interface FrozenArtifactBundle {
|
|
202
|
+
readonly artifact: ArtifactV5;
|
|
203
|
+
readonly objects: readonly FrozenArtifactObject[];
|
|
204
|
+
}
|
|
205
|
+
export interface PublishedArtifactHeadCore {
|
|
206
|
+
readonly head_schema_version: typeof PUBLISHED_ARTIFACT_HEAD_SCHEMA_VERSION;
|
|
207
|
+
readonly scenario_id: string;
|
|
208
|
+
readonly epoch: number;
|
|
209
|
+
readonly runtime_contract_hash: Sha256Hex;
|
|
210
|
+
readonly source_revision_digest: Sha256Hex;
|
|
211
|
+
readonly head_revision: number;
|
|
212
|
+
readonly artifact_canonical_digest: Sha256Hex;
|
|
213
|
+
readonly artifact_manifest_sha256: Sha256Hex;
|
|
214
|
+
readonly review_ticket_id: string;
|
|
215
|
+
readonly review_snapshot_hash: Sha256Hex;
|
|
216
|
+
readonly review_coverage_hash: Sha256Hex;
|
|
217
|
+
readonly published_at: number;
|
|
218
|
+
readonly previous_head_digest: Sha256Hex | null;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* append-only head 事件。可变 active pointer 只能 CAS 到 `head_digest`,不得改写该对象。
|
|
222
|
+
*/
|
|
223
|
+
export interface PublishedArtifactHead extends PublishedArtifactHeadCore {
|
|
224
|
+
readonly head_digest: Sha256Hex;
|
|
225
|
+
}
|
package/dist/artifact.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const FROZEN_PUBLISH_INPUT_SCHEMA_VERSION = 1;
|
|
2
|
+
export const CAPTURED_REVISION_SCHEMA_VERSION = 3;
|
|
3
|
+
export const ARTIFACT_MANIFEST_VERSION_V5 = 5;
|
|
4
|
+
export const ARTIFACT_PACKAGE_FORMAT_VERSION_V5 = 3;
|
|
5
|
+
export const LEGACY_ARTIFACT_PACKAGE_FORMAT_VERSION_V5 = 2;
|
|
6
|
+
export const PUBLISHED_ARTIFACT_HEAD_SCHEMA_VERSION = 1;
|
|
7
|
+
export const FROZEN_ARTIFACT_OBJECT_COUNT = 9;
|
|
8
|
+
export const FROZEN_DATABASE_DELIVERY_CODEC = "scnb-v2";
|
|
9
|
+
export const FROZEN_DATABASE_DELIVERY_MAGIC = 0x10;
|
|
10
|
+
export const FROZEN_DATABASE_DELIVERY_MEDIA_TYPE = "application/vnd.chat.scenario-database.scnb-v2";
|
|
11
|
+
export const FROZEN_DATABASE_DELIVERY_RELATIVE_PATH = "database.origin";
|
|
12
|
+
export const ARTIFACT_COMPILER_WITNESS_PATHS = Object.freeze({
|
|
13
|
+
source_manifest: "__tmw3__/source-manifest.pb",
|
|
14
|
+
target_profile: "__tmw3__/compile-target-profile.json",
|
|
15
|
+
compiler_receipt: "__tmw3__/compiler-receipt.json",
|
|
16
|
+
});
|
|
17
|
+
export const ARTIFACT_COMPILER_WITNESS_RESERVED_PREFIX = "__tmw3__/";
|
|
18
|
+
export const ARTIFACT_COMPILER_WITNESS_OBJECTS = Object.freeze({
|
|
19
|
+
source_manifest: Object.freeze({
|
|
20
|
+
kind: "source_manifest",
|
|
21
|
+
relative_path: "source-manifest.pb",
|
|
22
|
+
media_type: "application/x-protobuf",
|
|
23
|
+
resource_path: ARTIFACT_COMPILER_WITNESS_PATHS.source_manifest,
|
|
24
|
+
}),
|
|
25
|
+
target_profile: Object.freeze({
|
|
26
|
+
kind: "compile_target_profile",
|
|
27
|
+
relative_path: "compile-target-profile.json",
|
|
28
|
+
media_type: "application/json",
|
|
29
|
+
resource_path: ARTIFACT_COMPILER_WITNESS_PATHS.target_profile,
|
|
30
|
+
}),
|
|
31
|
+
compiler_receipt: Object.freeze({
|
|
32
|
+
kind: "compiler_receipt",
|
|
33
|
+
relative_path: "compiler-receipt.json",
|
|
34
|
+
media_type: "application/json",
|
|
35
|
+
resource_path: ARTIFACT_COMPILER_WITNESS_PATHS.compiler_receipt,
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type NeutralSourceCaptureWitness, type NeutralSourceCompileInput } from "@world-engines/scenario-author-source";
|
|
2
|
+
import type { FrozenArtifactBundle, FrozenRuntimeIdentity } from "./artifact.js";
|
|
3
|
+
import { type NeutralArtifactCompilation, type NeutralArtifactEmbeddingMaterialization } from "./neutral-artifact-assembler.js";
|
|
4
|
+
/**
|
|
5
|
+
* Bound-copy authority 的 server readback。`bound_source` 必须是替换目标 SVP
|
|
6
|
+
* 后由 authority 写入的 revision witness,不能复用原 scenario revision identity。
|
|
7
|
+
*/
|
|
8
|
+
export interface BoundCopyPublishReceipt {
|
|
9
|
+
readonly copy_operation_id: string;
|
|
10
|
+
readonly base_source_revision_digest: string;
|
|
11
|
+
readonly target_svp_sha256: string;
|
|
12
|
+
readonly bound_source: NeutralSourceCaptureWitness;
|
|
13
|
+
}
|
|
14
|
+
/** server-only codec seam;生产实现使用 SVP decoder 与 canonical gzip-tar packer。 */
|
|
15
|
+
export interface ServerBoundViewProjectCodec<TViewProject> {
|
|
16
|
+
decode_svp(bytes: Uint8Array): TViewProject;
|
|
17
|
+
pack_gzip_tar(project: TViewProject): Promise<Uint8Array>;
|
|
18
|
+
}
|
|
19
|
+
/** compiler 只消费本模块重建并 capture 的 source,不能接收调用方拼出的 model。 */
|
|
20
|
+
export interface ServerBoundViewCompiler<TViewProject> {
|
|
21
|
+
compile(source: NeutralSourceCompileInput): Promise<NeutralArtifactCompilation<TViewProject>>;
|
|
22
|
+
}
|
|
23
|
+
export interface BoundViewFreezeInput {
|
|
24
|
+
readonly bound_copy_receipt: BoundCopyPublishReceipt;
|
|
25
|
+
/** bound-copy 前的冻结 scenario input;adapter 只替换 view_project section。 */
|
|
26
|
+
readonly current_compile_input: NeutralSourceCompileInput;
|
|
27
|
+
/** server-only store 读出的 SVP1 bytes;任何 digest 都不能替代它。 */
|
|
28
|
+
readonly target_svp_bytes: Uint8Array;
|
|
29
|
+
readonly platform_html: Readonly<{
|
|
30
|
+
readonly mobile: Uint8Array;
|
|
31
|
+
readonly pc: Uint8Array;
|
|
32
|
+
}>;
|
|
33
|
+
readonly content_epoch: number;
|
|
34
|
+
readonly embedding: NeutralArtifactEmbeddingMaterialization;
|
|
35
|
+
readonly database_bytes: Uint8Array;
|
|
36
|
+
readonly database_delivery_bytes: Uint8Array;
|
|
37
|
+
readonly runtime_identity: FrozenRuntimeIdentity;
|
|
38
|
+
}
|
|
39
|
+
/** 单一 server-only publish adapter;不含 Browser build、SVP 读取或任何密钥。 */
|
|
40
|
+
export interface BoundViewFreezeAdapter {
|
|
41
|
+
freeze(input: BoundViewFreezeInput): Promise<FrozenArtifactBundle>;
|
|
42
|
+
}
|
|
43
|
+
export declare function createBoundViewFreezeAdapter<TViewProject>(codec: ServerBoundViewProjectCodec<TViewProject>, compiler: ServerBoundViewCompiler<TViewProject>): BoundViewFreezeAdapter;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { canonicalScenarioSourceManifestDigestInputBytes, captureNeutralSourceCompileInput, createNeutralScenarioSource, encodeNeutralScenarioSource, } from "@world-engines/scenario-author-source";
|
|
2
|
+
import { sha256Hex } from "./canonical.js";
|
|
3
|
+
import { buildFrozenArtifactBundle } from "./artifact-digest.js";
|
|
4
|
+
import { assembleNeutralFrozenPublishInput, } from "./neutral-artifact-assembler.js";
|
|
5
|
+
const SHA256 = /^[0-9a-f]{64}$/u;
|
|
6
|
+
export function createBoundViewFreezeAdapter(codec, compiler) {
|
|
7
|
+
return Object.freeze({
|
|
8
|
+
async freeze(input) {
|
|
9
|
+
assertInputReceiptBinding(input);
|
|
10
|
+
const targetProject = codec.decode_svp(input.target_svp_bytes.slice());
|
|
11
|
+
const targetGzipTar = await codec.pack_gzip_tar(targetProject);
|
|
12
|
+
if (!(targetGzipTar instanceof Uint8Array) || targetGzipTar.byteLength === 0) {
|
|
13
|
+
throw new Error("bound_view_freeze_target_project_bytes_invalid");
|
|
14
|
+
}
|
|
15
|
+
const source = await rebuildBoundCompileInput(input, targetGzipTar);
|
|
16
|
+
const compilation = await compiler.compile(source);
|
|
17
|
+
assertTrustedCompilationMatchesBoundSource(input, source, targetGzipTar, compilation);
|
|
18
|
+
const frozen = await assembleNeutralFrozenPublishInput({
|
|
19
|
+
source,
|
|
20
|
+
content_epoch: input.content_epoch,
|
|
21
|
+
compilation,
|
|
22
|
+
embedding: input.embedding,
|
|
23
|
+
database_bytes: input.database_bytes,
|
|
24
|
+
database_delivery_bytes: input.database_delivery_bytes,
|
|
25
|
+
view_publish_mobile_bytes: input.platform_html.mobile,
|
|
26
|
+
view_publish_pc_bytes: input.platform_html.pc,
|
|
27
|
+
runtime_identity: input.runtime_identity,
|
|
28
|
+
});
|
|
29
|
+
return buildFrozenArtifactBundle(frozen);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async function rebuildBoundCompileInput(input, targetGzipTar) {
|
|
34
|
+
let replaced = false;
|
|
35
|
+
const sections = input.current_compile_input.sections.map((section) => {
|
|
36
|
+
if (section.section_key !== "view_project")
|
|
37
|
+
return cloneSection(section);
|
|
38
|
+
replaced = true;
|
|
39
|
+
return {
|
|
40
|
+
section_key: "view_project",
|
|
41
|
+
media_type: "application/vnd.chat.view-project+gzip",
|
|
42
|
+
canonical_encoding: "gzip-tar-v1",
|
|
43
|
+
payload: targetGzipTar.slice(),
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
if (!replaced)
|
|
47
|
+
throw new Error("bound_view_freeze_current_view_section_missing");
|
|
48
|
+
const source = await createNeutralScenarioSource(input.current_compile_input.witness.scenario_id, sections);
|
|
49
|
+
const sourceBytes = await encodeNeutralScenarioSource(source);
|
|
50
|
+
const witness = input.bound_copy_receipt.bound_source;
|
|
51
|
+
const manifest = source.manifest;
|
|
52
|
+
if (manifest === undefined
|
|
53
|
+
|| sha256Hex(sourceBytes) !== witness.source_digest
|
|
54
|
+
|| sha256Hex(canonicalScenarioSourceManifestDigestInputBytes(manifest)) !== witness.manifest_digest) {
|
|
55
|
+
throw new Error("bound_view_freeze_rebuilt_source_receipt_mismatch");
|
|
56
|
+
}
|
|
57
|
+
return await captureNeutralSourceCompileInput({ witness, source_bytes: sourceBytes });
|
|
58
|
+
}
|
|
59
|
+
function assertInputReceiptBinding(input) {
|
|
60
|
+
const receipt = input.bound_copy_receipt;
|
|
61
|
+
const current = input.current_compile_input.witness;
|
|
62
|
+
if (!nonEmptyText(receipt.copy_operation_id)
|
|
63
|
+
|| !SHA256.test(receipt.base_source_revision_digest)
|
|
64
|
+
|| !SHA256.test(receipt.target_svp_sha256)
|
|
65
|
+
|| !validWitness(receipt.bound_source)) {
|
|
66
|
+
throw new Error("bound_view_freeze_receipt_invalid");
|
|
67
|
+
}
|
|
68
|
+
if (!(input.target_svp_bytes instanceof Uint8Array)
|
|
69
|
+
|| !(input.platform_html.mobile instanceof Uint8Array)
|
|
70
|
+
|| !(input.platform_html.pc instanceof Uint8Array)) {
|
|
71
|
+
throw new Error("bound_view_freeze_actual_bytes_required");
|
|
72
|
+
}
|
|
73
|
+
if (receipt.base_source_revision_digest !== current.revision_digest
|
|
74
|
+
|| receipt.bound_source.scenario_id !== current.scenario_id
|
|
75
|
+
|| receipt.bound_source.owner_id !== current.owner_id
|
|
76
|
+
|| sha256Hex(input.target_svp_bytes) !== receipt.target_svp_sha256) {
|
|
77
|
+
throw new Error("bound_view_freeze_receipt_current_source_mismatch");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function assertTrustedCompilationMatchesBoundSource(input, source, targetGzipTar, compilation) {
|
|
81
|
+
if (compilation.receipt.scenario_id !== source.witness.scenario_id
|
|
82
|
+
|| compilation.receipt.source_manifest_sha256 !== source.witness.manifest_digest
|
|
83
|
+
|| !sameBytes(compilation.model.view_source_bytes, targetGzipTar)
|
|
84
|
+
|| compilation.model.trigger_document.runtime_contract_hash !== input.runtime_identity.runtime_contract_hash) {
|
|
85
|
+
throw new Error("bound_view_freeze_trusted_compilation_mismatch");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function cloneSection(section) {
|
|
89
|
+
return {
|
|
90
|
+
section_key: section.section_key,
|
|
91
|
+
media_type: section.media_type,
|
|
92
|
+
canonical_encoding: section.canonical_encoding,
|
|
93
|
+
payload: section.payload.slice(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function validWitness(witness) {
|
|
97
|
+
return nonEmptyText(witness.owner_id) && nonEmptyText(witness.scenario_id)
|
|
98
|
+
&& Number.isSafeInteger(witness.source_revision) && witness.source_revision > 0
|
|
99
|
+
&& SHA256.test(witness.manifest_digest) && SHA256.test(witness.source_digest)
|
|
100
|
+
&& SHA256.test(witness.revision_digest) && SHA256.test(witness.head_digest)
|
|
101
|
+
&& (witness.previous_head_digest === null || SHA256.test(witness.previous_head_digest));
|
|
102
|
+
}
|
|
103
|
+
function nonEmptyText(value) {
|
|
104
|
+
return value.length > 0 && value === value.trim().normalize("NFC");
|
|
105
|
+
}
|
|
106
|
+
function sameBytes(left, right) {
|
|
107
|
+
if (left.byteLength !== right.byteLength)
|
|
108
|
+
return false;
|
|
109
|
+
for (let index = 0; index < left.byteLength; index += 1) {
|
|
110
|
+
if (left[index] !== right[index])
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JsonValue } from "./types.js";
|
|
2
|
+
export declare function utf8ByteLength(value: string): number;
|
|
3
|
+
export declare function escapeJsonPointerToken(token: string): string;
|
|
4
|
+
export declare function unescapeJsonPointerToken(token: string): string;
|
|
5
|
+
export declare function appendJsonPointer(pointer: string, token: string | number): string;
|
|
6
|
+
export declare function parseJsonPointer(pointer: string): string[];
|
|
7
|
+
export declare function compareUtf8(a: string, b: string): number;
|
|
8
|
+
export declare function canonicalJson(value: JsonValue): string;
|
|
9
|
+
export declare function toJsonValue(value: unknown, maxDepth?: number): JsonValue;
|
|
10
|
+
export declare function sha256Hex(value: string | Uint8Array): string;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
const encoder = new TextEncoder();
|
|
2
|
+
export function utf8ByteLength(value) {
|
|
3
|
+
return encoder.encode(value).byteLength;
|
|
4
|
+
}
|
|
5
|
+
export function escapeJsonPointerToken(token) {
|
|
6
|
+
return token.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
7
|
+
}
|
|
8
|
+
export function unescapeJsonPointerToken(token) {
|
|
9
|
+
if (/~(?:[^01]|$)/u.test(token)) {
|
|
10
|
+
throw new Error("scenario_review_json_pointer_escape_invalid");
|
|
11
|
+
}
|
|
12
|
+
return token.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
13
|
+
}
|
|
14
|
+
export function appendJsonPointer(pointer, token) {
|
|
15
|
+
if (pointer !== "" && !pointer.startsWith("/")) {
|
|
16
|
+
throw new Error("scenario_review_json_pointer_invalid");
|
|
17
|
+
}
|
|
18
|
+
return `${pointer}/${escapeJsonPointerToken(String(token))}`;
|
|
19
|
+
}
|
|
20
|
+
export function parseJsonPointer(pointer) {
|
|
21
|
+
if (pointer === "")
|
|
22
|
+
return [];
|
|
23
|
+
if (!pointer.startsWith("/"))
|
|
24
|
+
throw new Error("scenario_review_json_pointer_invalid");
|
|
25
|
+
return pointer.slice(1).split("/").map(unescapeJsonPointerToken);
|
|
26
|
+
}
|
|
27
|
+
export function compareUtf8(a, b) {
|
|
28
|
+
const left = encoder.encode(a);
|
|
29
|
+
const right = encoder.encode(b);
|
|
30
|
+
const length = Math.min(left.length, right.length);
|
|
31
|
+
for (let index = 0; index < length; index += 1) {
|
|
32
|
+
const difference = left[index] - right[index];
|
|
33
|
+
if (difference !== 0)
|
|
34
|
+
return difference;
|
|
35
|
+
}
|
|
36
|
+
return left.length - right.length;
|
|
37
|
+
}
|
|
38
|
+
export function canonicalJson(value) {
|
|
39
|
+
return encodeCanonical(value, new Set());
|
|
40
|
+
}
|
|
41
|
+
function encodeCanonical(value, ancestors) {
|
|
42
|
+
if (value === null)
|
|
43
|
+
return "null";
|
|
44
|
+
if (typeof value === "string" || typeof value === "boolean")
|
|
45
|
+
return JSON.stringify(value);
|
|
46
|
+
if (typeof value === "number") {
|
|
47
|
+
if (!Number.isFinite(value))
|
|
48
|
+
throw new Error("scenario_review_json_number_invalid");
|
|
49
|
+
return JSON.stringify(Object.is(value, -0) ? 0 : value);
|
|
50
|
+
}
|
|
51
|
+
if (ancestors.has(value))
|
|
52
|
+
throw new Error("scenario_review_json_cycle");
|
|
53
|
+
ancestors.add(value);
|
|
54
|
+
try {
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
assertDenseArray(value);
|
|
57
|
+
return `[${value.map((item) => encodeCanonical(item, ancestors)).join(",")}]`;
|
|
58
|
+
}
|
|
59
|
+
const keys = Object.keys(value).sort(compareUtf8);
|
|
60
|
+
return `{${keys
|
|
61
|
+
.map((key) => `${JSON.stringify(key)}:${encodeCanonical(value[key], ancestors)}`)
|
|
62
|
+
.join(",")}}`;
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
ancestors.delete(value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export function toJsonValue(value, maxDepth = 256) {
|
|
69
|
+
if (!Number.isSafeInteger(maxDepth) || maxDepth < 0) {
|
|
70
|
+
throw new Error("scenario_review_json_depth_limit_invalid");
|
|
71
|
+
}
|
|
72
|
+
return normalizeJson(value, new Set(), 0, maxDepth);
|
|
73
|
+
}
|
|
74
|
+
function normalizeJson(value, ancestors, depth, maxDepth) {
|
|
75
|
+
if (depth > maxDepth)
|
|
76
|
+
throw new Error("scenario_review_value_depth_limit_exceeded");
|
|
77
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
78
|
+
return value;
|
|
79
|
+
if (typeof value === "number") {
|
|
80
|
+
if (!Number.isFinite(value))
|
|
81
|
+
throw new Error("scenario_review_json_number_invalid");
|
|
82
|
+
return Object.is(value, -0) ? 0 : value;
|
|
83
|
+
}
|
|
84
|
+
if (typeof value !== "object")
|
|
85
|
+
throw new Error("scenario_review_json_value_invalid");
|
|
86
|
+
if (ancestors.has(value))
|
|
87
|
+
throw new Error("scenario_review_json_cycle");
|
|
88
|
+
ancestors.add(value);
|
|
89
|
+
try {
|
|
90
|
+
if (Array.isArray(value)) {
|
|
91
|
+
assertDenseArray(value);
|
|
92
|
+
return Array.from(value, (item) => normalizeJson(item, ancestors, depth + 1, maxDepth));
|
|
93
|
+
}
|
|
94
|
+
const prototype = Object.getPrototypeOf(value);
|
|
95
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
96
|
+
throw new Error("scenario_review_json_object_invalid");
|
|
97
|
+
}
|
|
98
|
+
const source = value;
|
|
99
|
+
const result = {};
|
|
100
|
+
for (const key of Object.keys(source).sort(compareUtf8)) {
|
|
101
|
+
result[key] = normalizeJson(source[key], ancestors, depth + 1, maxDepth);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
ancestors.delete(value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function assertDenseArray(value) {
|
|
110
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
111
|
+
if (!Object.prototype.hasOwnProperty.call(value, index)) {
|
|
112
|
+
throw new Error("scenario_review_json_sparse_array_invalid");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export function sha256Hex(value) {
|
|
117
|
+
const bytes = typeof value === "string" ? encoder.encode(value) : value;
|
|
118
|
+
const words = new Uint32Array(64);
|
|
119
|
+
const hash = new Uint32Array([
|
|
120
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
|
121
|
+
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
|
122
|
+
]);
|
|
123
|
+
const bitLength = BigInt(bytes.length) * 8n;
|
|
124
|
+
const paddedLength = Math.ceil((bytes.length + 9) / 64) * 64;
|
|
125
|
+
const padded = new Uint8Array(paddedLength);
|
|
126
|
+
padded.set(bytes);
|
|
127
|
+
padded[bytes.length] = 0x80;
|
|
128
|
+
for (let index = 0; index < 8; index += 1) {
|
|
129
|
+
padded[paddedLength - 1 - index] = Number((bitLength >> BigInt(index * 8)) & 0xffn);
|
|
130
|
+
}
|
|
131
|
+
for (let offset = 0; offset < padded.length; offset += 64) {
|
|
132
|
+
for (let index = 0; index < 16; index += 1) {
|
|
133
|
+
const at = offset + index * 4;
|
|
134
|
+
words[index] = ((padded[at] << 24) | (padded[at + 1] << 16) |
|
|
135
|
+
(padded[at + 2] << 8) | padded[at + 3]) >>> 0;
|
|
136
|
+
}
|
|
137
|
+
for (let index = 16; index < 64; index += 1) {
|
|
138
|
+
const a = words[index - 15];
|
|
139
|
+
const b = words[index - 2];
|
|
140
|
+
const s0 = rotateRight(a, 7) ^ rotateRight(a, 18) ^ (a >>> 3);
|
|
141
|
+
const s1 = rotateRight(b, 17) ^ rotateRight(b, 19) ^ (b >>> 10);
|
|
142
|
+
words[index] = (words[index - 16] + s0 + words[index - 7] + s1) >>> 0;
|
|
143
|
+
}
|
|
144
|
+
let [a, b, c, d, e, f, g, h] = hash;
|
|
145
|
+
for (let index = 0; index < 64; index += 1) {
|
|
146
|
+
const sum1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
147
|
+
const choice = (e & f) ^ (~e & g);
|
|
148
|
+
const t1 = (h + sum1 + choice + SHA256_K[index] + words[index]) >>> 0;
|
|
149
|
+
const sum0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
150
|
+
const majority = (a & b) ^ (a & c) ^ (b & c);
|
|
151
|
+
const t2 = (sum0 + majority) >>> 0;
|
|
152
|
+
h = g;
|
|
153
|
+
g = f;
|
|
154
|
+
f = e;
|
|
155
|
+
e = (d + t1) >>> 0;
|
|
156
|
+
d = c;
|
|
157
|
+
c = b;
|
|
158
|
+
b = a;
|
|
159
|
+
a = (t1 + t2) >>> 0;
|
|
160
|
+
}
|
|
161
|
+
hash[0] = (hash[0] + a) >>> 0;
|
|
162
|
+
hash[1] = (hash[1] + b) >>> 0;
|
|
163
|
+
hash[2] = (hash[2] + c) >>> 0;
|
|
164
|
+
hash[3] = (hash[3] + d) >>> 0;
|
|
165
|
+
hash[4] = (hash[4] + e) >>> 0;
|
|
166
|
+
hash[5] = (hash[5] + f) >>> 0;
|
|
167
|
+
hash[6] = (hash[6] + g) >>> 0;
|
|
168
|
+
hash[7] = (hash[7] + h) >>> 0;
|
|
169
|
+
}
|
|
170
|
+
return [...hash].map((word) => word.toString(16).padStart(8, "0")).join("");
|
|
171
|
+
}
|
|
172
|
+
function rotateRight(value, count) {
|
|
173
|
+
return (value >>> count) | (value << (32 - count));
|
|
174
|
+
}
|
|
175
|
+
const SHA256_K = new Uint32Array([
|
|
176
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
177
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
178
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
179
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
180
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
181
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
182
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
183
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
184
|
+
]);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { appendJsonPointer, canonicalJson, compareUtf8, escapeJsonPointerToken, parseJsonPointer, sha256Hex, toJsonValue, unescapeJsonPointerToken, utf8ByteLength, } from "./canonical.js";
|
|
2
|
+
export { buildScenarioReviewSnapshot, DEFAULT_SCENARIO_REVIEW_SNAPSHOT_LIMITS, reconstructRecordPayload, stableRelationId, } from "./snapshot.js";
|
|
3
|
+
export { ARTIFACT_MANIFEST_VERSION_V5, ARTIFACT_PACKAGE_FORMAT_VERSION_V5, LEGACY_ARTIFACT_PACKAGE_FORMAT_VERSION_V5, CAPTURED_REVISION_SCHEMA_VERSION, FROZEN_PUBLISH_INPUT_SCHEMA_VERSION, FROZEN_DATABASE_DELIVERY_CODEC, FROZEN_DATABASE_DELIVERY_MEDIA_TYPE, FROZEN_DATABASE_DELIVERY_MAGIC, FROZEN_DATABASE_DELIVERY_RELATIVE_PATH, PUBLISHED_ARTIFACT_HEAD_SCHEMA_VERSION, } from "./artifact.js";
|
|
4
|
+
export { artifactV5ManifestSha256, buildArtifactV5, buildFrozenArtifactBundle, buildPublishedArtifactHead, canonicalArtifactV5Bytes, canonicalBytes, canonicalPublishedArtifactHeadCoreBytes, canonicalSha256, digestPublishedArtifactHeadCore, parseArtifactV5, parseFrozenArtifactBundle, parseLegacyArtifactV5Package2, parsePublishedArtifactHead, } from "./artifact-digest.js";
|
|
5
|
+
export type { CoverageManifest, CoverageManifestCore, CoverageRecordEntry, CoverageSectionEntry, JsonPrimitive, JsonValue, ReviewFragmentValueKind, ReviewRecordKind, ReviewSection, ScenarioReviewChunk, ScenarioReviewFragment, ScenarioReviewRecord, ScenarioReviewSnapshot, ScenarioReviewSnapshotCore, ScenarioReviewSnapshotInput, ScenarioReviewSnapshotLimits, ScenarioReviewSupplementalRecordInput, } from "./types.js";
|
|
6
|
+
export type { ArtifactV5, ArtifactV5Core, BinaryIdentity, CanonicalJsonIdentity, CapturedRevision, FrozenPublishInput, FrozenDatabaseDelivery, FrozenDatabaseDeliveryIdentity, FrozenArtifactBundle, FrozenArtifactObject, FrozenArtifactObjectIdentity, FrozenArtifactObjectKind, FrozenPublishResource, FrozenResourceIdentity, FrozenRuntimeIdentity, FrozenSystemPrompt, LegacyArtifactV5Package2Read, PublishedArtifactHead, PublishedArtifactHeadCore, Sha256Hex, } from "./artifact.js";
|
|
7
|
+
export type { ArtifactObjectReadbackReceipt, FinalizeApprovedArtifactInput, FinalizeApprovedArtifactResult, PublishOperationKey, PublishAttemptState, PublishAttemptCoordinator, PublishedArtifactObjectReader, ResolvePublishedArtifactInput, ResolvedPublishedArtifact, SubmitFrozenArtifactInput, SubmittedPublishAttempt, WriteOnceArtifactObject, WriteOnceArtifactStore, WriteOncePutResult, } from "./publish-attempt.js";
|
|
8
|
+
export { buildFrozenArtifactObjectKey, publishOperationKey, } from "./publish-attempt.js";
|
|
9
|
+
export * from "./neutral-artifact-assembler.js";
|
|
10
|
+
export * from "./bound-view-freeze.js";
|
|
11
|
+
export * from "./server-bound-view-compiler.js";
|
|
12
|
+
export type { ViewInteractionManifestV3, ViewInteractionSourceV3, } from "@world-engines/tmw/view-interaction-manifest-v3";
|
|
13
|
+
export type { MusicCandidateSourceV3, } from "@world-engines/tmw/music-candidate-set";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { appendJsonPointer, canonicalJson, compareUtf8, escapeJsonPointerToken, parseJsonPointer, sha256Hex, toJsonValue, unescapeJsonPointerToken, utf8ByteLength, } from "./canonical.js";
|
|
2
|
+
export { buildScenarioReviewSnapshot, DEFAULT_SCENARIO_REVIEW_SNAPSHOT_LIMITS, reconstructRecordPayload, stableRelationId, } from "./snapshot.js";
|
|
3
|
+
export { ARTIFACT_MANIFEST_VERSION_V5, ARTIFACT_PACKAGE_FORMAT_VERSION_V5, LEGACY_ARTIFACT_PACKAGE_FORMAT_VERSION_V5, CAPTURED_REVISION_SCHEMA_VERSION, FROZEN_PUBLISH_INPUT_SCHEMA_VERSION, FROZEN_DATABASE_DELIVERY_CODEC, FROZEN_DATABASE_DELIVERY_MEDIA_TYPE, FROZEN_DATABASE_DELIVERY_MAGIC, FROZEN_DATABASE_DELIVERY_RELATIVE_PATH, PUBLISHED_ARTIFACT_HEAD_SCHEMA_VERSION, } from "./artifact.js";
|
|
4
|
+
export { artifactV5ManifestSha256, buildArtifactV5, buildFrozenArtifactBundle, buildPublishedArtifactHead, canonicalArtifactV5Bytes, canonicalBytes, canonicalPublishedArtifactHeadCoreBytes, canonicalSha256, digestPublishedArtifactHeadCore, parseArtifactV5, parseFrozenArtifactBundle, parseLegacyArtifactV5Package2, parsePublishedArtifactHead, } from "./artifact-digest.js";
|
|
5
|
+
export { buildFrozenArtifactObjectKey, publishOperationKey, } from "./publish-attempt.js";
|
|
6
|
+
export * from "./neutral-artifact-assembler.js";
|
|
7
|
+
export * from "./bound-view-freeze.js";
|
|
8
|
+
export * from "./server-bound-view-compiler.js";
|