feat(canvas): register figcraft's canvas tools in the termul MCP server

Merged
GN
3d ago
+1659-167

Summary

  • Agents need figcraft's own tools, with file access limited to the project.
  • Part 5 of 10 in a stacked series. Review and merge bottom-up; each PR targets the one below it. Canvas mode v3 (figcraft engine). Spec: spec-openpencil-canvas-mode; architecture spine 2026-10-16 (AD-17 to AD-31).

Related Issue

No issue. Split from #1369 so each part stays under 50 files.

Type of Change

  • feat: new feature

What Changed

  • Registers figcraft's 18 tools from its own definitions (names cannot drift). save_file saves through the host, exports write only inside the project, open_file answers UNSUPPORTED_IN_KIOSK.
  • Pins the fork release termul-v0.1.0 and formats two files biome ci flagged on dev.

Scope

  • E3-2. Proven with a probe agent spawned through the real ACP path.

How It Was Tested

  • bun run typecheck on this branch
  • Each part is a checkpoint that was built and tested when it was made (cargo test for canvas and host_mcp, vitest, real runs in headless Edge). The bottom and top of the stack were rebuilt and re-tested on current dev.

Checklist

  • PR title follows the conventional commit format
  • Explained why no issue exists
  • Added or updated tests
  • Read AGENTS.md
  • A human reviewed the complete diff before submission

🤖 Generated with Claude Code


Summary by cubic

Registers figcraft's own canvas tools, resources, and prompts in the host termul MCP server, with file access constrained to the session's project.

  • Tool, resource, and prompt surfaces are read from the pinned figcraft-mcp crate at runtime so names and schemas cannot drift. Every canvas call runs through a new kiosk policy in the parent: file.save becomes host.save, exports run inline and write only to paths validated inside the project, and open_file plus other path-taking commands answer UNSUPPORTED_IN_KIOSK.
  • The renderer gateway answers host.save with the canvas store's save and replies with the document's project-relative path.
  • Pins the figcraft fork to the termul-v0.1.0 release tag (previously a rev), making the pin check fail closed on any tag mismatch.

Migration

  • Part 5 of 10 in a stack: review and merge bottom-up, each PR targeting the one below it.