@aura3d/cli 5.0.3 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/aura.exports.json +20 -0
- package/data/root-export-dispositions.json +20 -0
- package/dist/commands/registry.d.ts +1 -0
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +1 -0
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/verify/index.d.ts +2 -0
- package/dist/commands/verify/index.d.ts.map +1 -0
- package/dist/commands/verify/index.js +11 -0
- package/dist/commands/verify/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/look-hdri-check.d.ts +7 -0
- package/dist/look-hdri-check.d.ts.map +1 -0
- package/dist/look-hdri-check.js +88 -0
- package/dist/look-hdri-check.js.map +1 -0
- package/dist/physics-backend-check.d.ts +8 -0
- package/dist/physics-backend-check.d.ts.map +1 -0
- package/dist/physics-backend-check.js +44 -0
- package/dist/physics-backend-check.js.map +1 -0
- package/dist/verify/cdp.d.ts +69 -0
- package/dist/verify/cdp.d.ts.map +1 -0
- package/dist/verify/cdp.js +223 -0
- package/dist/verify/cdp.js.map +1 -0
- package/dist/verify/codes.d.ts +17 -0
- package/dist/verify/codes.d.ts.map +1 -0
- package/dist/verify/codes.js +64 -0
- package/dist/verify/codes.js.map +1 -0
- package/dist/verify/command.d.ts +12 -0
- package/dist/verify/command.d.ts.map +1 -0
- package/dist/verify/command.js +101 -0
- package/dist/verify/command.js.map +1 -0
- package/dist/verify/frame.d.ts +46 -0
- package/dist/verify/frame.d.ts.map +1 -0
- package/dist/verify/frame.js +190 -0
- package/dist/verify/frame.js.map +1 -0
- package/dist/verify/index.d.ts +7 -0
- package/dist/verify/index.d.ts.map +1 -0
- package/dist/verify/index.js +7 -0
- package/dist/verify/index.js.map +1 -0
- package/dist/verify/lint.d.ts +43 -0
- package/dist/verify/lint.d.ts.map +1 -0
- package/dist/verify/lint.js +548 -0
- package/dist/verify/lint.js.map +1 -0
- package/dist/verify/run.d.ts +90 -0
- package/dist/verify/run.d.ts.map +1 -0
- package/dist/verify/run.js +317 -0
- package/dist/verify/run.js.map +1 -0
- package/package.json +6 -6
- package/skills/agent-docs/api-signatures.md +89 -23
- package/skills/agent-docs/recipes.md +94 -1
- package/skills/agent-docs/threejs-to-aura3d.md +7 -5
- package/skills/agent-files/AGENTS.md +1 -1
- package/skills/aura3d-materials-environments/SKILL.md +5 -5
- package/skills/aura3d-materials-environments/references/metal-glass.md +32 -0
- package/skills/aura3d-materials-environments/references/visual-helpers.md +20 -0
- package/skills/aura3d-performance/SKILL.md +5 -0
- package/skills/llms.txt +159 -30
- package/skills/manifest.json +4 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Preset id -> HDRI file stem (mirrors packages/engine/src/agent-api/looks/lookPresets.ts `v0.hdri`; null presets need none). */
|
|
2
|
+
export declare const LOOK_PRESET_HDRI: Readonly<Record<string, string | null>>;
|
|
3
|
+
/** The HDRI stems the project's source asks for: `looks.preset("id")` / `look: "id"` presets and literal `/hdri/<stem>.hdr` urls. */
|
|
4
|
+
export declare function usedLookHdris(projectDir: string): ReadonlyMap<string, string>;
|
|
5
|
+
/** Warnings for every used HDRI that is not under public/hdri (or dist/hdri after a build) or is an LFS pointer. */
|
|
6
|
+
export declare function lookHdriWarnings(projectDir: string, distDir?: string): string[];
|
|
7
|
+
//# sourceMappingURL=look-hdri-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"look-hdri-check.d.ts","sourceRoot":"","sources":["../src/look-hdri-check.ts"],"names":[],"mappings":"AAOA,kIAAkI;AAClI,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAgBpE,CAAC;AAYF,qIAAqI;AACrI,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAe7E;AAYD,oHAAoH;AACpH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,SAAS,GAAG,MAAM,EAAE,CAe/E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Scaffold/deploy-time check for LOOK_HDRI_MISSING: `looks.preset("golden-hour")` (and every other HDRI-backed
|
|
2
|
+
// preset) loads /hdri/<file>.hdr at runtime. When that file is absent from public/hdri (or is an unsmudged git-LFS
|
|
3
|
+
// pointer) the engine now degrades to a procedural probe and logs LOOK_HDRI_MISSING; this check warns before that.
|
|
4
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
5
|
+
import { join, resolve } from "node:path";
|
|
6
|
+
/** Preset id -> HDRI file stem (mirrors packages/engine/src/agent-api/looks/lookPresets.ts `v0.hdri`; null presets need none). */
|
|
7
|
+
export const LOOK_PRESET_HDRI = {
|
|
8
|
+
"outdoor-day": "autumn_field_puresky_1k",
|
|
9
|
+
"golden-hour": "kloppenheim_06_puresky_1k",
|
|
10
|
+
overcast: "autumn_field_puresky_1k",
|
|
11
|
+
"night-city": null,
|
|
12
|
+
"polar-night": null,
|
|
13
|
+
"alpine-snow": "autumn_field_puresky_1k",
|
|
14
|
+
"interior-warm": "studio_small_08_1k",
|
|
15
|
+
"interior-neutral": "studio_small_08_1k",
|
|
16
|
+
"interior-industrial": "studio_small_08_1k",
|
|
17
|
+
space: null,
|
|
18
|
+
underwater: null,
|
|
19
|
+
"product-studio": "studio_small_08_1k",
|
|
20
|
+
"character-showcase": "studio_small_08_1k",
|
|
21
|
+
"arena-fight": "studio_small_08_1k",
|
|
22
|
+
"neon-arcade": null
|
|
23
|
+
};
|
|
24
|
+
function* sourceFiles(dir, depth = 0) {
|
|
25
|
+
if (depth > 6 || !existsSync(dir))
|
|
26
|
+
return;
|
|
27
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
28
|
+
if (entry.name === "node_modules" || entry.name.startsWith("."))
|
|
29
|
+
continue;
|
|
30
|
+
const path = join(dir, entry.name);
|
|
31
|
+
if (entry.isDirectory())
|
|
32
|
+
yield* sourceFiles(path, depth + 1);
|
|
33
|
+
else if (/\.(?:[cm]?[jt]sx?)$/.test(entry.name) && !/\.d\.ts$/.test(entry.name))
|
|
34
|
+
yield path;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** The HDRI stems the project's source asks for: `looks.preset("id")` / `look: "id"` presets and literal `/hdri/<stem>.hdr` urls. */
|
|
38
|
+
export function usedLookHdris(projectDir) {
|
|
39
|
+
const used = new Map();
|
|
40
|
+
for (const file of sourceFiles(join(projectDir, "src"))) {
|
|
41
|
+
let text;
|
|
42
|
+
try {
|
|
43
|
+
text = readFileSync(file, "utf8");
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const label = file.slice(projectDir.length + 1);
|
|
49
|
+
for (const match of text.matchAll(/looks\.(?:preset|describe|resolve)\(\s*["'`]([a-z0-9-]+)["'`]|\blook\s*:\s*["'`]([a-z0-9-]+)["'`]/g)) {
|
|
50
|
+
const stem = LOOK_PRESET_HDRI[match[1] ?? match[2] ?? ""];
|
|
51
|
+
if (stem && !used.has(stem))
|
|
52
|
+
used.set(stem, `looks.preset("${match[1] ?? match[2]}") in ${label}`);
|
|
53
|
+
}
|
|
54
|
+
for (const match of text.matchAll(/["'`]\/hdri\/([A-Za-z0-9_.-]+?)\.hdr["'`]/g)) {
|
|
55
|
+
if (!used.has(match[1]))
|
|
56
|
+
used.set(match[1], `"/hdri/${match[1]}.hdr" in ${label}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return used;
|
|
60
|
+
}
|
|
61
|
+
function isUsableHdr(path) {
|
|
62
|
+
if (!existsSync(path))
|
|
63
|
+
return false;
|
|
64
|
+
const size = statSync(path).size;
|
|
65
|
+
if (size < 1024) {
|
|
66
|
+
const head = readFileSync(path, "utf8").slice(0, 64);
|
|
67
|
+
if (head.startsWith("version https://git-lfs") || !head.startsWith("#?"))
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
/** Warnings for every used HDRI that is not under public/hdri (or dist/hdri after a build) or is an LFS pointer. */
|
|
73
|
+
export function lookHdriWarnings(projectDir, distDir = "dist") {
|
|
74
|
+
const root = resolve(projectDir);
|
|
75
|
+
const warnings = [];
|
|
76
|
+
for (const [stem, where] of usedLookHdris(root)) {
|
|
77
|
+
const file = `${stem}.hdr`;
|
|
78
|
+
const inPublic = isUsableHdr(join(root, "public", "hdri", file));
|
|
79
|
+
const inDist = isUsableHdr(join(root, distDir, "hdri", file));
|
|
80
|
+
if (inPublic || inDist)
|
|
81
|
+
continue;
|
|
82
|
+
warnings.push(`LOOK_HDRI_MISSING: ${where} loads /hdri/${file}, but public/hdri/${file} is missing or a git-LFS pointer. ` +
|
|
83
|
+
`At runtime the engine falls back to a procedural probe (lighting will differ) and logs LOOK_HDRI_MISSING. ` +
|
|
84
|
+
`Fix: copy fixtures/environment-corpus/hdri/${file} into public/hdri/ (scaffolded templates ship it) and run \`git lfs pull\`.`);
|
|
85
|
+
}
|
|
86
|
+
return warnings;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=look-hdri-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"look-hdri-check.js","sourceRoot":"","sources":["../src/look-hdri-check.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,mHAAmH;AACnH,mHAAmH;AAEnH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,kIAAkI;AAClI,MAAM,CAAC,MAAM,gBAAgB,GAA4C;IACvE,aAAa,EAAE,yBAAyB;IACxC,aAAa,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SING runtime error: a project whose sources call `.physics(...)`,
|
|
4
|
+
* `app.physics` or `PhysicsWorld` must be able to resolve the Rapier backend. Returns one failure line (with the exact
|
|
5
|
+
* install command) or an empty list.
|
|
6
|
+
*/
|
|
7
|
+
export declare function physicsBackendFailures(projectDir: string): string[];
|
|
8
|
+
//# sourceMappingURL=physics-backend-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physics-backend-check.d.ts","sourceRoot":"","sources":["../src/physics-backend-check.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,+BAA+B,iDAAkC,CAAC;AAe/E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAcnE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
const BACKEND = "@dimforge/rapier3d-compat";
|
|
5
|
+
export const PHYSICS_BACKEND_INSTALL_COMMAND = `npm install ${BACKEND}@0.20.0`;
|
|
6
|
+
const PHYSICS_USE = /\.physics\s*\(|\bapp\.physics\b|\bpreloadPhysics\b|\bPhysicsWorld\b|\bphysics\s*:\s*\{/u;
|
|
7
|
+
function sourceFiles(directory, depth = 0, found = []) {
|
|
8
|
+
if (depth > 6 || found.length > 400 || !existsSync(directory))
|
|
9
|
+
return found;
|
|
10
|
+
for (const name of readdirSync(directory)) {
|
|
11
|
+
if (name === "node_modules" || name === "dist" || name.startsWith("."))
|
|
12
|
+
continue;
|
|
13
|
+
const path = join(directory, name);
|
|
14
|
+
const stats = statSync(path);
|
|
15
|
+
if (stats.isDirectory())
|
|
16
|
+
sourceFiles(path, depth + 1, found);
|
|
17
|
+
else if (/\.(?:ts|tsx|mts|js|jsx|mjs)$/u.test(name) && !name.endsWith(".d.ts") && stats.size < 512 * 1024)
|
|
18
|
+
found.push(path);
|
|
19
|
+
}
|
|
20
|
+
return found;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Lint-time signal for the typed PHYSICS_BACKEND_MISSING runtime error: a project whose sources call `.physics(...)`,
|
|
24
|
+
* `app.physics` or `PhysicsWorld` must be able to resolve the Rapier backend. Returns one failure line (with the exact
|
|
25
|
+
* install command) or an empty list.
|
|
26
|
+
*/
|
|
27
|
+
export function physicsBackendFailures(projectDir) {
|
|
28
|
+
const root = resolve(projectDir);
|
|
29
|
+
const used = sourceFiles(join(root, "src")).filter((file) => PHYSICS_USE.test(readFileSync(file, "utf8")));
|
|
30
|
+
if (used.length === 0)
|
|
31
|
+
return [];
|
|
32
|
+
let resolvable = false;
|
|
33
|
+
try {
|
|
34
|
+
createRequire(join(root, "package.json")).resolve(`${BACKEND}/package.json`);
|
|
35
|
+
resolvable = true;
|
|
36
|
+
}
|
|
37
|
+
catch { /* not installed */ }
|
|
38
|
+
if (!resolvable) {
|
|
39
|
+
// Some package exports maps hide package.json; fall back to the installed directory.
|
|
40
|
+
resolvable = existsSync(join(root, "node_modules", BACKEND, "package.json"));
|
|
41
|
+
}
|
|
42
|
+
return resolvable ? [] : [`PHYSICS_BACKEND_MISSING: ${used.length} source file(s) use Aura3D physics (first: ${used[0].slice(root.length + 1)}) but ${BACKEND} is not installed. Run: ${PHYSICS_BACKEND_INSTALL_COMMAND}`];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=physics-backend-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physics-backend-check.js","sourceRoot":"","sources":["../src/physics-backend-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,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I,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3G,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,OAAO,eAAe,CAAC,CAAC;QAC7E,UAAU,GAAG,IAAI,CAAC;IACpB,CAAC;IAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC/B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,qFAAqF;QACrF,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,4BAA4B,IAAI,CAAC,MAAM,8CAA8C,IAAI,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,SAAS,OAAO,2BAA2B,+BAA+B,EAAE,CAAC,CAAC;AAC9N,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface RenderCaptureOptions {
|
|
2
|
+
readonly width: number;
|
|
3
|
+
readonly height: number;
|
|
4
|
+
/** Quiet time after the app reports ready, before the first frame. */
|
|
5
|
+
readonly settleMs: number;
|
|
6
|
+
/** Time between the two frames used by the motion check. */
|
|
7
|
+
readonly motionGapMs: number;
|
|
8
|
+
/** Navigation budget. */
|
|
9
|
+
readonly timeoutMs: number;
|
|
10
|
+
/** How long to wait for `data-aura3d-ready` after load. */
|
|
11
|
+
readonly readyTimeoutMs: number;
|
|
12
|
+
}
|
|
13
|
+
export interface RenderCapture {
|
|
14
|
+
readonly status: number | null;
|
|
15
|
+
readonly consoleMessages: readonly {
|
|
16
|
+
readonly level: string;
|
|
17
|
+
readonly text: string;
|
|
18
|
+
}[];
|
|
19
|
+
readonly pageErrors: readonly string[];
|
|
20
|
+
readonly failedRequests: readonly string[];
|
|
21
|
+
readonly badResponses: readonly string[];
|
|
22
|
+
readonly appState: {
|
|
23
|
+
/** document.body.dataset.aura3dReady: "true", "error" or absent. */
|
|
24
|
+
readonly ready?: string;
|
|
25
|
+
readonly error?: string;
|
|
26
|
+
/** Page-level facts that explain a blank frame (tab visibility, canvas count and size, body data attributes). */
|
|
27
|
+
readonly page?: {
|
|
28
|
+
readonly visibility?: string;
|
|
29
|
+
readonly canvases?: number;
|
|
30
|
+
readonly canvasSize?: string;
|
|
31
|
+
readonly bodyData?: Readonly<Record<string, string>>;
|
|
32
|
+
};
|
|
33
|
+
readonly routeReady?: {
|
|
34
|
+
readonly status?: string;
|
|
35
|
+
readonly diagnostics?: {
|
|
36
|
+
readonly degradations?: readonly {
|
|
37
|
+
readonly code: string;
|
|
38
|
+
readonly message: string;
|
|
39
|
+
readonly nodeId?: string;
|
|
40
|
+
}[];
|
|
41
|
+
readonly warnings?: readonly string[];
|
|
42
|
+
readonly errors?: readonly string[];
|
|
43
|
+
readonly backend?: string;
|
|
44
|
+
readonly drawCalls?: number;
|
|
45
|
+
};
|
|
46
|
+
} | null;
|
|
47
|
+
};
|
|
48
|
+
/** PNG frames: [first, second]. */
|
|
49
|
+
readonly frames: readonly Buffer[];
|
|
50
|
+
readonly driver: string;
|
|
51
|
+
}
|
|
52
|
+
export interface VerifyBrowserDriver {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
capture(url: string, options: RenderCaptureOptions): Promise<RenderCapture>;
|
|
55
|
+
close(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export declare class BrowserUnavailableError extends Error {
|
|
58
|
+
constructor(message: string);
|
|
59
|
+
}
|
|
60
|
+
export declare function findChrome(explicit?: string): string | undefined;
|
|
61
|
+
export interface ChromeDriverOptions {
|
|
62
|
+
readonly chromePath?: string;
|
|
63
|
+
/** Force software GL (SwiftShader). Default: the machine's GPU. */
|
|
64
|
+
readonly softwareGl?: boolean;
|
|
65
|
+
readonly extraArgs?: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
/** Launch Chrome headless on an ephemeral loopback debugging port and drive one page per `capture`. */
|
|
68
|
+
export declare function createChromeCdpDriver(options?: ChromeDriverOptions): VerifyBrowserDriver;
|
|
69
|
+
//# sourceMappingURL=cdp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../../src/verify/cdp.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,yBAAyB;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE;QACjB,oEAAoE;QACpE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAA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AO,CAAC,aAAa,CAAC,CAAC;IAC5E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAC5B;AAQD,wBAAgB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUhE;AA0CD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED,uGAAuG;AACvG,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,mBAAwB,GAAG,mBAAmB,CAiH5F"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
// Default render driver for `aura3d verify`: a locally installed Chrome driven over the DevTools protocol on a loopback socket.
|
|
2
|
+
// No Playwright, no download, no remote service. The protocol client is ~60 lines on Node's global WebSocket.
|
|
3
|
+
// The driver is pluggable: anything that implements `VerifyBrowserDriver` can replace it (tests inject a mock).
|
|
4
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
5
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
export class BrowserUnavailableError extends Error {
|
|
9
|
+
constructor(message) { super(message); this.name = "BrowserUnavailableError"; }
|
|
10
|
+
}
|
|
11
|
+
const CHROME_CANDIDATES = [
|
|
12
|
+
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
13
|
+
"/Applications/Chromium.app/Contents/MacOS/Chromium",
|
|
14
|
+
"/usr/bin/google-chrome", "/usr/bin/google-chrome-stable", "/usr/bin/chromium", "/usr/bin/chromium-browser"
|
|
15
|
+
];
|
|
16
|
+
export function findChrome(explicit) {
|
|
17
|
+
const fromEnv = explicit ?? process.env.AURA3D_CHROME ?? process.env.CHROME_PATH;
|
|
18
|
+
if (fromEnv)
|
|
19
|
+
return existsSync(fromEnv) ? fromEnv : undefined;
|
|
20
|
+
const found = CHROME_CANDIDATES.find((candidate) => existsSync(candidate));
|
|
21
|
+
if (found)
|
|
22
|
+
return found;
|
|
23
|
+
for (const name of ["google-chrome", "chromium", "chrome"]) {
|
|
24
|
+
const which = spawnSync("which", [name], { encoding: "utf8" });
|
|
25
|
+
if (which.status === 0 && which.stdout.trim())
|
|
26
|
+
return which.stdout.trim();
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
class CdpConnection {
|
|
31
|
+
socket;
|
|
32
|
+
nextId = 1;
|
|
33
|
+
pending = new Map();
|
|
34
|
+
listeners = new Map();
|
|
35
|
+
constructor(socket) {
|
|
36
|
+
this.socket = socket;
|
|
37
|
+
socket.addEventListener("message", (event) => {
|
|
38
|
+
const message = JSON.parse(String(event.data));
|
|
39
|
+
if (message.id !== undefined) {
|
|
40
|
+
const waiter = this.pending.get(message.id);
|
|
41
|
+
if (!waiter)
|
|
42
|
+
return;
|
|
43
|
+
this.pending.delete(message.id);
|
|
44
|
+
if (message.error)
|
|
45
|
+
waiter.reject(new Error(message.error.message));
|
|
46
|
+
else
|
|
47
|
+
waiter.resolve(message.result ?? {});
|
|
48
|
+
}
|
|
49
|
+
else if (message.method) {
|
|
50
|
+
for (const listener of this.listeners.get(message.method) ?? [])
|
|
51
|
+
listener(message.params ?? {}, message.sessionId);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
socket.addEventListener("close", () => { for (const waiter of this.pending.values())
|
|
55
|
+
waiter.reject(new Error("DevTools connection closed")); this.pending.clear(); });
|
|
56
|
+
}
|
|
57
|
+
static connect(url) {
|
|
58
|
+
return new Promise((resolve, reject) => {
|
|
59
|
+
const socket = new WebSocket(url);
|
|
60
|
+
socket.addEventListener("open", () => resolve(new CdpConnection(socket)), { once: true });
|
|
61
|
+
socket.addEventListener("error", () => reject(new Error(`could not open DevTools socket ${url}`)), { once: true });
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
send(method, params = {}, sessionId) {
|
|
65
|
+
const id = this.nextId++;
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
this.pending.set(id, { resolve, reject });
|
|
68
|
+
this.socket.send(JSON.stringify({ id, method, params, ...(sessionId ? { sessionId } : {}) }));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
on(method, listener) { this.listeners.set(method, [...(this.listeners.get(method) ?? []), listener]); }
|
|
72
|
+
close() { try {
|
|
73
|
+
this.socket.close();
|
|
74
|
+
}
|
|
75
|
+
catch { /* already closed */ } }
|
|
76
|
+
}
|
|
77
|
+
const sleep = (ms) => new Promise((done) => setTimeout(done, ms));
|
|
78
|
+
/** Launch Chrome headless on an ephemeral loopback debugging port and drive one page per `capture`. */
|
|
79
|
+
export function createChromeCdpDriver(options = {}) {
|
|
80
|
+
let chrome;
|
|
81
|
+
let profileDir;
|
|
82
|
+
let connection;
|
|
83
|
+
async function launch() {
|
|
84
|
+
if (connection)
|
|
85
|
+
return connection;
|
|
86
|
+
const executable = findChrome(options.chromePath);
|
|
87
|
+
if (!executable)
|
|
88
|
+
throw new BrowserUnavailableError("No Chrome found. Pass --chrome <path> or set AURA3D_CHROME.");
|
|
89
|
+
profileDir = mkdtempSync(join(tmpdir(), "aura3d-verify-chrome-"));
|
|
90
|
+
const args = [
|
|
91
|
+
"--headless=new", "--remote-debugging-port=0", "--remote-debugging-address=127.0.0.1", `--user-data-dir=${profileDir}`,
|
|
92
|
+
"--no-first-run", "--no-default-browser-check", "--disable-extensions", "--disable-background-timer-throttling", "--disable-renderer-backgrounding",
|
|
93
|
+
"--ignore-gpu-blocklist", "--hide-scrollbars", "--mute-audio",
|
|
94
|
+
...(options.softwareGl ? ["--use-angle=swiftshader", "--enable-unsafe-swiftshader"] : []),
|
|
95
|
+
...(options.extraArgs ?? []), "about:blank"
|
|
96
|
+
];
|
|
97
|
+
chrome = spawn(executable, args, { stdio: "ignore" });
|
|
98
|
+
const portFile = join(profileDir, "DevToolsActivePort");
|
|
99
|
+
const deadline = Date.now() + 20_000;
|
|
100
|
+
while (!existsSync(portFile)) {
|
|
101
|
+
if (chrome.exitCode !== null)
|
|
102
|
+
throw new BrowserUnavailableError(`Chrome exited early (code ${chrome.exitCode}).`);
|
|
103
|
+
if (Date.now() > deadline)
|
|
104
|
+
throw new BrowserUnavailableError("Chrome did not open a DevTools port within 20s.");
|
|
105
|
+
await sleep(100);
|
|
106
|
+
}
|
|
107
|
+
await sleep(100);
|
|
108
|
+
const [port, path] = readFileSync(portFile, "utf8").trim().split("\n");
|
|
109
|
+
connection = await CdpConnection.connect(`ws://127.0.0.1:${port}${path}`);
|
|
110
|
+
return connection;
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
name: "chrome-cdp",
|
|
114
|
+
async capture(url, o) {
|
|
115
|
+
const cdp = await launch();
|
|
116
|
+
const { targetId } = (await cdp.send("Target.createTarget", { url: "about:blank" }));
|
|
117
|
+
const { sessionId } = (await cdp.send("Target.attachToTarget", { targetId, flatten: true }));
|
|
118
|
+
const send = (method, params = {}) => cdp.send(method, params, sessionId);
|
|
119
|
+
const consoleMessages = [];
|
|
120
|
+
const pageErrors = [];
|
|
121
|
+
const failedRequests = [];
|
|
122
|
+
const badResponses = [];
|
|
123
|
+
const documentRequests = new Set();
|
|
124
|
+
let status = null;
|
|
125
|
+
let loaded = false;
|
|
126
|
+
const mine = (id) => id === sessionId;
|
|
127
|
+
const pathOf = (value) => { try {
|
|
128
|
+
return new URL(value).pathname;
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return value.slice(0, 120);
|
|
132
|
+
} };
|
|
133
|
+
cdp.on("Runtime.consoleAPICalled", (p, id) => {
|
|
134
|
+
if (!mine(id))
|
|
135
|
+
return;
|
|
136
|
+
const type = String(p.type);
|
|
137
|
+
const args = p.args ?? [];
|
|
138
|
+
const text = args.map((a) => (a.value !== undefined ? String(a.value) : a.description ?? "")).join(" ").slice(0, 600);
|
|
139
|
+
consoleMessages.push({ level: type === "warning" ? "warning" : type, text });
|
|
140
|
+
});
|
|
141
|
+
cdp.on("Runtime.exceptionThrown", (p, id) => {
|
|
142
|
+
if (!mine(id))
|
|
143
|
+
return;
|
|
144
|
+
const d = (p.exceptionDetails ?? {});
|
|
145
|
+
pageErrors.push(String(d.exception?.description ?? d.text ?? "exception").split("\n").slice(0, 3).join(" | ").slice(0, 600));
|
|
146
|
+
});
|
|
147
|
+
cdp.on("Log.entryAdded", (p, id) => {
|
|
148
|
+
if (!mine(id))
|
|
149
|
+
return;
|
|
150
|
+
const entry = (p.entry ?? {});
|
|
151
|
+
if (entry.level === "error" && entry.text)
|
|
152
|
+
consoleMessages.push({ level: "error", text: `${entry.text}${entry.url ? ` (${pathOf(entry.url)})` : ""}`.slice(0, 600) });
|
|
153
|
+
});
|
|
154
|
+
cdp.on("Network.responseReceived", (p, id) => {
|
|
155
|
+
if (!mine(id))
|
|
156
|
+
return;
|
|
157
|
+
const response = (p.response ?? {});
|
|
158
|
+
if (p.type === "Document" && status === null)
|
|
159
|
+
status = response.status ?? null;
|
|
160
|
+
if ((response.status ?? 0) >= 400)
|
|
161
|
+
badResponses.push(`${response.status} ${pathOf(response.url ?? "")}`);
|
|
162
|
+
});
|
|
163
|
+
cdp.on("Network.requestWillBeSent", (p, id) => { if (mine(id) && p.type === "Document")
|
|
164
|
+
documentRequests.add(String(p.requestId)); });
|
|
165
|
+
cdp.on("Network.loadingFailed", (p, id) => {
|
|
166
|
+
if (!mine(id) || p.canceled)
|
|
167
|
+
return;
|
|
168
|
+
failedRequests.push(`${p.requestId} (${String(p.errorText ?? "failed")})`);
|
|
169
|
+
});
|
|
170
|
+
cdp.on("Page.loadEventFired", (_p, id) => { if (mine(id))
|
|
171
|
+
loaded = true; });
|
|
172
|
+
try {
|
|
173
|
+
await send("Page.enable");
|
|
174
|
+
await send("Runtime.enable");
|
|
175
|
+
await send("Log.enable");
|
|
176
|
+
await send("Network.enable");
|
|
177
|
+
await send("Emulation.setDeviceMetricsOverride", { width: o.width, height: o.height, deviceScaleFactor: 1, mobile: false });
|
|
178
|
+
await send("Emulation.setFocusEmulationEnabled", { enabled: true }).catch(() => undefined);
|
|
179
|
+
const nav = (await send("Page.navigate", { url }));
|
|
180
|
+
if (nav.errorText)
|
|
181
|
+
throw new Error(`navigation failed: ${nav.errorText}`);
|
|
182
|
+
const deadline = Date.now() + o.timeoutMs;
|
|
183
|
+
while (!loaded && Date.now() < deadline)
|
|
184
|
+
await sleep(50);
|
|
185
|
+
const readyDeadline = Date.now() + o.readyTimeoutMs;
|
|
186
|
+
const stateExpr = `(() => { const b = document.body; const r = window.__AURA3D_ROUTE_READY__; return JSON.stringify({ ready: b && b.dataset ? b.dataset.aura3dReady : undefined, error: b && b.dataset ? b.dataset.aura3dError : undefined, page: { visibility: document.visibilityState, canvases: document.querySelectorAll('canvas').length, canvasSize: (document.querySelector('canvas') || {}).width + 'x' + (document.querySelector('canvas') || {}).height, bodyData: b ? Object.assign({}, b.dataset) : {} }, routeReady: r ? { status: r.status, diagnostics: r.diagnostics ? { degradations: (r.diagnostics.degradations || []).slice(0, 40).map(function (d) { return { code: d.code, message: String(d.message).slice(0, 400), nodeId: d.nodeId }; }), warnings: r.diagnostics.warnings, errors: r.diagnostics.errors, backend: r.diagnostics.backend, drawCalls: r.diagnostics.drawCalls } : undefined } : null }); })()`;
|
|
187
|
+
const readState = async () => {
|
|
188
|
+
const result = (await send("Runtime.evaluate", { expression: stateExpr, returnByValue: true }));
|
|
189
|
+
return JSON.parse(result.result?.value ?? "{}");
|
|
190
|
+
};
|
|
191
|
+
let state = await readState();
|
|
192
|
+
while (state.ready === undefined && Date.now() < readyDeadline) {
|
|
193
|
+
await sleep(250);
|
|
194
|
+
state = await readState();
|
|
195
|
+
}
|
|
196
|
+
await sleep(o.settleMs);
|
|
197
|
+
const shot = async () => Buffer.from((await send("Page.captureScreenshot", { format: "png" })).data, "base64");
|
|
198
|
+
const first = await shot();
|
|
199
|
+
await sleep(o.motionGapMs);
|
|
200
|
+
const second = await shot();
|
|
201
|
+
state = await readState();
|
|
202
|
+
return { status, consoleMessages, pageErrors, failedRequests: failedRequests.map((f) => f), badResponses, appState: state, frames: [first, second], driver: "chrome-cdp" };
|
|
203
|
+
}
|
|
204
|
+
finally {
|
|
205
|
+
await cdp.send("Target.closeTarget", { targetId }).catch(() => undefined);
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
async close() {
|
|
209
|
+
connection?.close();
|
|
210
|
+
connection = undefined;
|
|
211
|
+
if (chrome && chrome.exitCode === null)
|
|
212
|
+
chrome.kill("SIGTERM");
|
|
213
|
+
await sleep(150);
|
|
214
|
+
if (chrome && chrome.exitCode === null)
|
|
215
|
+
chrome.kill("SIGKILL");
|
|
216
|
+
if (profileDir)
|
|
217
|
+
rmSync(profileDir, { recursive: true, force: true });
|
|
218
|
+
chrome = undefined;
|
|
219
|
+
profileDir = undefined;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=cdp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdp.js","sourceRoot":"","sources":["../../src/verify/cdp.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAChI,8GAA8G;AAC9G,gHAAgH;AAChH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAqB,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAwCjC,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe,IAAI,KAAK,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oBAAS,CAAC;gBACT,MAAM,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;QACD,KAAK,CAAC,KAAK;YACT,UAAU,EAAE,KAAK,EAAE,CAAC;YACpB,UAAU,GAAG,SAAS,CAAC;YACvB,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;gBAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC/D,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YACjB,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;gBAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC/D,IAAI,UAAU;gBAAE,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrE,MAAM,GAAG,SAAS,CAAC;YAAC,UAAU,GAAG,SAAS,CAAC;QAC7C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type VerifySeverity = "error" | "warning" | "info";
|
|
2
|
+
export type VerifyStepId = "typecheck" | "assets" | "lint" | "build" | "serve" | "render" | "inspect" | "verify";
|
|
3
|
+
export interface VerifyCodeEntry {
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly severity: VerifySeverity;
|
|
6
|
+
readonly step: VerifyStepId;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
/** Plain-English cause. */
|
|
9
|
+
readonly cause: string;
|
|
10
|
+
/** Concrete fix hint an agent can act on. */
|
|
11
|
+
readonly fix: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const VERIFY_CODE_TABLE: readonly VerifyCodeEntry[];
|
|
14
|
+
/** Look up a code. `X_DEGRADED` codes without their own row resolve to RENDER_DEGRADED. Case-insensitive. */
|
|
15
|
+
export declare function explainCode(code: string): VerifyCodeEntry | undefined;
|
|
16
|
+
export declare function formatExplanation(item: VerifyCodeEntry): string;
|
|
17
|
+
//# sourceMappingURL=codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/verify/codes.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEjH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAID,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EA0CvD,CAAC;AAIF,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CASrE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAE/D"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Error-code explainer for `aura3d verify`. One table, keyed by stable code: severity, the step that raises it, a plain-English
|
|
2
|
+
// cause and a concrete fix hint. `aura3d verify --explain <code>` prints an entry; a future MCP server can serve the same table.
|
|
3
|
+
// Codes are append-only: never rename or reuse one, because agents key their repair logic on them.
|
|
4
|
+
const entry = (code, severity, step, title, cause, fix) => ({ code, severity, step, title, cause, fix });
|
|
5
|
+
export const VERIFY_CODE_TABLE = [
|
|
6
|
+
entry("VERIFY_STEP_CRASHED", "error", "verify", "A verify step threw", "The step itself failed unexpectedly (not a finding about your project).", "Re-run with --only <step> to isolate it; if it repeats, report the message field."),
|
|
7
|
+
entry("TYPECHECK_ERROR", "error", "typecheck", "TypeScript error", "tsc rejected the project; the message carries the TS code and text.", "Fix the reported line. For an unknown @aura3d/engine export, `rg` the export in docs/agents/api-surface.md instead of guessing a name."),
|
|
8
|
+
entry("TYPECHECK_UNAVAILABLE", "warning", "typecheck", "Typecheck skipped", "No tsconfig.json or no TypeScript compiler could be resolved for this project.", "Add a tsconfig.json (strict, moduleResolution bundler) and `npm i -D typescript`."),
|
|
9
|
+
entry("ASSET_VALIDATION_FAILED", "error", "assets", "Asset manifest check failed", "`assets validate` rejected aura.assets.json or a referenced file (missing file, hash drift, licence or provenance gap).", "Run `aura3d assets validate --source` for the full list, then re-add the asset with `aura3d assets add` or `assets resolve` instead of editing the manifest by hand."),
|
|
10
|
+
entry("ASSET_VALIDATION_WARNING", "warning", "assets", "Asset manifest warning", "`assets validate` accepted the manifest but flagged something worth fixing.", "Read the message; fix it before a release gate (`assets validate --release`)."),
|
|
11
|
+
entry("ASSET_PATH_INVENTED", "error", "assets", "Model path is not a typed asset", "A model is referenced by a string path instead of a typed `assets.<key>`, so nothing proved the file exists, is licensed or has bounds. Invented paths load as 404s and draw nothing.", "Run `aura3d assets resolve \"<object>\" --name <name>` (or `assets add ./file.glb --name <name>`), then use `model(assets.<name>)` from src/aura-assets.ts."),
|
|
12
|
+
entry("ASSET_KEY_UNKNOWN", "error", "assets", "assets.<key> is not defined", "The code reads `assets.<key>` but src/aura-assets.ts defines no such key.", "Use a key listed in src/aura-assets.ts, or add the asset first with `aura3d assets add`."),
|
|
13
|
+
entry("LINT_SHADOW_NO_RECEIVER", "warning", "lint", "Light has shadow on, nothing receives shadows", "A light sets `shadow`, but every surface node in the project is a receiver-off node: `receiveShadow: false`, or a `material.custom` without `receiveShadow: true` (custom materials do not receive by default). The shadow pass runs and no shadow is ever visible.", "Add `receiveShadow: true` to the ground or surface that should show the shadow (or `receiveShadow: true` inside the `material.custom` spec and multiply your lit term by `a3dSunShadowAuto(worldPos, normal)`), and keep `castShadow` on the objects that cast. Remove `shadow` from the light if you do not want shadows."),
|
|
14
|
+
entry("LINT_SKY_HIDES_BACKGROUND", "info", "lint", "Sky node covers the scene background", "The scene sets a background colour and also adds a sky (`sky.*`). The sky draws over the clear colour, so the background you set is never seen (it still seeds fog and fallback colour). The canonical recipes do this on purpose, so it is informational.", "If you expected the background colour to show, drop the sky node; if you want the sky, you can drop the background or keep it as the fallback colour."),
|
|
15
|
+
entry("LINT_SHADER_UNIFORM_UNREAD", "warning", "lint", "Custom shader uniform is never read", "A uniform is declared in `material.custom({ uniforms })` but the GLSL never mentions it, so setting it changes nothing.", "Use the uniform in the vertex or fragment source, or delete it from `uniforms`."),
|
|
16
|
+
entry("LINT_SHADER_ATTRIBUTE_UNREAD", "warning", "lint", "Custom vertex attribute is never read", "`geometry.*({ attributes })` supplies a named attribute that no custom GLSL in the project reads.", "Declare `in <type> <name>;` in the vertex shader and read it, or drop the attribute."),
|
|
17
|
+
entry("LINT_EFFECT_OPTION_IGNORED", "warning", "lint", "Option is accepted but ignored", "An `effects.*` or `instances.model` option is not read by the lowering (the engine reports it as OPTION_IGNORED at runtime), so it has no effect.", "Remove the option, or use the builder that implements it (the message lists the valid options)."),
|
|
18
|
+
entry("LINT_UTIME_NOT_ANIMATED", "warning", "lint", "Shader reads uTime but nothing advances time", "The engine binds `uTime` from the host-supplied clock, which stays 0 unless you drive it, so a uTime-only animation is a frozen frame. This is a static guess; MOTION_NONE confirms it on a real frame.", "Declare your own uniform (e.g. `waveClock`), mark the node `.runtime({ id: \"water\", mutable: true })`, and in `app.onFrame` call `app.nodes.require(\"water\").setUniform?.(\"waveClock\", seconds)`."),
|
|
19
|
+
entry("LINT_UNIFORM_RESERVED", "error", "lint", "Reserved uniform name", "`uniforms` declares a name the generated GLSL prelude already owns (uTime, uResolution, cameraPosition, the matrices, position, normal, uv ...). The material fails validation and the draw is skipped.", "Rename the uniform (e.g. `uTime` to `waveClock`)."),
|
|
20
|
+
entry("LINT_READY_NOT_AWAITED", "warning", "lint", "app.ready() is not awaited", "The project mounts an app but never awaits `app.ready()` (or chains on it), so mount errors and asset failures are not observed and code that follows can run before the first frame.", "Await it inside a function (`async function main() { const app = createAuraApp(...); await app.ready(); } void main();`) or chain `app.ready().then(...)`. Avoid module-level await (see LINT_TOP_LEVEL_AWAIT_READY)."),
|
|
21
|
+
entry("LINT_TOP_LEVEL_AWAIT_READY", "warning", "lint", "Module-level `await app.ready()`", "`await app.ready()` at module scope makes the entry module wait on the app, and in a single-entry Vite bundle the engine's lazily imported chunks import back from that same entry, so the module graph can wait on itself and the app never becomes ready (observed with monorepo-source builds: no console output, blank canvas, no data-aura3d-ready).", "Move the app into `async function main() { ...; await app.ready(); } void main();`, or use `app.ready().then(...)`."),
|
|
22
|
+
entry("LINT_SCALE_EXTREME", "warning", "lint", "Node scale looks off by orders of magnitude", "A `.scale(...)` literal is >= 50 or <= 0.02. It is probably a unit mix-up (cm vs m) and fills or vanishes from the frame.", "Check the asset's `bounds` in src/aura-assets.ts and scale to metres (1 unit = 1 m)."),
|
|
23
|
+
entry("LINT_CAMERA_INSIDE_OBJECT", "warning", "lint", "Camera starts inside an object", "The camera distance is smaller than half the size of a large scaled node at the origin, so the camera sits inside it and only back faces (or nothing) draw.", "Increase the camera distance, or reduce the node scale."),
|
|
24
|
+
entry("BUILD_FAILED", "error", "build", "Build failed", "The project build script exited non-zero.", "Read the build output tail in the finding; fix the first error."),
|
|
25
|
+
entry("BUILD_SCRIPT_MISSING", "error", "build", "No build script", "package.json has no `build` script.", "Add `\"build\": \"vite build\"` to package.json."),
|
|
26
|
+
entry("DEPLOY_CHECK_FAILED", "error", "build", "check-deploy failed", "`check-deploy` found a problem in dist (missing hashed asset, unreferenced file, licence gate).", "Run `aura3d check-deploy --dist dist` for the list and fix the first entry."),
|
|
27
|
+
entry("SERVE_FAILED", "error", "serve", "Static server could not start", "No dist/index.html, or the local static server failed to bind.", "Run the build first and confirm dist/index.html exists."),
|
|
28
|
+
entry("BROWSER_UNAVAILABLE", "error", "render", "No Chrome found for the render step", "The default driver launches a locally installed Chrome over the DevTools protocol and none was found.", "Pass --chrome <path> or set AURA3D_CHROME; or skip the browser steps with --skip render,inspect."),
|
|
29
|
+
entry("RENDER_NAVIGATION_FAILED", "error", "render", "Page did not load", "The browser could not load the served page (HTTP error, timeout or navigation failure).", "Check the build output and that index.html loads the module script."),
|
|
30
|
+
entry("RENDER_NEVER_READY", "error", "render", "App never reported ready", "The page loaded but `document.body.dataset.aura3dReady` never appeared within the readiness budget, so no first frame was reported. Causes seen: module-level `await app.ready()` deadlocking a single-entry bundle (LINT_TOP_LEVEL_AWAIT_READY), a canvas that is not the one passed to createAuraApp, an exception swallowed before mount, or assets that take longer than the budget.", "Check LINT_TOP_LEVEL_AWAIT_READY first, then the console findings; raise --ready-timeout-ms only if the scene loads large assets."),
|
|
31
|
+
entry("RENDERER_MOUNT_FAILED", "error", "render", "Renderer failed to mount", "createAuraApp could not start a renderer (no WebGL2, a thrown mount error, or an invalid scene). Nothing draws. The text is in app.diagnostics().errors.", "Read the message in the finding; usual causes are an invalid scene spec, missing WebGL2 in the browser, or a zero-size canvas. Pass `strict: true` to createAuraApp to surface it as a rejected ready()."),
|
|
32
|
+
entry("RENDER_DEGRADED", "warning", "render", "A feature is degraded", "The renderer logged a `*_DEGRADED` code: a requested feature fell back to a simpler path on this device.", "Read the specific code in the evidence (e.g. TRANSMISSION_DEGRADED); remove the feature or accept the fallback."),
|
|
33
|
+
entry("RUNTIME_OPTION_IGNORED", "warning", "inspect", "Runtime reported OPTION_IGNORED", "A builder option was accepted but not applied; the engine recorded OPTION_IGNORED.", "Remove the listed option or use the builder that reads it."),
|
|
34
|
+
entry("RUNTIME_DEGRADATION", "warning", "inspect", "Compiler reported a degradation", "The scene compiler recorded a degradation (a node or option that could not be lowered as written); the code is in the evidence.", "Read the message; remove or replace the node it names."),
|
|
35
|
+
entry("RUNTIME_NO_LIGHTS", "warning", "inspect", "Scene has no lights", "The engine warns that the scene has no lights. Lit materials (pbr, metal) render dark or black without a light or environment.", "Add `lights.studio()`, `lights.directional(...)` or `lights.ambient()`, or a `looks.preset(...)` / `environments.*`."),
|
|
36
|
+
entry("RUNTIME_NO_INTERACTIONS", "info", "inspect", "Scene has no interactions", "The engine notes that the scene has no camera interaction. Fine for a fixed shot.", "Add `interactions.orbit()` if a viewer should be able to move the camera."),
|
|
37
|
+
entry("RUNTIME_DIAGNOSTIC_ERROR", "error", "inspect", "Engine diagnostics reported an error", "The engine recorded an error (shader compile failure, asset load failure, invalid node ...).", "Read the message; CUSTOM_SHADER_COMPILE_FAILED includes the GLSL log and the offending line."),
|
|
38
|
+
entry("RUNTIME_DIAGNOSTIC_WARNING", "warning", "inspect", "Engine diagnostics reported a warning", "The engine recorded a warning during mount or the first frames.", "Read the message and fix it if it describes something you intended to work."),
|
|
39
|
+
entry("CONSOLE_ERROR", "error", "inspect", "Console error", "The page logged a console error.", "Read the text; fix the first one, later ones are often consequences."),
|
|
40
|
+
entry("PAGE_EXCEPTION", "error", "inspect", "Uncaught exception", "The page threw an uncaught exception.", "Read the message in the evidence; the first exception is the root cause."),
|
|
41
|
+
entry("REQUEST_FAILED", "error", "inspect", "A request failed (HTTP error or network failure)", "A file the page asked for returned an HTTP error or failed to load (commonly a model or texture path that is not in dist).", "Put the file under public/ (or import it) so it ships in dist, and reference it through a typed asset."),
|
|
42
|
+
entry("FRAME_BLACK", "error", "inspect", "Frame is black", "The captured frame has no bright pixels. Typical causes: no light, a light pointing away, a camera looking at nothing, a mount failure, an unlit material on a dark background.", "Add `lights.directional(...)` or a `looks.preset(...)`, check the camera target, and read the other findings first (RENDERER_MOUNT_FAILED, RUNTIME_DIAGNOSTIC_ERROR)."),
|
|
43
|
+
entry("FRAME_DIM", "warning", "inspect", "Frame is very dim", "The frame has content but its brightest 1% of pixels is dark, usually an under-lit scene.", "Raise light intensity or add an environment/look preset; check exposure."),
|
|
44
|
+
entry("FRAME_FLAT", "error", "inspect", "Frame is one flat colour", "The frame has almost no distinct colours, i.e. only the clear colour or one fullscreen surface. Typical causes: a fog density that swallows the scene, a background or sky covering everything, the camera inside an object.", "Lower fog density or move `near`/`far`, check the camera position against object sizes and scales, and check LINT_* findings."),
|
|
45
|
+
entry("FRAME_EMPTY", "warning", "inspect", "Frame has no scene texture", "Most of the frame is flat: the scene is missing, tiny, huge or behind the camera. Typical causes: a scale off by 100x, a camera pointed away, a model that failed to load.", "Check node scale against asset bounds, the camera target and distance, and REQUEST_FAILED / RUNTIME_DIAGNOSTIC_ERROR findings."),
|
|
46
|
+
entry("MOTION_NONE", "warning", "inspect", "Nothing moved between two frames", "Two frames captured about a second apart are pixel-identical. Fine for a static product shot; a bug for water, particles or a game.", "If the scene should animate, drive time yourself (`setUniform` in `app.onFrame` on a `.runtime({ mutable: true })` node) and check LINT_UTIME_NOT_ANIMATED.")
|
|
47
|
+
];
|
|
48
|
+
const BY_CODE = new Map(VERIFY_CODE_TABLE.map((item) => [item.code, item]));
|
|
49
|
+
/** Look up a code. `X_DEGRADED` codes without their own row resolve to RENDER_DEGRADED. Case-insensitive. */
|
|
50
|
+
export function explainCode(code) {
|
|
51
|
+
const key = code.trim().toUpperCase();
|
|
52
|
+
const direct = BY_CODE.get(key);
|
|
53
|
+
if (direct)
|
|
54
|
+
return direct;
|
|
55
|
+
if (/^[A-Z0-9_]+_DEGRADED$/.test(key)) {
|
|
56
|
+
const base = BY_CODE.get("RENDER_DEGRADED");
|
|
57
|
+
return { ...base, code: key, title: `${key} (degraded feature)` };
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
export function formatExplanation(item) {
|
|
62
|
+
return [`${item.code} [${item.severity}, step ${item.step}]`, item.title, "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