openpencil/src
Danila Poyarkov 77509d8979 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 16:07:35 +03:00
..
ai Unify tool definitions: define once, adapt for AI/CLI/MCP 2026-03-01 16:07:35 +03:00
components Unify tool definitions: define once, adapt for AI/CLI/MCP 2026-03-01 16:07:35 +03:00
composables Merge chat-panel: AI chat with OpenRouter, tool execution, model selector 2026-03-01 11:55:57 +03:00
engine Add Code tab with JSX export and syntax highlighting 2026-03-01 12:12:45 +03:00
kiwi Deduplicate kiwi and serialization code 2026-03-01 10:59:35 +03:00
stores Rich text style runs with per-selection bold/italic/underline 2026-03-01 09:03:38 +03:00
app.css Use reka-ui Tabs/ScrollArea/Collapsible/Tooltip, tw-animate-css, vue-stream-markdown 2026-03-01 11:03:51 +03:00
App.vue Move AI chat to Design/AI tab in properties panel 2026-03-01 10:54:51 +03:00
constants.ts Extract @open-pencil/core package 2026-03-01 01:03:07 +03:00
demo.ts Add variable collections to demo: primitives, semantic tokens, spacing 2026-03-01 02:04:41 +03:00
env.d.ts Replace emoji icons with Lucide via Iconify (unplugin-icons) 2026-02-28 08:24:42 +03:00
global.d.ts Fix chat reactivity (markRaw), add Playwright tests with mock transport 2026-03-01 11:30:30 +03:00
main.ts Preload system fonts on app startup 2026-03-01 02:57:58 +03:00
types.ts Extract @open-pencil/core package 2026-03-01 01:03:07 +03:00