Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Merge origin/main into feat/777-mcp-game

Nguyen Xuan An050dc4034702
diff --cc docs/learn/connect-mcp.md
index a8bfa176,d3f9ac62..fdb3415f
--- a/docs/learn/connect-mcp.md
+++ b/docs/learn/connect-mcp.md
@@@ -6,7 -6,7 +6,7 @@@ This page connects the 67js MCP server
`67js-mcp` is a local program. The harness starts it and talks to it over stdin and stdout. It has no network listener for MCP.
- The server holds one active scene. When the agent calls `scene_create`, the server starts your installed Chrome in the background and renders the scene there. It gives the agent 24 tools to build, look at and export the scene. The tools take JSON, and they never run code that the agent writes.
-The server holds a few open scenes and uses the last one you used when a call has no `sessionId`. When the agent calls `scene_create`, the server starts your installed Chrome in the background and renders the scene there. It gives the agent 23 tools to build, look at and export the scene. The tools take JSON, and they never run code that the agent writes.
++The server holds a few open scenes and uses the last one you used when a call has no `sessionId`. When the agent calls `scene_create`, the server starts your installed Chrome in the background and renders the scene there. It gives the agent 24 tools to build, look at and export the scene. The tools take JSON, and they never run code that the agent writes.
You need two things:
diff --cc index.html
index bfd870ed,a710af32..34c49d7f
--- a/index.html
+++ b/index.html
@@@ -27,33 -29,26 +29,26 @@@
</nav>
<a class="site-nav-cta" href="https://github.com/codepawl/67.js" aria-label="GitHub"><span class="package-logo package-logo-github" aria-hidden="true"></span><span class="site-nav-cta-label">GitHub</span></a>
</header>
- <main id="content">
- <section class="hero" aria-label="67js introduction and live preview">
- <div class="hero-frame" data-glow="#ff6a2b">
- <a class="hero-shot" href="./showcase.html?scene=airport" aria-label="Open the airport ramp as a live 3D scene">
- <img src="./previews/showcase-airport.webp" alt="An airport ramp with a 787 at its stand and the turnaround crew, rendered by 67js" width="1280" height="720" fetchpriority="high" />
- </a>
- <canvas id="hero-viewport" class="hero-viewport" aria-label="Live 3D airport ramp. Drag to orbit, or pick a shot."></canvas>
- <aside class="hero-prompt" aria-label="Agent prompt presets">
- <div class="hero-prompt-tabs" role="group" aria-label="Agent prompt">
- <button type="button" data-prompt-preset="model" aria-pressed="true">Stand</button>
- <button type="button" data-prompt-preset="explode" aria-pressed="false">Ramp crew</button>
- <button type="button" data-prompt-preset="blend" aria-pressed="false">Sunset tower</button>
- <button type="button" data-prompt-preset="review" aria-pressed="false">Normals</button>
- </div>
- <p class="hero-prompt-text" data-agent-prompt>"Frame the widebody stand at golden hour with 3-cascade shadows across the Boeing 787-9, service trucks, and ground crew."</p>
- </aside>
- </div>
- <div class="hero-copy">
- <h1>3D engine that<br />AI agents drive</h1>
- <p class="lede">Real-time WebGL2 with Glaze, offline path tracing with Cook, and 24 MCP tools in one package.</p>
- <div class="hero-actions">
- <a href="/docs.html#getting-started" data-icon="book">Get started</a>
- <a href="https://www.npmjs.com/package/@codepawlhq/67js"><span class="package-logo package-logo-npm brand-npm" aria-hidden="true"></span>npm</a>
- </div>
+ <section id="hero" class="hero-loop" data-scene="port" aria-label="67js introduction and live preview">
+ <div class="stage" id="stage" role="img" aria-label="A live 3D scene: Container port">
+ <picture><source media="(max-width: 700px)" srcset="/hero-lab/poster-b-port-mobile.webp" /><img class="poster" id="poster" src="/hero-lab/poster-b-port.webp" alt="" width="1440" height="900" fetchpriority="high" /></picture>
+ </div>
+ <div class="copy">
+ <h1>3D engine that<br />AI agents drive</h1>
- <p class="lede">Real-time WebGL2 with Glaze, offline path tracing with Cook, and 23 MCP tools in one package.</p>
++ <p class="lede">Real-time WebGL2 with Glaze, offline path tracing with Cook, and 24 MCP tools in one package.</p>
+ <div class="hero-actions">
+ <a href="/docs.html#getting-started" data-icon="book">Get started</a>
+ <a href="https://www.npmjs.com/package/@codepawlhq/67js"><span class="package-logo package-logo-npm brand-npm" aria-hidden="true"></span>npm</a>
</div>
- </section>
-
+ </div>
+ <div class="scene-bar">
+ <div class="attribution" id="attribution" hidden></div>
+ <div class="credits-panel" id="credits-panel" hidden></div>
+ <nav class="scene-tabs" id="scene-tabs" aria-label="Scenes"></nav>
+ <button class="credits-toggle" id="credits-toggle" type="button" aria-expanded="false" aria-controls="credits-panel"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8v.1"/></svg><span class="credits-label">Credits</span></button>
+ </div>
+ </section>
+ <main id="content">
<section id="downloads" class="home-install" aria-label="Install 67js">
<div class="package-install">
<div class="package-managers" role="group" aria-label="Package manager">
diff --cc scripts/agent-runtime.mjs
index a76255ab,2d53295a..1f304f2a
--- a/scripts/agent-runtime.mjs
+++ b/scripts/agent-runtime.mjs
@@@ -46,9 -44,9 +46,10 @@@ const MAXIMUM_OBJECT_NAMES = 1000
// A path trace shares the machine with the person using it, so it takes half of the eight-thread ceiling.
const PATH_TRACER_THREADS = 8;
const MAXIMUM_QUEUED_CALLS = 16;
+ const MAXIMUM_REMEMBERED_EVICTIONS = 32;
const MAXIMUM_GLB_BYTES = 32 * 1024 * 1024;
const MAXIMUM_KEPT_GLBS = 8;
+const MAXIMUM_KEPT_WEB_BUILDS = 4;
const EVALUATION_TIMEOUT_MS = 30000;
const QUERY_ONLY_TIMEOUT_MS = 120000;
/** A bake runs on a worker for up to its own limit, so a call that bakes gets that much more than a plain call. */
@@@ -725,9 -754,9 +758,9 @@@ export function createAgentRuntime({ ke
return Object.freeze({
async capabilities() {
return {
- scene: { ...AGENT_SCENE_CAPABILITIES, postPasses: USER_PASS_CAPABILITIES, meshBlend: MESH_BLEND_CAPABILITIES, materialSnippet: MATERIAL_SNIPPET_CAPABILITIES, vegetation: VEGETATION_CAPABILITY_NOTE, crowd: CROWD_CAPABILITY_NOTE, textureSequence: TEXTURE_SEQUENCE_CAPABILITIES },
+ scene: { ...AGENT_SCENE_CAPABILITIES, game: GAME_CAPABILITIES, postPasses: USER_PASS_CAPABILITIES, meshBlend: MESH_BLEND_CAPABILITIES, materialSnippet: MATERIAL_SNIPPET_CAPABILITIES, vegetation: VEGETATION_CAPABILITY_NOTE, crowd: CROWD_CAPABILITY_NOTE, textureSequence: TEXTURE_SEQUENCE_CAPABILITIES },
sceneLimits: SCENE_LIMITS,
- preview: { backend, memoryBudgetMiB: memory, maximumWidth: 1024, maximumHeight: 1024, maximumImageBytes: MAXIMUM_IMAGE_BYTES, maximumActiveScenes: 1, maximumQueuedCalls: MAXIMUM_QUEUED_CALLS, evaluationTimeoutMs: EVALUATION_TIMEOUT_MS },
+ preview: { backend, memoryBudgetMiB: memory, maximumWidth: 1024, maximumHeight: 1024, maximumImageBytes: MAXIMUM_IMAGE_BYTES, maximumActiveScenes: SCENE_STORE_LIMITS.maxOpenScenes, maximumOpenSceneBytes: SCENE_STORE_LIMITS.maxOpenSceneBytes, maximumQueuedCalls: MAXIMUM_QUEUED_CALLS, evaluationTimeoutMs: EVALUATION_TIMEOUT_MS },
review: { ...REVIEW_LIMITS, backend, memoryBudgetMiB: memory, evaluationTimeoutMs: EVALUATION_TIMEOUT_MS,
totalTimeoutMs: EVALUATION_TIMEOUT_MS,
sourcePreserved: true, defaultMotionTime: null, defaultRendererTime: 0, branches: BRANCH_LIMITS },
diff --cc scripts/smoke-mcp-package.mjs
index ed6a0185,3e45fdce..480f1276
--- a/scripts/smoke-mcp-package.mjs
+++ b/scripts/smoke-mcp-package.mjs
@@@ -120,10 -120,10 +120,10 @@@ for (const era of ['modern', 'legacy']
const connectMs = performance.now() - start;
processId = transport.pid;
assert.equal(client.getServerVersion().version, metadata.version);
- assert.equal((await client.listTools()).tools.length, 23);
+ assert.equal((await client.listTools()).tools.length, 24);
const capabilities = (await call('scene_capabilities')).structuredContent;
assert.equal(capabilities.phase, 'idle');
- assert.equal((await call('scene_capabilities', { topic: 'preview' })).structuredContent.value.maximumActiveScenes, 1);
+ assert.equal((await call('scene_capabilities', { topic: 'preview' })).structuredContent.value.maximumActiveScenes, 4);
assert.equal(capabilities.availableIn, metadata.version);
if (protocolOnly) {
results.push({ era, tools: 18, connectMs, browserStarted: false });
diff --cc tests/agent-runtime.test.js
index d0599323,77d0c2ea..d674f980
--- a/tests/agent-runtime.test.js
+++ b/tests/agent-runtime.test.js
@@@ -112,9 -112,9 +113,9 @@@ async function reviewRuntimeHarness({ f
const context = createContext({ createServer, randomUUID, existsSync: () => true,
readFile: async () => '', packageMetadata: { version: 'test' },
createRequire: () => ({ resolve: () => { throw new Error('no peer in tests'); } }),
- VEGETATION_CAPABILITY_NOTE, CROWD_CAPABILITY_NOTE, USER_PASS_CAPABILITIES, MESH_BLEND_CAPABILITIES, MATERIAL_SNIPPET_CAPABILITIES, AGENT_SCENE_CAPABILITIES, AGENT_SCENE_DEFAULT_LIMITS, RENDER_PASS_NAMES, RENDER_PASS_DEPTH_RANGE, VIDEO_ENCODERS, MAXIMUM_VIDEO_SECONDS, MAXIMUM_JOB_SIDE, MAXIMUM_JOB_PIXELS, MAXIMUM_MEMORY_MIB, BAKE_WORKER_MAXIMUM_SECONDS, PATH_TRACER_CAPABILITIES,
+ VEGETATION_CAPABILITY_NOTE, CROWD_CAPABILITY_NOTE, GAME_CAPABILITIES, USER_PASS_CAPABILITIES, MESH_BLEND_CAPABILITIES, MATERIAL_SNIPPET_CAPABILITIES, AGENT_SCENE_CAPABILITIES, AGENT_SCENE_DEFAULT_LIMITS, RENDER_PASS_NAMES, RENDER_PASS_DEPTH_RANGE, VIDEO_ENCODERS, MAXIMUM_VIDEO_SECONDS, MAXIMUM_JOB_SIDE, MAXIMUM_JOB_PIXELS, MAXIMUM_MEMORY_MIB, BAKE_WORKER_MAXIMUM_SECONDS, PATH_TRACER_CAPABILITIES,
recipeAssetNeeds, sequenceFrameIds, catalogLookReferences, BUNDLED_ENVIRONMENT_NAMES, BUNDLED_CUBE_LOOK_NAMES, TEXTURE_SEQUENCE_CAPABILITIES, AGENT_ASSET_LIMITS, assertCombinedAssetBytes,
- audioInputArguments, createAudioLibrary, measureStreamSeconds, filmTimelineDuration, filmTimelineShotStarts, sampleFilmTimeline, normalizeReview, REVIEW_LIMITS, isPreviewHost, BRANCH_LIMITS, validateBranchName,
+ audioInputArguments, createAudioLibrary, measureStreamSeconds, filmTimelineDuration, filmTimelineShotStarts, sampleFilmTimeline, normalizeReview, REVIEW_LIMITS, isPreviewHost, BRANCH_LIMITS, validateBranchName, sessionProblem, SCENE_STORE_LIMITS,
chromium: { launch: async () => browser }, URL, Buffer, process, performance, clearTimeout,
setTimeout: (callback, delay) => { deadlines.push(delay); return setTimeout(callback, delay); },
});