@world-engines/tmw 0.1.0-alpha.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/activation.d.ts +50 -0
- package/dist/activation.js +113 -0
- package/dist/audio-presentation-projection.d.ts +23 -0
- package/dist/audio-presentation-projection.js +39 -0
- package/dist/author-scenario-source-v3.d.ts +34 -0
- package/dist/author-scenario-source-v3.js +1 -0
- package/dist/authoring-runtime.d.ts +76 -0
- package/dist/authoring-runtime.js +282 -0
- package/dist/builder-diagnostics.d.ts +3 -0
- package/dist/builder-diagnostics.js +8 -0
- package/dist/builder-node.d.ts +178 -0
- package/dist/builder-node.js +212 -0
- package/dist/builder.d.ts +32 -0
- package/dist/builder.js +127 -0
- package/dist/capability-registry.d.ts +32 -0
- package/dist/capability-registry.js +33 -0
- package/dist/compile-target-profile.d.ts +16 -0
- package/dist/compile-target-profile.js +70 -0
- package/dist/compiled-plan.d.ts +44 -0
- package/dist/compiled-plan.js +1 -0
- package/dist/compiler-compatibility-gate.d.ts +96 -0
- package/dist/compiler-compatibility-gate.js +609 -0
- package/dist/compiler-release-authority.d.ts +212 -0
- package/dist/compiler-release-authority.js +676 -0
- package/dist/compiler-stage-cache.d.ts +42 -0
- package/dist/compiler-stage-cache.js +100 -0
- package/dist/compiler-stage-registry.d.ts +48 -0
- package/dist/compiler-stage-registry.js +126 -0
- package/dist/compiler.d.ts +7 -0
- package/dist/compiler.js +68 -0
- package/dist/condition-graph.d.ts +46 -0
- package/dist/condition-graph.js +135 -0
- package/dist/diagnostics.d.ts +20 -0
- package/dist/diagnostics.js +20 -0
- package/dist/durable-intent.d.ts +29 -0
- package/dist/durable-intent.js +60 -0
- package/dist/effect-flow.d.ts +69 -0
- package/dist/effect-flow.js +98 -0
- package/dist/event-fabric.d.ts +81 -0
- package/dist/event-fabric.js +227 -0
- package/dist/event-lifecycle.d.ts +59 -0
- package/dist/event-lifecycle.js +161 -0
- package/dist/evidence.d.ts +37 -0
- package/dist/evidence.js +92 -0
- package/dist/gameplay-state.d.ts +127 -0
- package/dist/gameplay-state.js +214 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +52 -0
- package/dist/isolated-replay.d.ts +81 -0
- package/dist/isolated-replay.js +316 -0
- package/dist/music-candidate-set.d.ts +38 -0
- package/dist/music-candidate-set.js +102 -0
- package/dist/natural-language-chunking.d.ts +10 -0
- package/dist/natural-language-chunking.js +62 -0
- package/dist/natural-language-ingestion.d.ts +14 -0
- package/dist/natural-language-ingestion.js +128 -0
- package/dist/natural-language-structured-decode.d.ts +2 -0
- package/dist/natural-language-structured-decode.js +69 -0
- package/dist/natural-language-world-types.d.ts +142 -0
- package/dist/natural-language-world-types.js +2 -0
- package/dist/neutral-source-compiler.d.ts +135 -0
- package/dist/neutral-source-compiler.js +608 -0
- package/dist/presentation-intent.d.ts +42 -0
- package/dist/presentation-intent.js +137 -0
- package/dist/recall-query-envelope.d.ts +32 -0
- package/dist/recall-query-envelope.js +51 -0
- package/dist/rewrite-compensation.d.ts +28 -0
- package/dist/rewrite-compensation.js +85 -0
- package/dist/runtime-contract.d.ts +56 -0
- package/dist/runtime-contract.js +96 -0
- package/dist/runtime-domain-capabilities.d.ts +12 -0
- package/dist/runtime-domain-capabilities.js +20 -0
- package/dist/runtime-sav.d.ts +117 -0
- package/dist/runtime-sav.js +356 -0
- package/dist/runtime-trace.d.ts +44 -0
- package/dist/runtime-trace.js +119 -0
- package/dist/runtime.d.ts +238 -0
- package/dist/runtime.js +1887 -0
- package/dist/scene-author-source.d.ts +13 -0
- package/dist/scene-author-source.js +25 -0
- package/dist/scene-state.d.ts +275 -0
- package/dist/scene-state.js +334 -0
- package/dist/scheduler.d.ts +55 -0
- package/dist/scheduler.js +235 -0
- package/dist/selector-ast.d.ts +24 -0
- package/dist/selector-ast.js +18 -0
- package/dist/semantic-verdict.d.ts +48 -0
- package/dist/semantic-verdict.js +101 -0
- package/dist/simulator.d.ts +45 -0
- package/dist/simulator.js +58 -0
- package/dist/source-canonical.d.ts +4 -0
- package/dist/source-canonical.js +51 -0
- package/dist/source-crypto.d.ts +20 -0
- package/dist/source-crypto.js +17 -0
- package/dist/source-revision.d.ts +22 -0
- package/dist/source-revision.js +43 -0
- package/dist/spatial-impact-receipt.d.ts +38 -0
- package/dist/spatial-impact-receipt.js +67 -0
- package/dist/temporal-rewrite.d.ts +59 -0
- package/dist/temporal-rewrite.js +214 -0
- package/dist/time-domains.d.ts +37 -0
- package/dist/time-domains.js +142 -0
- package/dist/timeline-revision.d.ts +28 -0
- package/dist/timeline-revision.js +59 -0
- package/dist/trigger-document-v3.d.ts +99 -0
- package/dist/trigger-document-v3.js +334 -0
- package/dist/turn-commit.d.ts +56 -0
- package/dist/turn-commit.js +190 -0
- package/dist/validator.d.ts +7 -0
- package/dist/validator.js +142 -0
- package/dist/value-graph.d.ts +98 -0
- package/dist/value-graph.js +318 -0
- package/dist/view-event-delivery.d.ts +47 -0
- package/dist/view-event-delivery.js +197 -0
- package/dist/view-interaction-manifest-v3.d.ts +60 -0
- package/dist/view-interaction-manifest-v3.js +198 -0
- package/dist/view-payload-schema.d.ts +17 -0
- package/dist/view-payload-schema.js +84 -0
- package/package.json +62 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { type CompileTargetProfile } from "./compile-target-profile.js";
|
|
2
|
+
import { type CompilerCompatibilityCandidate, type CompilerCompatibilityFixtureFailure, type CompilerCompatibilityFixturePass } from "./compiler-compatibility-gate.js";
|
|
3
|
+
import { type CompilerStageCache, type CompilerStageCacheEntry } from "./compiler-stage-cache.js";
|
|
4
|
+
import { type CompilerStageRegistry } from "./compiler-stage-registry.js";
|
|
5
|
+
import { type NeutralSourceCompilerReceipt, type NeutralSourceDerivedObject } from "./neutral-source-compiler.js";
|
|
6
|
+
import { type NeutralSourceCaptureWitness, type NeutralSourceCompileInput } from "@world-engines/scenario-author-source";
|
|
7
|
+
export declare const COMPILER_RELEASE_AUTHORITY_SCHEMA_VERSION: 1;
|
|
8
|
+
export type CompilerReleaseOperationKind = "evaluate_candidate" | "promote_candidate" | "reject_candidate" | "rollback_active" | "rebuild_captured_artifact";
|
|
9
|
+
export interface CompilerReleaseIdentity {
|
|
10
|
+
readonly compiler_release: string;
|
|
11
|
+
readonly target_profile: CompileTargetProfile;
|
|
12
|
+
readonly target_profile_sha256: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CompilerReleaseStoreSnapshot {
|
|
15
|
+
readonly active: CompilerReleaseIdentity | null;
|
|
16
|
+
readonly previous_active: CompilerReleaseIdentity | null;
|
|
17
|
+
}
|
|
18
|
+
export interface CompilerReleaseStore {
|
|
19
|
+
read(): Promise<CompilerReleaseStoreSnapshot>;
|
|
20
|
+
writeOnce(expected: CompilerReleaseStoreSnapshot, next: CompilerReleaseStoreSnapshot): Promise<"stored" | "already_present">;
|
|
21
|
+
}
|
|
22
|
+
export type CompilerReleaseSnapshotLoader = () => Promise<unknown>;
|
|
23
|
+
export interface CompilerReleaseAuthoritySnapshot extends CompilerReleaseStoreSnapshot {
|
|
24
|
+
readonly schema_version: typeof COMPILER_RELEASE_AUTHORITY_SCHEMA_VERSION;
|
|
25
|
+
readonly revision: number;
|
|
26
|
+
}
|
|
27
|
+
export interface CompilerReleaseAuthorityTransport {
|
|
28
|
+
request(input: Readonly<{
|
|
29
|
+
method: "GET" | "POST";
|
|
30
|
+
path: string;
|
|
31
|
+
body?: unknown;
|
|
32
|
+
}>): Promise<Readonly<{
|
|
33
|
+
status: number;
|
|
34
|
+
body: unknown;
|
|
35
|
+
}>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Browser 与 Node 生产消费者共用的只读 authority adapter。唯一状态来自调用方
|
|
39
|
+
* 注入的 Edge readback;adapter 不缓存、不初始化 active,也不能执行 promotion。
|
|
40
|
+
*/
|
|
41
|
+
export declare class ReadbackCompilerReleaseStore implements CompilerReleaseStore {
|
|
42
|
+
#private;
|
|
43
|
+
constructor(load: CompilerReleaseSnapshotLoader);
|
|
44
|
+
read(): Promise<CompilerReleaseStoreSnapshot>;
|
|
45
|
+
writeOnce(): Promise<"stored" | "already_present">;
|
|
46
|
+
}
|
|
47
|
+
export declare class RemoteCompilerReleaseAuthority {
|
|
48
|
+
#private;
|
|
49
|
+
constructor(transport: CompilerReleaseAuthorityTransport, currentPath?: string);
|
|
50
|
+
read(): Promise<CompilerReleaseAuthoritySnapshot>;
|
|
51
|
+
readOperation(operationId: string): Promise<CompilerReleaseOperationReceipt | null>;
|
|
52
|
+
apply(kind: "promote" | "rollback", expectedRevision: number, receipt: CompilerReleaseOperationReceipt): Promise<CompilerReleaseAuthoritySnapshot>;
|
|
53
|
+
}
|
|
54
|
+
export interface PromotePersistedCompilerReleaseCandidateInput extends EvaluateCompilerReleaseCandidateInput {
|
|
55
|
+
readonly authority: RemoteCompilerReleaseAuthority;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 生产 promotion:先从唯一 Edge authority 做 operation readback;未提交时在冻结快照上
|
|
59
|
+
* 执行完整 corpus KAT,再把完整 receipt 交给 Edge CAS。网络结果不确定时以同一
|
|
60
|
+
* operation_id 重试会先读回 receipt,不会重复推进 pointer。
|
|
61
|
+
*/
|
|
62
|
+
export declare function promotePersistedCompilerReleaseCandidate(input: PromotePersistedCompilerReleaseCandidateInput): Promise<CompilerReleasePromotionOutcome>;
|
|
63
|
+
export interface RollbackPersistedCompilerReleaseInput {
|
|
64
|
+
readonly operation_id: string;
|
|
65
|
+
readonly authority: RemoteCompilerReleaseAuthority;
|
|
66
|
+
readonly live_store: CompilerReleaseLiveStore;
|
|
67
|
+
readonly corpus_digest: string;
|
|
68
|
+
}
|
|
69
|
+
export declare function rollbackPersistedCompilerRelease(input: RollbackPersistedCompilerReleaseInput): Promise<CompilerReleaseOperationReceipt>;
|
|
70
|
+
export interface CompilerReleaseAuthorSourceSnapshot {
|
|
71
|
+
readonly source_bytes: Uint8Array;
|
|
72
|
+
readonly source_sha256: string;
|
|
73
|
+
readonly manifest_sha256: string;
|
|
74
|
+
readonly head_digest: string;
|
|
75
|
+
readonly source_revision: number;
|
|
76
|
+
readonly author_operation_count: number;
|
|
77
|
+
}
|
|
78
|
+
export interface CompilerReleaseAuthorSourceIdentity {
|
|
79
|
+
readonly source_sha256: string;
|
|
80
|
+
readonly manifest_sha256: string;
|
|
81
|
+
readonly head_digest: string;
|
|
82
|
+
readonly source_revision: number;
|
|
83
|
+
readonly author_operation_count: number;
|
|
84
|
+
}
|
|
85
|
+
export interface CompilerReleaseLiveStore {
|
|
86
|
+
snapshot(): Promise<CompilerReleaseAuthorSourceSnapshot>;
|
|
87
|
+
mutateWorkingProjection(mutator: (bytes: Uint8Array) => Uint8Array): Promise<void>;
|
|
88
|
+
}
|
|
89
|
+
export interface CompilerReleaseDerivedStore {
|
|
90
|
+
read(objectId: string): Promise<Uint8Array | null>;
|
|
91
|
+
writeOnce(objectId: string, bytes: Uint8Array): Promise<"stored" | "already_present">;
|
|
92
|
+
delete(objectId: string): Promise<void>;
|
|
93
|
+
}
|
|
94
|
+
export interface CompilerReleaseClearableCache extends CompilerStageCache {
|
|
95
|
+
clear(): Promise<void>;
|
|
96
|
+
keys(): Promise<readonly string[]>;
|
|
97
|
+
}
|
|
98
|
+
export interface CompilerReleaseUnknownContentWitness {
|
|
99
|
+
readonly kind: string;
|
|
100
|
+
readonly path: string;
|
|
101
|
+
readonly sha256: string;
|
|
102
|
+
}
|
|
103
|
+
export interface CompilerReleaseCapturedBuild {
|
|
104
|
+
readonly operation_id: string;
|
|
105
|
+
readonly source: NeutralSourceCompileInput;
|
|
106
|
+
readonly target_profile: CompileTargetProfile;
|
|
107
|
+
readonly target_profile_sha256: string;
|
|
108
|
+
}
|
|
109
|
+
export interface CompilerReleaseRebuildResult {
|
|
110
|
+
readonly ok: true;
|
|
111
|
+
readonly operation_id: string;
|
|
112
|
+
readonly compiler_release: string;
|
|
113
|
+
readonly target_profile_sha256: string;
|
|
114
|
+
readonly source_manifest_sha256: string;
|
|
115
|
+
readonly receipt: NeutralSourceCompilerReceipt;
|
|
116
|
+
readonly derived_objects: readonly NeutralSourceDerivedObject[];
|
|
117
|
+
readonly artifact_digest: string;
|
|
118
|
+
readonly witness_digest: string;
|
|
119
|
+
readonly cache_keys: readonly string[];
|
|
120
|
+
}
|
|
121
|
+
export interface CompilerReleaseOperationReceiptCore {
|
|
122
|
+
readonly receipt_schema_version: typeof COMPILER_RELEASE_AUTHORITY_SCHEMA_VERSION;
|
|
123
|
+
readonly operation_id: string;
|
|
124
|
+
readonly operation_kind: CompilerReleaseOperationKind;
|
|
125
|
+
readonly corpus_digest: string;
|
|
126
|
+
readonly candidate: CompilerReleaseIdentity;
|
|
127
|
+
readonly active_before: CompilerReleaseIdentity | null;
|
|
128
|
+
readonly active_after: CompilerReleaseIdentity | null;
|
|
129
|
+
readonly previous_active: CompilerReleaseIdentity | null;
|
|
130
|
+
readonly source_before: CompilerReleaseAuthorSourceIdentity;
|
|
131
|
+
readonly source_after: CompilerReleaseAuthorSourceIdentity;
|
|
132
|
+
readonly fixture_passes: readonly CompilerCompatibilityFixturePass[];
|
|
133
|
+
readonly fixture_failures: readonly CompilerCompatibilityFixtureFailure[];
|
|
134
|
+
readonly unknown_content_witnesses: readonly CompilerReleaseUnknownContentWitness[];
|
|
135
|
+
}
|
|
136
|
+
export interface CompilerReleaseOperationReceipt extends CompilerReleaseOperationReceiptCore {
|
|
137
|
+
readonly receipt_sha256: string;
|
|
138
|
+
}
|
|
139
|
+
export type CompilerReleasePromotionOutcome = {
|
|
140
|
+
readonly promotable: true;
|
|
141
|
+
readonly switched: boolean;
|
|
142
|
+
readonly receipt: CompilerReleaseOperationReceipt;
|
|
143
|
+
} | {
|
|
144
|
+
readonly promotable: false;
|
|
145
|
+
readonly switched: false;
|
|
146
|
+
readonly receipt: CompilerReleaseOperationReceipt;
|
|
147
|
+
};
|
|
148
|
+
export interface EvaluateCompilerReleaseCandidateInput {
|
|
149
|
+
readonly operation_id: string;
|
|
150
|
+
readonly candidate: CompilerCompatibilityCandidate;
|
|
151
|
+
readonly corpus_value: unknown;
|
|
152
|
+
readonly load_fixture: (relativePath: string) => Promise<Uint8Array>;
|
|
153
|
+
readonly live_store: CompilerReleaseLiveStore;
|
|
154
|
+
}
|
|
155
|
+
export interface PromoteCompilerReleaseCandidateInput extends EvaluateCompilerReleaseCandidateInput {
|
|
156
|
+
readonly store: CompilerReleaseStore;
|
|
157
|
+
}
|
|
158
|
+
export interface RollbackCompilerReleaseInput {
|
|
159
|
+
readonly operation_id: string;
|
|
160
|
+
readonly store: CompilerReleaseStore;
|
|
161
|
+
readonly live_store: CompilerReleaseLiveStore;
|
|
162
|
+
readonly corpus_digest: string;
|
|
163
|
+
}
|
|
164
|
+
export interface CaptureCompilerReleaseBuildInput {
|
|
165
|
+
readonly operation_id: string;
|
|
166
|
+
readonly witness: NeutralSourceCaptureWitness;
|
|
167
|
+
readonly live_store: CompilerReleaseLiveStore;
|
|
168
|
+
readonly target_profile: CompileTargetProfile;
|
|
169
|
+
}
|
|
170
|
+
export interface RebuildCompilerReleaseArtifactInput {
|
|
171
|
+
readonly captured: CompilerReleaseCapturedBuild;
|
|
172
|
+
readonly registry: CompilerStageRegistry;
|
|
173
|
+
readonly cache: CompilerReleaseClearableCache;
|
|
174
|
+
readonly derived_store: CompilerReleaseDerivedStore;
|
|
175
|
+
readonly live_store: CompilerReleaseLiveStore;
|
|
176
|
+
readonly object_id: string;
|
|
177
|
+
}
|
|
178
|
+
export declare class InMemoryCompilerReleaseStore implements CompilerReleaseStore {
|
|
179
|
+
#private;
|
|
180
|
+
constructor(initial?: CompilerReleaseStoreSnapshot);
|
|
181
|
+
read(): Promise<CompilerReleaseStoreSnapshot>;
|
|
182
|
+
writeOnce(expected: CompilerReleaseStoreSnapshot, next: CompilerReleaseStoreSnapshot): Promise<"stored" | "already_present">;
|
|
183
|
+
}
|
|
184
|
+
export declare class MapBackedCompilerReleaseClearableCache implements CompilerReleaseClearableCache {
|
|
185
|
+
#private;
|
|
186
|
+
read(cacheKey: string): Promise<CompilerStageCacheEntry | null>;
|
|
187
|
+
writeOnce(entry: CompilerStageCacheEntry): Promise<"stored" | "already_present">;
|
|
188
|
+
delete(cacheKey: string): Promise<void>;
|
|
189
|
+
keys(): Promise<readonly string[]>;
|
|
190
|
+
clear(): Promise<void>;
|
|
191
|
+
}
|
|
192
|
+
export declare class InMemoryCompilerReleaseDerivedStore implements CompilerReleaseDerivedStore {
|
|
193
|
+
#private;
|
|
194
|
+
read(objectId: string): Promise<Uint8Array | null>;
|
|
195
|
+
writeOnce(objectId: string, bytes: Uint8Array): Promise<"stored" | "already_present">;
|
|
196
|
+
delete(objectId: string): Promise<void>;
|
|
197
|
+
}
|
|
198
|
+
export declare class FrozenCompilerReleaseLiveStore implements CompilerReleaseLiveStore {
|
|
199
|
+
#private;
|
|
200
|
+
constructor(snapshot: CompilerReleaseAuthorSourceSnapshot);
|
|
201
|
+
snapshot(): Promise<CompilerReleaseAuthorSourceSnapshot>;
|
|
202
|
+
mutateWorkingProjection(mutator: (bytes: Uint8Array) => Uint8Array): Promise<void>;
|
|
203
|
+
}
|
|
204
|
+
export declare function evaluateCompilerReleaseCandidate(input: EvaluateCompilerReleaseCandidateInput, activeBefore?: CompilerReleaseIdentity | null): Promise<CompilerReleasePromotionOutcome>;
|
|
205
|
+
export declare function promoteCompilerReleaseCandidate(input: PromoteCompilerReleaseCandidateInput): Promise<CompilerReleasePromotionOutcome>;
|
|
206
|
+
export declare function rollbackCompilerRelease(input: RollbackCompilerReleaseInput): Promise<CompilerReleaseOperationReceipt>;
|
|
207
|
+
export declare function captureCompilerReleaseBuild(input: CaptureCompilerReleaseBuildInput): Promise<CompilerReleaseCapturedBuild>;
|
|
208
|
+
export declare function rebuildCompilerReleaseArtifact(input: RebuildCompilerReleaseArtifactInput): Promise<CompilerReleaseRebuildResult>;
|
|
209
|
+
export declare function clearAndRebuildCompilerReleaseArtifact(input: RebuildCompilerReleaseArtifactInput): Promise<CompilerReleaseRebuildResult>;
|
|
210
|
+
export declare function requireActiveCompilerRelease(store: CompilerReleaseStore, expected: CompileTargetProfile): Promise<CompilerReleaseIdentity>;
|
|
211
|
+
/** @deprecated 生产 caller 必须注入 Edge readback;保留导出仅为增量兼容并始终 fail-closed。 */
|
|
212
|
+
export declare const defaultCompilerReleaseStore: CompilerReleaseStore;
|