Skip to content

feat: agent map data + framebuffer canvas screenshot#210

Merged
JumpLink merged 1 commit into
mainfrom
feat/agent-map-tools
Jun 12, 2026
Merged

feat: agent map data + framebuffer canvas screenshot#210
JumpLink merged 1 commit into
mainfrom
feat/agent-map-tools

Conversation

@JumpLink

Copy link
Copy Markdown
Contributor

First two of the three agreed agent-tooling building blocks (data first):

GetMapData(mapId) / MCP get_map_data — compact, agent-oriented JSON projection of a loaded map: a walkability grid (. walkable / # solid / void; folds every visible layer's per-tile solid flags + blocking placements), placements with names resolved through the canonical resolvePlacementDefinition, spawn points and teleports with their targets. Pure engine service (services/agent-map-data.ts, spec'd + registered), works with no open scene, engine or visible window. It proved itself during its own validation: the grid immediately exposed two real gameplay bugs — the tree-house spawn point sat on the solid stool tile, and both kokiri door triggers sat on solid tiles the player can never enter (fixed in this PR: spawn → (5,7), triggers → the walkable mat row 67, return arrival → (76,68)).

Framebuffer canvas screenshotScreenshot('canvas') now reads the WebGL framebuffer instead of Gtk.WidgetPaintable: the engine widget hooks connect_after('render') on the GLArea bridge (the only moment its framebuffer is bound — out-of-frame readPixels returns blanks, which the first two implementation attempts demonstrated), forces a frame via queue_render(), flips the rows and encodes via GdkPixbuf. Chrome-free content that works while the window is occluded (mapped windows keep their frame clock); widget-snapshot stays as fallback (no engine / minimised). Screenshot is now async on the Control plane (precedent: StartSession). Known quirk noted in TODO: a faint offset ghost from FBO double-buffer residue.

Bridge: new get_map_data tool (+ guidance to prefer it over screenshots), updated screenshot description, pause-policy classification (GetMapData: read-only, pinned table extended). Both validated END-TO-END through the restarted MCP bridge against the live editor. Follow-ups in TODO.md: render_map (offscreen full-map PNG via the MapPreview Gsk pipeline) and an optional blocking open_scene.

@JumpLink JumpLink merged commit 18e36b7 into main Jun 12, 2026
1 check passed
@JumpLink JumpLink deleted the feat/agent-map-tools branch June 12, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant