mirror of
https://github.com/hanzoai/extension.git
synced 2026-10-31 21:57:06 +00:00
New @hanzo/figma package: a Figma + FigJam plugin that rewrites, translates, content-fills, critiques (with a11y notes), renames layers, and generates copy variants for the selected layers — built on the published @hanzo/ai headless client against api.hanzo.ai. Two-thread architecture per the Figma plugin model: - code.ts (main): serializes the selection into a plain SelectionSnapshot (text nodes + structure + colors, node-budgeted) and applies write-backs (font-loaded setCharacters, rename, createText) — full figma.* access, no net. - ui.ts (iframe): the only place the model is called; streams via design-core, parses per action, posts edits/inserts back to code.ts over a typed postMessage protocol (messaging.ts). - design-core.ts (PURE): the design-action catalog (system+user prompt builders per action), selection->context assembly + budget truncation, response parsing (JSON id->value edit maps with id allow-listing, variant-list splitting), and the @hanzo/ai run funnels over an injectable client. Key pasted in the UI, validated via /v1/models, stored in figma.clientStorage; manifest networkAccess allowlists only api.hanzo.ai. esbuild build emits the three Figma files (code.js IIFE, ui.html with JS+CSS inlined, manifest.json). 56 vitest tests green (design-core + messaging guards); tsc --noEmit clean.
9 lines
158 B
TypeScript
9 lines
158 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
include: ['tests/**/*.test.ts'],
|
|
environment: 'node',
|
|
},
|
|
});
|