MCP: References and viewing images (#194) #208
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!208
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-194-mcp-references"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #194. Part of #157.
What changed
read_reference_setreturns a set's Tiles, each Tile's versions (generation or import provenance,lockedIn) and its Lock snapshots.list_location_reference_setsreturns a Location's sets, one per Lighting, with the Location's own note and the note in force.add_tileandremove_tileboth return the set.generate_tile(prompt) andedit_tile(instruction, orderedreferences, optionalseed) return{ jobId, version }. A reference can be any image the Project holds: a Reference version, Keyframe, Panel, Source sheet or Take frame. These use the existingEditSourceDto, which now also derivesJsonSchema.import_tile_imagemakes the file a Source sheet and crops the whole sheet into the Tile, so the version has ordinary import provenance. Importing the same image again returns the existing version.import_source_sheetimports a sheet.import_voice_cliptakes a Character id and imports into that Character's voice set.lock_reference_setlocks the set.roll_back_reference_setmakes a new snapshot that copies an earlier snapshot's pick.preview_atlastakes 1 to 3 Look ids.view_imagetakes a typed reference:referenceVersion,sourceSheet,atlas(bylookIds) orpanel. It returns MCP image content scaled down to a long edge ofmaxSize, default 1024. Scaled images come back as PNG; images that already fit come back as stored. WithsaveTo(an absolute path) it writes the full-resolution stored bytes there and returns the path, media type and size. Keyframes and Take frames are left to later slices.ProjectSession::import_tile_imageimports and crops as one command and refuses an unknown Tile before it imports anything.reference_imageresolves an image reference the same way an Edit does.atlas_imagereads a cached Atlas.Beyond the issue
get_projectnow showseditReferenceLimit, so a harness knows how many referencesedit_tiletakes.Review notes
ApiImplmethods are plain methods, not on the RPC trait, asjob_statuseswas for #193. The UI has no use for them yet.Tests
src-tauri/tests/mcp_references.rshas 11 tests at the MCP boundary:wait_for_jobs→view_image→ Edit with references and a seed → lockview_imagedownscaling by default and withmaxSize,saveTowriting the full-resolution file, and a relativesaveToand unknown id refusedget_projectshowingeditReferenceLimitThe full workspace suite passes. Clippy shows no warnings in the changed code.