@three-blocks/devtools 1.0.0-alpha.176.g8ff8a72e6369
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/CHANGELOG.md +11 -0
- package/LICENSE +76 -0
- package/NOTICE +32 -0
- package/README.md +254 -0
- package/dist/browser/environment-bake.js +1 -0
- package/dist/browser/shader-capture.d.ts +45 -0
- package/dist/browser/shader-capture.js +3 -0
- package/dist/browser-smoke-76626IZQ.js +254 -0
- package/dist/chunk-26FK4CRS.js +6 -0
- package/dist/chunk-4EHPYBKA.cjs +1 -0
- package/dist/chunk-5L2VS3BN.js +2 -0
- package/dist/chunk-76WRV5MZ.js +7 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-HOZDD6PW.js +2 -0
- package/dist/chunk-HRYYNBVC.js +3 -0
- package/dist/chunk-INDAJN42.js +94 -0
- package/dist/chunk-JMS5NTP7.js +3 -0
- package/dist/chunk-ME3X2KFY.js +14 -0
- package/dist/chunk-NE7SC2BX.js +2 -0
- package/dist/chunk-SCJNCGMF.js +17 -0
- package/dist/chunk-UDUICSME.js +1 -0
- package/dist/chunk-VGJ3V4QQ.js +78 -0
- package/dist/chunk-ZDNZCQUQ.js +2 -0
- package/dist/chunk-ZKK6E42X.js +1 -0
- package/dist/chunk-ZT6T2W4B.js +2 -0
- package/dist/cli.js +24 -0
- package/dist/environment-bake-5P4IAL4O.js +4 -0
- package/dist/index.d.ts +1183 -0
- package/dist/index.js +272 -0
- package/dist/shader-autowire-DCODBFMX.js +18 -0
- package/dist/shader-browser-65V22LLL.js +1 -0
- package/dist/shader-browser-JII6ZFCW.js +2 -0
- package/dist/shader-capture-server.d.ts +272 -0
- package/dist/shader-capture-server.js +19 -0
- package/dist/shader-config-4EXO5DKK.js +2 -0
- package/dist/shader-parity-QXJWR6OZ.js +1 -0
- package/dist/shader-parity-XPKQQK26.js +2 -0
- package/dist/shader-project-runner-GUR3LTYS.js +5 -0
- package/dist/shader-transform-CUkZn5Oa.d.ts +55 -0
- package/dist/shader-watch-QHTNTSZE.js +2 -0
- package/dist/shader-workflow-U4G565EB.js +2 -0
- package/dist/status-DV2BYZHR.js +2 -0
- package/dist/text-atlas-BHPSDU7C.js +2 -0
- package/dist/transform.cjs +1 -0
- package/dist/transform.d.ts +62 -0
- package/dist/transform.js +1 -0
- package/dist/webpack-loader.cjs +1 -0
- package/dist/webpack-loader.d.ts +17 -0
- package/dist/webpack-loader.js +1 -0
- package/fonts/OFL-1.1.txt +93 -0
- package/package.json +113 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1183 @@
|
|
|
1
|
+
import { PrecompiledManifest } from 'three-blocks/shaders';
|
|
2
|
+
export { A as AppliedShaderProviderTransform, a as ApplyShaderProviderTransformOptions, S as SHADER_CAPTURE_CLIENT_ID, b as ShaderCaptureTransformOptions, c as ShaderProviderTransform, d as ShaderProviderTransformOptions, e as ShaderProviderTransformStatus, f as applyShaderProviderTransform, g as assertShaderProviderTransform, h as createShaderProviderTransform } from './shader-transform-CUkZn5Oa.js';
|
|
3
|
+
import 'vite';
|
|
4
|
+
|
|
5
|
+
type ArtifactState = 'fresh' | 'pending';
|
|
6
|
+
interface ProjectMetadataV2 {
|
|
7
|
+
readonly schemaVersion: 2;
|
|
8
|
+
/** Stable default shader scene key. It is not a template catalogue identity. */
|
|
9
|
+
readonly template: string;
|
|
10
|
+
/** Informational project layers; devtools does not prescribe their catalogue or order. */
|
|
11
|
+
readonly layers: readonly string[];
|
|
12
|
+
readonly generator?: {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly version: string;
|
|
15
|
+
};
|
|
16
|
+
readonly runtime: {
|
|
17
|
+
readonly three: string;
|
|
18
|
+
readonly threeBlocks: string;
|
|
19
|
+
};
|
|
20
|
+
readonly features: {
|
|
21
|
+
/** The only project capability currently consumed by the generic engine. */
|
|
22
|
+
readonly text: boolean;
|
|
23
|
+
};
|
|
24
|
+
readonly artifacts?: {
|
|
25
|
+
readonly shaders: ArtifactState;
|
|
26
|
+
readonly text: ArtifactState | 'not-applicable';
|
|
27
|
+
};
|
|
28
|
+
readonly protocol: {
|
|
29
|
+
readonly resultFile: 1;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
declare function parseProjectMetadata(value: unknown): ProjectMetadataV2;
|
|
33
|
+
interface ShaderCoverage {
|
|
34
|
+
readonly render: number;
|
|
35
|
+
readonly vertex: number;
|
|
36
|
+
readonly fragment: number;
|
|
37
|
+
readonly compute: number;
|
|
38
|
+
}
|
|
39
|
+
interface ShaderSceneReceipt {
|
|
40
|
+
readonly artifact: string;
|
|
41
|
+
readonly artifactHash: string;
|
|
42
|
+
/** Path relative to the configured public directory. */
|
|
43
|
+
readonly asset?: string;
|
|
44
|
+
readonly assetHash?: string;
|
|
45
|
+
readonly inputs: Readonly<Record<string, string>>;
|
|
46
|
+
readonly coverage: ShaderCoverage;
|
|
47
|
+
readonly bytes?: number;
|
|
48
|
+
readonly skipped?: {
|
|
49
|
+
readonly render: number;
|
|
50
|
+
readonly compute: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
interface ShaderReceiptV2 {
|
|
54
|
+
readonly schemaVersion: 2;
|
|
55
|
+
readonly runtime: ProjectMetadataV2['runtime'] & {
|
|
56
|
+
readonly threeBlocksShaderClosure: string;
|
|
57
|
+
readonly capture?: {
|
|
58
|
+
readonly userAgent: string;
|
|
59
|
+
readonly adapter: string;
|
|
60
|
+
readonly features: readonly string[];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly tool?: {
|
|
64
|
+
readonly name: '@three-blocks/devtools';
|
|
65
|
+
readonly version: string;
|
|
66
|
+
readonly compatibility: string;
|
|
67
|
+
readonly transform: number;
|
|
68
|
+
readonly address: number;
|
|
69
|
+
readonly recipe: number;
|
|
70
|
+
readonly hydration: number;
|
|
71
|
+
};
|
|
72
|
+
readonly scenes: Readonly<Record<string, ShaderSceneReceipt>>;
|
|
73
|
+
}
|
|
74
|
+
declare function parseShaderReceipt(value: unknown): ShaderReceiptV2;
|
|
75
|
+
|
|
76
|
+
declare const TEXT_ATLAS_SCHEMA_VERSION = 1;
|
|
77
|
+
declare const TEXT_ATLAS_GENERATOR_VERSION = "1.0.0";
|
|
78
|
+
interface BuiltinFontMetadata {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly family: string;
|
|
81
|
+
readonly version: string;
|
|
82
|
+
readonly license: 'OFL-1.1';
|
|
83
|
+
readonly licenseFile: string;
|
|
84
|
+
readonly sourceFile: string;
|
|
85
|
+
readonly sourceUrl: string;
|
|
86
|
+
readonly sourceBytes: number;
|
|
87
|
+
readonly sourceChecksum: string;
|
|
88
|
+
readonly sourceArchive?: {
|
|
89
|
+
readonly bytes: number;
|
|
90
|
+
readonly checksum: string;
|
|
91
|
+
readonly entry: string;
|
|
92
|
+
};
|
|
93
|
+
readonly browserFile: string;
|
|
94
|
+
readonly browserUrl: string;
|
|
95
|
+
readonly browserBytes: number;
|
|
96
|
+
readonly browserChecksum: string;
|
|
97
|
+
}
|
|
98
|
+
type FetchFontAsset = (input: string | URL | globalThis.Request, init?: globalThis.RequestInit) => Promise<globalThis.Response>;
|
|
99
|
+
interface TextAtlasRuntimeOptions {
|
|
100
|
+
/** Override the platform user cache. Primarily useful for CI and cache prewarming. */
|
|
101
|
+
readonly cacheDirectory?: string;
|
|
102
|
+
/** Override network transport without changing the immutable source metadata. */
|
|
103
|
+
readonly fetch?: FetchFontAsset;
|
|
104
|
+
/** Override download location/archive metadata while retaining the pinned extracted-file checksums. */
|
|
105
|
+
readonly mapBuiltinFont?: (metadata: BuiltinFontMetadata) => BuiltinFontMetadata;
|
|
106
|
+
}
|
|
107
|
+
interface AtlasOptions {
|
|
108
|
+
readonly size: number;
|
|
109
|
+
readonly distanceRange: number;
|
|
110
|
+
readonly padding: number;
|
|
111
|
+
readonly maxTextureSize: number;
|
|
112
|
+
}
|
|
113
|
+
interface TextAtlasFileReceipt {
|
|
114
|
+
readonly path: string;
|
|
115
|
+
readonly sha256: string;
|
|
116
|
+
readonly bytes: number;
|
|
117
|
+
}
|
|
118
|
+
interface TextAtlasGenerationReceipt {
|
|
119
|
+
readonly schemaVersion: typeof TEXT_ATLAS_SCHEMA_VERSION;
|
|
120
|
+
readonly generatorVersion: typeof TEXT_ATLAS_GENERATOR_VERSION;
|
|
121
|
+
readonly font: {
|
|
122
|
+
readonly key: string;
|
|
123
|
+
readonly source: string;
|
|
124
|
+
readonly sourceHash: string;
|
|
125
|
+
readonly license?: BuiltinFontMetadata['license'];
|
|
126
|
+
};
|
|
127
|
+
readonly inputHash: string;
|
|
128
|
+
readonly glyphSetHash: string;
|
|
129
|
+
readonly codePoints: readonly number[];
|
|
130
|
+
readonly options: AtlasOptions;
|
|
131
|
+
readonly texture: {
|
|
132
|
+
readonly format: 'RGBA8';
|
|
133
|
+
readonly orientation: 'rd';
|
|
134
|
+
readonly compression: 'zstd' | 'none';
|
|
135
|
+
readonly width: number;
|
|
136
|
+
readonly height: number;
|
|
137
|
+
};
|
|
138
|
+
readonly files: {
|
|
139
|
+
readonly browser: TextAtlasFileReceipt;
|
|
140
|
+
readonly atlas: TextAtlasFileReceipt;
|
|
141
|
+
readonly metrics: TextAtlasFileReceipt;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
interface GeneratedTextAtlas {
|
|
145
|
+
readonly font: string;
|
|
146
|
+
readonly receipt: TextAtlasGenerationReceipt;
|
|
147
|
+
readonly metadataPath: string;
|
|
148
|
+
readonly updatedFiles: readonly string[];
|
|
149
|
+
}
|
|
150
|
+
interface GenerateTextResult {
|
|
151
|
+
readonly glyphs: number;
|
|
152
|
+
readonly glyphSetHash: string;
|
|
153
|
+
readonly atlases: readonly GeneratedTextAtlas[];
|
|
154
|
+
readonly updatedFiles: readonly string[];
|
|
155
|
+
}
|
|
156
|
+
interface TextAtlasInspection {
|
|
157
|
+
readonly state: 'ready' | 'missing' | 'invalid';
|
|
158
|
+
readonly reason: string;
|
|
159
|
+
readonly missing: readonly number[];
|
|
160
|
+
readonly atlases: readonly TextAtlasGenerationReceipt[];
|
|
161
|
+
}
|
|
162
|
+
declare function builtinFontMetadata(id: string): BuiltinFontMetadata;
|
|
163
|
+
/** Download and verify one built-in font pair without generating an atlas. */
|
|
164
|
+
declare function prewarmBuiltinFont(id: string, options?: TextAtlasRuntimeOptions): Promise<void>;
|
|
165
|
+
/** Generate every configured atlas only from semantically declared text content. */
|
|
166
|
+
declare function generateTextAtlases(root: string, configurationPath?: string, runtimeOptions?: TextAtlasRuntimeOptions): Promise<GenerateTextResult>;
|
|
167
|
+
declare function parseTextAtlasReceipt(value: unknown): TextAtlasGenerationReceipt;
|
|
168
|
+
/** Validate text coverage, metadata, KTX2 decoding, dimensions, orientation, and freshness without a GPU. */
|
|
169
|
+
declare function inspectTextAtlases(root: string, configurationPath?: string): Promise<TextAtlasInspection>;
|
|
170
|
+
|
|
171
|
+
declare const SHADER_TOOL_CONFIG_FILE = "three-blocks.shaders.json";
|
|
172
|
+
declare const SHADER_ARTIFACT_DIRECTORY = ".three-blocks/shaders";
|
|
173
|
+
declare const SHADER_PARITY_DIRECTORY = ".three-blocks/shaders/parity";
|
|
174
|
+
interface ShaderSceneConfig {
|
|
175
|
+
readonly key: string;
|
|
176
|
+
/** Project-relative browser URL, including an optional query string. */
|
|
177
|
+
readonly url: string;
|
|
178
|
+
readonly requiresText: boolean;
|
|
179
|
+
/** Optional authoritative project-relative semantic inputs for this scene. */
|
|
180
|
+
readonly inputs?: readonly string[];
|
|
181
|
+
/** Optional scene-specific completed-frame count for deterministic parity. */
|
|
182
|
+
readonly parityFrames?: number;
|
|
183
|
+
/** Optional scene-specific pixel-difference budget for intrinsically nondeterministic GPU work. */
|
|
184
|
+
readonly maxDiffRatio?: number;
|
|
185
|
+
/** Permit Three's backend pipeline cache to reuse an earlier injected pipeline with identical WGSL. */
|
|
186
|
+
readonly allowPipelineReuse?: boolean;
|
|
187
|
+
/** Require the normal published page's primary canvas to keep changing after startup. */
|
|
188
|
+
readonly runtimeMotion?: boolean;
|
|
189
|
+
}
|
|
190
|
+
interface ShaderParityConfig {
|
|
191
|
+
readonly frames: number;
|
|
192
|
+
readonly channelTolerance: number;
|
|
193
|
+
readonly maxDiffRatio: number;
|
|
194
|
+
}
|
|
195
|
+
interface ShaderBridgeConfig {
|
|
196
|
+
/** Temporary compatibility for the private integration lab's v1 globals. */
|
|
197
|
+
readonly legacyLab: boolean;
|
|
198
|
+
/** Browser module exposing the lab's deterministic recording store. */
|
|
199
|
+
readonly deterministicModule?: string;
|
|
200
|
+
}
|
|
201
|
+
interface ShaderReadinessConfig {
|
|
202
|
+
/** CSS selector whose presence marks the application ready for capture. */
|
|
203
|
+
readonly selector?: string;
|
|
204
|
+
/** Dot-separated window/global property containing `true` or a readiness promise. */
|
|
205
|
+
readonly global?: string;
|
|
206
|
+
}
|
|
207
|
+
interface ShaderToolConfig {
|
|
208
|
+
readonly schemaVersion: 1;
|
|
209
|
+
readonly scenes: readonly ShaderSceneConfig[];
|
|
210
|
+
readonly settleFrames: number;
|
|
211
|
+
/** Total post-readiness settle ceiling. Defaults to 30 seconds. */
|
|
212
|
+
readonly settleTimeoutMs?: number;
|
|
213
|
+
/** Chromium is relaunched after this many isolated capture contexts. Defaults to 8. */
|
|
214
|
+
readonly browserRelaunchScenes?: number;
|
|
215
|
+
readonly timeoutMs: number;
|
|
216
|
+
readonly viewport: {
|
|
217
|
+
readonly width: number;
|
|
218
|
+
readonly height: number;
|
|
219
|
+
};
|
|
220
|
+
readonly parity: ShaderParityConfig;
|
|
221
|
+
readonly bridge: ShaderBridgeConfig;
|
|
222
|
+
readonly readiness: ShaderReadinessConfig;
|
|
223
|
+
/** Static-asset root used for zero-import runtime manifests. Defaults to `public`. */
|
|
224
|
+
readonly publicDir?: string;
|
|
225
|
+
/** Permit unregistered Three-internal/live builds in a receipt. Defaults true; set false for a strict matrix. */
|
|
226
|
+
readonly allowLiveBuilds: boolean;
|
|
227
|
+
}
|
|
228
|
+
declare function parseShaderToolConfig(value: unknown): ShaderToolConfig;
|
|
229
|
+
declare function findShaderProjectRoot(start?: string): Promise<string>;
|
|
230
|
+
declare function loadShaderToolConfig(root: string): Promise<ShaderToolConfig>;
|
|
231
|
+
interface EnsuredShaderToolConfig {
|
|
232
|
+
readonly config: ShaderToolConfig;
|
|
233
|
+
readonly file: string;
|
|
234
|
+
readonly created: boolean;
|
|
235
|
+
}
|
|
236
|
+
interface InferredShaderCaptureTarget {
|
|
237
|
+
readonly driverKind: 'vite' | 'static';
|
|
238
|
+
readonly serve?: string;
|
|
239
|
+
readonly reason: string;
|
|
240
|
+
}
|
|
241
|
+
/** Select the zero-flag browser driver from the target project's own build shape. */
|
|
242
|
+
declare function inferShaderCaptureTarget(root: string): Promise<InferredShaderCaptureTarget>;
|
|
243
|
+
/**
|
|
244
|
+
* Materialize the convention single-scene configuration on first capture.
|
|
245
|
+
* Existing explicit configuration and generated-project metadata remain authoritative.
|
|
246
|
+
*/
|
|
247
|
+
declare function ensureShaderToolConfig(root: string): Promise<EnsuredShaderToolConfig>;
|
|
248
|
+
|
|
249
|
+
/** Published devtools protocol/package version. Kept dependency-free for instant CLI startup. */
|
|
250
|
+
declare const SHADER_DEVTOOLS_VERSION: "0.1.0";
|
|
251
|
+
|
|
252
|
+
declare const SHADER_PROVIDER_TRANSFORM_VERSION: 3;
|
|
253
|
+
declare const SHADER_LOCAL_TIMING_FILE: "timing.local.json";
|
|
254
|
+
declare const SHADER_COMMITTED_TIMING_FILE: "timing.json";
|
|
255
|
+
declare const SHADER_PARITY_EVIDENCE_FILE: "parity.json";
|
|
256
|
+
interface ShaderSceneTiming {
|
|
257
|
+
/** Number of registered render/compute NodeBuilder builds covered by the manifest. */
|
|
258
|
+
readonly builds: number;
|
|
259
|
+
/** Cumulative NodeBuilder time in the live half of the capture. */
|
|
260
|
+
readonly liveBuildMs: number;
|
|
261
|
+
/** Cumulative NodeBuilder time in the precompiled half of the same capture. */
|
|
262
|
+
readonly precompiledBuildMs: number;
|
|
263
|
+
/** Non-negative live minus precompiled NodeBuilder time. */
|
|
264
|
+
readonly avoidedBuildMs: number;
|
|
265
|
+
/** Number of measured live/precompiled pairs represented by the medians. */
|
|
266
|
+
readonly runs: number;
|
|
267
|
+
/** Maximum absolute per-run saved-time deviation from the median. */
|
|
268
|
+
readonly spreadMs: number;
|
|
269
|
+
}
|
|
270
|
+
interface ShaderLocalTiming {
|
|
271
|
+
readonly schemaVersion: 3;
|
|
272
|
+
/** Binds this machine-local observation to the exact committed shader receipt. */
|
|
273
|
+
readonly receiptHash: string;
|
|
274
|
+
readonly measuredAt: string;
|
|
275
|
+
readonly source: 'latest-local-capture';
|
|
276
|
+
readonly scenes: Readonly<Record<string, ShaderSceneTiming>>;
|
|
277
|
+
}
|
|
278
|
+
interface ShaderCommittedTiming {
|
|
279
|
+
readonly schemaVersion: 3;
|
|
280
|
+
readonly receiptHash: string;
|
|
281
|
+
readonly measuredAt: string;
|
|
282
|
+
readonly source: 'committed-capture';
|
|
283
|
+
readonly adapter: string;
|
|
284
|
+
readonly platform: string;
|
|
285
|
+
readonly scenes: Readonly<Record<string, ShaderSceneTiming>>;
|
|
286
|
+
}
|
|
287
|
+
type ShaderTiming = ShaderLocalTiming | ShaderCommittedTiming;
|
|
288
|
+
interface ShaderTimingEnvironment {
|
|
289
|
+
readonly adapter: string;
|
|
290
|
+
readonly platform: string;
|
|
291
|
+
}
|
|
292
|
+
interface ShaderSceneParityEvidence {
|
|
293
|
+
/** Binds one successful browser comparison to its scene plus shared runtime/tool receipt inputs. */
|
|
294
|
+
readonly fingerprint: string;
|
|
295
|
+
readonly verifiedAt: string;
|
|
296
|
+
}
|
|
297
|
+
interface ShaderParityEvidence {
|
|
298
|
+
readonly schemaVersion: 2;
|
|
299
|
+
readonly scenes: Readonly<Record<string, ShaderSceneParityEvidence>>;
|
|
300
|
+
}
|
|
301
|
+
interface ShaderSkippedBuild {
|
|
302
|
+
readonly kind: 'render' | 'compute';
|
|
303
|
+
readonly name: string;
|
|
304
|
+
readonly reason: string;
|
|
305
|
+
}
|
|
306
|
+
interface ShaderCaptureStats {
|
|
307
|
+
readonly buildCalls: number;
|
|
308
|
+
readonly renderBuilds: number;
|
|
309
|
+
readonly computeBuilds: number;
|
|
310
|
+
readonly registeredBuilds: number;
|
|
311
|
+
readonly registeredRenderBuilds: number;
|
|
312
|
+
readonly registeredComputeBuilds: number;
|
|
313
|
+
readonly buildMs: number;
|
|
314
|
+
readonly injected: number;
|
|
315
|
+
readonly injectedRender: number;
|
|
316
|
+
readonly injectedCompute: number;
|
|
317
|
+
readonly missed: number;
|
|
318
|
+
readonly missedRender: number;
|
|
319
|
+
readonly missedCompute: number;
|
|
320
|
+
/** Stable registered shader keys that fell back to a live build. */
|
|
321
|
+
readonly missedKeys?: readonly string[];
|
|
322
|
+
}
|
|
323
|
+
interface ShaderCaptureStageTiming {
|
|
324
|
+
readonly launch?: number;
|
|
325
|
+
readonly firstRequest?: number;
|
|
326
|
+
readonly readiness?: number;
|
|
327
|
+
readonly lastBuild?: number;
|
|
328
|
+
readonly settled?: number;
|
|
329
|
+
readonly posted?: number;
|
|
330
|
+
}
|
|
331
|
+
interface ShaderCaptureProvenance {
|
|
332
|
+
readonly userAgent: string;
|
|
333
|
+
readonly adapter: string;
|
|
334
|
+
readonly features: readonly string[];
|
|
335
|
+
}
|
|
336
|
+
interface ShaderCapturePayload extends Pick<PrecompiledManifest, 'modules' | 'nodes' | 'layouts' | 'attributePlans' | 'updatePlans' | 'requirementPlans' | 'states' | 'entries'> {
|
|
337
|
+
readonly protocolVersion: 2;
|
|
338
|
+
readonly compatibility: string;
|
|
339
|
+
readonly scene: string;
|
|
340
|
+
readonly automatic?: {
|
|
341
|
+
readonly prefix: string;
|
|
342
|
+
};
|
|
343
|
+
readonly skipped: readonly ShaderSkippedBuild[];
|
|
344
|
+
readonly errors: readonly string[];
|
|
345
|
+
readonly stats: ShaderCaptureStats;
|
|
346
|
+
readonly timing?: ShaderCaptureStageTiming;
|
|
347
|
+
readonly provenance?: ShaderCaptureProvenance;
|
|
348
|
+
}
|
|
349
|
+
interface ValidatedShaderCapture {
|
|
350
|
+
readonly scene: string;
|
|
351
|
+
readonly manifest: PrecompiledManifest;
|
|
352
|
+
readonly skipped: readonly ShaderSkippedBuild[];
|
|
353
|
+
readonly stats: ShaderCaptureStats;
|
|
354
|
+
readonly coverage: ShaderCoverage;
|
|
355
|
+
readonly timing?: ShaderCaptureStageTiming;
|
|
356
|
+
readonly provenance?: ShaderCaptureProvenance;
|
|
357
|
+
}
|
|
358
|
+
interface ValidateShaderCaptureOptions {
|
|
359
|
+
readonly scene: string;
|
|
360
|
+
readonly runtime: InstalledShaderRuntime;
|
|
361
|
+
}
|
|
362
|
+
declare function shaderCoverage(manifest: PrecompiledManifest): ShaderCoverage;
|
|
363
|
+
/** Validate untrusted browser capture data through the public runtime manifest schema. */
|
|
364
|
+
declare function validateShaderCapture(value: unknown, options: ValidateShaderCaptureOptions): ValidatedShaderCapture;
|
|
365
|
+
declare function stableStringify(value: unknown, indent?: number): string;
|
|
366
|
+
declare function serializeShaderManifest(manifest: PrecompiledManifest): string;
|
|
367
|
+
/** Read machine-local timing only when it matches the exact receipt bytes. */
|
|
368
|
+
declare function readShaderLocalTiming(directory: string, receipt: Uint8Array): Promise<ShaderLocalTiming | undefined>;
|
|
369
|
+
/** Read exact timing twins, preferring the machine-local observation. */
|
|
370
|
+
declare function readShaderTiming(directory: string, receipt: Uint8Array): Promise<ShaderTiming | undefined>;
|
|
371
|
+
/** Read browser parity evidence for the scenes that still match the current receipt. */
|
|
372
|
+
declare function readShaderParityEvidence(directory: string, receipt: Uint8Array): Promise<ShaderParityEvidence | undefined>;
|
|
373
|
+
/** Read only the canonical, committed timing file for an exact receipt. */
|
|
374
|
+
declare function readShaderCommittedTiming(directory: string, receipt: Uint8Array): Promise<ShaderCommittedTiming | undefined>;
|
|
375
|
+
/** Persist successful build timing, bound to the exact current shader receipt. */
|
|
376
|
+
declare function writeShaderLocalTiming(root: string, scenes: Readonly<Record<string, ShaderSceneTiming>>): Promise<ShaderLocalTiming>;
|
|
377
|
+
/** Persist successful browser parity checkpoints for exact per-scene receipt inputs. */
|
|
378
|
+
declare function writeShaderParityEvidence(root: string, scenes: readonly string[], expectedReceipt?: Uint8Array): Promise<ShaderParityEvidence>;
|
|
379
|
+
/** Persist local timing and its explicitly requested committed twin. */
|
|
380
|
+
declare function writeShaderTimingTwins(root: string, scenes: Readonly<Record<string, ShaderSceneTiming>>, environment: ShaderTimingEnvironment): Promise<{
|
|
381
|
+
readonly local: ShaderLocalTiming;
|
|
382
|
+
readonly committed: ShaderCommittedTiming;
|
|
383
|
+
}>;
|
|
384
|
+
interface WriteShaderArtifactsOptions {
|
|
385
|
+
readonly root: string;
|
|
386
|
+
readonly scenes: readonly ShaderSceneConfig[];
|
|
387
|
+
readonly captures: ReadonlyMap<string, ValidatedShaderCapture>;
|
|
388
|
+
readonly runtime: InstalledShaderRuntime;
|
|
389
|
+
readonly inputs: ReadonlyMap<string, Readonly<Record<string, string>>>;
|
|
390
|
+
readonly previousReceipt?: ShaderReceiptV2;
|
|
391
|
+
readonly publicDirectory?: string;
|
|
392
|
+
}
|
|
393
|
+
interface WrittenShaderArtifacts {
|
|
394
|
+
readonly directory: string;
|
|
395
|
+
readonly receipt: ShaderReceiptV2;
|
|
396
|
+
readonly files: readonly string[];
|
|
397
|
+
}
|
|
398
|
+
/** Write a complete deterministic scene matrix, with meta.json committed last. */
|
|
399
|
+
declare function writeShaderArtifacts(options: WriteShaderArtifactsOptions): Promise<WrittenShaderArtifacts>;
|
|
400
|
+
|
|
401
|
+
interface ShaderBrowserReadiness {
|
|
402
|
+
readonly workerReady: boolean;
|
|
403
|
+
readonly assetsReady: boolean;
|
|
404
|
+
readonly textReady: boolean;
|
|
405
|
+
readonly compileEnd: boolean;
|
|
406
|
+
readonly firstFrame: boolean;
|
|
407
|
+
}
|
|
408
|
+
interface ShaderBrowserObservation {
|
|
409
|
+
readonly scene: string;
|
|
410
|
+
readonly mode: 'live' | 'precompiled';
|
|
411
|
+
readonly compatibility: string;
|
|
412
|
+
readonly transform: number;
|
|
413
|
+
readonly readiness: ShaderBrowserReadiness;
|
|
414
|
+
readonly stats: ShaderCaptureStats;
|
|
415
|
+
/** Application animation frame frozen for deterministic live/precompiled parity. */
|
|
416
|
+
readonly frame: number;
|
|
417
|
+
readonly screenshot: Buffer;
|
|
418
|
+
readonly errors: readonly string[];
|
|
419
|
+
}
|
|
420
|
+
interface ShaderPublishedObservation extends ShaderBrowserObservation {
|
|
421
|
+
/** Primary renderer canvas before the normal-lifecycle soak. */
|
|
422
|
+
readonly beforeScreenshot: Buffer;
|
|
423
|
+
}
|
|
424
|
+
interface ShaderBrowserDriver {
|
|
425
|
+
capture(scene: ShaderSceneConfig, config: ShaderToolConfig): Promise<unknown>;
|
|
426
|
+
observe(scene: ShaderSceneConfig, mode: 'live' | 'precompiled', config: ShaderToolConfig, targetFrame?: number): Promise<ShaderBrowserObservation>;
|
|
427
|
+
/** Observe the published route with strict precompiled telemetry enabled. */
|
|
428
|
+
observePublished(scene: ShaderSceneConfig, config: ShaderToolConfig): Promise<ShaderPublishedObservation>;
|
|
429
|
+
timingEnvironment?(): PromiseLike<ShaderTimingEnvironment> | ShaderTimingEnvironment;
|
|
430
|
+
close(): Promise<void>;
|
|
431
|
+
}
|
|
432
|
+
interface PlaywrightShaderDriverOptions {
|
|
433
|
+
readonly root: string;
|
|
434
|
+
readonly runtime: InstalledShaderRuntime;
|
|
435
|
+
readonly headed?: boolean;
|
|
436
|
+
}
|
|
437
|
+
interface StaticPlaywrightShaderDriverOptions extends PlaywrightShaderDriverOptions {
|
|
438
|
+
/** Project-relative directory containing the already-built application. */
|
|
439
|
+
readonly serve: string;
|
|
440
|
+
}
|
|
441
|
+
interface AttachedPlaywrightShaderDriverOptions extends PlaywrightShaderDriverOptions {
|
|
442
|
+
/** Already-running application origin or base URL. */
|
|
443
|
+
readonly url: string;
|
|
444
|
+
}
|
|
445
|
+
declare function isRetryableShaderObservationNavigation(error: unknown): boolean;
|
|
446
|
+
declare function createPlaywrightShaderDriver(options: PlaywrightShaderDriverOptions): ShaderBrowserDriver;
|
|
447
|
+
/** Capture and verify an already-built app without loading Vite from the target project. */
|
|
448
|
+
declare function createStaticPlaywrightShaderDriver(options: StaticPlaywrightShaderDriverOptions): ShaderBrowserDriver;
|
|
449
|
+
/** Attach capture and parity transport to an already-running transformed application. */
|
|
450
|
+
declare function createAttachedPlaywrightShaderDriver(options: AttachedPlaywrightShaderDriverOptions): ShaderBrowserDriver;
|
|
451
|
+
|
|
452
|
+
interface ShaderScreenshotMetrics {
|
|
453
|
+
readonly width: number;
|
|
454
|
+
readonly height: number;
|
|
455
|
+
/** Average alpha-weighted sRGB luminance in the range 0...1. */
|
|
456
|
+
readonly luminance: number;
|
|
457
|
+
}
|
|
458
|
+
interface ShaderParityResult extends ShaderScreenshotMetrics {
|
|
459
|
+
readonly differentPixels: number;
|
|
460
|
+
readonly totalPixels: number;
|
|
461
|
+
readonly diffRatio: number;
|
|
462
|
+
readonly maximumChannelDelta: number;
|
|
463
|
+
readonly baselineLuminance: number;
|
|
464
|
+
readonly precompiledLuminance: number;
|
|
465
|
+
readonly nonBlack: boolean;
|
|
466
|
+
readonly matches: boolean;
|
|
467
|
+
readonly diff: Buffer;
|
|
468
|
+
}
|
|
469
|
+
declare function shaderScreenshotMetrics(source: Uint8Array): ShaderScreenshotMetrics;
|
|
470
|
+
declare function compareShaderScreenshots(baselineSource: Uint8Array, precompiledSource: Uint8Array, channelTolerance: number, maxDiffRatio: number): ShaderParityResult;
|
|
471
|
+
|
|
472
|
+
/** Snapshot declared scene inputs, or discover shader roots and their local runtime import closure. */
|
|
473
|
+
declare function snapshotShaderInputs(root: string, declaredInputs?: readonly string[]): Promise<Readonly<Record<string, string>>>;
|
|
474
|
+
interface InstalledShaderRuntime {
|
|
475
|
+
readonly three: string;
|
|
476
|
+
readonly threeBlocks: string;
|
|
477
|
+
readonly threeBlocksShaderClosure: string;
|
|
478
|
+
}
|
|
479
|
+
/** Read exact installed versions and hash the public `three-blocks/shaders` ESM closure. */
|
|
480
|
+
declare function readInstalledShaderRuntime(root: string): Promise<InstalledShaderRuntime>;
|
|
481
|
+
|
|
482
|
+
type ShaderMatrixState = 'fresh' | 'stale' | 'invalid' | 'missing';
|
|
483
|
+
interface ShaderSceneArtifactStatus {
|
|
484
|
+
readonly scene: string;
|
|
485
|
+
readonly state: ShaderMatrixState;
|
|
486
|
+
readonly reason: string;
|
|
487
|
+
readonly coverage?: ShaderCoverage;
|
|
488
|
+
/** Build timing, exposed only while its exact receipt is fresh. */
|
|
489
|
+
readonly timing?: ShaderSceneTiming & {
|
|
490
|
+
readonly schemaVersion: 3;
|
|
491
|
+
readonly measuredAt: string;
|
|
492
|
+
readonly source: ShaderTiming['source'];
|
|
493
|
+
readonly adapter?: string;
|
|
494
|
+
readonly platform?: string;
|
|
495
|
+
};
|
|
496
|
+
readonly changedInputs?: readonly string[];
|
|
497
|
+
readonly addedInputs?: readonly string[];
|
|
498
|
+
readonly removedInputs?: readonly string[];
|
|
499
|
+
}
|
|
500
|
+
interface ShaderMatrixStatus {
|
|
501
|
+
readonly schemaVersion: 1;
|
|
502
|
+
readonly root: string;
|
|
503
|
+
readonly state: ShaderMatrixState;
|
|
504
|
+
readonly reason: string;
|
|
505
|
+
readonly scenes: readonly ShaderSceneArtifactStatus[];
|
|
506
|
+
readonly runtime?: InstalledShaderRuntime;
|
|
507
|
+
readonly receipt?: ShaderReceiptV2;
|
|
508
|
+
readonly timing?: ShaderTiming;
|
|
509
|
+
}
|
|
510
|
+
/** Inspect all configured manifests without launching Vite, a browser, or a GPU. */
|
|
511
|
+
declare function inspectShaderMatrix(start?: string): Promise<ShaderMatrixStatus>;
|
|
512
|
+
|
|
513
|
+
interface CaptureShadersOptions {
|
|
514
|
+
readonly start?: string;
|
|
515
|
+
readonly root?: string;
|
|
516
|
+
readonly config?: ShaderToolConfig;
|
|
517
|
+
readonly driver?: ShaderBrowserDriver;
|
|
518
|
+
/** Built-output capture bypasses Vite in the target project. */
|
|
519
|
+
readonly driverKind?: 'vite' | 'static';
|
|
520
|
+
/** Project-relative built directory used by the static driver. */
|
|
521
|
+
readonly serve?: string;
|
|
522
|
+
/** Attach to an already-running transformed application. */
|
|
523
|
+
readonly url?: string;
|
|
524
|
+
readonly headed?: boolean;
|
|
525
|
+
readonly ifStale?: boolean;
|
|
526
|
+
readonly attempts?: number;
|
|
527
|
+
/** Progress hook fired before each scene capture begins. */
|
|
528
|
+
readonly onSceneStart?: (scene: string, index: number, total: number) => void;
|
|
529
|
+
/** Progress hook fired before a failed scene is retried. */
|
|
530
|
+
readonly onSceneRetry?: (scene: string, attempt: number, total: number, timeoutMs: number, error: unknown) => void;
|
|
531
|
+
}
|
|
532
|
+
interface CaptureSceneResult {
|
|
533
|
+
readonly scene: string;
|
|
534
|
+
readonly attempts: number;
|
|
535
|
+
readonly coverage: ShaderCoverage;
|
|
536
|
+
readonly skipped: number;
|
|
537
|
+
/** Measured registered TSL builds in the live capture. */
|
|
538
|
+
readonly startupBuilds: number;
|
|
539
|
+
/** Measured CPU time spent in those live NodeBuilder calls. */
|
|
540
|
+
readonly startupBuildMs: number;
|
|
541
|
+
readonly timing?: ValidatedShaderCapture['timing'];
|
|
542
|
+
}
|
|
543
|
+
interface ShaderStartupMeasurement {
|
|
544
|
+
readonly beforeBuilds: number;
|
|
545
|
+
readonly afterBuilds: 0;
|
|
546
|
+
/** Negative measured NodeBuilder time removed from the first-frame critical path. */
|
|
547
|
+
readonly firstFrameDeltaMs: number;
|
|
548
|
+
readonly source: 'capture-build-phase';
|
|
549
|
+
}
|
|
550
|
+
interface CaptureShadersResult {
|
|
551
|
+
readonly schemaVersion: 1;
|
|
552
|
+
readonly root: string;
|
|
553
|
+
readonly skipped: boolean;
|
|
554
|
+
readonly reason: string;
|
|
555
|
+
readonly durationMs?: number;
|
|
556
|
+
readonly scenes: readonly CaptureSceneResult[];
|
|
557
|
+
readonly measurement?: ShaderStartupMeasurement;
|
|
558
|
+
readonly configuration?: {
|
|
559
|
+
readonly created: boolean;
|
|
560
|
+
readonly file: string;
|
|
561
|
+
};
|
|
562
|
+
readonly written?: WrittenShaderArtifacts;
|
|
563
|
+
readonly timing?: ShaderTiming;
|
|
564
|
+
}
|
|
565
|
+
/** Run isolated browser captures and checkpoint updates against an existing complete matrix. */
|
|
566
|
+
declare function captureShaders(options?: CaptureShadersOptions): Promise<CaptureShadersResult>;
|
|
567
|
+
interface TestShadersOptions {
|
|
568
|
+
readonly start?: string;
|
|
569
|
+
readonly root?: string;
|
|
570
|
+
readonly config?: ShaderToolConfig;
|
|
571
|
+
readonly driver?: ShaderBrowserDriver;
|
|
572
|
+
readonly driverKind?: 'vite' | 'static';
|
|
573
|
+
readonly serve?: string;
|
|
574
|
+
readonly url?: string;
|
|
575
|
+
readonly headed?: boolean;
|
|
576
|
+
readonly skipBrowser?: boolean;
|
|
577
|
+
/** Measured live/precompiled pairs after one discarded warmup. Defaults to 5. */
|
|
578
|
+
readonly runs?: number;
|
|
579
|
+
/** Run one live/precompiled correctness pair per scene without timing or published-page soak. */
|
|
580
|
+
readonly parityOnly?: boolean;
|
|
581
|
+
/** Also write the opt-in, hardware-labeled committed timing twin. */
|
|
582
|
+
readonly commitTiming?: boolean;
|
|
583
|
+
/** Progress hook fired before each scene observation begins. */
|
|
584
|
+
readonly onSceneStart?: (scene: string, index: number, total: number) => void;
|
|
585
|
+
/** Progress hook fired after a parity-only scene fails and verification continues. */
|
|
586
|
+
readonly onSceneError?: (scene: string, error: unknown) => void;
|
|
587
|
+
}
|
|
588
|
+
interface ShaderSceneTestResult {
|
|
589
|
+
readonly scene: string;
|
|
590
|
+
readonly coverage: ShaderCoverage;
|
|
591
|
+
readonly live: Omit<ShaderBrowserObservation, 'screenshot'>;
|
|
592
|
+
readonly precompiled: Omit<ShaderBrowserObservation, 'screenshot'>;
|
|
593
|
+
readonly published?: Omit<ShaderPublishedObservation, 'beforeScreenshot' | 'screenshot'>;
|
|
594
|
+
readonly parity: Omit<ShaderParityResult, 'diff'>;
|
|
595
|
+
readonly runtimeMotion?: {
|
|
596
|
+
readonly differentPixels: number;
|
|
597
|
+
readonly totalPixels: number;
|
|
598
|
+
readonly diffRatio: number;
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
interface TestShadersResult {
|
|
602
|
+
readonly schemaVersion: 1;
|
|
603
|
+
readonly root: string;
|
|
604
|
+
readonly noGpu: ShaderMatrixStatus;
|
|
605
|
+
readonly browser: 'passed' | 'skipped';
|
|
606
|
+
readonly scenes: readonly ShaderSceneTestResult[];
|
|
607
|
+
readonly timing?: ShaderLocalTiming;
|
|
608
|
+
readonly committedTiming?: ShaderCommittedTiming;
|
|
609
|
+
}
|
|
610
|
+
/** Validate freshness, zero registered builds (render and compute), and deterministic pixels. */
|
|
611
|
+
declare function testShaders(options?: TestShadersOptions): Promise<TestShadersResult>;
|
|
612
|
+
|
|
613
|
+
type ShaderState = 'precompiled' | 'live' | 'stale' | 'invalid' | 'missing';
|
|
614
|
+
type ShaderFreshness = 'fresh' | 'stale' | 'invalid' | 'missing';
|
|
615
|
+
type TextState = 'ready' | 'generating' | 'fallback' | 'missing' | 'invalid';
|
|
616
|
+
type RuntimeState = 'starting' | 'worker ready' | 'assets ready' | 'compiled' | 'first frame' | 'updating' | 'error';
|
|
617
|
+
type RuntimeObservation = RuntimeState;
|
|
618
|
+
type RuntimeBackend = 'OffscreenCanvas' | 'MainThread';
|
|
619
|
+
declare const RUNTIME_STATUS_RECEIPT_PATH = ".three-blocks/runtime/status.json";
|
|
620
|
+
declare const RUNTIME_STATUS_RECEIPT_MAX_BYTES: number;
|
|
621
|
+
declare const RUNTIME_STATUS_RECOVERY = "three-blocks browser smoke";
|
|
622
|
+
interface RuntimeCodecObservation {
|
|
623
|
+
readonly name: string;
|
|
624
|
+
readonly available: boolean;
|
|
625
|
+
readonly decoded: boolean;
|
|
626
|
+
}
|
|
627
|
+
interface RuntimeHmrCapabilities {
|
|
628
|
+
readonly scene: boolean;
|
|
629
|
+
readonly component: boolean;
|
|
630
|
+
readonly assetManifest: boolean;
|
|
631
|
+
readonly workerRestart: boolean;
|
|
632
|
+
}
|
|
633
|
+
interface RuntimeHmrOutcome {
|
|
634
|
+
readonly attempted: boolean;
|
|
635
|
+
readonly succeeded: boolean | null;
|
|
636
|
+
readonly rollbackPreserved: boolean | null;
|
|
637
|
+
readonly workerRestarted: boolean;
|
|
638
|
+
}
|
|
639
|
+
interface RuntimeStatusReceiptV1 {
|
|
640
|
+
readonly schemaVersion: 1;
|
|
641
|
+
readonly observedAt: string;
|
|
642
|
+
readonly worker: {
|
|
643
|
+
readonly backend: RuntimeBackend;
|
|
644
|
+
readonly renderer: 'WebGPU' | 'WebGL';
|
|
645
|
+
readonly protocolVersion: 1;
|
|
646
|
+
};
|
|
647
|
+
readonly assets: {
|
|
648
|
+
readonly codecs: readonly RuntimeCodecObservation[];
|
|
649
|
+
readonly resources: number;
|
|
650
|
+
};
|
|
651
|
+
readonly hmr: {
|
|
652
|
+
readonly capabilities: RuntimeHmrCapabilities;
|
|
653
|
+
readonly outcome: RuntimeHmrOutcome;
|
|
654
|
+
};
|
|
655
|
+
readonly stats: {
|
|
656
|
+
readonly snapshots: number;
|
|
657
|
+
readonly textures: number;
|
|
658
|
+
readonly workerProfiler: boolean;
|
|
659
|
+
readonly mainPanels: boolean;
|
|
660
|
+
};
|
|
661
|
+
readonly lifecycle: {
|
|
662
|
+
readonly state: RuntimeState;
|
|
663
|
+
readonly workerReady: boolean;
|
|
664
|
+
readonly assetsReady: boolean;
|
|
665
|
+
readonly compiled: boolean;
|
|
666
|
+
readonly firstFrame: boolean;
|
|
667
|
+
};
|
|
668
|
+
readonly shaders: {
|
|
669
|
+
readonly mode: 'precompiled' | 'live';
|
|
670
|
+
readonly pipelines: number;
|
|
671
|
+
};
|
|
672
|
+
readonly text?: {
|
|
673
|
+
readonly state: TextState;
|
|
674
|
+
readonly atlases: number;
|
|
675
|
+
readonly glyphs: number;
|
|
676
|
+
readonly requiredGlyphs: number;
|
|
677
|
+
};
|
|
678
|
+
readonly error: string | null;
|
|
679
|
+
}
|
|
680
|
+
interface ShaderStatus {
|
|
681
|
+
readonly state: ShaderFreshness;
|
|
682
|
+
readonly scene: string;
|
|
683
|
+
readonly reason: string;
|
|
684
|
+
readonly coverage?: ShaderCoverage;
|
|
685
|
+
readonly changedInputs?: readonly string[];
|
|
686
|
+
readonly addedInputs?: readonly string[];
|
|
687
|
+
readonly removedInputs?: readonly string[];
|
|
688
|
+
}
|
|
689
|
+
interface TextAtlasStatus {
|
|
690
|
+
readonly name: string;
|
|
691
|
+
readonly glyphs: number;
|
|
692
|
+
readonly width: number;
|
|
693
|
+
readonly height: number;
|
|
694
|
+
}
|
|
695
|
+
interface TextStatus {
|
|
696
|
+
readonly state: TextState;
|
|
697
|
+
readonly reason: string;
|
|
698
|
+
readonly atlases: readonly TextAtlasStatus[];
|
|
699
|
+
}
|
|
700
|
+
interface RuntimeWorkerStatus {
|
|
701
|
+
readonly state: RuntimeState;
|
|
702
|
+
readonly backend: RuntimeStatusReceiptV1['worker']['backend'] | null;
|
|
703
|
+
readonly renderer: RuntimeStatusReceiptV1['worker']['renderer'] | null;
|
|
704
|
+
readonly protocolVersion: 1;
|
|
705
|
+
}
|
|
706
|
+
interface RuntimeAssetsStatus {
|
|
707
|
+
readonly state: RuntimeState;
|
|
708
|
+
readonly codecs: readonly RuntimeCodecObservation[];
|
|
709
|
+
readonly resources: number;
|
|
710
|
+
}
|
|
711
|
+
interface RuntimeHmrStatus {
|
|
712
|
+
readonly state: RuntimeState;
|
|
713
|
+
readonly capabilities: RuntimeHmrCapabilities;
|
|
714
|
+
readonly outcome: RuntimeHmrOutcome;
|
|
715
|
+
}
|
|
716
|
+
interface RuntimeStatsStatus {
|
|
717
|
+
readonly state: RuntimeState;
|
|
718
|
+
readonly snapshots: number;
|
|
719
|
+
readonly textures: number;
|
|
720
|
+
readonly workerProfiler: boolean;
|
|
721
|
+
readonly mainPanels: boolean;
|
|
722
|
+
}
|
|
723
|
+
interface RuntimeOptimizationStatus {
|
|
724
|
+
readonly state: RuntimeState | ShaderState | ShaderFreshness;
|
|
725
|
+
readonly mode: RuntimeStatusReceiptV1['shaders']['mode'] | null;
|
|
726
|
+
readonly pipelines: number;
|
|
727
|
+
readonly artifactState: ShaderFreshness;
|
|
728
|
+
}
|
|
729
|
+
interface RuntimeTextStatus {
|
|
730
|
+
readonly state: RuntimeState | TextState;
|
|
731
|
+
readonly atlases: number;
|
|
732
|
+
readonly glyphs: number;
|
|
733
|
+
readonly requiredGlyphs: number;
|
|
734
|
+
}
|
|
735
|
+
interface ProjectStatus {
|
|
736
|
+
readonly schemaVersion: 1;
|
|
737
|
+
readonly root: string;
|
|
738
|
+
readonly metadata: ProjectMetadataV2;
|
|
739
|
+
readonly configuration: {
|
|
740
|
+
readonly worker: RuntimeWorkerStatus;
|
|
741
|
+
readonly assets: RuntimeAssetsStatus;
|
|
742
|
+
readonly hmr: RuntimeHmrStatus;
|
|
743
|
+
readonly optimization: RuntimeOptimizationStatus;
|
|
744
|
+
readonly stats: RuntimeStatsStatus;
|
|
745
|
+
readonly text?: RuntimeTextStatus;
|
|
746
|
+
};
|
|
747
|
+
readonly runtime: {
|
|
748
|
+
readonly state: RuntimeState;
|
|
749
|
+
readonly observed: boolean;
|
|
750
|
+
readonly observedAt: string | null;
|
|
751
|
+
readonly reason: string;
|
|
752
|
+
readonly recovery: string;
|
|
753
|
+
readonly observation: RuntimeStatusReceiptV1 | null;
|
|
754
|
+
};
|
|
755
|
+
readonly shaders: ShaderStatus;
|
|
756
|
+
readonly text?: TextStatus;
|
|
757
|
+
}
|
|
758
|
+
interface AdoptedProjectStatus {
|
|
759
|
+
readonly schemaVersion: 1;
|
|
760
|
+
readonly root: string;
|
|
761
|
+
readonly kind: 'adopted';
|
|
762
|
+
readonly markers: {
|
|
763
|
+
readonly shaders: boolean;
|
|
764
|
+
readonly text: boolean;
|
|
765
|
+
};
|
|
766
|
+
readonly shaders?: ShaderMatrixStatus;
|
|
767
|
+
readonly text?: TextAtlasInspection;
|
|
768
|
+
}
|
|
769
|
+
type ThreeBlocksStatus = ProjectStatus | AdoptedProjectStatus;
|
|
770
|
+
/** Strict parser for the browser-owned observation receipt consumed by `three-blocks status`. */
|
|
771
|
+
declare function parseRuntimeStatusReceipt(value: unknown): RuntimeStatusReceiptV1;
|
|
772
|
+
declare function findProjectRoot(start?: string): Promise<string>;
|
|
773
|
+
declare function inspectProject(start?: string): Promise<ProjectStatus>;
|
|
774
|
+
/**
|
|
775
|
+
* Inspect metadata-aware projects or compose the public markers independently
|
|
776
|
+
* adopted by any other application. Unknown private metadata never blocks the
|
|
777
|
+
* public shader/text status surface.
|
|
778
|
+
*/
|
|
779
|
+
declare function inspectThreeBlocksStatus(start?: string): Promise<ThreeBlocksStatus>;
|
|
780
|
+
/** Whether `status --check` should accept the composed report. */
|
|
781
|
+
declare function threeBlocksStatusIsFresh(report: ThreeBlocksStatus): boolean;
|
|
782
|
+
/** Shared shaders-status formatter used by both commands. */
|
|
783
|
+
declare function formatShaderMatrixStatus(report: ShaderMatrixStatus): string;
|
|
784
|
+
/**
|
|
785
|
+
* The human status view. Committed artifacts and installed versions are facts;
|
|
786
|
+
* a browser observation is evidence with an age — it is labeled as such instead
|
|
787
|
+
* of rendering unobserved runtime rows as an alarming wall of "starting".
|
|
788
|
+
*/
|
|
789
|
+
declare function formatStatus(report: ProjectStatus, now?: number): string;
|
|
790
|
+
/** Human status output for either starter metadata or independently adopted markers. */
|
|
791
|
+
declare function formatThreeBlocksStatus(report: ThreeBlocksStatus, now?: number): string;
|
|
792
|
+
|
|
793
|
+
type TextUnicodePreset = 'latin' | 'japanese-kana';
|
|
794
|
+
interface TextUnicodeRange {
|
|
795
|
+
readonly start: number;
|
|
796
|
+
readonly end: number;
|
|
797
|
+
}
|
|
798
|
+
interface GlyphSetOptions {
|
|
799
|
+
readonly presets?: readonly TextUnicodePreset[];
|
|
800
|
+
readonly ranges?: readonly TextUnicodeRange[];
|
|
801
|
+
readonly additionalCharacters?: string;
|
|
802
|
+
}
|
|
803
|
+
interface GlyphSet {
|
|
804
|
+
readonly codePoints: readonly number[];
|
|
805
|
+
readonly characters: string;
|
|
806
|
+
readonly hash: string;
|
|
807
|
+
}
|
|
808
|
+
/** Extract only visible text nested under the public `data-canvas-text` marker. */
|
|
809
|
+
declare function extractCanvasTextFromHtml(html: string): readonly string[];
|
|
810
|
+
/** Extract string values only from helpers imported from the public text entrypoint. */
|
|
811
|
+
declare function extractDefinedTextContent(source: string, fileName?: string): readonly string[];
|
|
812
|
+
/** Normalize, deduplicate, and deterministically sort the closed-world glyph set. */
|
|
813
|
+
declare function buildGlyphSet(content: readonly string[], options?: GlyphSetOptions): GlyphSet;
|
|
814
|
+
|
|
815
|
+
interface ToolTextFontSourceBuiltin {
|
|
816
|
+
readonly builtin: string;
|
|
817
|
+
}
|
|
818
|
+
interface ToolTextFontSourcePath {
|
|
819
|
+
readonly path: string;
|
|
820
|
+
}
|
|
821
|
+
interface ToolTextFontSourcePackage {
|
|
822
|
+
readonly package: string;
|
|
823
|
+
readonly file: string;
|
|
824
|
+
readonly checksum: string;
|
|
825
|
+
}
|
|
826
|
+
type ToolTextFontSource = ToolTextFontSourceBuiltin | ToolTextFontSourcePath | ToolTextFontSourcePackage;
|
|
827
|
+
interface ToolTextFontRoute {
|
|
828
|
+
readonly source: ToolTextFontSource;
|
|
829
|
+
readonly browser: string;
|
|
830
|
+
readonly atlas: string;
|
|
831
|
+
readonly metrics: string;
|
|
832
|
+
readonly families: readonly string[];
|
|
833
|
+
readonly languages: readonly string[];
|
|
834
|
+
readonly default: boolean;
|
|
835
|
+
}
|
|
836
|
+
interface ToolTextGenerationOptions extends GlyphSetOptions {
|
|
837
|
+
readonly presets?: readonly TextUnicodePreset[];
|
|
838
|
+
readonly ranges?: readonly TextUnicodeRange[];
|
|
839
|
+
readonly size?: number;
|
|
840
|
+
readonly distanceRange?: number;
|
|
841
|
+
readonly padding?: number;
|
|
842
|
+
readonly maxTextureSize?: number;
|
|
843
|
+
}
|
|
844
|
+
interface ToolTextConfiguration {
|
|
845
|
+
readonly schemaVersion: 1;
|
|
846
|
+
readonly content: readonly string[];
|
|
847
|
+
readonly fonts: Readonly<Record<string, ToolTextFontRoute>>;
|
|
848
|
+
readonly generation: ToolTextGenerationOptions;
|
|
849
|
+
}
|
|
850
|
+
interface DiscoveredTextContent {
|
|
851
|
+
readonly values: readonly string[];
|
|
852
|
+
readonly glyphs: GlyphSet;
|
|
853
|
+
readonly inputs: Readonly<Record<string, string>>;
|
|
854
|
+
}
|
|
855
|
+
/** Parse one statically authored `defineText()` call without executing project code. */
|
|
856
|
+
declare function parseTextConfiguration(source: string, fileName?: string): ToolTextConfiguration;
|
|
857
|
+
declare function readTextConfiguration(root: string, relativePath?: string): Promise<ToolTextConfiguration>;
|
|
858
|
+
/** Read only configured semantic inputs and compute the content-sensitive glyph fingerprint. */
|
|
859
|
+
declare function discoverTextContent(root: string, configuration: ToolTextConfiguration): Promise<DiscoveredTextContent>;
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Ambient Chromium/Three.js diagnostics that do not describe an application failure.
|
|
863
|
+
*
|
|
864
|
+
* Keep this list intentionally small. A new suppression is a public behavior change and
|
|
865
|
+
* should name the upstream diagnostic it is suppressing.
|
|
866
|
+
*/
|
|
867
|
+
declare const DOCUMENTED_BROWSER_NOISE: readonly [{
|
|
868
|
+
readonly id: "three-inspector-invalid-json";
|
|
869
|
+
readonly pattern: RegExp;
|
|
870
|
+
}, {
|
|
871
|
+
readonly id: "chromium-webgpu-experimental";
|
|
872
|
+
readonly pattern: RegExp;
|
|
873
|
+
}];
|
|
874
|
+
declare function isDocumentedBrowserNoise(message: string): boolean;
|
|
875
|
+
/** Chromium launch flags used by public WebGPU browser tools. */
|
|
876
|
+
declare function webgpuBrowserArgs(environment?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): readonly string[];
|
|
877
|
+
/** Lavapipe is most reliable in Chromium's headful mode under Xvfb. */
|
|
878
|
+
declare function webgpuBrowserHeadless(headed?: boolean, environment?: NodeJS.ProcessEnv): boolean;
|
|
879
|
+
|
|
880
|
+
interface BrowserSmokeOptions {
|
|
881
|
+
readonly root: string;
|
|
882
|
+
/** Project URL below Vite's configured base. Defaults to `/`. */
|
|
883
|
+
readonly route?: string;
|
|
884
|
+
readonly timeoutMs?: number;
|
|
885
|
+
readonly settleMs?: number;
|
|
886
|
+
readonly headed?: boolean;
|
|
887
|
+
readonly viewport?: {
|
|
888
|
+
readonly width: number;
|
|
889
|
+
readonly height: number;
|
|
890
|
+
};
|
|
891
|
+
/** Minimum mean center-frame or readable-panel luminance. Defaults to 2. */
|
|
892
|
+
readonly minimumLuminance?: number;
|
|
893
|
+
/** Optional project-relative scene module to invalidate through Vite's real HMR pipeline. */
|
|
894
|
+
readonly hmrModule?: string;
|
|
895
|
+
/** Exercise the worker-owned WebGL fallback by hiding WebGPU before application code runs. */
|
|
896
|
+
readonly forceWebgl?: boolean;
|
|
897
|
+
/** Exercise the visible fatal path by hiding the Worker API before application code runs. */
|
|
898
|
+
readonly unsupportedWorker?: boolean;
|
|
899
|
+
/** Treat a visible, unrecovered text fallback plus one actionable Vite warning as the expected outcome. */
|
|
900
|
+
readonly expectTextGenerationFailure?: boolean;
|
|
901
|
+
}
|
|
902
|
+
interface BrowserSmokeLifecycle {
|
|
903
|
+
readonly source: 'public' | 'legacy' | 'missing';
|
|
904
|
+
readonly backend: 'OffscreenCanvas' | 'MainThread' | 'unknown';
|
|
905
|
+
readonly worker: boolean;
|
|
906
|
+
readonly workerReady: boolean;
|
|
907
|
+
readonly assetsReady: boolean;
|
|
908
|
+
readonly compileEnd: boolean;
|
|
909
|
+
readonly textEnabled: boolean;
|
|
910
|
+
readonly textReady: boolean;
|
|
911
|
+
readonly firstFrame: boolean;
|
|
912
|
+
}
|
|
913
|
+
interface BrowserSmokeCodecRoute {
|
|
914
|
+
readonly route: string;
|
|
915
|
+
readonly bytes: number;
|
|
916
|
+
readonly contentType: string;
|
|
917
|
+
}
|
|
918
|
+
interface BrowserSmokeCodec {
|
|
919
|
+
readonly name: 'draco' | 'ktx2' | 'meshopt';
|
|
920
|
+
readonly state: 'ready' | 'disabled' | 'error';
|
|
921
|
+
readonly routes: readonly BrowserSmokeCodecRoute[];
|
|
922
|
+
readonly decoded: boolean;
|
|
923
|
+
readonly evidence: 'delivery' | 'decoder-ready' | 'text-atlas-decoded' | 'asset-manager-decoded';
|
|
924
|
+
readonly blocker: string | null;
|
|
925
|
+
readonly error: string | null;
|
|
926
|
+
}
|
|
927
|
+
interface BrowserSmokeHmrEvidence {
|
|
928
|
+
readonly sceneIdentityReplaced: boolean;
|
|
929
|
+
readonly stateRestored: boolean;
|
|
930
|
+
readonly assetIdentityPreserved: boolean;
|
|
931
|
+
readonly assetReferencesPreserved: boolean;
|
|
932
|
+
readonly statsIdentityPreserved: boolean;
|
|
933
|
+
readonly statsSequenceAdvanced: boolean;
|
|
934
|
+
readonly shaderInvalidated: boolean;
|
|
935
|
+
readonly rollbackPreserved: boolean;
|
|
936
|
+
}
|
|
937
|
+
interface BrowserSmokeWorkerRestart {
|
|
938
|
+
readonly requested: boolean;
|
|
939
|
+
readonly appIdentityStable: boolean;
|
|
940
|
+
readonly contentIdentityStable: boolean;
|
|
941
|
+
readonly canvasReplaced: boolean;
|
|
942
|
+
readonly workerIdentityChanged: boolean;
|
|
943
|
+
readonly generationAdvanced: boolean;
|
|
944
|
+
readonly restartCountAdvanced: boolean;
|
|
945
|
+
readonly stateReplayed: boolean;
|
|
946
|
+
readonly readinessRestored: boolean;
|
|
947
|
+
readonly shaderModeStable: boolean;
|
|
948
|
+
readonly statsSnapshotsAdvanced: boolean;
|
|
949
|
+
readonly statsTextureTransferred: boolean;
|
|
950
|
+
readonly statsTextureStopped: boolean;
|
|
951
|
+
readonly error: string | null;
|
|
952
|
+
}
|
|
953
|
+
interface BrowserSmokeHmr {
|
|
954
|
+
readonly requested: boolean;
|
|
955
|
+
readonly module: string | null;
|
|
956
|
+
readonly dispatched: boolean;
|
|
957
|
+
readonly acknowledged: boolean;
|
|
958
|
+
readonly lifecycleStable: boolean;
|
|
959
|
+
readonly sourceUnchanged: boolean;
|
|
960
|
+
readonly evidenceSource: 'public-runtime-browser-probe';
|
|
961
|
+
readonly evidence: BrowserSmokeHmrEvidence;
|
|
962
|
+
readonly restart: BrowserSmokeWorkerRestart;
|
|
963
|
+
readonly error: string | null;
|
|
964
|
+
}
|
|
965
|
+
interface BrowserSmokeBuildReceipt {
|
|
966
|
+
readonly schemaVersion: 2;
|
|
967
|
+
readonly renderer: {
|
|
968
|
+
readonly owner: 'worker';
|
|
969
|
+
readonly api: 'WebGPU';
|
|
970
|
+
readonly fallback: 'WebGL';
|
|
971
|
+
};
|
|
972
|
+
readonly assets: {
|
|
973
|
+
readonly draco: 'ready' | 'disabled';
|
|
974
|
+
readonly ktx2: 'ready' | 'disabled';
|
|
975
|
+
readonly meshopt: 'lazy' | 'disabled';
|
|
976
|
+
};
|
|
977
|
+
readonly shaders: {
|
|
978
|
+
readonly state: 'fresh' | 'stale' | 'invalid' | 'missing';
|
|
979
|
+
readonly mode: 'precompiled' | 'live';
|
|
980
|
+
readonly pipelines: number;
|
|
981
|
+
};
|
|
982
|
+
readonly text?: {
|
|
983
|
+
readonly state: 'ready' | 'generating' | 'fallback' | 'missing' | 'invalid';
|
|
984
|
+
readonly atlases: number;
|
|
985
|
+
readonly glyphs: number;
|
|
986
|
+
};
|
|
987
|
+
readonly stats: {
|
|
988
|
+
readonly enabled: boolean;
|
|
989
|
+
readonly production: boolean;
|
|
990
|
+
};
|
|
991
|
+
readonly output: string;
|
|
992
|
+
readonly threeVersion: string;
|
|
993
|
+
}
|
|
994
|
+
interface BrowserSmokeReport {
|
|
995
|
+
readonly schemaVersion: 1;
|
|
996
|
+
readonly command: 'browser smoke';
|
|
997
|
+
readonly passed: boolean;
|
|
998
|
+
readonly scene: string;
|
|
999
|
+
readonly lifecycle: BrowserSmokeLifecycle;
|
|
1000
|
+
readonly renderer: {
|
|
1001
|
+
readonly requested: 'WebGPU-first' | 'WebGL-fallback' | 'unsupported-worker';
|
|
1002
|
+
readonly active: 'WebGPU' | 'WebGL' | 'none' | 'unknown';
|
|
1003
|
+
readonly navigatorGpu: boolean;
|
|
1004
|
+
readonly workerOwned: boolean;
|
|
1005
|
+
readonly fallbackDiagnostic: boolean;
|
|
1006
|
+
};
|
|
1007
|
+
readonly compatibility: {
|
|
1008
|
+
readonly fatalVisible: boolean;
|
|
1009
|
+
readonly code: string | null;
|
|
1010
|
+
readonly detail: string | null;
|
|
1011
|
+
readonly silentMainThreadRenderer: boolean;
|
|
1012
|
+
};
|
|
1013
|
+
readonly receipt: BrowserSmokeBuildReceipt | null;
|
|
1014
|
+
readonly textFallback: {
|
|
1015
|
+
readonly states: readonly string[];
|
|
1016
|
+
readonly fallbackObserved: boolean;
|
|
1017
|
+
readonly recovered: boolean;
|
|
1018
|
+
readonly visibleElements: number;
|
|
1019
|
+
readonly totalElements: number;
|
|
1020
|
+
};
|
|
1021
|
+
readonly warnings: readonly string[];
|
|
1022
|
+
readonly rendering: {
|
|
1023
|
+
readonly luminance: number;
|
|
1024
|
+
readonly panelLuminance: number;
|
|
1025
|
+
readonly threshold: number;
|
|
1026
|
+
readonly blackFrame: boolean;
|
|
1027
|
+
};
|
|
1028
|
+
readonly codecs: readonly BrowserSmokeCodec[];
|
|
1029
|
+
readonly hmr: BrowserSmokeHmr;
|
|
1030
|
+
readonly errors: {
|
|
1031
|
+
readonly console: readonly string[];
|
|
1032
|
+
readonly page: readonly string[];
|
|
1033
|
+
readonly resolved: readonly string[];
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
/** Parse the public smoke bridge, with a bounded compatibility path for the integration lab. */
|
|
1037
|
+
declare function parseBrowserSmokeLifecycle(snapshot: unknown, textEnabled: boolean): BrowserSmokeLifecycle;
|
|
1038
|
+
declare function screenshotLuminance(bytes: Uint8Array): number;
|
|
1039
|
+
/** Boot a project's Vite config and verify its real browser/worker runtime. */
|
|
1040
|
+
declare function runBrowserSmoke(options: BrowserSmokeOptions): Promise<BrowserSmokeReport>;
|
|
1041
|
+
declare function formatBrowserSmokeReport(report: BrowserSmokeReport): string;
|
|
1042
|
+
interface BrowserPreviewOptions {
|
|
1043
|
+
readonly root: string;
|
|
1044
|
+
/** Project URLs below Vite's configured base, all verified against one production build. */
|
|
1045
|
+
readonly routes?: readonly string[];
|
|
1046
|
+
/** Vite mode for the production build; `"strict"` is a common release mode. */
|
|
1047
|
+
readonly buildMode?: string;
|
|
1048
|
+
/** Shader runtime mode every route must report. Defaults to `precompiled`. */
|
|
1049
|
+
readonly expectShaders?: 'precompiled' | 'live';
|
|
1050
|
+
/** Routes must also reach text readiness. */
|
|
1051
|
+
readonly text?: boolean;
|
|
1052
|
+
readonly timeoutMs?: number;
|
|
1053
|
+
readonly settleMs?: number;
|
|
1054
|
+
readonly headed?: boolean;
|
|
1055
|
+
readonly viewport?: {
|
|
1056
|
+
readonly width: number;
|
|
1057
|
+
readonly height: number;
|
|
1058
|
+
};
|
|
1059
|
+
/** Minimum mean center-frame or readable-panel luminance. Defaults to 2. */
|
|
1060
|
+
readonly minimumLuminance?: number;
|
|
1061
|
+
}
|
|
1062
|
+
interface BrowserPreviewRouteReport {
|
|
1063
|
+
readonly route: string;
|
|
1064
|
+
readonly passed: boolean;
|
|
1065
|
+
readonly lifecycle: BrowserSmokeLifecycle;
|
|
1066
|
+
readonly shaderMode: 'precompiled' | 'live' | null;
|
|
1067
|
+
readonly rendering: {
|
|
1068
|
+
readonly luminance: number;
|
|
1069
|
+
readonly panelLuminance: number;
|
|
1070
|
+
readonly threshold: number;
|
|
1071
|
+
readonly blackFrame: boolean;
|
|
1072
|
+
};
|
|
1073
|
+
readonly errors: {
|
|
1074
|
+
readonly console: readonly string[];
|
|
1075
|
+
readonly page: readonly string[];
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
interface BrowserPreviewReport {
|
|
1079
|
+
readonly schemaVersion: 1;
|
|
1080
|
+
readonly command: 'browser preview';
|
|
1081
|
+
readonly passed: boolean;
|
|
1082
|
+
readonly buildMode: string | null;
|
|
1083
|
+
readonly expectShaders: 'precompiled' | 'live';
|
|
1084
|
+
readonly routes: readonly BrowserPreviewRouteReport[];
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Build the project's real production bundle and verify each route against `vite preview`:
|
|
1088
|
+
* worker lifecycle, non-black rendering, the reported shader runtime mode, and an
|
|
1089
|
+
* error-free console. Dev-server smokes never exercise minified worker chunks, so this is
|
|
1090
|
+
* the gate that catches precompiled-shader hydration regressions in shipped output.
|
|
1091
|
+
*/
|
|
1092
|
+
declare function runBrowserPreview(options: BrowserPreviewOptions): Promise<BrowserPreviewReport>;
|
|
1093
|
+
declare function formatBrowserPreviewReport(report: BrowserPreviewReport): string;
|
|
1094
|
+
|
|
1095
|
+
declare const ENVIRONMENT_BAKE_VERSION: 1;
|
|
1096
|
+
interface RoomEnvironmentMetadata {
|
|
1097
|
+
readonly compression: 'zstd' | 'none';
|
|
1098
|
+
readonly cubeSize: number;
|
|
1099
|
+
readonly format: 'RGBA16F CubeUVReflectionMapping';
|
|
1100
|
+
readonly height: number;
|
|
1101
|
+
readonly rawBytes: number;
|
|
1102
|
+
readonly sha256: string;
|
|
1103
|
+
readonly three: string;
|
|
1104
|
+
readonly version: typeof ENVIRONMENT_BAKE_VERSION;
|
|
1105
|
+
readonly width: number;
|
|
1106
|
+
}
|
|
1107
|
+
interface EncodedRoomEnvironment {
|
|
1108
|
+
readonly bytes: Uint8Array;
|
|
1109
|
+
readonly metadata: RoomEnvironmentMetadata;
|
|
1110
|
+
}
|
|
1111
|
+
interface RoomEnvironmentCaptureResult {
|
|
1112
|
+
readonly bytes: Uint8Array;
|
|
1113
|
+
readonly threeRevision: string;
|
|
1114
|
+
}
|
|
1115
|
+
interface RoomEnvironmentCaptureOptions {
|
|
1116
|
+
readonly root: string;
|
|
1117
|
+
readonly size: number;
|
|
1118
|
+
readonly timeoutMs: number;
|
|
1119
|
+
readonly headed: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
type RoomEnvironmentCapture = (options: RoomEnvironmentCaptureOptions) => Promise<RoomEnvironmentCaptureResult>;
|
|
1122
|
+
interface EnvironmentBakeOptions {
|
|
1123
|
+
readonly root: string;
|
|
1124
|
+
readonly size?: number;
|
|
1125
|
+
readonly output?: string;
|
|
1126
|
+
readonly timeoutMs?: number;
|
|
1127
|
+
readonly compression?: 'zstd' | 'none';
|
|
1128
|
+
readonly headed?: boolean;
|
|
1129
|
+
/** Dependency-injection seam for deterministic tests and alternate browser farms. */
|
|
1130
|
+
readonly capture?: RoomEnvironmentCapture;
|
|
1131
|
+
}
|
|
1132
|
+
interface EnvironmentBakeReport {
|
|
1133
|
+
readonly schemaVersion: 1;
|
|
1134
|
+
readonly command: 'environment bake';
|
|
1135
|
+
readonly output: string;
|
|
1136
|
+
readonly metadataOutput: string;
|
|
1137
|
+
readonly bytes: number;
|
|
1138
|
+
readonly metadata: RoomEnvironmentMetadata;
|
|
1139
|
+
}
|
|
1140
|
+
declare function validateEnvironmentCubeSize(value: number): number;
|
|
1141
|
+
/** Deterministically zstd-encode and fully round-trip an exported RGBA16F CubeUV KTX2. */
|
|
1142
|
+
declare function encodeRoomEnvironmentKtx2(rawBytes: Uint8Array, options: {
|
|
1143
|
+
readonly cubeSize: number;
|
|
1144
|
+
readonly threeRevision: string;
|
|
1145
|
+
readonly compression?: 'zstd' | 'none';
|
|
1146
|
+
}): EncodedRoomEnvironment;
|
|
1147
|
+
/** Capture the procedural environment in a real Chromium WebGPU renderer. */
|
|
1148
|
+
declare const captureRoomEnvironment: RoomEnvironmentCapture;
|
|
1149
|
+
/** Render, encode, verify, and atomically commit the public RoomEnvironment artifact pair. */
|
|
1150
|
+
declare function bakeRoomEnvironment(options: EnvironmentBakeOptions): Promise<EnvironmentBakeReport>;
|
|
1151
|
+
declare function formatEnvironmentBakeReport(report: EnvironmentBakeReport): string;
|
|
1152
|
+
|
|
1153
|
+
declare function loadShaderCaptureRuntimeSource(): Promise<string>;
|
|
1154
|
+
|
|
1155
|
+
interface ShaderWatchQueueOptions {
|
|
1156
|
+
readonly capture: () => Promise<void>;
|
|
1157
|
+
readonly debounceMs?: number;
|
|
1158
|
+
readonly onError?: (error: Error) => void;
|
|
1159
|
+
}
|
|
1160
|
+
/** Debounced capture queue with at most one running capture and one queued rerun. */
|
|
1161
|
+
declare class ShaderWatchQueue {
|
|
1162
|
+
#private;
|
|
1163
|
+
constructor(options: ShaderWatchQueueOptions);
|
|
1164
|
+
notify(): void;
|
|
1165
|
+
close(): Promise<void>;
|
|
1166
|
+
}
|
|
1167
|
+
interface WatchShadersOptions extends Omit<CaptureShadersOptions, 'root' | 'ifStale'> {
|
|
1168
|
+
readonly root?: string;
|
|
1169
|
+
readonly debounceMs?: number;
|
|
1170
|
+
readonly signal?: AbortSignal;
|
|
1171
|
+
readonly onResult?: (result: CaptureShadersResult) => void;
|
|
1172
|
+
readonly onError?: (error: Error) => void;
|
|
1173
|
+
readonly initial?: boolean;
|
|
1174
|
+
}
|
|
1175
|
+
interface ShaderWatchSession {
|
|
1176
|
+
readonly root: string;
|
|
1177
|
+
readonly done: Promise<void>;
|
|
1178
|
+
close(): Promise<void>;
|
|
1179
|
+
}
|
|
1180
|
+
/** Opt-in filesystem watch. A failed recapture leaves the prior receipt in place and watching continues. */
|
|
1181
|
+
declare function watchShaders(options?: WatchShadersOptions): Promise<ShaderWatchSession>;
|
|
1182
|
+
|
|
1183
|
+
export { type AdoptedProjectStatus, type ArtifactState, type AttachedPlaywrightShaderDriverOptions, type BrowserPreviewOptions, type BrowserPreviewReport, type BrowserPreviewRouteReport, type BrowserSmokeBuildReceipt, type BrowserSmokeCodec, type BrowserSmokeCodecRoute, type BrowserSmokeHmr, type BrowserSmokeHmrEvidence, type BrowserSmokeLifecycle, type BrowserSmokeOptions, type BrowserSmokeReport, type BrowserSmokeWorkerRestart, type BuiltinFontMetadata, type CaptureSceneResult, type CaptureShadersOptions, type CaptureShadersResult, DOCUMENTED_BROWSER_NOISE, type DiscoveredTextContent, type EncodedRoomEnvironment, type EnsuredShaderToolConfig, type EnvironmentBakeOptions, type EnvironmentBakeReport, type GenerateTextResult, type GeneratedTextAtlas, type GlyphSet, type GlyphSetOptions, type InferredShaderCaptureTarget, type InstalledShaderRuntime, type PlaywrightShaderDriverOptions, type ProjectMetadataV2, type ProjectStatus, RUNTIME_STATUS_RECEIPT_MAX_BYTES, RUNTIME_STATUS_RECEIPT_PATH, RUNTIME_STATUS_RECOVERY, type RoomEnvironmentCapture, type RoomEnvironmentCaptureOptions, type RoomEnvironmentCaptureResult, type RoomEnvironmentMetadata, type RuntimeAssetsStatus, type RuntimeBackend, type RuntimeCodecObservation, type RuntimeHmrCapabilities, type RuntimeHmrOutcome, type RuntimeHmrStatus, type RuntimeObservation, type RuntimeOptimizationStatus, type RuntimeState, type RuntimeStatsStatus, type RuntimeStatusReceiptV1, type RuntimeTextStatus, type RuntimeWorkerStatus, SHADER_ARTIFACT_DIRECTORY, SHADER_COMMITTED_TIMING_FILE, SHADER_DEVTOOLS_VERSION, SHADER_LOCAL_TIMING_FILE, SHADER_PARITY_DIRECTORY, SHADER_PARITY_EVIDENCE_FILE, SHADER_PROVIDER_TRANSFORM_VERSION, SHADER_TOOL_CONFIG_FILE, type ShaderBridgeConfig, type ShaderBrowserDriver, type ShaderBrowserObservation, type ShaderBrowserReadiness, type ShaderCapturePayload, type ShaderCaptureProvenance, type ShaderCaptureStageTiming, type ShaderCaptureStats, type ShaderCommittedTiming, type ShaderCoverage, type ShaderFreshness, type ShaderLocalTiming, type ShaderMatrixState, type ShaderMatrixStatus, type ShaderParityConfig, type ShaderParityEvidence, type ShaderParityResult, type ShaderReadinessConfig, type ShaderReceiptV2, type ShaderSceneArtifactStatus, type ShaderSceneConfig, type ShaderSceneParityEvidence, type ShaderSceneReceipt, type ShaderSceneTestResult, type ShaderSceneTiming, type ShaderScreenshotMetrics, type ShaderSkippedBuild, type ShaderStartupMeasurement, type ShaderState, type ShaderStatus, type ShaderTiming, type ShaderTimingEnvironment, type ShaderToolConfig, ShaderWatchQueue, type ShaderWatchQueueOptions, type ShaderWatchSession, type StaticPlaywrightShaderDriverOptions, TEXT_ATLAS_GENERATOR_VERSION, TEXT_ATLAS_SCHEMA_VERSION, type TestShadersOptions, type TestShadersResult, type TextAtlasFileReceipt, type TextAtlasGenerationReceipt, type TextAtlasInspection, type TextAtlasRuntimeOptions, type TextAtlasStatus, type TextState, type TextStatus, type TextUnicodePreset, type TextUnicodeRange, type ThreeBlocksStatus, type ToolTextConfiguration, type ToolTextFontRoute, type ToolTextFontSource, type ToolTextGenerationOptions, type ValidateShaderCaptureOptions, type ValidatedShaderCapture, type WatchShadersOptions, type WriteShaderArtifactsOptions, type WrittenShaderArtifacts, bakeRoomEnvironment, buildGlyphSet, builtinFontMetadata, captureRoomEnvironment, captureShaders, compareShaderScreenshots, createAttachedPlaywrightShaderDriver, createPlaywrightShaderDriver, createStaticPlaywrightShaderDriver, discoverTextContent, encodeRoomEnvironmentKtx2, ensureShaderToolConfig, extractCanvasTextFromHtml, extractDefinedTextContent, findProjectRoot, findShaderProjectRoot, formatBrowserPreviewReport, formatBrowserSmokeReport, formatEnvironmentBakeReport, formatShaderMatrixStatus, formatStatus, formatThreeBlocksStatus, generateTextAtlases, inferShaderCaptureTarget, inspectProject, inspectShaderMatrix, inspectTextAtlases, inspectThreeBlocksStatus, isDocumentedBrowserNoise, isRetryableShaderObservationNavigation, loadShaderCaptureRuntimeSource, loadShaderToolConfig, parseBrowserSmokeLifecycle, parseProjectMetadata, parseRuntimeStatusReceipt, parseShaderReceipt, parseShaderToolConfig, parseTextAtlasReceipt, parseTextConfiguration, prewarmBuiltinFont, readInstalledShaderRuntime, readShaderCommittedTiming, readShaderLocalTiming, readShaderParityEvidence, readShaderTiming, readTextConfiguration, runBrowserPreview, runBrowserSmoke, screenshotLuminance, serializeShaderManifest, shaderCoverage, shaderScreenshotMetrics, snapshotShaderInputs, stableStringify, testShaders, threeBlocksStatusIsFresh, validateEnvironmentCubeSize, validateShaderCapture, watchShaders, webgpuBrowserArgs, webgpuBrowserHeadless, writeShaderArtifacts, writeShaderLocalTiming, writeShaderParityEvidence, writeShaderTimingTwins };
|