Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

feat(agent): publish in-loop render contract (#21)

Matthew Kissingeref62cfe8ee5c
diff --git a/src/agent/index.ts b/src/agent/index.ts
index 36807780..cff1ccd2 100644
--- a/src/agent/index.ts
+++ b/src/agent/index.ts
@@ -26,6 +26,9 @@ export type { RunKilnAgentOptions, RunKilnAgentResult, KilnKnowhow, KilnInputIma
export { resolveToolSurface, buildAgentTools } from './surface';
export type { KilnToolSurface, RefineMode } from './surface';
+export { DEFAULT_INLOOP_VIEW_RENDER_TIMEOUT_MS } from '../tools/registry';
+export type { InLoopViewRender } from '../tools/registry';
+
export {
generateKilnAsset,
generateKilnCodeAgent,
diff --git a/src/tools/__tests__/registry-render-views.test.ts b/src/tools/__tests__/registry-render-views.test.ts
index d87c431b..bb4e22ef 100644
--- a/src/tools/__tests__/registry-render-views.test.ts
+++ b/src/tools/__tests__/registry-render-views.test.ts
@@ -31,6 +31,12 @@ describe('kilnRenderViewsDef (unified kiln_render)', () => {
expect(kilnToolRegistry.filter((d) => d === kilnRenderViewsDef)).toEqual([]);
});
+ test('describes the conditional GPU PBR path and the flat-shaded CPU fallback honestly', () => {
+ expect(kilnRenderViewsDef.description).toContain('GPU PBR shading');
+ expect(kilnRenderViewsDef.description).toContain('textured or metallic materials');
+ expect(kilnRenderViewsDef.description).toContain('flat-shaded CPU render');
+ });
+
test('valid code returns metrics AND the six-view grid PNG from one execution', async () => {
const out = (await kilnRenderViewsDef.run({ code: BOX_CODE })) as KilnRenderViewsResult;
expect(out.ok).toBe(true);
diff --git a/src/tools/registry.ts b/src/tools/registry.ts
index 9a213c9b..13a415bc 100644
--- a/src/tools/registry.ts
+++ b/src/tools/registry.ts
@@ -643,7 +643,7 @@ const KILN_RENDER_VIEWS_DESCRIPTION =
'elevation 0 = eye level, positive looks down. Use it to aim every cell at what actually needs ' +
'checking — a seam, an underside, a joint the standard six leave occluded — instead of spending ' +
'cells on angles that show nothing. Max 9 cells. The reply echoes the grid shape it rendered. ' +
- 'If the build fails you get an error and NO image — fix the code and render again. Flat-shaded CPU render; writes no files.';
+ 'If the build fails you get an error and NO image — fix the code and render again. Uses GPU PBR shading when the scene has textured or metallic materials and the renderer is reachable; otherwise uses a flat-shaded CPU render. Writes no files.';
/** Create the unified render/view definition with host-owned QA context. */
export function createKilnRenderViewsDef(context: KilnToolContext = {}): KilnToolDef {