@aura3d/cli 4.6.2 → 4.7.1
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/dist/admission/cubeLut.d.ts +18 -0
- package/dist/admission/cubeLut.d.ts.map +1 -0
- package/dist/admission/cubeLut.js +53 -0
- package/dist/admission/cubeLut.js.map +1 -0
- package/dist/asset-core-types.d.ts +7 -4
- package/dist/asset-core-types.d.ts.map +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +7 -4
- package/dist/cli-help.js.map +1 -1
- package/dist/cli-options.d.ts +1 -1
- package/dist/cli-options.d.ts.map +1 -1
- package/dist/cli-options.js +2 -2
- package/dist/cli-options.js.map +1 -1
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/assets/certifyCategories.d.ts +26 -0
- package/dist/commands/assets/certifyCategories.d.ts.map +1 -0
- package/dist/commands/assets/certifyCategories.js +31 -0
- package/dist/commands/assets/certifyCategories.js.map +1 -0
- package/dist/commands/assets/optimize.d.ts +66 -0
- package/dist/commands/assets/optimize.d.ts.map +1 -1
- package/dist/commands/assets/optimize.js +270 -1
- package/dist/commands/assets/optimize.js.map +1 -1
- package/dist/commands/assets/optimizeVerb.d.ts.map +1 -1
- package/dist/commands/assets/optimizeVerb.js +26 -1
- package/dist/commands/assets/optimizeVerb.js.map +1 -1
- package/dist/commands/evidence/judge.d.ts +50 -1
- package/dist/commands/evidence/judge.d.ts.map +1 -1
- package/dist/commands/evidence/judge.js +154 -6
- package/dist/commands/evidence/judge.js.map +1 -1
- package/dist/commands/prd05/index.js +1 -1
- package/dist/commands/prd05/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -9
- package/dist/index.js.map +1 -1
- package/dist/look/judge.d.ts +53 -5
- package/dist/look/judge.d.ts.map +1 -1
- package/dist/look/judge.js +226 -50
- package/dist/look/judge.js.map +1 -1
- package/package.json +5 -5
- package/skills/aura3d-art-direction/references/look-recipes.md +2 -1
- package/skills/aura3d-game-art/SKILL.md +39 -17
- package/skills/aura3d-materials-environments/SKILL.md +4 -4
- package/skills/aura3d-materials-environments/references/look-overrides-4.7.md +93 -0
- package/skills/llms.txt +2 -2
package/dist/look/judge.d.ts
CHANGED
|
@@ -4,16 +4,63 @@
|
|
|
4
4
|
*
|
|
5
5
|
* `look judge --validate <file>` validates a LookJudgement and reports the
|
|
6
6
|
* per-category scores, weakest category and next-change hint.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `look judge --judge prism --shots <jpg,...|dir>` (GU47 WP-9 E-I) sends up to
|
|
8
|
+
* 4 JPEG frames to the C-32 provider `judgeWithPrism`
|
|
9
|
+
* (tools/quality-gate/src/judge-prism.ts) with a 12-category look prompt,
|
|
10
|
+
* turns the GameJudgementRecord into a LookJudgement (judge "prism"),
|
|
11
|
+
* validates it and writes it. The provider is imported from source, so the
|
|
12
|
+
* path works where tools/ exists (a repo checkout, `tsx`); elsewhere it exits
|
|
13
|
+
* 2 with `judge-unavailable`, never a fabricated score. The key comes only
|
|
14
|
+
* from PRISM_API_KEY or the file named by PRISM_KEY_FILE and is never printed.
|
|
10
15
|
*/
|
|
16
|
+
import { type LookJudgement } from "./rubric.js";
|
|
11
17
|
import type { AuraCliCommand } from "../contracts/commands.js";
|
|
12
|
-
|
|
18
|
+
/** The C-32 provider signature (`judgeWithPrism` in tools/quality-gate/src/judge-prism.ts:38). */
|
|
19
|
+
export type PrismJudgeFn = (packet: {
|
|
20
|
+
readonly itemId: string;
|
|
21
|
+
readonly images: readonly string[];
|
|
22
|
+
readonly prompt: string;
|
|
23
|
+
readonly kind: "benchmark" | "game";
|
|
24
|
+
}, opts: {
|
|
25
|
+
readonly baseUrl: string;
|
|
26
|
+
readonly apiKeyEnv: "PRISM_API_KEY";
|
|
27
|
+
readonly model: "claude-opus-5.5";
|
|
28
|
+
}) => Promise<unknown>;
|
|
29
|
+
export interface LookJudgeDeps {
|
|
30
|
+
/** Test seam: replaces the import of tools/quality-gate/src/judge-prism.ts (resolves undefined when absent). */
|
|
31
|
+
readonly loadPrismJudge?: () => Promise<PrismJudgeFn | undefined>;
|
|
32
|
+
}
|
|
33
|
+
/** Prism model of the C-32 provider (PrismJudgeOptions.model). */
|
|
34
|
+
export declare const PRISM_LOOK_MODEL: "claude-opus-5.5";
|
|
35
|
+
/** Prism accepts at most 4 images per turn (judge-prism.ts). */
|
|
36
|
+
export declare const PRISM_MAX_SHOTS = 4;
|
|
37
|
+
/** The look-judge prompt: the 12 AGENT_LOOK_CATEGORIES, answered in the C-32 GameJudgementRecord shape plus observations. */
|
|
38
|
+
export declare function lookJudgePrompt(input: {
|
|
39
|
+
readonly itemId: string;
|
|
40
|
+
readonly subject: string;
|
|
41
|
+
readonly genre?: string;
|
|
42
|
+
readonly shots: number;
|
|
43
|
+
}): string;
|
|
44
|
+
/** Map the provider's GameJudgementRecord (plus the prompt's `observations`) onto a LookJudgement with judge "prism". */
|
|
45
|
+
export declare function lookJudgementFromPrism(record: unknown, input: {
|
|
46
|
+
readonly round: number;
|
|
47
|
+
readonly shots: readonly {
|
|
48
|
+
readonly path: string;
|
|
49
|
+
readonly sha256: string;
|
|
50
|
+
}[];
|
|
51
|
+
readonly references?: readonly string[];
|
|
52
|
+
}): LookJudgement;
|
|
53
|
+
/** `--shots a.jpg,b.jpg` or a folder: JPEG files only (the provider labels every image image/jpeg). */
|
|
54
|
+
export declare function collectJudgeShots(spec: string, cwd: string): {
|
|
55
|
+
readonly files: readonly string[];
|
|
56
|
+
readonly error?: string;
|
|
57
|
+
};
|
|
58
|
+
type JudgeIo = {
|
|
13
59
|
readonly cwd: string;
|
|
14
60
|
stdout(s: string): void;
|
|
15
61
|
stderr(s: string): void;
|
|
16
|
-
}
|
|
62
|
+
};
|
|
63
|
+
export declare function runLookJudge(argv: readonly string[], io: JudgeIo, deps?: LookJudgeDeps): Promise<number>;
|
|
17
64
|
export declare function runLookRubric(argv: readonly string[], io: {
|
|
18
65
|
readonly cwd: string;
|
|
19
66
|
stdout(s: string): void;
|
|
@@ -21,4 +68,5 @@ export declare function runLookRubric(argv: readonly string[], io: {
|
|
|
21
68
|
}): number;
|
|
22
69
|
export declare const lookJudgeCommand: AuraCliCommand;
|
|
23
70
|
export declare const lookRubricCommand: AuraCliCommand;
|
|
71
|
+
export {};
|
|
24
72
|
//# sourceMappingURL=judge.d.ts.map
|
package/dist/look/judge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../../../../packages/aura3d-cli/src/look/judge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../../../../packages/aura3d-cli/src/look/judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAQL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,kGAAkG;AAClG,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAA;CAAE,EACrI,IAAI,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE,KACvG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC5B,gHAAgH;IAChH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,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E,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoClH;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,CA4B7I;AAED,eAAO,MAAM,gBAAgB,EAAE,cAM9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAM/B,CAAC"}
|
package/dist/look/judge.js
CHANGED
|
@@ -4,13 +4,159 @@
|
|
|
4
4
|
*
|
|
5
5
|
* `look judge --validate <file>` validates a LookJudgement and reports the
|
|
6
6
|
* per-category scores, weakest category and next-change hint.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `look judge --judge prism --shots <jpg,...|dir>` (GU47 WP-9 E-I) sends up to
|
|
8
|
+
* 4 JPEG frames to the C-32 provider `judgeWithPrism`
|
|
9
|
+
* (tools/quality-gate/src/judge-prism.ts) with a 12-category look prompt,
|
|
10
|
+
* turns the GameJudgementRecord into a LookJudgement (judge "prism"),
|
|
11
|
+
* validates it and writes it. The provider is imported from source, so the
|
|
12
|
+
* path works where tools/ exists (a repo checkout, `tsx`); elsewhere it exits
|
|
13
|
+
* 2 with `judge-unavailable`, never a fabricated score. The key comes only
|
|
14
|
+
* from PRISM_API_KEY or the file named by PRISM_KEY_FILE and is never printed.
|
|
10
15
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
16
|
+
import { createHash } from "node:crypto";
|
|
17
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
18
|
+
import { dirname, extname, join, relative, resolve, sep } from "node:path";
|
|
13
19
|
import { AGENT_LOOK_CATEGORIES, GENRE_RECIPE_ROWS, LOOK_JUDGEMENT_SCHEMA, lookHintFor, validateLookJudgement, weakestLookCategory } from "./rubric.js";
|
|
20
|
+
/** Prism model of the C-32 provider (PrismJudgeOptions.model). */
|
|
21
|
+
export const PRISM_LOOK_MODEL = "claude-opus-5.5";
|
|
22
|
+
/** Prism accepts at most 4 images per turn (judge-prism.ts). */
|
|
23
|
+
export const PRISM_MAX_SHOTS = 4;
|
|
24
|
+
async function importPrismJudge() {
|
|
25
|
+
const { judgeWithPrism } = await import("../../../../tools/quality-gate/src/judge-prism.js");
|
|
26
|
+
const fn = judgeWithPrism;
|
|
27
|
+
return typeof fn === "function" ? fn : undefined;
|
|
28
|
+
}
|
|
29
|
+
/** The look-judge prompt: the 12 AGENT_LOOK_CATEGORIES, answered in the C-32 GameJudgementRecord shape plus observations. */
|
|
30
|
+
export function lookJudgePrompt(input) {
|
|
31
|
+
const recipe = input.genre ? GENRE_RECIPE_ROWS[input.genre] : undefined;
|
|
32
|
+
return [
|
|
33
|
+
`You are an art director and rendering engineer judging ${input.shots} screenshot${input.shots === 1 ? "" : "s"} of one browser 3D game (${input.subject}) against a ${AGENT_LOOK_CATEGORIES.length}-category look rubric.`,
|
|
34
|
+
"Judge only what is visible in the frames. Score each category from 0 to 10 in 0.5 steps; omit a category the frames cannot show.",
|
|
35
|
+
"Every score below 7 needs at least one observation for that category naming what you saw.",
|
|
36
|
+
...(recipe ? [`Genre ${input.genre}: the recipe expects look ${recipe.look}, ${recipe.camera}, subject ${recipe.subjectPercent}% of the frame, key ${recipe.keyLight}, palette ${recipe.palette}, atmosphere ${recipe.atmosphere}, post ${recipe.post}.`] : []),
|
|
37
|
+
`Categories: ${AGENT_LOOK_CATEGORIES.join(", ")}`,
|
|
38
|
+
"Respond with one JSON object and nothing else, exactly these keys:",
|
|
39
|
+
`{ "itemId": ${JSON.stringify(input.itemId)}, "judge": { "id": "prism" }, "scores": { "<category>": <0-10> }, "observations": [{ "category": "<category>", "seen": "<what is visible>" }], "dominantCauses": [{ "cause": "<cause>", "percent": <0-100> }], "competitiveWithModernThree": <true if the frames hold up against current well-made browser 3D games>, "critique": "<at least 200 characters>" }`
|
|
40
|
+
].join("\n");
|
|
41
|
+
}
|
|
42
|
+
const snapHalf = (n) => Math.min(10, Math.max(0, Math.round(n * 2) / 2));
|
|
43
|
+
/** Map the provider's GameJudgementRecord (plus the prompt's `observations`) onto a LookJudgement with judge "prism". */
|
|
44
|
+
export function lookJudgementFromPrism(record, input) {
|
|
45
|
+
const r = (record ?? {});
|
|
46
|
+
const scores = {};
|
|
47
|
+
for (const category of AGENT_LOOK_CATEGORIES) {
|
|
48
|
+
const value = r.scores?.[category];
|
|
49
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
50
|
+
scores[category] = snapHalf(value);
|
|
51
|
+
}
|
|
52
|
+
const observations = [];
|
|
53
|
+
if (Array.isArray(r.observations)) {
|
|
54
|
+
for (const o of r.observations) {
|
|
55
|
+
if (typeof o?.category === "string" && typeof o.seen === "string" && o.seen.trim() && AGENT_LOOK_CATEGORIES.includes(o.category)) {
|
|
56
|
+
observations.push({ category: o.category, seen: o.seen.trim() });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const critique = typeof r.critique === "string" ? r.critique.trim() : "";
|
|
61
|
+
for (const [category, score] of Object.entries(scores)) {
|
|
62
|
+
if (score < 7 && !observations.some((o) => o.category === category)) {
|
|
63
|
+
observations.push({ category, seen: critique ? `critique: ${critique.slice(0, 240)}` : "scored below 7 by the prism judge without an observation" });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const draft = {
|
|
67
|
+
schema: LOOK_JUDGEMENT_SCHEMA,
|
|
68
|
+
round: input.round,
|
|
69
|
+
shots: input.shots,
|
|
70
|
+
references: input.references ?? [],
|
|
71
|
+
scores,
|
|
72
|
+
observations,
|
|
73
|
+
nextChange: { category: "", change: "", api: "" },
|
|
74
|
+
judge: "prism"
|
|
75
|
+
};
|
|
76
|
+
const weakest = weakestLookCategory(draft);
|
|
77
|
+
const hint = weakest ? lookHintFor(weakest) : undefined;
|
|
78
|
+
return { ...draft, nextChange: hint ? { category: hint.category, change: hint.change, api: hint.api } : draft.nextChange };
|
|
79
|
+
}
|
|
80
|
+
/** `--shots a.jpg,b.jpg` or a folder: JPEG files only (the provider labels every image image/jpeg). */
|
|
81
|
+
export function collectJudgeShots(spec, cwd) {
|
|
82
|
+
const files = [];
|
|
83
|
+
for (const part of spec.split(",").map((s) => s.trim()).filter(Boolean)) {
|
|
84
|
+
const path = resolve(cwd, part);
|
|
85
|
+
if (!existsSync(path))
|
|
86
|
+
return { files, error: `shot not found: ${part}` };
|
|
87
|
+
if (statSync(path).isDirectory()) {
|
|
88
|
+
for (const name of readdirSync(path).sort())
|
|
89
|
+
if (/\.jpe?g$/i.test(name))
|
|
90
|
+
files.push(join(path, name));
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
files.push(path);
|
|
94
|
+
}
|
|
95
|
+
if (files.length === 0)
|
|
96
|
+
return { files, error: "no JPEG shots given (--shots <a.jpg,b.jpg,...|dir>)" };
|
|
97
|
+
if (files.length > PRISM_MAX_SHOTS)
|
|
98
|
+
return { files, error: `Prism takes at most ${PRISM_MAX_SHOTS} images per turn; got ${files.length}` };
|
|
99
|
+
for (const file of files) {
|
|
100
|
+
const head = readFileSync(file).subarray(0, 3);
|
|
101
|
+
if (!/\.jpe?g$/i.test(extname(file)) || head[0] !== 0xff || head[1] !== 0xd8 || head[2] !== 0xff) {
|
|
102
|
+
return { files, error: `not a JPEG: ${relative(cwd, file) || file} (the prism judge sends image/jpeg only)` };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return { files };
|
|
106
|
+
}
|
|
107
|
+
/** Run `fn` with PRISM_API_KEY present: from the env, else read from PRISM_KEY_FILE for the call only. Never printed. */
|
|
108
|
+
async function withPrismKey(fn) {
|
|
109
|
+
const previous = process.env.PRISM_API_KEY;
|
|
110
|
+
const fromFile = !previous?.trim() && process.env.PRISM_KEY_FILE ? readFileSync(process.env.PRISM_KEY_FILE, "utf8").trim() : "";
|
|
111
|
+
const key = previous?.trim() || fromFile;
|
|
112
|
+
if (!key)
|
|
113
|
+
throw new KeyMissing();
|
|
114
|
+
if (fromFile)
|
|
115
|
+
process.env.PRISM_API_KEY = fromFile;
|
|
116
|
+
try {
|
|
117
|
+
return await fn(key);
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
if (fromFile) {
|
|
121
|
+
if (previous === undefined)
|
|
122
|
+
delete process.env.PRISM_API_KEY;
|
|
123
|
+
else
|
|
124
|
+
process.env.PRISM_API_KEY = previous;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
class KeyMissing extends Error {
|
|
129
|
+
constructor() {
|
|
130
|
+
super("set PRISM_API_KEY or PRISM_KEY_FILE (the key is read from the environment only and never printed)");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function printJudgement(judgement, io, asJson, header) {
|
|
134
|
+
const weakest = weakestLookCategory(judgement);
|
|
135
|
+
const hint = weakest ? lookHintFor(weakest) : undefined;
|
|
136
|
+
if (asJson) {
|
|
137
|
+
io.stdout(JSON.stringify({
|
|
138
|
+
ok: true,
|
|
139
|
+
schema: LOOK_JUDGEMENT_SCHEMA,
|
|
140
|
+
judge: judgement.judge,
|
|
141
|
+
round: judgement.round,
|
|
142
|
+
scores: judgement.scores,
|
|
143
|
+
weakestCategory: weakest ?? null,
|
|
144
|
+
hint: hint ?? null
|
|
145
|
+
}, null, 2));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
io.stdout(header);
|
|
149
|
+
for (const category of AGENT_LOOK_CATEGORIES) {
|
|
150
|
+
const score = judgement.scores[category];
|
|
151
|
+
if (score !== undefined)
|
|
152
|
+
io.stdout(` ${category}: ${score}`);
|
|
153
|
+
}
|
|
154
|
+
if (weakest) {
|
|
155
|
+
io.stdout(`weakest category: ${weakest}`);
|
|
156
|
+
io.stdout(`next change: ${hint.change}`);
|
|
157
|
+
io.stdout(`api: ${hint.api}`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
14
160
|
function parseArgs(argv) {
|
|
15
161
|
const flags = new Map();
|
|
16
162
|
const switches = new Set();
|
|
@@ -29,28 +175,82 @@ function parseArgs(argv) {
|
|
|
29
175
|
}
|
|
30
176
|
return { flags, switches };
|
|
31
177
|
}
|
|
32
|
-
|
|
178
|
+
async function runPrismLookJudge(flags, asJson, io, deps) {
|
|
179
|
+
const spec = flags.get("shots");
|
|
180
|
+
if (!spec) {
|
|
181
|
+
io.stderr(`look judge --judge prism requires --shots <a.jpg,b.jpg,...|dir> (at most ${PRISM_MAX_SHOTS} JPEG frames)`);
|
|
182
|
+
return 2;
|
|
183
|
+
}
|
|
184
|
+
const round = Number(flags.get("round") ?? 1);
|
|
185
|
+
if (!Number.isInteger(round) || round < 1) {
|
|
186
|
+
io.stderr("--round must be an integer >= 1");
|
|
187
|
+
return 2;
|
|
188
|
+
}
|
|
189
|
+
const genre = flags.get("genre");
|
|
190
|
+
if (genre && !GENRE_RECIPE_ROWS[genre]) {
|
|
191
|
+
io.stderr(`unknown genre "${genre}"; genres: ${Object.keys(GENRE_RECIPE_ROWS).join(", ")}`);
|
|
192
|
+
return 2;
|
|
193
|
+
}
|
|
194
|
+
const { files, error } = collectJudgeShots(spec, io.cwd);
|
|
195
|
+
if (error) {
|
|
196
|
+
io.stderr(error);
|
|
197
|
+
return 2;
|
|
198
|
+
}
|
|
199
|
+
let judgeFn;
|
|
200
|
+
try {
|
|
201
|
+
judgeFn = await (deps.loadPrismJudge ?? importPrismJudge)();
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
judgeFn = undefined;
|
|
205
|
+
}
|
|
206
|
+
if (!judgeFn) {
|
|
207
|
+
io.stderr("judge-unavailable: C-32 judgeWithPrism (tools/quality-gate/src/judge-prism.ts) cannot be loaded here; run the CLI from a repo checkout");
|
|
208
|
+
return 2;
|
|
209
|
+
}
|
|
210
|
+
const images = files.map((file) => readFileSync(file));
|
|
211
|
+
const shots = files.map((file, i) => ({ path: relative(io.cwd, file).split(sep).join("/") || file, sha256: createHash("sha256").update(images[i]).digest("hex") }));
|
|
212
|
+
const itemId = flags.get("item") ?? "look-judge";
|
|
213
|
+
const prompt = lookJudgePrompt({ itemId, subject: flags.get("subject") ?? "a browser 3D game", genre, shots: files.length });
|
|
214
|
+
let record;
|
|
215
|
+
let key = "";
|
|
216
|
+
try {
|
|
217
|
+
record = await withPrismKey(async (k) => {
|
|
218
|
+
key = k;
|
|
219
|
+
return judgeFn({ itemId, images: images.map((b) => b.toString("base64")), prompt, kind: "game" }, { baseUrl: process.env.PRISM_BASE_URL ?? "https://prism.auraone.ai", apiKeyEnv: "PRISM_API_KEY", model: PRISM_LOOK_MODEL });
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
catch (e) {
|
|
223
|
+
if (e instanceof KeyMissing) {
|
|
224
|
+
io.stderr(`judge-unavailable: ${e.message}`);
|
|
225
|
+
return 2;
|
|
226
|
+
}
|
|
227
|
+
const message = String(e instanceof Error ? e.message : e);
|
|
228
|
+
io.stderr(`prism judge failed: ${(key ? message.split(key).join("[redacted]") : message).slice(0, 300)}`);
|
|
229
|
+
return 1;
|
|
230
|
+
}
|
|
231
|
+
const references = (flags.get("references") ?? "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
232
|
+
const judgement = lookJudgementFromPrism(record, { round, shots, references });
|
|
233
|
+
const validation = validateLookJudgement(judgement);
|
|
234
|
+
if (!validation.ok) {
|
|
235
|
+
for (const problem of validation.errors)
|
|
236
|
+
io.stderr(`invalid prism judgement: ${problem}`);
|
|
237
|
+
return 1;
|
|
238
|
+
}
|
|
239
|
+
const out = resolve(io.cwd, flags.get("out") ?? "look-judgement.json");
|
|
240
|
+
mkdirSync(dirname(out), { recursive: true });
|
|
241
|
+
writeFileSync(out, `${JSON.stringify(judgement, null, 2)}\n`);
|
|
242
|
+
printJudgement(judgement, io, asJson, `prism judgement ${LOOK_JUDGEMENT_SCHEMA} round ${round} (${PRISM_LOOK_MODEL}, ${files.length} shot${files.length === 1 ? "" : "s"}), wrote ${relative(io.cwd, out) || out}`);
|
|
243
|
+
return 0;
|
|
244
|
+
}
|
|
245
|
+
export async function runLookJudge(argv, io, deps = {}) {
|
|
33
246
|
const { flags, switches } = parseArgs(argv);
|
|
34
247
|
const judge = flags.get("judge") ?? "self";
|
|
35
248
|
const asJson = switches.has("json");
|
|
36
|
-
if (judge === "prism")
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (typeof mod.judgeWithPrism !== "function") {
|
|
42
|
-
io.stderr("judge-unavailable: C-32 judgeWithPrism is not exported by tools/quality-gate yet");
|
|
43
|
-
return 2;
|
|
44
|
-
}
|
|
45
|
-
// Provider path for when PRD 12 lands: delegate and pass through.
|
|
46
|
-
const result = await mod.judgeWithPrism({ argv, cwd: io.cwd });
|
|
47
|
-
io.stdout(asJson ? JSON.stringify(result, null, 2) : String(result));
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
io.stderr("judge-unavailable: C-32 judgeWithPrism is not exported by tools/quality-gate yet");
|
|
52
|
-
return 2;
|
|
53
|
-
}
|
|
249
|
+
if (judge === "prism" && !flags.has("validate"))
|
|
250
|
+
return runPrismLookJudge(flags, asJson, io, deps);
|
|
251
|
+
if (judge !== "self" && judge !== "prism") {
|
|
252
|
+
io.stderr(`unknown judge "${judge}" (self or prism)`);
|
|
253
|
+
return 2;
|
|
54
254
|
}
|
|
55
255
|
const validatePath = flags.get("validate");
|
|
56
256
|
if (!validatePath) {
|
|
@@ -77,31 +277,7 @@ export async function runLookJudge(argv, io) {
|
|
|
77
277
|
return 1;
|
|
78
278
|
}
|
|
79
279
|
const judgement = parsed;
|
|
80
|
-
|
|
81
|
-
const hint = weakest ? lookHintFor(weakest) : undefined;
|
|
82
|
-
if (asJson) {
|
|
83
|
-
io.stdout(JSON.stringify({
|
|
84
|
-
ok: true,
|
|
85
|
-
schema: LOOK_JUDGEMENT_SCHEMA,
|
|
86
|
-
judge: judgement.judge,
|
|
87
|
-
round: judgement.round,
|
|
88
|
-
scores: judgement.scores,
|
|
89
|
-
weakestCategory: weakest ?? null,
|
|
90
|
-
hint: hint ?? null
|
|
91
|
-
}, null, 2));
|
|
92
|
-
return 0;
|
|
93
|
-
}
|
|
94
|
-
io.stdout(`judgement ${LOOK_JUDGEMENT_SCHEMA} round ${judgement.round} (${judgement.judge}) is valid`);
|
|
95
|
-
for (const category of AGENT_LOOK_CATEGORIES) {
|
|
96
|
-
const score = judgement.scores[category];
|
|
97
|
-
if (score !== undefined)
|
|
98
|
-
io.stdout(` ${category}: ${score}`);
|
|
99
|
-
}
|
|
100
|
-
if (weakest) {
|
|
101
|
-
io.stdout(`weakest category: ${weakest}`);
|
|
102
|
-
io.stdout(`next change: ${hint.change}`);
|
|
103
|
-
io.stdout(`api: ${hint.api}`);
|
|
104
|
-
}
|
|
280
|
+
printJudgement(judgement, io, asJson, `judgement ${LOOK_JUDGEMENT_SCHEMA} round ${judgement.round} (${judgement.judge}) is valid`);
|
|
105
281
|
return 0;
|
|
106
282
|
}
|
|
107
283
|
export function runLookRubric(argv, io) {
|
|
@@ -138,7 +314,7 @@ export const lookJudgeCommand = {
|
|
|
138
314
|
name: "look judge",
|
|
139
315
|
owner: "prd13",
|
|
140
316
|
summary: "Validate a LookJudgement, print scores, weakest category and next-change hint",
|
|
141
|
-
usage: "aura3d look judge --validate <look-judgement.json> [--judge
|
|
317
|
+
usage: "aura3d look judge --validate <look-judgement.json> [--json] | aura3d look judge --judge prism --shots <a.jpg,b.jpg,...|dir> [--round 1] [--genre <genre>] [--item <id>] [--subject <text>] [--references <id,...>] [--out look-judgement.json] [--json]",
|
|
142
318
|
run: (argv, io) => runLookJudge(argv, io)
|
|
143
319
|
};
|
|
144
320
|
export const lookRubricCommand = {
|
package/dist/look/judge.js.map
CHANGED
|
@@ -1 +1 @@
|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/C,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,qEAAqE;IAC9E,KAAK,EAAE,6DAA6D;IACpE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;CACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aura3d/cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aura3d": "dist/cli.js",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"typescript": "^5.8.3",
|
|
31
|
-
"@aura3d/asset-index": "4.
|
|
32
|
-
"@aura3d/audio": "4.
|
|
33
|
-
"
|
|
34
|
-
"
|
|
31
|
+
"@aura3d/asset-index": "4.7.1",
|
|
32
|
+
"@aura3d/audio": "4.7.1",
|
|
33
|
+
"create-aura3d": "4.7.1",
|
|
34
|
+
"@aura3d/rendering": "4.7.1"
|
|
35
35
|
},
|
|
36
36
|
"description": "Bring real GLB/glTF assets into Aura3D browser apps with typed references, provenance, catalog search, validation, screenshots, and deploy checks.",
|
|
37
37
|
"keywords": [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Look recipes —
|
|
1
|
+
# Look recipes — 14 genre rows
|
|
2
2
|
|
|
3
3
|
One row per genre. Use the row's look id verbatim, take its camera/framing/palette
|
|
4
4
|
as the starting point, then iterate in the look-dev loop. Palettes: 3 base tones +
|
|
@@ -11,6 +11,7 @@ is the subject's share of frame height.
|
|
|
11
11
|
| racing | `golden-hour` | `chase`, fov 60 | 15–25 | 12° / 35° (low sun) | warm asphalt, burnt orange, charcoal + headlight amber | fog 30–180 m | `cinematic-film` | brake glow, speed dust | `webgl_materials_car` |
|
|
12
12
|
| fighting | `arena-fight` | `follow` (side-on), fov 45 | 20–30 (pair) | top spot 60° / 0° | arena dark, rope colour, crowd shadow + spotlight rim | haze cone | `arena-fight` | hit sparks, knockback flash | `webgl_animation_skinning_morph` |
|
|
13
13
|
| arena shooter | `space` | `orthographic` (top-down) 60°, fov 55 | 10–15 (field) | rim 70° / 210° | deep space blue, graphite, teal + laser magenta | none (space background exception) | `space` | model muzzle flash, shield segments | `webgl_shaders_sky` |
|
|
14
|
+
| maze-arcade | `neon-arcade` | `orthographic` (top-down) 55°, fov 40 | 70–85 (maze board) | 55° / 210° (one shadowed key) | ink navy floor, slate walls, graphite trim + pellet cyan | fog 60–320 m (half night-city) | `neon-night` | pellet pickup sparkle, emissive wall trace along the runner's path | `webgl_lights_spotlights` |
|
|
14
15
|
| sports/table | `interior-industrial` | broadcast `orthographic` (top-down) 70°, fov 40 | 25–40 (table) | flood 55° / 45° | turf green, line white, crowd dark + ball accent | indoor haze | `arena-fight` | scoreboard pulse | `webgl_materials_lightmap` |
|
|
15
16
|
| product | `product-studio` | `orbit` autoframe, fov 35 | 45–70 | softbox 45° / 30° | neutral grey, white, metal + one brand accent | none | `product-studio` | sweep highlight on turn | `webgl_materials_video` |
|
|
16
17
|
| character | `character-showcase` | `orbit`, fov 40 | 50–70 | 3-point 50° / 35° | costume-driven neutrals + rim pick | light room haze | `product-studio` | cloth/hair motion settle | `webgl_animation_skinning_blending` |
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aura3d-game-art
|
|
3
|
-
description: Produces 2D game art that a real Aura3D consumer uses: flipbook VFX sprite sheets for `effects.flipbook` (the `flipbook-sprite` effect with `spriteColumns` / `spriteRows`) and HUD icons or UI sprites for DOM overlays, each admitted as a typed texture asset. Use when a game template (`mini-game`, `racing-starter`, `falling-blocks-starter`, `fighting-game`) needs explosion, muzzle-flash, or hit VFX sheets, HUD icons, score or health sprites, or a style-consistent batch of UI art.
|
|
3
|
+
description: Produces 2D game art that a real Aura3D consumer uses: flipbook VFX sprite sheets for `effects.flipbook({ texture })` (the `flipbook-sprite` effect with `spriteColumns` / `spriteRows`) or particle `sprite` sheets, and HUD icons or UI sprites for DOM overlays, each admitted as a typed texture asset; also names the built-in atlas sprites, registered presets and trails that need no art. Use when a game template (`mini-game`, `racing-starter`, `falling-blocks-starter`, `fighting-game`) needs explosion, muzzle-flash, or hit VFX sheets, HUD icons, score or health sprites, or a style-consistent batch of UI art.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Aura3D game art (flipbook VFX and HUD sprites)
|
|
7
7
|
|
|
8
|
-
Only two
|
|
9
|
-
sheets
|
|
8
|
+
Only two kinds of consumer exist, so only two kinds of art are produced:
|
|
9
|
+
sprite sheets (the `flipbook-sprite` effect, or a particle `sprite` sheet) and
|
|
10
|
+
icons for the DOM HUD. Tilesets
|
|
10
11
|
are out of scope: no 2D tile runtime consumes them, so 3D levels come from
|
|
11
12
|
`aura3d-browser-game` and `aura3d-assets`. Shared rules (claim labels, typed
|
|
12
13
|
assets, CSS/DOM is UI only, benchmark mode) are in
|
|
@@ -28,12 +29,13 @@ texture viewer hides.
|
|
|
28
29
|
2. Read `src/aura-assets.ts` and `aura.assets.json`, and find the consumer
|
|
29
30
|
first: the `effects.flipbook(...)` call, or the HUD element in `src/main.ts`
|
|
30
31
|
(the `mini-game` HUD is a DOM `aside`). No consumer means no art.
|
|
31
|
-
3. Know the flipbook state. `effects.flipbook
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
3. Know the flipbook state. `effects.flipbook({ texture: assets.sheet,
|
|
33
|
+
spriteColumns, spriteRows, frameRate })` draws through the particle pass
|
|
34
|
+
(A3D_QR_VFX, on by default): it samples the typed sheet on that grid.
|
|
35
|
+
Without `texture` it draws the built-in fireball sheet; `sprite:
|
|
36
|
+
"flame-loop"` uses a built-in atlas sequence instead. A sheet draws the
|
|
37
|
+
soft-dot until it has loaded, and a failed load is named
|
|
38
|
+
`VFX_SPRITE_UNAVAILABLE` in `app.diagnostics()`.
|
|
37
39
|
4. Benchmark mode: `npm install && npm run build`, then stop.
|
|
38
40
|
|
|
39
41
|
## Procedure
|
|
@@ -65,11 +67,31 @@ Flipbook VFX sheets:
|
|
|
65
67
|
npx @aura3d/cli@latest assets typegen
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
5. Declare the effect with the same grid:
|
|
69
|
-
`effects.flipbook({
|
|
70
|
-
Mismatched or non-integer values throw a
|
|
71
|
-
catch and ignore it.
|
|
72
|
-
|
|
70
|
+
5. Declare the effect with the same grid and the typed asset:
|
|
71
|
+
`effects.flipbook({ texture: assets.explosionSheet, spriteColumns: 8,
|
|
72
|
+
spriteRows: 4, frameRate: 24 })`. Mismatched or non-integer values throw a
|
|
73
|
+
`RangeError` (fail loud); never catch and ignore it. Author sheets with
|
|
74
|
+
straight alpha; frame 0 is the top-left cell.
|
|
75
|
+
|
|
76
|
+
Particles, presets and trails (when the game needs runtime VFX, not a sheet):
|
|
77
|
+
|
|
78
|
+
- Built-in atlas sprites need no art: `effects.particles({ sprite:
|
|
79
|
+
"smoke-a" })` or `app.effects.burst("dust", at, { sprite: "dust-mote" })`.
|
|
80
|
+
Names: soft-dot, glow, flare, spark-streak, ring, ring-thin, dust-mote,
|
|
81
|
+
bubble, rain-streak, snowflake, smoke-a, smoke-b, fireball, flame-loop,
|
|
82
|
+
muzzle, splash, electric, debris-chips. A sheet works on emitters too:
|
|
83
|
+
`sprite: { atlas: assets.sparkSheet, frame: 3 }` with `spriteColumns` and
|
|
84
|
+
`spriteRows`.
|
|
85
|
+
- A game's own pack: `app.effects.registerPreset("chalk-puff", { name:
|
|
86
|
+
"chalk-puff", layers: [{ type: "emitter", preset: "dust", color: "#f2efe6",
|
|
87
|
+
count: 18, sprite: "dust-mote" }, { type: "light", intensity: 4 }] })`, then
|
|
88
|
+
`app.effects.burst("chalk-puff", at)`. Registered names win over built-ins;
|
|
89
|
+
layers may be emitter, light, camera or decal, with an `at` delay in
|
|
90
|
+
seconds. Genre-coloured built-ins exist for spark, dust and pickup (for
|
|
91
|
+
example `spark-electric`, `dust-sand`, `pickup-gold`).
|
|
92
|
+
- Ribbons: `app.effects.trail(nodeId, { width: 0.4, life: 0.8, color:
|
|
93
|
+
"#ffcc66", widthOverSpeed: [2, 12] })` follows the node; the head is opaque,
|
|
94
|
+
the tail fades over `life`, and stopping its handle lets it fade out.
|
|
73
95
|
|
|
74
96
|
HUD icons and UI sprites:
|
|
75
97
|
|
|
@@ -100,9 +122,9 @@ Style-consistent batches:
|
|
|
100
122
|
|
|
101
123
|
- The sheet fails `sheet-check.mjs`, or frames bleed across cells: fix the
|
|
102
124
|
sheet; do not change the grid in code to paper over it.
|
|
103
|
-
- The
|
|
104
|
-
and quote the
|
|
105
|
-
an animated `<img>` on top of the canvas.
|
|
125
|
+
- The sheet does not draw (`VFX_SPRITE_UNAVAILABLE`, or only soft dots in the
|
|
126
|
+
frame): label that effect `prototype` and quote the diagnostic. Do not fake
|
|
127
|
+
it with CSS, a DOM overlay, or an animated `<img>` on top of the canvas.
|
|
106
128
|
- Someone asks for a tileset: decline it and route level work to
|
|
107
129
|
`aura3d-browser-game`.
|
|
108
130
|
- A file has no license or author: do not admit it.
|
|
@@ -14,10 +14,10 @@ labels, typed assets, catalog-first for models, benchmark mode) are in
|
|
|
14
14
|
|
|
15
15
|
## Look target
|
|
16
16
|
|
|
17
|
-
Most scenes need no per-file HDRI at all: `looks.preset(<genre>)` already
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
Most scenes need no per-file HDRI at all: `looks.preset(<genre>)` already supplies environment light, sky/background, fog and grade — pick it from the
|
|
18
|
+
recipe row in `../aura3d-art-direction/references/look-recipes.md` and only descend into manual environments when the look cannot express the mood.
|
|
19
|
+
From 4.7.0 a look takes overrides (a catalogued `hdri` id, environment intensity and rotation, key, rim, fog, grade, post) and the app changes light,
|
|
20
|
+
environment, fog and post at runtime: [look overrides, HDRI ids and runtime setters](references/look-overrides-4.7.md).
|
|
21
21
|
|
|
22
22
|
## Establish the contract
|
|
23
23
|
|