@carbonenginejs/runtime-utils 0.1.1 → 0.1.3
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 +21 -21
- package/NOTICE +23 -23
- package/README.md +69 -69
- package/THIRD-PARTY-NOTICES.md +64 -64
- package/docs/README.md +74 -73
- package/docs/architecture.md +101 -101
- package/docs/concepts/foundation-consolidation.md +85 -85
- package/docs/concepts/model-lifecycle.md +111 -0
- package/docs/const-kb.md +85 -87
- package/docs/core-types/DECORATOR-TODOS.md +25 -25
- package/docs/core-types/README.md +229 -168
- package/docs/reference/api.md +105 -102
- package/docs/reference/classes/README.md +135 -135
- package/package.json +139 -139
- package/src/arrays.js +5 -5
- package/src/audio/audioFormats.js +34 -34
- package/src/audio/index.js +1 -1
- package/src/box3.js +331 -331
- package/src/bytes.js +56 -56
- package/src/compression.js +56 -56
- package/src/constants/index.js +7 -7
- package/src/constants/trinity.js +13 -13
- package/src/constants.js +15 -15
- package/src/curve.js +79 -79
- package/src/d3d/dxgiFormats.js +46 -46
- package/src/d3d/index.js +2 -2
- package/src/d3d/primitiveTopology.js +11 -11
- package/src/document/CjsCarbonDocument.js +212 -212
- package/src/document/CjsClassRegistry.js +373 -373
- package/src/document/CjsDocumentDehydrator.js +142 -142
- package/src/document/CjsDocumentHydrator.js +156 -156
- package/src/document/CjsStructRegistry.js +348 -348
- package/src/document/hydrationAdapter.js +129 -129
- package/src/document/index.js +6 -6
- package/src/errors/CjsError.js +286 -286
- package/src/errors/index.js +5 -5
- package/src/geometry/box.js +22 -22
- package/src/geometry/cylinder.js +22 -22
- package/src/geometry/helpers/earcut.js +1 -1
- package/src/geometry/helpers/misc.js +3 -3
- package/src/geometry/index.js +8 -8
- package/src/geometry/json.js +67 -67
- package/src/geometry/lathe.js +44 -44
- package/src/geometry/plane.js +14 -14
- package/src/geometry/shape.js +4 -4
- package/src/geometry/sphere.js +24 -24
- package/src/geometry/torus.js +14 -14
- package/src/graphics/colorSpaces.js +22 -22
- package/src/graphics/index.js +4 -4
- package/src/graphics/pixelFormats.js +158 -158
- package/src/graphics/textureDimensions.js +22 -22
- package/src/graphics/trinityEnums.js +87 -87
- package/src/index.js +62 -62
- package/src/is.js +108 -46
- package/src/json.js +23 -23
- package/src/lifecycle/CjsLifecycleState.js +77 -77
- package/src/lifecycle/index.js +1 -1
- package/src/lne3.js +70 -70
- package/src/lookup.js +48 -48
- package/src/mat3.js +51 -51
- package/src/mat4.js +699 -699
- package/src/math/index.js +25 -25
- package/src/math/scalar.js +63 -63
- package/src/media/index.js +1 -1
- package/src/media/mediaTypes.js +50 -50
- package/src/mesh.js +424 -424
- package/src/model/CjsEventEmitter.js +333 -333
- package/src/model/CjsModel.js +1589 -1544
- package/src/model/CjsModelState.js +72 -72
- package/src/model/index.js +4 -4
- package/src/model/sourceRecordUtils.js +54 -54
- package/src/noise.js +310 -310
- package/src/num.js +827 -827
- package/src/object.js +39 -39
- package/src/path.js +53 -53
- package/src/pln.js +125 -125
- package/src/pool.js +9 -9
- package/src/quat.js +144 -144
- package/src/ray3.js +188 -188
- package/src/renderContext/formats.js +145 -145
- package/src/renderContext/index.js +5 -5
- package/src/renderContext/presentation.js +125 -125
- package/src/renderContext/resources.js +27 -27
- package/src/renderContext/upscaling.js +22 -22
- package/src/renderContext/window.js +20 -20
- package/src/runtime/CjsRuntimeState.js +50 -50
- package/src/schema/CjsSchema.js +555 -318
- package/src/schema/index.js +4 -4
- package/src/shader/index.js +1 -1
- package/src/shader/shaderStages.js +37 -37
- package/src/sph3.js +181 -181
- package/src/tangent.js +288 -288
- package/src/text.js +40 -40
- package/src/tri3.js +98 -98
- package/src/types/carbonTypes.js +635 -635
- package/src/types/index.js +2 -2
- package/src/utils.js +58 -58
- package/src/validation.js +46 -46
- package/src/vec2.js +229 -229
- package/src/vec3.js +1188 -1172
- package/src/vec4.js +347 -347
- package/src/vertex.js +108 -108
- package/src/webgpu/index.js +1 -1
- package/src/webgpu/textureFormats.js +121 -121
package/docs/const-kb.md
CHANGED
|
@@ -1,99 +1,97 @@
|
|
|
1
|
-
# Runtime Const Knowledge Base
|
|
2
|
-
|
|
3
|
-
Status: Evolving
|
|
4
|
-
Scope: `@carbonenginejs/runtime-utils` constant families
|
|
5
|
-
Audience: Runtime authors and maintainers
|
|
6
|
-
Summary: Defines ownership and dependency rules for shared constant vocabularies.
|
|
7
|
-
|
|
8
|
-
`runtime-utils` owns shared vocabulary and numeric constants for CarbonEngineJS.
|
|
9
|
-
|
|
10
|
-
## Purpose
|
|
11
|
-
|
|
1
|
+
# Runtime Const Knowledge Base
|
|
2
|
+
|
|
3
|
+
Status: Evolving
|
|
4
|
+
Scope: `@carbonenginejs/runtime-utils` constant families
|
|
5
|
+
Audience: Runtime authors and maintainers
|
|
6
|
+
Summary: Defines ownership and dependency rules for shared constant vocabularies.
|
|
7
|
+
|
|
8
|
+
`runtime-utils` owns shared vocabulary and numeric constants for CarbonEngineJS.
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
12
|
This package provides stable constants that can be shared by:
|
|
13
13
|
|
|
14
14
|
- `runtime-resource/formats/*` readers when emitting GPU-free semantic
|
|
15
|
-
payloads.
|
|
16
|
-
- maintained standalone shader-format packages.
|
|
15
|
+
payloads, including the DXBC, HLSL, WebGL, and WebGPU subpaths.
|
|
17
16
|
- `runtime-resource` when interpreting payloads and resource intent.
|
|
18
17
|
- `engine-*` packages when mapping payloads to backend APIs.
|
|
19
|
-
- tools and tests that need canonical media, graphics, audio, shader, D3D, or
|
|
20
|
-
backend names.
|
|
21
|
-
|
|
22
|
-
## Boundaries
|
|
23
|
-
|
|
24
|
-
`runtime-utils` owns:
|
|
25
|
-
|
|
26
|
-
- canonical string tokens, such as pixel formats and color spaces.
|
|
27
|
-
- small helpers for normalization and classification.
|
|
28
|
-
- numeric mirrors of external enums where useful, such as DXGI/D3D values.
|
|
29
|
-
- mapping tables between shared constants and backend constants.
|
|
30
|
-
|
|
31
|
-
The constant families do not own:
|
|
32
|
-
|
|
33
|
-
- resource lifecycle, cache, source reads, or loader dispatch.
|
|
34
|
-
- format parsing or byte decoding.
|
|
35
|
-
- format-container internals such as DDS header offsets, FOURCC parsing,
|
|
36
|
-
PNG chunk handling, WAV chunk layouts, or MP4 box parsing.
|
|
37
|
-
- class hydration or runtime object population, which are separate
|
|
38
|
-
runtime-utils families.
|
|
39
|
-
- WebGPU/WebGL resource creation.
|
|
40
|
-
|
|
41
|
-
## Dependency Rule
|
|
42
|
-
|
|
43
|
-
`runtime-utils` should stay dependency-light and pure JavaScript.
|
|
44
|
-
|
|
45
|
-
Preferred direction:
|
|
46
|
-
|
|
18
|
+
- tools and tests that need canonical media, graphics, audio, shader, D3D, or
|
|
19
|
+
backend names.
|
|
20
|
+
|
|
21
|
+
## Boundaries
|
|
22
|
+
|
|
23
|
+
`runtime-utils` owns:
|
|
24
|
+
|
|
25
|
+
- canonical string tokens, such as pixel formats and color spaces.
|
|
26
|
+
- small helpers for normalization and classification.
|
|
27
|
+
- numeric mirrors of external enums where useful, such as DXGI/D3D values.
|
|
28
|
+
- mapping tables between shared constants and backend constants.
|
|
29
|
+
|
|
30
|
+
The constant families do not own:
|
|
31
|
+
|
|
32
|
+
- resource lifecycle, cache, source reads, or loader dispatch.
|
|
33
|
+
- format parsing or byte decoding.
|
|
34
|
+
- format-container internals such as DDS header offsets, FOURCC parsing,
|
|
35
|
+
PNG chunk handling, WAV chunk layouts, or MP4 box parsing.
|
|
36
|
+
- class hydration or runtime object population, which are separate
|
|
37
|
+
runtime-utils families.
|
|
38
|
+
- WebGPU/WebGL resource creation.
|
|
39
|
+
|
|
40
|
+
## Dependency Rule
|
|
41
|
+
|
|
42
|
+
`runtime-utils` should stay dependency-light and pure JavaScript.
|
|
43
|
+
|
|
44
|
+
Preferred direction:
|
|
45
|
+
|
|
47
46
|
```text
|
|
48
47
|
runtime-resource/formats/* may emit matching strings, imports runtime-utils
|
|
49
|
-
shader format-* may emit matching strings, import runtime-utils
|
|
50
48
|
runtime-resource may import/re-export runtime-utils
|
|
51
49
|
engine-* imports runtime-utils for backend mapping
|
|
52
50
|
runtime-utils imports no runtime-resource or engine packages
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## Initial Domains
|
|
59
|
-
|
|
60
|
-
- media and payload types
|
|
61
|
-
- graphics pixel formats, color spaces, texture dimensions
|
|
62
|
-
- audio sample formats and channel layouts
|
|
63
|
-
- shader stages and shader models
|
|
64
|
-
- D3D/DXGI enum mirrors
|
|
65
|
-
- WebGPU mapping helpers
|
|
66
|
-
|
|
67
|
-
## Format-Specific Constants
|
|
68
|
-
|
|
69
|
-
Container-specific constants live with their maintained reader.
|
|
70
|
-
|
|
71
|
-
Examples:
|
|
72
|
-
|
|
73
|
-
- DDS magic numbers, header offsets, pixel format flags, caps bits, FOURCC
|
|
74
|
-
values, and DX10 header parsing belong to
|
|
75
|
-
`@carbonenginejs/runtime-resource/formats/dds`.
|
|
76
|
-
- PNG chunk names and filter ids belong to
|
|
77
|
-
`@carbonenginejs/runtime-resource/formats/png`.
|
|
78
|
-
- WAV RIFF chunk ids belong to
|
|
79
|
-
`@carbonenginejs/runtime-resource/formats/wav`.
|
|
80
|
-
|
|
81
|
-
`runtime-utils` may still expose general constants that those formats reference,
|
|
82
|
-
such as canonical `PixelFormat` strings or generic `DxgiFormat` numeric enum
|
|
83
|
-
values. Parser-specific interpretation remains in the maintained reader.
|
|
84
|
-
|
|
85
|
-
## Payload Example
|
|
86
|
-
|
|
87
|
-
```js
|
|
88
|
-
{
|
|
89
|
-
payloadType: "texture",
|
|
90
|
-
sourceFormat: "dds",
|
|
91
|
-
pixelFormat: "bc7-rgba-unorm",
|
|
92
|
-
colorSpace: "srgb",
|
|
93
|
-
dimension: "2d",
|
|
94
|
-
isCompressed: true
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
The payload is still GPU-free. Engine packages decide whether and how to create
|
|
99
|
-
backend resources from it.
|
|
53
|
+
Shader formats are maintained as runtime-resource subpaths. Retired standalone
|
|
54
|
+
format package names are provenance labels, not current dependency owners.
|
|
55
|
+
|
|
56
|
+
## Initial Domains
|
|
57
|
+
|
|
58
|
+
- media and payload types
|
|
59
|
+
- graphics pixel formats, color spaces, texture dimensions
|
|
60
|
+
- audio sample formats and channel layouts
|
|
61
|
+
- shader stages and shader models
|
|
62
|
+
- D3D/DXGI enum mirrors
|
|
63
|
+
- WebGPU mapping helpers
|
|
64
|
+
|
|
65
|
+
## Format-Specific Constants
|
|
66
|
+
|
|
67
|
+
Container-specific constants live with their maintained reader.
|
|
68
|
+
|
|
69
|
+
Examples:
|
|
70
|
+
|
|
71
|
+
- DDS magic numbers, header offsets, pixel format flags, caps bits, FOURCC
|
|
72
|
+
values, and DX10 header parsing belong to
|
|
73
|
+
`@carbonenginejs/runtime-resource/formats/dds`.
|
|
74
|
+
- PNG chunk names and filter ids belong to
|
|
75
|
+
`@carbonenginejs/runtime-resource/formats/png`.
|
|
76
|
+
- WAV RIFF chunk ids belong to
|
|
77
|
+
`@carbonenginejs/runtime-resource/formats/wav`.
|
|
78
|
+
|
|
79
|
+
`runtime-utils` may still expose general constants that those formats reference,
|
|
80
|
+
such as canonical `PixelFormat` strings or generic `DxgiFormat` numeric enum
|
|
81
|
+
values. Parser-specific interpretation remains in the maintained reader.
|
|
82
|
+
|
|
83
|
+
## Payload Example
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
{
|
|
87
|
+
payloadType: "texture",
|
|
88
|
+
sourceFormat: "dds",
|
|
89
|
+
pixelFormat: "bc7-rgba-unorm",
|
|
90
|
+
colorSpace: "srgb",
|
|
91
|
+
dimension: "2d",
|
|
92
|
+
isCompressed: true
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The payload is still GPU-free. Engine packages decide whether and how to create
|
|
97
|
+
backend resources from it.
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# Runtime-utils decorator TODOs
|
|
2
|
-
|
|
3
|
-
Status: Evolving
|
|
4
|
-
Scope: `@carbonenginejs/runtime-utils/schema`
|
|
5
|
-
Audience: Schema authors and maintainers
|
|
6
|
-
Summary: Records reviewed decorator gaps that remain outside the current schema contract.
|
|
7
|
-
|
|
8
|
-
## Confirmed status
|
|
9
|
-
|
|
10
|
-
No missing decorator primitive is currently confirmed. `@type`, `@io`,
|
|
11
|
-
`@schema`, `@carbon`, and `@impl` provide the required metadata surface, and
|
|
12
|
-
`CjsModel.SetValues` adds declared `@io.flag`/`@io.rebuild` consequences at
|
|
13
|
-
write time.
|
|
14
|
-
|
|
15
|
-
## Open work
|
|
16
|
-
|
|
17
|
-
- [ ] Decide how a concrete Blue class declares an inherited Carbon method
|
|
18
|
-
without adding a forwarding wrapper. `CjsSchema.decorateMethod` can already
|
|
19
|
-
register the inherited implementation on an exact constructor; add a new
|
|
20
|
-
declarative form only if the package-wide checker requires one.
|
|
21
|
-
- [ ] Keep tests proving that `@io.flag` and `@io.rebuild` tokens are added by
|
|
22
|
-
changed-field writes and are never cleared by generic settle logic.
|
|
23
|
-
- [ ] Do not add proposed semantic aliases such as `type.position` or
|
|
24
|
-
`type.worldTransform` as part of missing-decorator cleanup; those remain a
|
|
25
|
-
separate API decision.
|
|
1
|
+
# Runtime-utils decorator TODOs
|
|
2
|
+
|
|
3
|
+
Status: Evolving
|
|
4
|
+
Scope: `@carbonenginejs/runtime-utils/schema`
|
|
5
|
+
Audience: Schema authors and maintainers
|
|
6
|
+
Summary: Records reviewed decorator gaps that remain outside the current schema contract.
|
|
7
|
+
|
|
8
|
+
## Confirmed status
|
|
9
|
+
|
|
10
|
+
No missing decorator primitive is currently confirmed. `@type`, `@io`,
|
|
11
|
+
`@schema`, `@carbon`, and `@impl` provide the required metadata surface, and
|
|
12
|
+
`CjsModel.SetValues` adds declared `@io.flag`/`@io.rebuild` consequences at
|
|
13
|
+
write time.
|
|
14
|
+
|
|
15
|
+
## Open work
|
|
16
|
+
|
|
17
|
+
- [ ] Decide how a concrete Blue class declares an inherited Carbon method
|
|
18
|
+
without adding a forwarding wrapper. `CjsSchema.decorateMethod` can already
|
|
19
|
+
register the inherited implementation on an exact constructor; add a new
|
|
20
|
+
declarative form only if the package-wide checker requires one.
|
|
21
|
+
- [ ] Keep tests proving that `@io.flag` and `@io.rebuild` tokens are added by
|
|
22
|
+
changed-field writes and are never cleared by generic settle logic.
|
|
23
|
+
- [ ] Do not add proposed semantic aliases such as `type.position` or
|
|
24
|
+
`type.worldTransform` as part of missing-decorator cleanup; those remain a
|
|
25
|
+
separate API decision.
|