@tarot-ai/pixel 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +218 -20
- package/dist/index.cjs +75 -51
- package/dist/view/index.html +2 -2
- package/dist/view/view-assets/{App-D5VfGkce.js → App-BkF1Yv4U.js} +1 -1
- package/dist/view/view-assets/index-CVVd8wWv.css +1 -0
- package/dist/view/view-assets/index-De_cXzWY.js +352 -0
- package/package.json +10 -3
- package/dist/view/view-assets/index-CMO4vRwl.js +0 -352
- package/dist/view/view-assets/index-CfsmYNhW.css +0 -1
package/README.md
CHANGED
|
@@ -1,27 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tarot Pixel
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
提供本地设计稿读取、分析、渲染和资源生成能力。
|
|
3
|
+
[简体中文](#简体中文) · [English](#english)
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Tarot Pixel connects MasterGo, Figma, and Sketch designs with Coding Agents through a local
|
|
6
|
+
MCP runtime and structured visual context.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
Tarot Pixel 通过本地 MCP Runtime 和结构化视觉上下文,把 MasterGo、Figma、Sketch
|
|
9
|
+
设计稿连接到 Coding Agent。
|
|
10
|
+
|
|
11
|
+
## 简体中文
|
|
12
|
+
|
|
13
|
+
### 产品简介
|
|
14
|
+
|
|
15
|
+
Tarot Pixel 是设计稿与 Coding Agent 之间的桥梁。设计工具插件负责读取并同步设计稿,
|
|
16
|
+
`@tarot-ai/pixel` 在本机保存、分析和渲染设计数据,再通过 MCP 向 Qoder 等兼容客户端
|
|
17
|
+
按需提供布局、样式、文本、资源和视觉预览。
|
|
18
|
+
|
|
19
|
+
它不会替 Agent 编写业务代码,而是提供持续在线、可精确查询的视觉上下文,让 Agent
|
|
20
|
+
能够像查字典一样理解设计稿。
|
|
21
|
+
|
|
22
|
+
### 主要能力
|
|
23
|
+
|
|
24
|
+
- 读取 MasterGo、Figma 和 Sketch 设计稿。
|
|
25
|
+
- 查询页面、模块、节点、文本、尺寸、间距、布局和样式。
|
|
26
|
+
- 为实现任务生成分层的 Design-to-Code 上下文。
|
|
27
|
+
- 生成节点截图、组合图片和本地字体子集。
|
|
28
|
+
- 通过本地 View 检查设计结构与导出资源。
|
|
29
|
+
- 通过 MCP 按需读取信息,避免一次性把完整设计稿塞入上下文。
|
|
30
|
+
|
|
31
|
+
### 工作方式
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
MasterGo / Figma / Sketch 插件
|
|
35
|
+
↓ 同步设计数据
|
|
36
|
+
@tarot-ai/pixel 本地 Runtime
|
|
37
|
+
↓ MCP
|
|
38
|
+
Qoder / Coding Agent
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
设计数据默认保存在用户本机。设计工具导入只使用受限的本地接口,Coding Agent 的读取、
|
|
42
|
+
分析和渲染能力只通过 MCP 暴露。
|
|
43
|
+
|
|
44
|
+
### 快速开始
|
|
45
|
+
|
|
46
|
+
1. 在 Qoder 中安装并启用 Tarot Pixel,或按下文说明手动启动本地 Runtime。
|
|
47
|
+
2. 安装 [Figma 插件](https://www.figma.com/community/plugin/1635645029043726171) 或
|
|
48
|
+
[Sketch 插件](https://unpkg.com/@tarot-ai/tarot-pixel-sketch-release@latest/Tarot-Pixel.sketchplugin.zip)。
|
|
49
|
+
3. 在设计工具中选择要导出的 Frame、画板或图层,运行 Tarot Pixel 并点击“同步设计稿”。
|
|
50
|
+
4. 将同步后打开的本地链接、`designId`、模块或节点信息提供给 Agent。
|
|
51
|
+
5. 描述需要实现、检查或还原的页面与组件。
|
|
52
|
+
|
|
53
|
+
### 设计工具插件
|
|
54
|
+
|
|
55
|
+
#### Figma
|
|
56
|
+
|
|
57
|
+
- [在 Figma Community 中打开 Tarot Pixel](https://www.figma.com/community/plugin/1635645029043726171)
|
|
58
|
+
- 也可以在 Figma Community 或 Figma 的插件面板中搜索 `Tarot Pixel`。
|
|
59
|
+
|
|
60
|
+
打开目标设计文件,选择要同步的 Frame 或图层,运行 Tarot Pixel,然后点击
|
|
61
|
+
“同步设计稿”。开始同步前,请确保 Qoder 中的 Tarot Pixel 已启用,或本地 Runtime 已启动。
|
|
62
|
+
|
|
63
|
+
#### Sketch
|
|
64
|
+
|
|
65
|
+
- 最低 Sketch 版本:`80.0`
|
|
66
|
+
- [下载 Sketch 插件](https://unpkg.com/@tarot-ai/tarot-pixel-sketch-release@latest/Tarot-Pixel.sketchplugin.zip)
|
|
67
|
+
|
|
68
|
+
下载 ZIP 并解压后,双击 `tarot-pixel.sketchplugin` 即可安装。插件会优先连接本机运行的
|
|
69
|
+
Tarot Pixel。打开目标文档,选择要同步的画板或图层,运行 Tarot Pixel,然后点击
|
|
70
|
+
“同步设计稿”。安装完成后,Sketch 会自动检查插件更新。组织云端能力可能需要额外的
|
|
71
|
+
网络和账号权限。
|
|
72
|
+
|
|
73
|
+
### 在 Qoder 中使用
|
|
74
|
+
|
|
75
|
+
推荐在 Qoder 中安装并启用 Tarot Pixel 插件。Qoder 会使用固定版本的 Runtime,并自动
|
|
76
|
+
建立 stdio MCP 连接,通常不需要手动启动本包。
|
|
77
|
+
|
|
78
|
+
1. 在 Qoder 中启用 Tarot Pixel。
|
|
79
|
+
2. 使用对应设计工具中的 Tarot Pixel 插件同步设计稿。
|
|
80
|
+
3. 把设计稿链接、`designId`、模块或节点信息提供给 Agent。
|
|
81
|
+
4. 描述需要实现、检查或还原的页面与组件。
|
|
82
|
+
|
|
83
|
+
### 手动接入 MCP Client
|
|
84
|
+
|
|
85
|
+
运行要求:
|
|
10
86
|
|
|
11
87
|
- Node.js 20.19.0 或更高版本。
|
|
12
|
-
- npm
|
|
88
|
+
- npm 客户端能够访问 npm 公共仓库。
|
|
13
89
|
- 截图和组合图片功能需要本机安装 Chrome、Chromium、Edge 或 Brave。
|
|
14
90
|
|
|
15
|
-
|
|
91
|
+
启动 Runtime:
|
|
16
92
|
|
|
17
93
|
```bash
|
|
18
|
-
npx --yes --package=@tarot-ai/pixel@
|
|
94
|
+
npx --yes --package=@tarot-ai/pixel@latest -- tarot-pixel
|
|
19
95
|
```
|
|
20
96
|
|
|
21
|
-
|
|
22
|
-
本地日志文件。
|
|
23
|
-
|
|
24
|
-
MCP Client 可以使用以下配置:
|
|
97
|
+
MCP Client 配置示例:
|
|
25
98
|
|
|
26
99
|
```json
|
|
27
100
|
{
|
|
@@ -29,21 +102,146 @@ MCP Client 可以使用以下配置:
|
|
|
29
102
|
"tarot-pixel": {
|
|
30
103
|
"type": "stdio",
|
|
31
104
|
"command": "npx",
|
|
32
|
-
"args": ["--yes", "--package=@tarot-ai/pixel@
|
|
105
|
+
"args": ["--yes", "--package=@tarot-ai/pixel@latest", "--", "tarot-pixel"]
|
|
33
106
|
}
|
|
34
107
|
}
|
|
35
108
|
}
|
|
36
109
|
```
|
|
37
110
|
|
|
38
|
-
|
|
111
|
+
生产环境建议固定经过验证的精确版本,不要直接依赖 `latest`。
|
|
39
112
|
|
|
40
|
-
|
|
113
|
+
### 数据与隐私
|
|
41
114
|
|
|
42
|
-
-
|
|
43
|
-
- 包内不包含 npm
|
|
115
|
+
- 设计稿、资源和渲染结果默认保存在当前用户的本地数据目录。
|
|
116
|
+
- 包内不包含 npm Token、设计工具凭据或用户密钥。
|
|
117
|
+
- 完整 Server、View 与 MCP HTTP 只绑定本机回环地址。
|
|
44
118
|
- 本地 URL、资源 URI、数据目录和临时渲染路径不应提交到业务仓库。
|
|
45
|
-
-
|
|
119
|
+
- 生成的资源应复制到目标项目的资源目录后再由业务代码引用。
|
|
46
120
|
|
|
47
|
-
|
|
121
|
+
### 许可证
|
|
48
122
|
|
|
49
123
|
该包为专有软件,不授予开源许可。随包分发的第三方组件保留各自的许可证声明。
|
|
124
|
+
|
|
125
|
+
## English
|
|
126
|
+
|
|
127
|
+
### Overview
|
|
128
|
+
|
|
129
|
+
Tarot Pixel is the bridge between design files and Coding Agents. Companion plugins read and
|
|
130
|
+
sync designs from MasterGo, Figma, and Sketch. The local `@tarot-ai/pixel` runtime stores,
|
|
131
|
+
analyzes, and renders that data, then exposes layout, styles, text, assets, and visual previews
|
|
132
|
+
to compatible MCP clients such as Qoder.
|
|
133
|
+
|
|
134
|
+
Tarot Pixel does not generate application code on behalf of the Agent. It provides clean,
|
|
135
|
+
layered, continuously available visual context that an Agent can query on demand.
|
|
136
|
+
|
|
137
|
+
### Highlights
|
|
138
|
+
|
|
139
|
+
- Read designs from MasterGo, Figma, and Sketch.
|
|
140
|
+
- Inspect pages, modules, nodes, text, dimensions, spacing, layout, and styles.
|
|
141
|
+
- Generate layered Design-to-Code context for implementation tasks.
|
|
142
|
+
- Render node screenshots, composite images, and local font subsets.
|
|
143
|
+
- Inspect design structure and exported assets in a local View.
|
|
144
|
+
- Query only the required context through MCP instead of loading an entire design at once.
|
|
145
|
+
|
|
146
|
+
### How it works
|
|
147
|
+
|
|
148
|
+
```text
|
|
149
|
+
MasterGo / Figma / Sketch plugin
|
|
150
|
+
↓ sync design data
|
|
151
|
+
@tarot-ai/pixel local runtime
|
|
152
|
+
↓ MCP
|
|
153
|
+
Qoder / Coding Agent
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Design data is stored locally by default. Design imports use a restricted local endpoint, while
|
|
157
|
+
all read, analysis, and rendering capabilities for Coding Agents are exposed through MCP only.
|
|
158
|
+
|
|
159
|
+
### Quick start
|
|
160
|
+
|
|
161
|
+
1. Install and enable Tarot Pixel in Qoder, or start the local Runtime manually as described
|
|
162
|
+
below.
|
|
163
|
+
2. Install the [Figma plugin](https://www.figma.com/community/plugin/1635645029043726171) or
|
|
164
|
+
[Sketch plugin](https://unpkg.com/@tarot-ai/tarot-pixel-sketch-release@latest/Tarot-Pixel.sketchplugin.zip).
|
|
165
|
+
3. Select the artboards, frames, or layers to export, run Tarot Pixel, and click **Sync design**.
|
|
166
|
+
4. Give the Agent the local link opened after synchronization, a `designId`, module, or node
|
|
167
|
+
reference.
|
|
168
|
+
5. Describe the page or component you want to implement, inspect, or reproduce.
|
|
169
|
+
|
|
170
|
+
### Design-tool plugins
|
|
171
|
+
|
|
172
|
+
#### Figma
|
|
173
|
+
|
|
174
|
+
- [Open Tarot Pixel in Figma Community](https://www.figma.com/community/plugin/1635645029043726171)
|
|
175
|
+
- You can also search for `Tarot Pixel` in Figma Community or the Figma plugin panel.
|
|
176
|
+
|
|
177
|
+
Open the target design file, select the frames or layers to sync, run Tarot Pixel, and click
|
|
178
|
+
**Sync design**. Before syncing, make sure Tarot Pixel is enabled in Qoder or the local Runtime
|
|
179
|
+
is running.
|
|
180
|
+
|
|
181
|
+
#### Sketch
|
|
182
|
+
|
|
183
|
+
- Minimum Sketch version: `80.0`
|
|
184
|
+
- [Download the Sketch plugin](https://unpkg.com/@tarot-ai/tarot-pixel-sketch-release@latest/Tarot-Pixel.sketchplugin.zip)
|
|
185
|
+
|
|
186
|
+
Download and extract the ZIP, then double-click `tarot-pixel.sketchplugin` to install it. The
|
|
187
|
+
plugin connects to a local Tarot Pixel runtime first. Open the target document, select the
|
|
188
|
+
artboards or layers to sync, run Tarot Pixel, and click **Sync design**. Sketch checks for plugin
|
|
189
|
+
updates automatically after installation. Organization cloud features may require additional
|
|
190
|
+
network access and account permissions.
|
|
191
|
+
|
|
192
|
+
### Use with Qoder
|
|
193
|
+
|
|
194
|
+
The recommended setup is to install and enable the Tarot Pixel plugin in Qoder. Qoder pins a
|
|
195
|
+
verified Runtime version and opens the stdio MCP connection automatically, so you normally do
|
|
196
|
+
not need to start this package yourself.
|
|
197
|
+
|
|
198
|
+
1. Enable Tarot Pixel in Qoder.
|
|
199
|
+
2. Sync a design with the corresponding Tarot Pixel design-tool plugin.
|
|
200
|
+
3. Give the Agent a design link, `designId`, module, or node reference.
|
|
201
|
+
4. Describe the page or component you want to implement, inspect, or reproduce.
|
|
202
|
+
|
|
203
|
+
### Connect another MCP client
|
|
204
|
+
|
|
205
|
+
Requirements:
|
|
206
|
+
|
|
207
|
+
- Node.js 20.19.0 or later.
|
|
208
|
+
- Access to the public npm registry.
|
|
209
|
+
- Chrome, Chromium, Edge, or Brave for screenshot and composite-image features.
|
|
210
|
+
|
|
211
|
+
Start the Runtime:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx --yes --package=@tarot-ai/pixel@latest -- tarot-pixel
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Example MCP configuration:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"mcpServers": {
|
|
222
|
+
"tarot-pixel": {
|
|
223
|
+
"type": "stdio",
|
|
224
|
+
"command": "npx",
|
|
225
|
+
"args": ["--yes", "--package=@tarot-ai/pixel@latest", "--", "tarot-pixel"]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Pin an exact, verified version in production instead of depending on `latest`.
|
|
232
|
+
|
|
233
|
+
### Data and privacy
|
|
234
|
+
|
|
235
|
+
- Designs, assets, and rendered output are stored in the current user's local data directory by
|
|
236
|
+
default.
|
|
237
|
+
- The package contains no npm tokens, design-tool credentials, or user secrets.
|
|
238
|
+
- The full Server, View, and MCP HTTP endpoints bind to the local loopback interface only.
|
|
239
|
+
- Do not commit local URLs, resource URIs, data directories, or temporary render paths to an
|
|
240
|
+
application repository.
|
|
241
|
+
- Copy generated assets into a directory owned by the target project before referencing them in
|
|
242
|
+
application code.
|
|
243
|
+
|
|
244
|
+
### License
|
|
245
|
+
|
|
246
|
+
This package is proprietary and does not grant an open-source license. Third-party components
|
|
247
|
+
retain their respective license notices.
|