3D engine that AI agents drive
JavaScript 3d3d-engineagentic-aiai-agentsblenderclaude-codegame-enginegaussian-splattinggltfjavascriptmcpmcp-servermodel-context-protocolpath-tracerpath-tracingpbrrenderingthreejs-alternativewebgl2webgpu
Tell a lasso which parts share a material and which only graze it (#922)
Nguyen Xuan An8e79d2b6efe7
diff --git a/changes/922-lasso.md b/changes/922-lasso.mdindex 65a00fcf..6ee0d662 100644--- a/changes/922-lasso.md+++ b/changes/922-lasso.md@@ -1 +1 @@-- `scene_ask_user`: the annotate page has a lasso tool; a lasso mark comes back with `kind` `"lasso"`, its `points` and the `parts` under the outline (most covered first, with `coverage`), and the test-only answer fixture accepts `lasso` marks (#922).+- `scene_ask_user`: the annotate page has a lasso tool; a lasso mark comes back with `kind` `"lasso"`, its `points` and the `parts` under the outline (most covered first, with `coverage`, `edge` below 0.15 and `materialSharedWith` for a material also used outside the mark), and the test-only answer fixture accepts `lasso` marks (#922).diff --git a/changes/922-lasso.size.md b/changes/922-lasso.size.mdindex bdff384c..af844335 100644--- a/changes/922-lasso.size.md+++ b/changes/922-lasso.size.md@@ -1,3 +1,5 @@- scene:agent-scene: the lasso mark lets a person mean "these parts" in one gesture instead of pinning each part; the point-in-polygon, outline check and part resolution add about 116 bytes gzip, an agent-facing capability of issue 922.- scene:agent-scene+lazy: the same code, about 107 bytes gzip.- goal:agent-scene: the lasso is an agent-facing capability with no smaller home, since pick resolution and the mark validator already live in src/agent-annotate.js.+- scene:agent-scene: lasso parts list the unmarked parts that share their material (materialSharedWith) and mark grazed parts edge, which the Haiku bench of #1969 needed to stop a shared stone material turning the floor blue; a few hundred bytes of source and one tool description sentence, agent-facing.+- tool:scene_ask_user: one short phrase (materialSharedWith: own material first) stops an agent recolouring a material that parts outside the mark also use, which turned the floor blue in all 3 Haiku bench runs of ask-user-lasso; the mark description grew with the lasso (#1969) too.diff --git a/docs/mcp.md b/docs/mcp.mdindex ad4b84a3..974664ea 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -223,7 +223,7 @@ Imported clip sampling remains available through `set-animation`.`scene_ask_user` is for a change the person cannot put in words. It renders the current view, opens it in their default browser on a loopback address under a random path, and waits up to `timeoutSeconds` (default 300, at most 900) for them to pin up to 16 points with a note of at most 280 characters each and press Send. Each mark comes back with its pixel, the `partId` and world `point` and `normal` the pin lands on (all `null` on empty sky), the `distance` from the camera and the part's `material`, plus the `view` camera and a PNG with the numbered pins. A cancelled or timed-out page returns `outcome` `cancelled` or `timeout` with no marks. Nothing leaves the machine and the tool takes no code or remote URL.-The page also has a lasso tool: the person draws a closed outline around a region (3 to 64 points, thinned from the pen stroke) and adds a note, so one mark can mean "these parts". Such a mark counts toward the 16 and comes back with the pin fields plus `kind` `"lasso"`, `points` and `parts`. `parts` lists the parts under the outline, most covered first, each as `{ partId, samples, coverage, material }`: the server picks a fixed 24 by 24 grid of pixels over the outline's bounding box, keeps the ones inside it (even-odd rule) and runs the same pick as a pin on each, so `coverage` is the share of those pixels a part holds (pixels on empty sky count toward no part, so the shares may add up to less than 1). `pixel`, `partId`, `point`, `normal`, `distance` and `material` are those of the most covered part, taken at the picked pixel nearest the outline's centre; `parts` is empty and `partId` `null` when the outline holds only sky. A sliver of a part behind the region can show up with a small `coverage`: read it before acting on every part listed. The inline chat view and the review page take pins only. Not yet marks: dragged transforms, colours, saved views and film times (issue #922 lists them).+The page also has a lasso tool: the person draws a closed outline around a region (3 to 64 points, thinned from the pen stroke) and adds a note, so one mark can mean "these parts". Such a mark counts toward the 16 and comes back with the pin fields plus `kind` `"lasso"`, `points` and `parts`. `parts` lists the parts under the outline, most covered first, each as `{ partId, samples, coverage, material }`: the server picks a fixed 24 by 24 grid of pixels over the outline's bounding box, keeps the ones inside it (even-odd rule) and runs the same pick as a pin on each, so `coverage` is the share of those pixels a part holds (pixels on empty sky count toward no part, so the shares may add up to less than 1). `pixel`, `partId`, `point`, `normal`, `distance` and `material` are those of the most covered part, taken at the picked pixel nearest the outline's centre; `parts` is empty and `partId` `null` when the outline holds only sky. A part under 0.15 coverage carries `edge: true` and stays listed: it only grazes the outline. A part whose material is also used by parts outside the mark carries `materialSharedWith` (those part IDs, sorted, at most 8, plus `materialSharedWithMore` with the count left over): recolouring that material would change them too, so give the part its own material first. Pins are unchanged. The inline chat view and the review page take pins only. Not yet marks: dragged transforms, colours, saved views and film times (issue #922 lists them).#### Inline in chat apps (MCP Apps)diff --git a/scripts/agent-preview-browser.js b/scripts/agent-preview-browser.jsindex c957a9df..f2d5fb14 100644--- a/scripts/agent-preview-browser.js+++ b/scripts/agent-preview-browser.js@@ -43,7 +43,7 @@ import { framingProblems, placementProblems, textureProblems, exposureProblems,import { BRANCH_LIMITS, createBranchStore, printableLabel } from '../src/agent-branches.js';import { agentAssetDecodeOptions, withCatalogLimitAdvice } from '../src/agent-asset-limits.js';import { describeMarks, validateMarks } from '../src/agent-annotate.js';-import { sceneQueryFor, summarizeWalkMap, walkOptionsFor, createQueryOnlyCache } from './agent-walkmap.js';+import { sceneQueryFor, partMaterialsFor, summarizeWalkMap, walkOptionsFor, createQueryOnlyCache } from './agent-walkmap.js';// Open scenes by sessionId, least recently used first. One canvas serves them all, so at most one record owns a renderer;// a call on another scene hands the canvas over (the scene data stays, the renderer is rebuilt).@@ -1341,7 +1341,7 @@ window.__agentPreview = {if (!allAgentSceneModulesLoaded()) await loadAllAgentSceneModules();const clean = validateMarks(marks, { width, height });const query = sceneQueryFor(record);- return { revision: record.scene.revision, marks: describeMarks(clean, camera, { width, height, raycast: ray => query.raycast(ray) }) };+ return { revision: record.scene.revision, marks: describeMarks(clean, camera, { width, height, raycast: ray => query.raycast(ray), partMaterials: partMaterialsFor(record) }) };},checkpoint({ sessionId, checkpointId }) {const record = requireSession(sessionId);diff --git a/scripts/agent-walkmap.js b/scripts/agent-walkmap.jsindex 8f93ffdf..dc7e1305 100644--- a/scripts/agent-walkmap.js+++ b/scripts/agent-walkmap.js@@ -16,6 +16,15 @@ function queryPartsOf(scene) {return scene.parts.map(part => ({ id: part.name, geometry: part.geometry, matrix: part.matrix, material: part.material?.id }));}+/** Every part's material by part ID, so a mark can tell which unmarked parts share its material. */+export function partMaterialsFor(record) {+ const materials = {};+ for (const part of queryPartsOf(record.scene)) {+ if (part.material !== undefined && part.material !== null) materials[part.id] = part.material;+ }+ return materials;+}+/** One cached scene query per session. It is rebuilt when the revision or any part matrix (a seeked pose) changes. */export function sceneQueryFor(record) {const parts = queryPartsOf(record.scene);diff --git a/scripts/mcp-server.mjs b/scripts/mcp-server.mjsindex 5f9f6a0b..e3a7913a 100644--- a/scripts/mcp-server.mjs+++ b/scripts/mcp-server.mjs@@ -1037,7 +1037,7 @@ export function createAgentMcpServer(runtime, { version = packageMetadata.versioconst metadata = findings ? lookMetadata : metadataWithoutFindings;return { content: [{ type: 'image', data, mimeType }, { type: 'text', text: JSON.stringify(metadata) }], structuredContent: metadata };});- const askUserTool = register('scene_ask_user', 'Open the view in the browser so the person pins points with notes; waits for Send. Use for a change hard to say in words. Returns marks with partId, point, normal, note, and the marked PNG. reviewFile: the text a review page saved, read instead of opening the browser.', z.strictObject({ ...sessionFields, reviewFile: z.string().max(16384).optional().describe('Text of the file a scene_export_web review page saved.'), prompt: z.string().max(200).optional().describe('Line shown above the picture.'), maxMarks: z.number().int().min(1).max(16).default(16), timeoutSeconds: z.number().int().min(10).max(900).default(300) }), askUser, async argumentsValue => {+ const askUserTool = register('scene_ask_user', 'Open the view in the browser so the person pins points with notes; waits for Send. Use for a change hard to say in words. Returns marks with partId, point, normal, note, and the marked PNG. materialSharedWith: own material first. reviewFile: the text a review page saved, read instead of opening the browser.', z.strictObject({ ...sessionFields, reviewFile: z.string().max(16384).optional().describe('Text of the file a scene_export_web review page saved.'), prompt: z.string().max(200).optional().describe('Line shown above the picture.'), maxMarks: z.number().int().min(1).max(16).default(16), timeoutSeconds: z.number().int().min(10).max(900).default(300) }), askUser, async argumentsValue => {const { content, image, viewMeta } = await runtime.askUser(clientShowsApps ? { ...argumentsValue, inline: true } : argumentsValue);return { content: [...(image ? [{ type: 'image', data: image, mimeType: 'image/png' }] : []), { type: 'text', text: JSON.stringify(content) }], ...(viewMeta ? { _meta: { 'crucible/annotate': viewMeta } } : {}) };});diff --git a/src/agent-annotate.js b/src/agent-annotate.jsindex 694c444f..20a595ec 100644--- a/src/agent-annotate.js+++ b/src/agent-annotate.js@@ -15,6 +15,8 @@ export const ANNOTATE_LIMITS = Object.freeze({minLassoPoints: 3,maxLassoPoints: 64,lassoSamplesPerAxis: 24,+ edgeCoverage: 0.15,+ maxSharedMaterialParts: 8,});const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47];@@ -163,9 +165,18 @@ export function lassoSamplePixels(points) {return samples;}+// The other parts, outside the mark, that use the same material: recolouring that material would change them too.+function sharedMaterialFields(material, markedIds, partMaterials, ownId) {+ if (material === null || !partMaterials) return {};+ const others = Object.keys(partMaterials).filter(id => partMaterials[id] === material && id !== ownId && !markedIds.has(id)).sort();+ if (others.length === 0) return {};+ const cap = ANNOTATE_LIMITS.maxSharedMaterialParts;+ return { materialSharedWith: others.slice(0, cap), ...(others.length > cap ? { materialSharedWithMore: others.length - cap } : {}) };+}+// The parts under a lasso, most covered first. Each carries its share of the picked pixels; the lasso's own hit fields are the// most covered part's hit nearest the outline's centre.-function describeLasso(mark, index, camera, { width, height, raycast }) {+function describeLasso(mark, index, camera, { width, height, raycast, partMaterials }) {const centre = polygonCentre(mark.points);const samples = lassoSamplePixels(mark.points);const groups = new Map();@@ -179,19 +190,28 @@ function describeLasso(mark, index, camera, { width, height, raycast }) {groups.set(hit.id, group);}const ranked = [...groups.entries()].sort(([firstId, first], [secondId, second]) => second.count - first.count || (firstId < secondId ? -1 : 1));- const parts = ranked.map(([partId, group]) => ({+ const measured = ranked.map(([partId, group]) => ({partId, samples: group.count, coverage: Math.round(group.count / samples.length * 100) / 100, material: group.hit.material ?? null,}));+ // A grazed edge part is listed but not meant by the outline, so its material still counts as shared with it.+ const markedIds = new Set(measured.filter(part => part.coverage >= ANNOTATE_LIMITS.edgeCoverage).map(part => part.partId));+ const parts = measured.map(part => ({+ ...part,+ ...(markedIds.has(part.partId) ? {} : { edge: true }),+ ...sharedMaterialFields(part.material, markedIds, partMaterials, part.partId),+ }));return { number: index + 1, kind: 'lasso', pixel: centre, points: mark.points, note: mark.note, ...hitFields(ranked[0]?.[1].hit), parts };}/*** Numbers the marks and attaches what each one points at: part ID, world point, normal and distance, or null on empty sky.* A lasso also returns kind, points and parts (the parts under its outline); its partId and point are the most covered part's.+ * partMaterials ({ partId: material }, optional) lets each lasso part list materialSharedWith, the unmarked parts on its material.+ * A part covering under ANNOTATE_LIMITS.edgeCoverage of the picked pixels is marked edge: true and stays listed.*/-export function describeMarks(marks, camera, { width, height, raycast }) {+export function describeMarks(marks, camera, { width, height, raycast, partMaterials }) {return marks.map((mark, index) => {- if (mark.kind === 'lasso') return describeLasso(mark, index, camera, { width, height, raycast });+ if (mark.kind === 'lasso') return describeLasso(mark, index, camera, { width, height, raycast, partMaterials });const hit = raycast(pixelRay(camera, mark.x, mark.y, width, height));return { number: index + 1, pixel: [mark.x, mark.y], note: mark.note, ...hitFields(hit) };});diff --git a/src/agent-scene-capabilities.js b/src/agent-scene-capabilities.jsindex 83fe4bdd..83c520e5 100644--- a/src/agent-scene-capabilities.js+++ b/src/agent-scene-capabilities.js@@ -236,7 +236,7 @@ export const AGENT_SCENE_CAPABILITIES = Object.freeze({terrain: 'One mesh, x and z from -size/2 to size/2, hills about y = 0. size 40 m (1-2000), resolution 64 cells (2-256), seed 1, amplitude 1 m (0-200), holes up to 16 of {center:[x,z],radius}, no surface inside; radius a few cells or more.',vehicleDamage: 'Geometry dented {source, impacts:[{point, direction, impulse N s}] 1-8, stiffness 2000, maxDepth 0.25 m, radius 0.4}: the source (not a fragment or dent) pushed in around each point by min(maxDepth, impulse/stiffness); a part that comes off is a body on a fixed joint with breakImpulse. docs/vehicle.md.',placedAssets: 'Node field asset:{id or name,materials?,flatten?,clip?,drive?} turns a group node into a catalog GLB (id from asset_catalog, or name: its exact file name, stored as the id; give one). Its transform places it. scene_apply add-node with an asset field places the first or any later instance, so a scene need not start with its assets. materials:[{name,id?,color,metallic,roughness,opacity,emission,emissiveColor}] override source materials by name; an id (such as "stool-heat") gives that material a handle that a set-motion material track can drive: emission and emissiveColor fade a heat glow, one id per placement. emissionMask:{axis:x|y|z,from,to} (metres in the own space of the part, smooth ramp, from above to flips it) multiplies emission so the glow sits only at one end while texture and shading stay; rasterizer only, path tracers ignore it. flatten:{color?,unlit?} flattens every material of the placement in one call: unlit true draws them without lighting, color [r,g,b] paints them one colour (textures dropped), both give a flat silhouette; a named override still wins. clip:{index,start=0,speed=1,loop=true} plays that clip from scene time start; set-motion tracks move the node and scene time seeks the clip. drive:{path | legs, cruiseSpeed | speed, wheels, lights} drives a car along a path in the placement frame (docs/vehicle.md). Max 512 placements, 16 assets, 16 animated.',- askUser: 'scene_ask_user opens the current view in their browser; they pin up to maxMarks (16) points, each with a note, and press Send. Ask when a change is hard to say in words ("warmer here", "this bit"), not for facts you can inspect. Each mark returns partId, point, normal, note, distance and material (null on sky), plus view.camera and a PNG with numbered pins. Apply the change the note names to that partId, then to similar parts (same material or name prefix) when the note says so. A mark with kind "lasso" is an outline around a region: apply the note to every part in its parts list (partId, coverage, material, most covered first), and skip a part with a tiny coverage that the note does not fit. Parts that share a material need their own material before one of them is recoloured. outcome cancelled or timeout returns no marks: ask in text. Edits made while they mark change revision; the result warns.',+ askUser: 'scene_ask_user opens the current view in their browser; they pin up to maxMarks (16) points, each with a note, and press Send. Ask when a change is hard to say in words ("warmer here", "this bit"), not for facts you can inspect. Each mark returns partId, point, normal, note, distance and material (null on sky), plus view.camera and a PNG with numbered pins. Apply the change the note names to that partId, then to similar parts (same material or name prefix) when the note says so. A mark with kind "lasso" is an outline around a region: apply the note to every part in its parts list (partId, coverage, material, most covered first), and skip a part with a tiny coverage that the note does not fit. A part with materialSharedWith has that material on parts outside the mark: give it its own material before you change it. A part with edge true only grazes the outline. outcome cancelled or timeout returns no marks: ask in text. Edits made while they mark change revision; the result warns.',navigation: 'scene_inspect path:{ground,from:[x,z],to:[x,z]} returns a route over the ground node around its holes, steep slopes and the nodes in avoid:[ids] (box footprints), as keyframes [{time,value:[x,y,z]}] for a translation track with interpolation LINEAR. radius 0.3 m; maxSlope 40 degrees; cellSize defaults to radius; seconds or speed (1.4 m/s); lift adds y.',meshEdits: Object.freeze({ operations: Object.freeze(Object.keys(MESH_EDIT_OPERATIONS)), maxEdits: MAX_MESH_EDITS }),meshStack: Object.freeze({ operations: STACK_OPERATIONS, maxNodes: MAX_STACK_NODES }),diff --git a/tests/agent-annotate-lasso.test.js b/tests/agent-annotate-lasso.test.jsindex c7ea5282..7ef69eeb 100644--- a/tests/agent-annotate-lasso.test.js+++ b/tests/agent-annotate-lasso.test.js@@ -106,3 +106,70 @@ test('the annotate page offers the lasso tool and returns a validated lasso markassert.equal((await send([{ kind: 'lasso', points: square, note: 'these' }])).status, 200);assert.deepEqual((await session).marks, [{ kind: 'lasso', points: square, note: 'these' }]);});++// Columns of the picture are three parts: two on "stone" (one marked, one outside the lasso), one on unique "bronze".+function columns(rayDirections) {+ return ray => {+ const found = rayDirections.find(([limit]) => ray.direction[0] < limit);+ if (!found) return null;+ const [, id, material] = found;+ return { id, point: [0, 0, 0], normal: [0, 1, 0], distance: 5, material };+ };+}+const lassoRegion = { kind: 'lasso', points: [[100, 50], [300, 50], [300, 150], [100, 150]], note: 'make these blue' };++test('a lasso part lists the unmarked parts on its material in materialSharedWith, sorted by ID', () => {+ const raycast = columns([[-0.0001, 'plinth', 'stone'], [1, 'statue', 'bronze']]);+ const partMaterials = { zeta: 'stone', plinth: 'stone', alpha: 'stone', statue: 'bronze', lamp: 'brass' };+ const [mark] = describeMarks([lassoRegion], camera, { ...view, raycast, partMaterials });+ const plinth = mark.parts.find(part => part.partId === 'plinth');+ const statue = mark.parts.find(part => part.partId === 'statue');+ assert.deepEqual(plinth.materialSharedWith, ['alpha', 'zeta']);+ assert.equal('materialSharedWithMore' in plinth, false);+ assert.equal('materialSharedWith' in statue, false, 'a unique material has no field');+});++test('a part whose material is shared only with parts inside the same mark gets no materialSharedWith', () => {+ const raycast = columns([[-0.0001, 'left', 'stone'], [1, 'right', 'stone']]);+ const [mark] = describeMarks([lassoRegion], camera, { ...view, raycast, partMaterials: { left: 'stone', right: 'stone' } });+ assert.equal(mark.parts.some(part => 'materialSharedWith' in part), false);+});++test('materialSharedWith lists at most 8 IDs and counts the rest in materialSharedWithMore', () => {+ const raycast = columns([[1, 'plinth', 'stone']]);+ const partMaterials = { plinth: 'stone' };+ for (let index = 0; index < 11; index++) partMaterials[`floor-${String(index).padStart(2, '0')}`] = 'stone';+ const [mark] = describeMarks([lassoRegion], camera, { ...view, raycast, partMaterials });+ const [plinth] = mark.parts;+ assert.deepEqual(plinth.materialSharedWith, ['floor-00', 'floor-01', 'floor-02', 'floor-03', 'floor-04', 'floor-05', 'floor-06', 'floor-07']);+ assert.equal(plinth.materialSharedWithMore, 3);+ partMaterials['floor-11'] = 'other';+ delete partMaterials['floor-10'];+ delete partMaterials['floor-09'];+ delete partMaterials['floor-08'];+ const [exact] = describeMarks([lassoRegion], camera, { ...view, raycast, partMaterials });+ assert.equal(exact.parts[0].materialSharedWith.length, 8);+ assert.equal('materialSharedWithMore' in exact.parts[0], false, 'exactly 8 needs no count');+});++test('a part under 15 percent of the picked pixels is marked edge: true and stays listed', () => {+ // The sliver is the strip of rays right of x = 0.46 at the far right of the outline.+ const raycast = ray => ({ id: ray.direction[0] > 0.46 ? 'floor' : 'plinth', point: [0, 0, 0], normal: [0, 1, 0], distance: 5, material: 'stone' });+ const [mark] = describeMarks([lassoRegion], camera, { ...view, raycast });+ const floor = mark.parts.find(part => part.partId === 'floor');+ const plinth = mark.parts.find(part => part.partId === 'plinth');+ assert.ok(floor && floor.coverage > 0 && floor.coverage < ANNOTATE_LIMITS.edgeCoverage, `floor coverage ${floor?.coverage}`);+ assert.equal(floor.edge, true);+ assert.deepEqual(plinth.materialSharedWith, undefined, 'no partMaterials given, so nothing is claimed');+ assert.equal('edge' in plinth, false);+ const atThreshold = describeMarks([lassoRegion], camera, { ...view, raycast: () => ({ id: 'only', point: [0, 0, 0], normal: [0, 1, 0], distance: 1, material: null }) })[0];+ assert.equal('edge' in atThreshold.parts[0], false, 'full coverage is not an edge');+ assert.equal(ANNOTATE_LIMITS.edgeCoverage, 0.15);+});++test('a pin result is unchanged by partMaterials', () => {+ const pin = { x: 100, y: 100, note: 'pin' };+ const expected = { number: 1, pixel: [100, 100], note: 'pin', partId: 'wall', point: [-1, 0, 0], normal: [0, 0, 1], distance: 10, material: 'plaster' };+ assert.deepEqual(describeMarks([pin], camera, { ...view, raycast: wallLampSky })[0], expected);+ assert.deepEqual(describeMarks([pin], camera, { ...view, raycast: wallLampSky, partMaterials: { wall: 'plaster', other: 'plaster' } })[0], expected);+});diff --git a/tests/ask-user-fixture.test.js b/tests/ask-user-fixture.test.jsindex 6bba2d48..22cb8d86 100644--- a/tests/ask-user-fixture.test.js+++ b/tests/ask-user-fixture.test.js@@ -110,6 +110,11 @@ test('the bench lasso outlines the statue and the plinth, not the floor, at theconst covered = Object.fromEntries(mark.parts.map(part => [part.partId, part.coverage]));assert.ok(covered.statue > 0.25 && covered.plinth > 0.25, JSON.stringify(covered));assert.ok((covered.floor ?? 0) < 0.15, `the floor stays a sliver: ${JSON.stringify(covered)}`);+ const byId = Object.fromEntries(mark.parts.map(part => [part.partId, part]));+ assert.deepEqual(byId.plinth.materialSharedWith, ['floor'], 'the plinth shares stone with the unmarked floor');+ assert.equal('materialSharedWith' in byId.statue, false);+ assert.equal(byId.floor.edge, true);+ assert.equal('edge' in byId.plinth, false);});function startServer(environmentOverrides) {diff --git a/tests/support/preview-harness.mjs b/tests/support/preview-harness.mjsindex e2031bb1..97b4c0a0 100644--- a/tests/support/preview-harness.mjs+++ b/tests/support/preview-harness.mjs@@ -20,7 +20,7 @@ import { AGENT_SCENE_DEFAULT_LIMITS, MEMORY_CEILING_MIB } from '../../src/agent-import { describeApplication } from '../../src/agent-apply-report.js';import { framingProblems, placementProblems, textureProblems, exposureProblems, lumaShares } from '../../src/frame-checks.js';import { agentAssetDecodeOptions, withCatalogLimitAdvice } from '../../src/agent-asset-limits.js';-import { sceneQueryFor, summarizeWalkMap, walkOptionsFor, createQueryOnlyCache } from '../../scripts/agent-walkmap.js';+import { sceneQueryFor, partMaterialsFor, summarizeWalkMap, walkOptionsFor, createQueryOnlyCache } from '../../scripts/agent-walkmap.js';import { describeMarks, validateMarks } from '../../src/agent-annotate.js';// Runs the preview page's adapter code in a VM with a fault-injected renderer, the way the MCP preview runs it in a browser.@@ -88,7 +88,7 @@ export function previewHarness({ createImageBitmap = async () => { throw new Err// The harness loads Manifold from node_modules directly, so the preview's served-file loader is ignored.setManifoldModuleLoader: () => {},needsPhysics, loadPhysicsEngine, physicsEngineLoaded, setPhysicsModuleLoader: () => {},- describeMarks, validateMarks, sceneQueryFor, summarizeWalkMap, walkOptionsFor, createQueryOnlyCache, parseGltf, hasPatternTextures, rasterOptionsFor, Uint8Array, atob, sessionProblem, SCENE_STORE_LIMITS, AGENT_SCENE_DEFAULT_LIMITS, MEMORY_CEILING_MIB, imageLimitProblem, TEXTURE_SEQUENCE_LIMITS, Blob, createImageBitmap, describeApplication, framingProblems, placementProblems, textureProblems, exposureProblems, lumaShares, assetCopyKey, recipeAssetNeeds, agentAssetDecodeOptions, withCatalogLimitAdvice,+ describeMarks, validateMarks, sceneQueryFor, partMaterialsFor, summarizeWalkMap, walkOptionsFor, createQueryOnlyCache, parseGltf, hasPatternTextures, rasterOptionsFor, Uint8Array, atob, sessionProblem, SCENE_STORE_LIMITS, AGENT_SCENE_DEFAULT_LIMITS, MEMORY_CEILING_MIB, imageLimitProblem, TEXTURE_SEQUENCE_LIMITS, Blob, createImageBitmap, describeApplication, framingProblems, placementProblems, textureProblems, exposureProblems, lumaShares, assetCopyKey, recipeAssetNeeds, agentAssetDecodeOptions, withCatalogLimitAdvice,applyProjection, applyCameraFields, mat4, fitAgentShadow, resolveAgentShadow, agentEnvironmentMap, BRANCH_LIMITS,// Line art needs a real renderer with render passes, so the fault-injected one gets a no-op install.agentSceneModule: name => (name === 'lineArt' ? { installLineArt: renderer => renderer } : name === 'userPass' ? { ...agentSceneModule(name), installUserPasses: renderer => renderer } : agentSceneModule(name)), agentSceneModuleLoaded, createBranchStore, printableLabel,