openpencil/tests
Danila Poyarkov 3849872b32 Unify tool definitions: define once, adapt for AI/CLI/MCP
Move tool logic to @open-pencil/core/tools/schema.ts as framework-agnostic
ToolDef objects. AI adapter generates valibot schemas + Vercel AI tool()
wrappers automatically.

26 tools (was 10): create_shape, render (JSX), set_fill, set_stroke,
set_effects, set_layout, set_constraints, update_node, delete, clone,
rename, reparent, group/ungroup, find_nodes, get_node, get_page_tree,
get_selection, select, list_pages, switch_page, list_variables,
list_collections, create_component, create_instance, eval.

src/ai/tools.ts: 269→28 lines (adapter only).

Tests for all 3 interfaces:
- 26 core tool tests (FigmaAPI directly)
- 11 AI adapter tests (valibot + Vercel AI SDK tool())
- 12 CLI integration tests (eval command on .fig fixture)
323 total, all passing.
2026-03-01 15:02:05 +03:00
..
e2e Fix tool name extraction from UIMessage parts, add tool call e2e test 2026-03-01 11:51:38 +03:00
engine Unify tool definitions: define once, adapt for AI/CLI/MCP 2026-03-01 15:02:05 +03:00
figma Playwright visual regression testing with Figma CDP reference 2026-02-28 07:32:15 +03:00
fixtures Add .fig test fixtures (LFS) and fix O(n²) import bottleneck 2026-03-01 09:55:07 +03:00
helpers Fix silent rendering crash, no-chrome test mode, error detection 2026-02-28 08:39:19 +03:00