@series-inc/rundot-kinetix 0.0.0-bootstrap.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 +77 -0
- package/authoring.d.ts +30 -0
- package/index.d.ts +221 -0
- package/native/component_runtime.cpp +341 -0
- package/native/component_runtime.hpp +112 -0
- package/native/deterministic_math.cpp +594 -0
- package/native/deterministic_math.hpp +21 -0
- package/native/kinetix-f64-native-profile.cpp +406 -0
- package/native/kinetix-f64-native-profile.hpp +5 -0
- package/native/kinetix-fixed1000-native-profile.cpp +777 -0
- package/native/kinetix-fixed1000-native-profile.hpp +58 -0
- package/native/kinetix-fixed1000-physics.cpp +887 -0
- package/native/kinetix-fixed1000-physics.hpp +28 -0
- package/native/kinetix-installed-f64-renderer.cpp +344 -0
- package/native/kinetix-installed-f64-renderer.hpp +35 -0
- package/native/kinetix-installed-f64-runtime.cpp +1085 -0
- package/native/kinetix-installed-f64-runtime.hpp +141 -0
- package/native/kinetix-installed-fixed1000-data.hpp +77 -0
- package/native/kinetix-native-main.cpp +37 -0
- package/native/kinetix-native-runtime.cpp +20 -0
- package/native/kinetix-native-runtime.hpp +25 -0
- package/native/kinetix-render-projection.cpp +20 -0
- package/native/kinetix-render-projection.hpp +14 -0
- package/package.json +65 -0
- package/runtime.d.ts +76 -0
- package/scripts/build-native.mjs +67 -0
- package/scripts/emit-product-digests.mjs +33 -0
- package/scripts/preflight.mjs +76 -0
- package/src/index.mjs +57 -0
- package/src/kinetix-authoring.mjs +69 -0
- package/src/kinetix-baker.mjs +587 -0
- package/src/kinetix-deterministic-math.mjs +1044 -0
- package/src/kinetix-fixed1000-runtime-adapter.mjs +33 -0
- package/src/kinetix-fixed1000-runtime.mjs +954 -0
- package/src/kinetix-installed-f64-reference.mjs +157 -0
- package/src/kinetix-installed-f64-render-frames.mjs +53 -0
- package/src/kinetix-installed-f64-renderer.mjs +240 -0
- package/src/kinetix-installed-f64-runtime-adapter.mjs +68 -0
- package/src/kinetix-installed-f64-runtime.mjs +607 -0
- package/src/kinetix-installed-mechanics.mjs +377 -0
- package/src/kinetix-installed-systems.mjs +181 -0
- package/src/kinetix-native-product.mjs +72 -0
- package/src/kinetix-product-contract.mjs +121 -0
- package/src/kinetix-project-compiler.mjs +1017 -0
- package/src/kinetix-render-projection.mjs +28 -0
- package/src/kinetix-runtime-adapter-utils.mjs +168 -0
- package/src/kinetix-runtime-contract.mjs +54 -0
- package/src/kinetix-session-config.mjs +170 -0
- package/src/kinetix-source-snapshot.mjs +24 -0
- package/src/kinetix-survival-runtime-adapter.mjs +305 -0
- package/src/kinetix-survival-runtime.generated.mjs +1 -0
- package/src/kinetix-world-kernel.mjs +580 -0
- package/src/kinetix-world-runtime.mjs +171 -0
- package/src/runtime.mjs +14 -0
- package/src/shared/f64-bits.mjs +14 -0
- package/src/shared/kinetix-envelope-v1.mjs +589 -0
- package/src/shared/render-records-v1.mjs +168 -0
- package/src/shared/sha256.mjs +73 -0
package/src/index.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Public surface of the Kinetix core. Consumers that want a single module can
|
|
2
|
+
// import from here; the granular subpath exports in package.json stay available
|
|
3
|
+
// for callers that would rather not pull the compiler (and with it TypeScript)
|
|
4
|
+
// into a runtime-only process.
|
|
5
|
+
export { compileKinetixProject, compileTrustedKinetixSource } from './kinetix-project-compiler.mjs';
|
|
6
|
+
export { kinetixCanonicalSourceDigest } from './kinetix-source-snapshot.mjs';
|
|
7
|
+
export {
|
|
8
|
+
bakeKinetixEnvelope,
|
|
9
|
+
bakeKinetixProjectDefinition,
|
|
10
|
+
kinetixBakerVersion,
|
|
11
|
+
kinetixPhases,
|
|
12
|
+
scanKinetixPayloadTree,
|
|
13
|
+
stableKinetixProductBytes,
|
|
14
|
+
stableKinetixSourceBytes,
|
|
15
|
+
validateInstalledKinetixProfile,
|
|
16
|
+
} from './kinetix-baker.mjs';
|
|
17
|
+
export { defineKinetixProject } from './kinetix-authoring.mjs';
|
|
18
|
+
export { createKinetixWorld } from './kinetix-world-kernel.mjs';
|
|
19
|
+
export { createKinetixWorldRuntime } from './kinetix-world-runtime.mjs';
|
|
20
|
+
export { createInstalledF64Runtime } from './kinetix-installed-f64-runtime-adapter.mjs';
|
|
21
|
+
export { createInstalledSurvivalRuntime } from './kinetix-survival-runtime-adapter.mjs';
|
|
22
|
+
export { createFixed1000Runtime } from './kinetix-fixed1000-runtime-adapter.mjs';
|
|
23
|
+
export {
|
|
24
|
+
decodeKinetixSessionConfig,
|
|
25
|
+
encodeKinetixSessionConfig,
|
|
26
|
+
kinetixSessionConfigDigest,
|
|
27
|
+
} from './kinetix-session-config.mjs';
|
|
28
|
+
export {
|
|
29
|
+
createInstalledKinetixProfile,
|
|
30
|
+
kinetixRuntimeContractForProfile,
|
|
31
|
+
} from './kinetix-installed-systems.mjs';
|
|
32
|
+
export { createKinetixRenderProjection } from './kinetix-render-projection.mjs';
|
|
33
|
+
export {
|
|
34
|
+
compileStableKinetixProducts,
|
|
35
|
+
compileStableKinetixProductsFromTrustedSource,
|
|
36
|
+
nativeFixed1000ProductBytes,
|
|
37
|
+
} from './kinetix-native-product.mjs';
|
|
38
|
+
export {
|
|
39
|
+
canonicalFixedStateBytes,
|
|
40
|
+
canonicalFixedTickHash,
|
|
41
|
+
createFixedRuntime,
|
|
42
|
+
tickFixedRuntime,
|
|
43
|
+
} from './kinetix-fixed1000-runtime.mjs';
|
|
44
|
+
export { canonicalF64TickHash, runF64Replay } from './kinetix-installed-f64-reference.mjs';
|
|
45
|
+
export { buildNative } from '../scripts/build-native.mjs';
|
|
46
|
+
export {
|
|
47
|
+
assertKinetixProductContract,
|
|
48
|
+
assertKinetixRuntimeContract,
|
|
49
|
+
assertKinetixRuntimeIdentityMatchesProducts,
|
|
50
|
+
deriveKinetixRuntimeIdentity,
|
|
51
|
+
kinetixProductKinds,
|
|
52
|
+
} from './kinetix-product-contract.mjs';
|
|
53
|
+
export {
|
|
54
|
+
assertKinetixRuntime,
|
|
55
|
+
assertKinetixRuntimeIdentity,
|
|
56
|
+
kinetixRuntimeAbiVersion,
|
|
57
|
+
} from './kinetix-runtime-contract.mjs';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { normalizeKinetixSessionConfigSchema } from './kinetix-session-config.mjs';
|
|
2
|
+
|
|
3
|
+
const projectKeys = new Set([
|
|
4
|
+
'id',
|
|
5
|
+
'installedProfile',
|
|
6
|
+
'tickRate',
|
|
7
|
+
'inputSchema',
|
|
8
|
+
'sessionConfigSchema',
|
|
9
|
+
'mechanics',
|
|
10
|
+
'components',
|
|
11
|
+
'systems',
|
|
12
|
+
'presentationBindings',
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function fail(code) {
|
|
16
|
+
throw new Error(code);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function isPlainObject(value) {
|
|
20
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
21
|
+
&& Object.getPrototypeOf(value) === Object.prototype;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function canonicalData(value) {
|
|
25
|
+
if (Array.isArray(value)) return value.map(canonicalData);
|
|
26
|
+
if (isPlainObject(value)) {
|
|
27
|
+
return Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonicalData(value[key])]));
|
|
28
|
+
}
|
|
29
|
+
if (value === null || typeof value === 'string' || typeof value === 'boolean'
|
|
30
|
+
|| (typeof value === 'number' && Number.isFinite(value) && Number.isSafeInteger(value))) {
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
fail('KINETIX_AUTHORING_VALUE_INVALID');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function deepFreeze(value) {
|
|
37
|
+
if (value && typeof value === 'object') {
|
|
38
|
+
Object.freeze(value);
|
|
39
|
+
Object.values(value).forEach(deepFreeze);
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function defineKinetixProject(input) {
|
|
45
|
+
if (!isPlainObject(input)) fail('KINETIX_AUTHORING_INVALID');
|
|
46
|
+
if (Object.keys(input).some((key) => !projectKeys.has(key))) fail('KINETIX_AUTHORING_FIELD_UNKNOWN');
|
|
47
|
+
if (typeof input.id !== 'string' || input.id.length === 0
|
|
48
|
+
|| !['deterministic-f64', 'fixed-1000-3d'].includes(input.installedProfile)
|
|
49
|
+
|| ![10, 20, 30, 60].includes(input.tickRate)
|
|
50
|
+
|| !isPlainObject(input.inputSchema)
|
|
51
|
+
|| !Array.isArray(input.mechanics)
|
|
52
|
+
|| !Array.isArray(input.components)
|
|
53
|
+
|| !Array.isArray(input.systems)
|
|
54
|
+
|| !Array.isArray(input.presentationBindings)) {
|
|
55
|
+
fail('KINETIX_AUTHORING_INVALID');
|
|
56
|
+
}
|
|
57
|
+
const project = canonicalData({
|
|
58
|
+
id: input.id,
|
|
59
|
+
installedProfile: input.installedProfile,
|
|
60
|
+
tickRate: input.tickRate,
|
|
61
|
+
inputSchema: input.inputSchema,
|
|
62
|
+
sessionConfigSchema: normalizeKinetixSessionConfigSchema(input.sessionConfigSchema),
|
|
63
|
+
mechanics: input.mechanics,
|
|
64
|
+
components: input.components,
|
|
65
|
+
systems: input.systems,
|
|
66
|
+
presentationBindings: input.presentationBindings,
|
|
67
|
+
});
|
|
68
|
+
return deepFreeze(project);
|
|
69
|
+
}
|