@forgeax/engine-shader 0.1.2
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 +202 -0
- package/README.md +99 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/ShaderRegistry.d.ts +208 -0
- package/dist/ShaderRegistry.d.ts.map +1 -0
- package/dist/__tests__/atmosphere-background.test.d.ts +2 -0
- package/dist/__tests__/atmosphere-background.test.d.ts.map +1 -0
- package/dist/__tests__/atmosphere-cubemap-orientation.test.d.ts +2 -0
- package/dist/__tests__/atmosphere-cubemap-orientation.test.d.ts.map +1 -0
- package/dist/__tests__/atmosphere-preetham-numeric.test.d.ts +2 -0
- package/dist/__tests__/atmosphere-preetham-numeric.test.d.ts.map +1 -0
- package/dist/__tests__/atmosphere-preetham-red.test.d.ts +2 -0
- package/dist/__tests__/atmosphere-preetham-red.test.d.ts.map +1 -0
- package/dist/__tests__/atmosphere-preetham.test.d.ts +2 -0
- package/dist/__tests__/atmosphere-preetham.test.d.ts.map +1 -0
- package/dist/__tests__/atmosphere-three-r184-reference.test.d.ts +2 -0
- package/dist/__tests__/atmosphere-three-r184-reference.test.d.ts.map +1 -0
- package/dist/__tests__/bloom-fxaa-tonemap.unit.test.d.ts +2 -0
- package/dist/__tests__/bloom-fxaa-tonemap.unit.test.d.ts.map +1 -0
- package/dist/__tests__/builtin-texture-sampling-contract.test.d.ts +2 -0
- package/dist/__tests__/builtin-texture-sampling-contract.test.d.ts.map +1 -0
- package/dist/__tests__/default-standard-pbr-alpha.unit.test.d.ts +2 -0
- package/dist/__tests__/default-standard-pbr-alpha.unit.test.d.ts.map +1 -0
- package/dist/__tests__/deferred-lighting-ssao.test.d.ts +2 -0
- package/dist/__tests__/deferred-lighting-ssao.test.d.ts.map +1 -0
- package/dist/__tests__/fog-oracle.unit.test.d.ts +2 -0
- package/dist/__tests__/fog-oracle.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fog-orthographic-ray.unit.test.d.ts +2 -0
- package/dist/__tests__/fog-orthographic-ray.unit.test.d.ts.map +1 -0
- package/dist/__tests__/fog-producer-matrix.integration.test.d.ts +2 -0
- package/dist/__tests__/fog-producer-matrix.integration.test.d.ts.map +1 -0
- package/dist/__tests__/hdrp-ssao-compile.test.d.ts +2 -0
- package/dist/__tests__/hdrp-ssao-compile.test.d.ts.map +1 -0
- package/dist/__tests__/ibl-irradiance.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl-irradiance.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ibl-sampling.unit.test.d.ts +2 -0
- package/dist/__tests__/ibl-sampling.unit.test.d.ts.map +1 -0
- package/dist/__tests__/lighting-punctual.unit.test.d.ts +2 -0
- package/dist/__tests__/lighting-punctual.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-artifact-dedup.unit.test.d.ts +2 -0
- package/dist/__tests__/material-artifact-dedup.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-builtins.unit.test.d.ts +2 -0
- package/dist/__tests__/material-builtins.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-contract.unit.test.d.ts +2 -0
- package/dist/__tests__/material-contract.unit.test.d.ts.map +1 -0
- package/dist/__tests__/material-derived-builtins.integration.test.d.ts +2 -0
- package/dist/__tests__/material-derived-builtins.integration.test.d.ts.map +1 -0
- package/dist/__tests__/public-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/public-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/scene-temporal.unit.test.d.ts +2 -0
- package/dist/__tests__/scene-temporal.unit.test.d.ts.map +1 -0
- package/dist/__tests__/shader-registry-transaction.unit.test.d.ts +2 -0
- package/dist/__tests__/shader-registry-transaction.unit.test.d.ts.map +1 -0
- package/dist/__tests__/shader.unit.test.d.ts +2 -0
- package/dist/__tests__/shader.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-lit-shader.test.d.ts +2 -0
- package/dist/__tests__/sprite-lit-shader.test.d.ts.map +1 -0
- package/dist/__tests__/sprite-variants.unit.test.d.ts +2 -0
- package/dist/__tests__/sprite-variants.unit.test.d.ts.map +1 -0
- package/dist/__tests__/taa-resolve.unit.test.d.ts +2 -0
- package/dist/__tests__/taa-resolve.unit.test.d.ts.map +1 -0
- package/dist/__tests__/transparent-pbr.unit.test.d.ts +2 -0
- package/dist/__tests__/transparent-pbr.unit.test.d.ts.map +1 -0
- package/dist/__tests__/vertex-color-variant.unit.test.d.ts +2 -0
- package/dist/__tests__/vertex-color-variant.unit.test.d.ts.map +1 -0
- package/dist/errors.d.ts +96 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +560 -0
- package/dist/index.mjs.map +1 -0
- package/dist/material/artifact-registry.d.ts +31 -0
- package/dist/material/artifact-registry.d.ts.map +1 -0
- package/dist/material/artifact-types.d.ts +13 -0
- package/dist/material/artifact-types.d.ts.map +1 -0
- package/dist/material-schemas.d.ts +8 -0
- package/dist/material-schemas.d.ts.map +1 -0
- package/dist/register-default-sprite-lit.d.ts +40 -0
- package/dist/register-default-sprite-lit.d.ts.map +1 -0
- package/dist/register-default-standard-pbr-skin.d.ts +34 -0
- package/dist/register-default-standard-pbr-skin.d.ts.map +1 -0
- package/dist/tonemap.d.ts +13 -0
- package/dist/tonemap.d.ts.map +1 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +58 -0
- package/src/ShaderRegistry.ts +519 -0
- package/src/__tests__/atmosphere-background.test.ts +33 -0
- package/src/__tests__/atmosphere-cubemap-orientation.test.ts +68 -0
- package/src/__tests__/atmosphere-preetham-numeric.test.ts +122 -0
- package/src/__tests__/atmosphere-preetham-red.test.ts +52 -0
- package/src/__tests__/atmosphere-preetham.test.ts +132 -0
- package/src/__tests__/atmosphere-three-r184-reference.test.ts +122 -0
- package/src/__tests__/bloom-fxaa-tonemap.unit.test.ts +31 -0
- package/src/__tests__/builtin-texture-sampling-contract.test.ts +56 -0
- package/src/__tests__/default-standard-pbr-alpha.unit.test.ts +19 -0
- package/src/__tests__/deferred-lighting-ssao.test.ts +114 -0
- package/src/__tests__/fog-oracle.unit.test.ts +132 -0
- package/src/__tests__/fog-orthographic-ray.unit.test.ts +62 -0
- package/src/__tests__/fog-producer-matrix.integration.test.ts +77 -0
- package/src/__tests__/hdrp-ssao-compile.test.ts +185 -0
- package/src/__tests__/ibl-irradiance.unit.test.ts +43 -0
- package/src/__tests__/ibl-sampling.unit.test.ts +40 -0
- package/src/__tests__/lighting-punctual.unit.test.ts +66 -0
- package/src/__tests__/manifest.fixture.json +22 -0
- package/src/__tests__/material-artifact-dedup.unit.test.ts +21 -0
- package/src/__tests__/material-builtins.unit.test.ts +111 -0
- package/src/__tests__/material-contract.unit.test.ts +79 -0
- package/src/__tests__/material-derived-builtins.integration.test.ts +30 -0
- package/src/__tests__/public-surface.unit.test.ts +9 -0
- package/src/__tests__/scene-temporal.unit.test.ts +32 -0
- package/src/__tests__/shader-registry-transaction.unit.test.ts +116 -0
- package/src/__tests__/shader.unit.test.ts +1909 -0
- package/src/__tests__/sprite-lit-shader.test.ts +240 -0
- package/src/__tests__/sprite-variants.unit.test.ts +209 -0
- package/src/__tests__/taa-resolve.unit.test.ts +32 -0
- package/src/__tests__/transparent-pbr.unit.test.ts +21 -0
- package/src/__tests__/vertex-color-variant.unit.test.ts +52 -0
- package/src/atmosphere-background.wgsl +80 -0
- package/src/atmosphere-cubemap.wgsl +72 -0
- package/src/atmosphere-ibl.wgsl +127 -0
- package/src/atmosphere-preetham.wgsl +214 -0
- package/src/bloom-blur.wgsl +89 -0
- package/src/bloom-bright.wgsl +50 -0
- package/src/bloom-composite.wgsl +54 -0
- package/src/brdf.wgsl +25 -0
- package/src/common.wgsl +523 -0
- package/src/default-standard-pbr-skin.wgsl +538 -0
- package/src/default-standard-pbr.wgsl +794 -0
- package/src/errors.ts +169 -0
- package/src/fog.wgsl +27 -0
- package/src/fxaa.wgsl +259 -0
- package/src/hdrp-cluster-forward.wgsl +186 -0
- package/src/hdrp-deferred-lighting.wgsl +69 -0
- package/src/hdrp-ssao.wgsl +174 -0
- package/src/ibl-brdf-lut.wgsl +92 -0
- package/src/ibl-equirect-to-cube.wgsl +56 -0
- package/src/ibl-irradiance.wgsl +89 -0
- package/src/ibl-prefilter.wgsl +101 -0
- package/src/ibl-sampling.wgsl +58 -0
- package/src/ibl-shared.wgsl +118 -0
- package/src/index.ts +166 -0
- package/src/lighting-directional.wgsl +471 -0
- package/src/lighting-punctual.wgsl +274 -0
- package/src/material/artifact-registry.ts +78 -0
- package/src/material/artifact-types.ts +26 -0
- package/src/material-schemas.ts +48 -0
- package/src/msdf-text.wgsl +208 -0
- package/src/pbr-temporal.wgsl +73 -0
- package/src/register-default-sprite-lit.ts +87 -0
- package/src/register-default-standard-pbr-skin.ts +74 -0
- package/src/shadow-pcf.wgsl +120 -0
- package/src/shadow_caster.wgsl +54 -0
- package/src/skybox.wgsl +75 -0
- package/src/sprite-lit.wgsl +307 -0
- package/src/sprite.wgsl +365 -0
- package/src/taa-resolve.wgsl +129 -0
- package/src/tbn.wgsl +54 -0
- package/src/tonemap.ts +13 -0
- package/src/tonemap.wgsl +177 -0
- package/src/types.ts +59 -0
- package/src/unlit.wgsl +186 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import type { Result, RhiError, ShaderModule } from '@forgeax/engine-rhi';
|
|
2
|
+
import type { ImmutableParamSchemaProjection, ManifestEntry, ParamSchemaEntry, ParamSchemaProjectionOwnerStats } from '@forgeax/engine-types';
|
|
3
|
+
import { type ShaderError, type Result as ShaderResult } from './errors.js';
|
|
4
|
+
import type { MaterialShaderManifestEntry } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Device dependency-injection interface — ShaderRegistry does not directly
|
|
7
|
+
* depend on `@forgeax/engine-rhi-webgpu` (physical isolation); the caller (engine or
|
|
8
|
+
* tests) supplies a device-like object that implements
|
|
9
|
+
* `createShaderModule(desc) → Result<ShaderModule, RhiError>`.
|
|
10
|
+
*
|
|
11
|
+
* Difference from the top-level async `createShaderModule(device, desc)` in
|
|
12
|
+
* `@forgeax/engine-rhi-webgpu`:
|
|
13
|
+
* - This interface is synchronous — so `registry.get()` can return a cached
|
|
14
|
+
* module synchronously.
|
|
15
|
+
* - The caller is responsible for wrapping the async real path into a sync one
|
|
16
|
+
* (e.g. the engine pre-compiles and caches modules during `loadManifest`).
|
|
17
|
+
*
|
|
18
|
+
* Mock test shape: a direct sync implementation (see `createMockDevice` in
|
|
19
|
+
* src/__tests__/registry.test.ts).
|
|
20
|
+
*/
|
|
21
|
+
export interface ShaderRegistryDevice {
|
|
22
|
+
createShaderModule(desc: {
|
|
23
|
+
readonly code: string;
|
|
24
|
+
readonly label?: string | undefined;
|
|
25
|
+
}): Result<ShaderModule, RhiError>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The `forgeax::` prefix reserves engine-shipped material shader identifiers
|
|
29
|
+
* (plan-strategy D-DefaultStandardPbr-Identifier + §8 charter F1 grep gate).
|
|
30
|
+
* AI users grep `forgeax::` to enumerate every reserved shader identifier in
|
|
31
|
+
* one shot. Custom user-side shaders pick their own identifier path
|
|
32
|
+
* (typically `<package>::<id>`) — anything that is not a `<guid>`
|
|
33
|
+
* (UUIDv5/v7) shape and not `forgeax::*`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const FORGEAX_RESERVED_PATH_PREFIX: "forgeax::";
|
|
36
|
+
/**
|
|
37
|
+
* Material shader admission input accepted by
|
|
38
|
+
* `installMaterialArtifact(identifier, entry)`. `findMaterialArtifact`
|
|
39
|
+
* returns a {@link RegisteredMaterialShaderEntry} with the immutable schema
|
|
40
|
+
* projection attached.
|
|
41
|
+
*
|
|
42
|
+
* - `source`: composed WGSL source (post-naga_oil); the final form fed to
|
|
43
|
+
* `device.createShaderModule({ code })` at pipeline-build time.
|
|
44
|
+
* - `paramSchema`: closed list of `{name, type, default?}` triples that the
|
|
45
|
+
* `MaterialAsset.payload.values` is validated against at register-time
|
|
46
|
+
* (feat-20260523-shader-template-instance-split M4 3-tier validation). Per
|
|
47
|
+
* feat-20260613-material-paramschema-driven-binding M3 / w12-w13, the
|
|
48
|
+
* paramSchema is also the SSOT for the pipeline BGL via
|
|
49
|
+
* `derive(paramSchema).bglEntries` — there is no longer a separate
|
|
50
|
+
* `bindingLayout` field on this entry (D-1 / D-2).
|
|
51
|
+
*
|
|
52
|
+
* The shape is symmetric across engine-default + user-custom paths
|
|
53
|
+
* (charter P4 consistent abstraction): both go through the same
|
|
54
|
+
* `installMaterialArtifact` API regardless of whether the host wires the
|
|
55
|
+
* default-standard-pbr triple at boot or the user registers a custom
|
|
56
|
+
* shader after asset import.
|
|
57
|
+
*/
|
|
58
|
+
export interface MaterialShaderEntry {
|
|
59
|
+
readonly source: string;
|
|
60
|
+
readonly paramSchema: readonly ParamSchemaEntry[];
|
|
61
|
+
}
|
|
62
|
+
/** Registry-owned runtime shape published after immutable schema admission. */
|
|
63
|
+
export interface RegisteredMaterialShaderEntry extends MaterialShaderEntry {
|
|
64
|
+
readonly paramSchemaProjection: ImmutableParamSchemaProjection;
|
|
65
|
+
}
|
|
66
|
+
export interface ShaderRegistryOptions {
|
|
67
|
+
readonly device: ShaderRegistryDevice;
|
|
68
|
+
/**
|
|
69
|
+
* URL the registry fetches `manifest.json` from. `undefined` puts the
|
|
70
|
+
* registry into the **zero-entry** mode: `loadManifest()` resolves
|
|
71
|
+
* `Result.ok(undefined)` without issuing a fetch and `entries()` returns
|
|
72
|
+
* an empty iterator. This is the bug-20260519 clear-pass-only path
|
|
73
|
+
* where AI users build a `Camera`-only world (no PBR / unlit pipeline
|
|
74
|
+
* is ever needed). `createRenderer.ts` Step 2 narrows on
|
|
75
|
+
* `manifestEntries.length > 0` to skip the dual `createShaderModule`
|
|
76
|
+
* compile in the same path (charter P3 + plan-strategy D-1 + D-2).
|
|
77
|
+
*/
|
|
78
|
+
readonly manifestUrl: string | undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Runtime shader registry — content-addressable manifest lookup →
|
|
82
|
+
* `device.createShaderModule`.
|
|
83
|
+
*
|
|
84
|
+
* Usage:
|
|
85
|
+
* ```
|
|
86
|
+
* const registry = new ShaderRegistry({ device, manifestUrl: '/shaders/manifest.json' });
|
|
87
|
+
* const loaded = await registry.loadManifest();
|
|
88
|
+
* if (!loaded.ok) handleError(loaded.error); // ShaderError.manifest-malformed
|
|
89
|
+
*
|
|
90
|
+
* const result = registry.get('abc12345');
|
|
91
|
+
* if (!result.ok) handleError(result.error); // RhiError | ShaderError.shader-not-found
|
|
92
|
+
* else useModule(result.value);
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* `static get` / module-level singletons are **forbidden** (plan-strategy
|
|
96
|
+
* §S-10).
|
|
97
|
+
*/
|
|
98
|
+
export declare class ShaderRegistry {
|
|
99
|
+
#private;
|
|
100
|
+
constructor(opts: ShaderRegistryOptions);
|
|
101
|
+
/**
|
|
102
|
+
* Loads manifest.json and populates the hash → ManifestEntry index.
|
|
103
|
+
*
|
|
104
|
+
* Failure paths (charter proposition 4: explicit failure):
|
|
105
|
+
* - fetch / data: URL parse failed → `Result.err(ShaderError.manifest-malformed)`
|
|
106
|
+
* - JSON.parse failed → ditto
|
|
107
|
+
* - schema missing the `entries` field / an entries element missing
|
|
108
|
+
* hash/wgsl/bindings → ditto
|
|
109
|
+
* - a material shader row is incomplete → ditto
|
|
110
|
+
*
|
|
111
|
+
* Validation is atomic: the registry does not publish any entry or
|
|
112
|
+
* material shader row until the complete document has been validated.
|
|
113
|
+
*
|
|
114
|
+
* Idempotent: subsequent calls reuse the first result (never re-fetch;
|
|
115
|
+
* charter proposition 6: idempotency).
|
|
116
|
+
*/
|
|
117
|
+
loadManifest(): Promise<ShaderResult<void, ShaderError>>;
|
|
118
|
+
/**
|
|
119
|
+
* Iterate every `ManifestEntry` populated by the most recent successful
|
|
120
|
+
* `loadManifest()` call. Order matches the manifest JSON `entries` array
|
|
121
|
+
* (insertion order; charter P2 structured-over-prose: AI users walk this
|
|
122
|
+
* to discover engine-shipped entries by content marker without
|
|
123
|
+
* re-fetching the manifest).
|
|
124
|
+
*
|
|
125
|
+
* Returns an empty iterator when no manifest has been loaded yet
|
|
126
|
+
* (charter P3 explicit failure: the empty case is not an error — the
|
|
127
|
+
* absent SSOT is the absent contract).
|
|
128
|
+
*/
|
|
129
|
+
entries(): IterableIterator<ManifestEntry>;
|
|
130
|
+
/**
|
|
131
|
+
* Looks up a hash and forwards to `device.createShaderModule` (creates lazily
|
|
132
|
+
* on first hit, then caches).
|
|
133
|
+
*
|
|
134
|
+
* Error paths:
|
|
135
|
+
* - hash miss → `Result.err(ShaderError.shader-not-found)`
|
|
136
|
+
* - device.createShaderModule failed → `Result.err(RhiError)` passes through
|
|
137
|
+
* (it is **not** wrapped as a ShaderError).
|
|
138
|
+
*
|
|
139
|
+
* Sync shape: on cache miss, the underlying `device.createShaderModule` is
|
|
140
|
+
* called synchronously; the caller is responsible for handling the async
|
|
141
|
+
* real path at the device-wrapper layer (e.g. the engine pre-compiles
|
|
142
|
+
* during `loadManifest`).
|
|
143
|
+
*/
|
|
144
|
+
get(hash: string): Result<ShaderModule, RhiError | ShaderError>;
|
|
145
|
+
/**
|
|
146
|
+
* Register a material shader entry under a stable identifier.
|
|
147
|
+
*
|
|
148
|
+
* **Throws** on:
|
|
149
|
+
* - duplicate registration of the same identifier (programmer error per
|
|
150
|
+
* AGENTS.md "explicit registration" + Inspector "fail-fast no overwrite"
|
|
151
|
+
* pattern; charter P3 explicit failure on misuse).
|
|
152
|
+
*
|
|
153
|
+
* Successful path returns void — the registry mutates in-place. Use
|
|
154
|
+
* {@link findMaterialArtifact} to read back.
|
|
155
|
+
*
|
|
156
|
+
* Identifier conventions (charter F1 / plan-strategy §8 §2):
|
|
157
|
+
* - `forgeax::<kebab-case>` — engine-shipped reserved prefix; the host
|
|
158
|
+
* registers `forgeax::default-standard-pbr` at boot.
|
|
159
|
+
* - `<package>::<id>` or `<guid>` — user-side custom shaders.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* const registry = new ShaderRegistry({ device, manifestUrl });
|
|
164
|
+
* registry.installMaterialArtifact('forgeax::default-standard-pbr', {
|
|
165
|
+
* source: composedWgsl,
|
|
166
|
+
* paramSchema: defaultStandardPbrSchema,
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
installMaterialArtifact(identifier: string, entry: MaterialShaderEntry): void;
|
|
171
|
+
/**
|
|
172
|
+
* Lookup a previously-registered material shader entry by identifier.
|
|
173
|
+
*
|
|
174
|
+
* Returns `Result.ok(entry)` on hit, `Result.err(material-shader-not-found)`
|
|
175
|
+
* on miss. The `Result` shape mirrors `get(hash)` for consistent
|
|
176
|
+
* abstraction across the runtime registry surface (charter P4).
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const r = registry.findMaterialArtifact('forgeax::default-standard-pbr');
|
|
181
|
+
* if (!r.ok) return handleError(r.error);
|
|
182
|
+
* const { source, paramSchema } = r.value;
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
findMaterialArtifact(identifier: string): ShaderResult<RegisteredMaterialShaderEntry, ShaderError>;
|
|
186
|
+
/**
|
|
187
|
+
* Iterate every registered material shader identifier in registration
|
|
188
|
+
* order (charter F1 grep gate: `for (const id of registry.materialShaderIdentifiers())`
|
|
189
|
+
* lists every `forgeax::*` + user shader without a private-field reach-in).
|
|
190
|
+
*/
|
|
191
|
+
materialShaderIdentifiers(): IterableIterator<string>;
|
|
192
|
+
/** Runtime diagnostic counters for the immutable ParamSchema owner. */
|
|
193
|
+
paramSchemaProjectionStats(): ParamSchemaProjectionOwnerStats;
|
|
194
|
+
/**
|
|
195
|
+
* Iterate every MaterialShaderManifestEntry parsed from manifest.json's
|
|
196
|
+
* `materialShaders[]` field during `loadManifest()`.
|
|
197
|
+
*
|
|
198
|
+
* feat-20260526-pbr-uniform-fallback-no-storage-buffer M3 / w12:
|
|
199
|
+
* createRenderer variant resolution consumes this list to select the
|
|
200
|
+
* correct variant (by `caps.storageBuffer`) and register the resolved
|
|
201
|
+
* WGSL via `installMaterialArtifact`.
|
|
202
|
+
*
|
|
203
|
+
* Returns an empty iterator when no manifest has been loaded yet or
|
|
204
|
+
* the manifest lacks `materialShaders` (backward-compatible).
|
|
205
|
+
*/
|
|
206
|
+
materialShaderManifestEntries(): IterableIterator<MaterialShaderManifestEntry>;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=ShaderRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShaderRegistry.d.ts","sourceRoot":"","sources":["../src/ShaderRegistry.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EACV,8BAA8B,EAC9B,aAAa,EACb,gBAAgB,EAChB,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,MAAM,IAAI,YAAY,EAE5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAI9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,oBAAoB;IACnC,kBAAkB,CAAC,IAAI,EAAE;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACrC,GAAG,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;CACpC;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,EAAG,WAAoB,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,mBAAmB;IACl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":["../../src/__tests__/atmosphere-background.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere-cubemap-orientation.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/atmosphere-cubemap-orientation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere-preetham-numeric.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/atmosphere-preetham-numeric.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere-preetham-red.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/atmosphere-preetham-red.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere-preetham.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/atmosphere-preetham.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere-three-r184-reference.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/atmosphere-three-r184-reference.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloom-fxaa-tonemap.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/bloom-fxaa-tonemap.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-texture-sampling-contract.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/builtin-texture-sampling-contract.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-standard-pbr-alpha.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/default-standard-pbr-alpha.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred-lighting-ssao.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/deferred-lighting-ssao.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fog-oracle.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/fog-oracle.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fog-orthographic-ray.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/fog-orthographic-ray.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fog-producer-matrix.integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/fog-producer-matrix.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hdrp-ssao-compile.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/hdrp-ssao-compile.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ibl-irradiance.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/ibl-irradiance.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ibl-sampling.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/ibl-sampling.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lighting-punctual.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/lighting-punctual.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-artifact-dedup.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/material-artifact-dedup.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-builtins.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/material-builtins.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-contract.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/material-contract.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-derived-builtins.integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/material-derived-builtins.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-surface.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/public-surface.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-temporal.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/scene-temporal.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-registry-transaction.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/shader-registry-transaction.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/shader.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite-lit-shader.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/sprite-lit-shader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite-variants.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/sprite-variants.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taa-resolve.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/taa-resolve.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transparent-pbr.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/transparent-pbr.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertex-color-variant.unit.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/vertex-color-variant.unit.test.ts"],"names":[],"mappings":""}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { ShaderErrorCode } from '@forgeax/engine-types';
|
|
2
|
+
export type { ShaderErrorCode };
|
|
3
|
+
/**
|
|
4
|
+
* Path-specific `detail` shape for `manifest-malformed` / `shader-not-found`.
|
|
5
|
+
* `reason` is supplemental prose (it does not replace `hint`).
|
|
6
|
+
*/
|
|
7
|
+
export interface ShaderErrorDetail {
|
|
8
|
+
readonly reason?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Machine-consumable list of currently-registered material-shader identifiers.
|
|
11
|
+
* Populated by `materialShaderNotFound()` factory so AI users can enumerate
|
|
12
|
+
* available shaders via `err.detail.registeredShaderIds` for autocomplete /
|
|
13
|
+
* fuzzy-match recovery without parsing the human-formatted `err.expected`
|
|
14
|
+
* string (charter P3 structured failure). `err.expected` still carries the
|
|
15
|
+
* pre-formatted `"ShaderRegistry has registered identifiers: [...]"` message
|
|
16
|
+
* for human-readable log output — the two channels are complementary.
|
|
17
|
+
*/
|
|
18
|
+
readonly registeredShaderIds?: readonly string[] | undefined;
|
|
19
|
+
}
|
|
20
|
+
interface ShaderErrorInit {
|
|
21
|
+
readonly code: ShaderErrorCode;
|
|
22
|
+
readonly expected: string;
|
|
23
|
+
readonly hint: string;
|
|
24
|
+
readonly message: string;
|
|
25
|
+
readonly lineNum?: number | undefined;
|
|
26
|
+
readonly linePos?: number | undefined;
|
|
27
|
+
readonly detail?: ShaderErrorDetail | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Structured shader error (runtime path, aligned with build-time
|
|
31
|
+
* `@forgeax/engine-shader-compiler.ShaderError`).
|
|
32
|
+
*
|
|
33
|
+
* **5 surface fields** (MVP-2.3 top-level projection, AI-user consumption path):
|
|
34
|
+
* - `.code` — member of the closed `ShaderErrorCode` union (4 variants)
|
|
35
|
+
* - `.message` — display text (`Error` base-class field, populated at construction)
|
|
36
|
+
* - `.hint` — actionable recovery guidance (charter proposition 3:
|
|
37
|
+
* machine-readable hint > prose)
|
|
38
|
+
* - `.lineNum` / `.linePos` — error source location (undefined on the runtime
|
|
39
|
+
* path; only populated by the build-time compile-failed path; the field is
|
|
40
|
+
* retained here for shape alignment).
|
|
41
|
+
*
|
|
42
|
+
* **3 internal fields**:
|
|
43
|
+
* - `.name` = `'ShaderError'` (debug label)
|
|
44
|
+
* - `.expected` — expected-state description (symmetric with RhiError)
|
|
45
|
+
* - `.detail` — path-specific extras (`reason` prose)
|
|
46
|
+
*
|
|
47
|
+
* **Do not `new` this directly** — construct via the 2 factory helpers
|
|
48
|
+
* (`manifestMalformed` / `shaderNotFound`); the runtime path of this loop does
|
|
49
|
+
* not trigger compile-failed / init-failed (those two paths belong to the
|
|
50
|
+
* build-time `ShaderError` shape in `@forgeax/engine-shader-compiler`).
|
|
51
|
+
*/
|
|
52
|
+
export declare class ShaderError extends Error {
|
|
53
|
+
readonly name: 'ShaderError';
|
|
54
|
+
readonly code: ShaderErrorCode;
|
|
55
|
+
readonly expected: string;
|
|
56
|
+
readonly hint: string;
|
|
57
|
+
readonly lineNum: number | undefined;
|
|
58
|
+
readonly linePos: number | undefined;
|
|
59
|
+
readonly detail: ShaderErrorDetail | undefined;
|
|
60
|
+
constructor(init: ShaderErrorInit);
|
|
61
|
+
}
|
|
62
|
+
/** `manifest-malformed`: manifest.json schema validation failed (4 fields missing or JSON unparseable). */
|
|
63
|
+
export declare function manifestMalformed(args: {
|
|
64
|
+
readonly message: string;
|
|
65
|
+
readonly hint: string;
|
|
66
|
+
readonly reason?: string | undefined;
|
|
67
|
+
}): ShaderError;
|
|
68
|
+
/** `shader-not-found`: ShaderRegistry.get(hash) hash miss. */
|
|
69
|
+
export declare function shaderNotFound(args: {
|
|
70
|
+
readonly hash: string;
|
|
71
|
+
readonly hint: string;
|
|
72
|
+
}): ShaderError;
|
|
73
|
+
/**
|
|
74
|
+
* `material-shader-not-found`: `ShaderRegistry.findMaterialArtifact(identifier)`
|
|
75
|
+
* miss. Returned by the runtime path when a `MaterialAsset.payload.materialShader`
|
|
76
|
+
* `::`-routed identifier (or any registered identifier) has no matching entry
|
|
77
|
+
* in the registry. AI-user recovery: the `.hint` cites the
|
|
78
|
+
* `forgeax::default-standard-pbr` reservation + the
|
|
79
|
+
* `installMaterialArtifact(...)` API path so the caller can register the missing
|
|
80
|
+
* shader at engine boot (feat-20260523-shader-template-instance-split M5 / T05).
|
|
81
|
+
*
|
|
82
|
+
* feat-20260528-material-shader-registration-unification M3 / w12 +
|
|
83
|
+
* feat-20260624-sprite-lit F-P1 fix: dual-channel exposure of the registered
|
|
84
|
+
* identifier set. `.expected` carries the pre-formatted string
|
|
85
|
+
* `"ShaderRegistry has registered identifiers: [id1, id2, ...]"` for human /
|
|
86
|
+
* log output; `.detail.registeredShaderIds` carries the raw `readonly string[]`
|
|
87
|
+
* for AI users to enumerate via property access without regex-parsing the
|
|
88
|
+
* message (charter P3 structured failure).
|
|
89
|
+
*/
|
|
90
|
+
export declare function materialShaderNotFound(args: {
|
|
91
|
+
readonly identifier: string;
|
|
92
|
+
readonly hint: string;
|
|
93
|
+
readonly expected: string[];
|
|
94
|
+
}): ShaderError;
|
|
95
|
+
export { err, ok, type Result, type ResultErr, type ResultOk, } from '@forgeax/engine-rhi';
|
|
96
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,YAA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EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,GAAG,WAAW,CAQd;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,GAAG,WAAW,CAOd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;CAC7B,GAAG,WAAW,CAQd;AAYD,OAAO,EACL,GAAG,EACH,EAAE,EACF,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type { ManifestEntry, ParamSchemaEntry } from '@forgeax/engine-types';
|
|
2
|
+
import type { MaterialAsset } from '@forgeax/engine-types';
|
|
3
|
+
export { MATERIAL_PARAM_TYPES } from '@forgeax/engine-types';
|
|
4
|
+
export { err, manifestMalformed, materialShaderNotFound, ok, type Result, type ResultErr, type ResultOk, ShaderError, type ShaderErrorCode, type ShaderErrorDetail, shaderNotFound, } from './errors.js';
|
|
5
|
+
export { type MaterialArtifactConflictError, type MaterialArtifactInspection, MaterialArtifactRegistry, type MaterialRuntimeArtifact, registerMaterialArtifact, } from './material/artifact-registry.js';
|
|
6
|
+
export { isMaterialShaderArtifact, type MaterialShaderArtifact, } from './material/artifact-types.js';
|
|
7
|
+
export { DEFAULT_MSDF_TEXT_PARAM_SCHEMA, DEFAULT_SPRITE_PARAM_SCHEMA, DEFAULT_STANDARD_PBR_PARAM_SCHEMA, DEFAULT_UNLIT_PARAM_SCHEMA, STANDARD_PBR_ALPHA_CUTOFF_DEFAULT, } from './material-schemas.js';
|
|
8
|
+
export { registerDefaultSpriteLit, type SpriteLitCaps, } from './register-default-sprite-lit.js';
|
|
9
|
+
export { registerDefaultStandardPbrSkin } from './register-default-standard-pbr-skin.js';
|
|
10
|
+
export { FORGEAX_RESERVED_PATH_PREFIX, type MaterialShaderEntry, type RegisteredMaterialShaderEntry, ShaderRegistry, type ShaderRegistryDevice, type ShaderRegistryOptions, } from './ShaderRegistry.js';
|
|
11
|
+
export { findVariantByKey, type MaterialShaderManifestEntry, type MaterialShaderManifestVariant, } from './types.js';
|
|
12
|
+
export declare const BUILTIN_MATERIAL_MODULES: {
|
|
13
|
+
readonly standard: "forgeax_material::standard";
|
|
14
|
+
readonly unlit: "forgeax_material::unlit";
|
|
15
|
+
readonly sprite: "forgeax_material::sprite";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Material modules whose shader source and parameter contract are owned by
|
|
19
|
+
* the Engine. They live in the runtime ShaderRegistry, so a Pack containing
|
|
20
|
+
* one of these materials carries authored values only and does not require a
|
|
21
|
+
* project material-cook artifact.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ENGINE_MATERIAL_MODULES: readonly ["forgeax::default-standard-pbr", "forgeax::pbr-skin", "forgeax::default-standard-pbr-skin", "forgeax::default-unlit", "forgeax::default-shadow-caster", "forgeax::sprite", "forgeax::sprite-lit", "forgeax::msdf-text", "forgeax_material::standard", "forgeax_material::unlit", "forgeax_material::sprite", "forgeax_material::sprite-lit"];
|
|
24
|
+
export declare function isEngineMaterialModule(module: string): boolean;
|
|
25
|
+
export declare function isEngineMaterial(material: Pick<MaterialAsset, 'passes'>): boolean;
|
|
26
|
+
export type BuiltinMaterialKind = keyof typeof BUILTIN_MATERIAL_MODULES;
|
|
27
|
+
export declare function createBuiltinMaterialAsset(kind: BuiltinMaterialKind): MaterialAsset;
|
|
28
|
+
/**
|
|
29
|
+
* Shared luminance epsilon floor for the extended Reinhard tone-map
|
|
30
|
+
* (feat-20260519-tonemap-reinhard-mvp / D-O3).
|
|
31
|
+
*
|
|
32
|
+
* Both the TS port at `packages/runtime/src/systems/tonemap.ts` and the WGSL
|
|
33
|
+
* fragment stage in `packages/shader/src/tonemap.wgsl` apply
|
|
34
|
+
* `max(Y, TONEMAP_LUMINANCE_EPSILON)` before dividing the luminance ratio.
|
|
35
|
+
* The floor keeps the divisor finite at degenerate inputs (`Y = 0` from black
|
|
36
|
+
* pixels, `Y < 0` from rare numerical artefacts). Single SSOT here so a
|
|
37
|
+
* single `import { TONEMAP_LUMINANCE_EPSILON } from '@forgeax/engine-shader'`
|
|
38
|
+
* keeps TS / WGSL byte-equivalent.
|
|
39
|
+
*
|
|
40
|
+
* Value: `1e-5` — small enough to not perturb any plausible HDR luminance.
|
|
41
|
+
*/
|
|
42
|
+
export declare const TONEMAP_LUMINANCE_EPSILON = 0.00001;
|
|
43
|
+
export { TONEMAP_SHADER_MODE, type TonemapShaderMode } from './tonemap.js';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,uBAAuB,CAAC;AAG7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,GAAG,EACH,iBAAiB,EACjB,sBAAsB,EACtB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,wBAAwB,EACxB,KAAK,uBAAuB,EAC5B,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AACzC,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