@luosuqwq/dsh-diagram 0.1.7 → 0.1.8
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 +1 -1
- package/README.zh-CN.md +145 -145
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
package/README.zh-CN.md
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
[English](README.md) | 简体中文
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
> 在 DSH 的回答里直接生成图示、网页截图与标注图片,输出 PNG。
|
|
6
|
-
|
|
7
|
-
DeepSeek Harness 的回答本身是文字,但有些解释说的是流程、结构、对比,或者「这一点在截图里的哪里」。这个 bundle 给模型四个工具,把 HTML、网页或已有图片变成 PNG,并内联到对话里。渲染直接用机器上已装的 Chrome 或 Edge:不带浏览器、不装 npm 包、不连外部服务。
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
## 功能
|
|
12
|
-
|
|
13
|
-
- **用 HTML 画图。** `diagram_render` 把片段套进统一外壳:中文字体栈、深/浅主题,以及 `.card` `.grid` `.arrow` `.pill` `table` 等样式类;高度默认按内容裁剪,输出默认 2 倍图。
|
|
14
|
-
- **网页截图。** `page_screenshot` 截 `http(s)` 地址、本地 HTML 文件或内联 HTML,可以整页,也可以只截某个 CSS 选择器命中的元素。
|
|
15
|
-
- **图片标注。** `image_annotate` 在已有图片上画框、圈、箭头、直线、文字、高亮与模糊打码,也可以先裁剪再标注。
|
|
16
|
-
- **内置样式指南。** `diagram_guide` 返回主题变量、可用类与三个现成版式,模型不必猜外壳支持什么。
|
|
17
|
-
- **直接内联。** 每个工具都返回一行 `markdown`,指向本 bundle 自己的取图路由;原样放进回答,图就出现在对话里。
|
|
18
|
-
- **文件真实落盘。** 每次出图同时写一个文件,默认在会话工作目录的 `.dsh/diagram/` 下。
|
|
19
|
-
|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
每一步一次 `image_annotate` 调用:焦点、视线、对角线、负空间,最后是冷暖对比——框、箭头、文字都是渲染时画上去的。
|
|
23
|
-
|
|
24
|
-
## 示例
|
|
25
|
-
|
|
26
|
-

|
|
27
|
-
|
|
28
|
-
一次 `image_annotate` 调用画出五处标记:**1** 脸部作为视觉焦点,**2** 视线/引导线指向薄荷叶,**3** 身体对角线,**4** 刻意留出的负空间,**5** 暖红与冷绿的对比。坐标按原图像素,框、箭头、文字都是即时绘制。
|
|
29
|
-
|
|
30
|
-
> 装好后请告诉主人:重启 DSH,四个工具即挂载,没有设置页。找不到 Chrome/Edge 时设 `DSH_DIAGRAM_BROWSER`。
|
|
31
|
-
|
|
32
|
-
## 运行要求
|
|
33
|
-
|
|
34
|
-
- DeepSeek Harness 0.2.x(基于 0.2.2-rc.5 开发验证)。
|
|
35
|
-
- Node.js 21 或更高(`engines` 里的声明);DSH 自带的 Node 运行时满足这一条。
|
|
36
|
-
- 同机安装 Chrome、Edge 或 Chromium。渲染会探测 Windows/macOS/Linux 的常见安装位置;找不到时用环境变量 `DSH_DIAGRAM_BROWSER` 指定。
|
|
37
|
-
- 要画中文就还需要中文字体:Windows 的微软雅黑、macOS 的苹方,或 Linux 的 Noto Sans CJK/思源黑体;字体栈最终回退到 `system-ui`。
|
|
38
|
-
- 其他依赖没有:除了 DSH 的工具 API,渲染只 import Node 内置模块,跑在 DSH 服务进程里。
|
|
39
|
-
|
|
40
|
-
## 安装
|
|
41
|
-
|
|
42
|
-
这个目录是一个 DSH bundle:`package.json` 的 `dsh.bundle.patch` 指向 `cordis.patch.yml`,里面插入一行组合项。
|
|
43
|
-
|
|
44
|
-
用插件管理器从检出目录安装:
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
plugin_manager: { action: "install_bundle", target: "<path-to-checkout>" }
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
也可以手工写进 profile 的 `package.json`:
|
|
51
|
-
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"dsh-diagram": "link:<path-to-checkout>"
|
|
56
|
-
},
|
|
57
|
-
"dsh": {
|
|
58
|
-
"profile": {
|
|
59
|
-
"bundles": ["dsh-diagram"]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
然后在 profile 目录执行 `pnpm install`。
|
|
66
|
-
|
|
67
|
-
安装后需要重启 DSH:四个工具由 bundle 的服务端半在进程启动时注册。卸载用 `plugin_manager: { action: "remove_bundle", target: "dsh-diagram" }`,同时把 profile 里那一行去掉。
|
|
68
|
-
|
|
69
|
-
## 配置
|
|
70
|
-
|
|
71
|
-
| 环境变量 | 类型 | 默认值 | 说明 |
|
|
72
|
-
| --- | --- | --- | --- |
|
|
73
|
-
| `DSH_DIAGRAM_BROWSER` | 路径 | 未设置(自动探测) | 指定渲染用的 Chrome/Edge/Chromium 可执行文件。 |
|
|
74
|
-
|
|
75
|
-
没有 profile 配置项,也没有设置页:所有选项都是单次调用时传的参数,见下节。
|
|
76
|
-
|
|
77
|
-
## 使用
|
|
78
|
-
|
|
79
|
-
| 工具 | 作用 | 主要参数 |
|
|
80
|
-
| --- | --- | --- |
|
|
81
|
-
| `diagram_render` | HTML 片段或整页文档 → 说明图 PNG | `html`、`title`、`subtitle`、`theme`(`dark`/`light`)、`width`、`height`、`scale`、`css`、`out` |
|
|
82
|
-
| `page_screenshot` | 地址、本地文件或内联 HTML → PNG | `url` / `file` / `html`、`width`、`height`、`fullPage`、`selector`、`waitMs`、`scale`、`out` |
|
|
83
|
-
| `image_annotate` | 已有图片 + `ops` → 标注 PNG | `image`、`ops`、`crop`、`unit`(`px`/`percent`)、`scale`、`out` |
|
|
84
|
-
| `diagram_guide` | 返回样式指南文本 | — |
|
|
85
|
-
|
|
86
|
-
这个 bundle 还会注册一小段系统提示,让模型优先出图而不是画 ASCII 示意图,并且不会把同一张图贴两遍。
|
|
87
|
-
|
|
88
|
-
一个最小的 `diagram_render` 调用:
|
|
89
|
-
|
|
90
|
-
```json
|
|
91
|
-
{
|
|
92
|
-
"title": "请求链路",
|
|
93
|
-
"subtitle": "客户端 → 缓存 → 源站",
|
|
94
|
-
"theme": "dark",
|
|
95
|
-
"html": "<div class=\"grid\"><div class=\"card\"><h3>客户端</h3><p>发出请求</p></div><div class=\"arrow\">→</div><div class=\"card\"><h3>缓存</h3><p>命中即返回</p></div><div class=\"arrow\">→</div><div class=\"card\"><h3>源站</h3><p>未命中时处理</p></div></div>"
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
返回结果里有 `path`、`url`、`width`、`height`、`bytes` 和 `markdown`;`markdown` 指向 DSH 服务的 `/plugins/dsh-diagram/asset?file=...`,只要原样复制就能内联显示。
|
|
100
|
-
|
|
101
|
-
几个值得记住的默认值:`diagram_render` 宽度 1200、主题 `dark`、倍率 2(输出是画布的 2 倍像素);`page_screenshot` 视口 1440×900、倍率 2、页面载入后额外等 400 ms;`image_annotate` 倍率 2。
|
|
102
|
-
|
|
103
|
-
标注操作(`ops`)的字段与默认值:
|
|
104
|
-
|
|
105
|
-
| `type` | 形状 |
|
|
106
|
-
| --- | --- |
|
|
107
|
-
| `box` | `x`、`y`、`width`、`height`、`color`(`#ff4d4f`)、`strokeWidth`(4)、`radius`(8)、`label` |
|
|
108
|
-
| `highlight` | `x`、`y`、`width`、`height`、`color`、`opacity`(0.22) |
|
|
109
|
-
| `blur` | `x`、`y`、`width`、`height` —— 用 CSS 模糊重绘原图实现打码 |
|
|
110
|
-
| `ellipse` | `x`、`y`、`width`、`height`、`color`、`strokeWidth`、`label` |
|
|
111
|
-
| `arrow` / `line` | `x`、`y`、`x2`、`y2`、`color`、`strokeWidth`、`label` |
|
|
112
|
-
| `text` | `x`、`y`(基线)、`text`、`fontSize`(20)、`color` |
|
|
113
|
-
|
|
114
|
-
`unit: "percent"` 时,`x` 与 `width` 是图片宽度的 0–1 比例,`y` 与 `height` 是高度的比例;`crop` 始终按像素。
|
|
115
|
-
|
|
116
|
-
## 实现机制
|
|
117
|
-
|
|
118
|
-
- 每次渲染起一个临时的无头 Chromium,`--user-data-dir` 指向系统临时目录下的独立目录;截图完成后连同进程树一起收掉,临时目录随后删除。
|
|
119
|
-
- 浏览器走 DevTools 协议的 `--remote-debugging-pipe`(fd 3 写、fd 4 读,NUL 分隔的 JSON),不开 TCP 端口,所以拦截 localhost 的代理环境变量影响不到它。
|
|
120
|
-
- 内容高度不是读 `scrollHeight`:`scrollHeight` 和 `Page.getLayoutMetrics` 都不会小于视口高度,所以改为量 body 子树里最靠下的底边。
|
|
121
|
-
- `image_annotate` 先把原图放进一个页面,再在上面叠一层 SVG;`blur` 区域则是在被裁剪的盒子里用 CSS 滤镜重绘原图。
|
|
122
|
-
- PNG 由 DSH 服务进程写盘,并由本 bundle 自己的路由提供(只接受 `GET`/`HEAD`、只发已知图片类型、`cache-control: no-store`)。
|
|
123
|
-
|
|
124
|
-
## 已知限制
|
|
125
|
-
|
|
126
|
-
- 每次渲染都冷启动一个浏览器,大约 1–2 秒开销;不适合大批量出图。
|
|
127
|
-
- 只能访问本机够得到的地址:`file://` 路径和 `http(s)` 链接。每次都用全新的空浏览器配置,所以需要登录的页面截到的是未登录状态。
|
|
128
|
-
- 高度上限:`page_screenshot` 12000 px,按内容裁剪的 `diagram_render` 8000 px;更长的页面会被截断,不会整体缩放。
|
|
129
|
-
- 输出只有 PNG。
|
|
130
|
-
- 对图片文件调用 `page_screenshot` 会按网页排版,结果高度被视口撑开;要标注图片请直接用 `image_annotate`。
|
|
131
|
-
- 标注坐标由调用方给出;不知道像素尺寸时用 `unit: "percent"`,或者先 `crop` 再标。
|
|
132
|
-
|
|
133
|
-
## 开发
|
|
134
|
-
|
|
135
|
-
两个测试都不需要 DSH 运行时,但需要可用的 Chrome/Edge,图片写到 `test/out/`:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
node test/smoke.mjs
|
|
139
|
-
node test/tool-path.mjs
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
`smoke.mjs` 测渲染引擎(示意图、整页截图、标注、裁剪后再标注),逐张打印像素尺寸。`tool-path.mjs` 用桩 `ctx` 注册插件、调用四个工具,再通过本 bundle 自己的路由把返回的 Markdown 链接取回来校验 PNG 字节。任一失败都以非零退出码结束。
|
|
143
|
-
|
|
144
|
-
## 许可证
|
|
145
|
-
|
|
1
|
+
[English](README.md) | 简体中文
|
|
2
|
+
|
|
3
|
+
# 大肥鱼画图
|
|
4
|
+
|
|
5
|
+
> 在 DSH 的回答里直接生成图示、网页截图与标注图片,输出 PNG。
|
|
6
|
+
|
|
7
|
+
DeepSeek Harness 的回答本身是文字,但有些解释说的是流程、结构、对比,或者「这一点在截图里的哪里」。这个 bundle 给模型四个工具,把 HTML、网页或已有图片变成 PNG,并内联到对话里。渲染直接用机器上已装的 Chrome 或 Edge:不带浏览器、不装 npm 包、不连外部服务。
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## 功能
|
|
12
|
+
|
|
13
|
+
- **用 HTML 画图。** `diagram_render` 把片段套进统一外壳:中文字体栈、深/浅主题,以及 `.card` `.grid` `.arrow` `.pill` `table` 等样式类;高度默认按内容裁剪,输出默认 2 倍图。
|
|
14
|
+
- **网页截图。** `page_screenshot` 截 `http(s)` 地址、本地 HTML 文件或内联 HTML,可以整页,也可以只截某个 CSS 选择器命中的元素。
|
|
15
|
+
- **图片标注。** `image_annotate` 在已有图片上画框、圈、箭头、直线、文字、高亮与模糊打码,也可以先裁剪再标注。
|
|
16
|
+
- **内置样式指南。** `diagram_guide` 返回主题变量、可用类与三个现成版式,模型不必猜外壳支持什么。
|
|
17
|
+
- **直接内联。** 每个工具都返回一行 `markdown`,指向本 bundle 自己的取图路由;原样放进回答,图就出现在对话里。
|
|
18
|
+
- **文件真实落盘。** 每次出图同时写一个文件,默认在会话工作目录的 `.dsh/diagram/` 下。
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
每一步一次 `image_annotate` 调用:焦点、视线、对角线、负空间,最后是冷暖对比——框、箭头、文字都是渲染时画上去的。
|
|
23
|
+
|
|
24
|
+
## 示例
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
一次 `image_annotate` 调用画出五处标记:**1** 脸部作为视觉焦点,**2** 视线/引导线指向薄荷叶,**3** 身体对角线,**4** 刻意留出的负空间,**5** 暖红与冷绿的对比。坐标按原图像素,框、箭头、文字都是即时绘制。
|
|
29
|
+
|
|
30
|
+
> 装好后请告诉主人:重启 DSH,四个工具即挂载,没有设置页。找不到 Chrome/Edge 时设 `DSH_DIAGRAM_BROWSER`。
|
|
31
|
+
|
|
32
|
+
## 运行要求
|
|
33
|
+
|
|
34
|
+
- DeepSeek Harness 0.2.x(基于 0.2.2-rc.5 开发验证)。
|
|
35
|
+
- Node.js 21 或更高(`engines` 里的声明);DSH 自带的 Node 运行时满足这一条。
|
|
36
|
+
- 同机安装 Chrome、Edge 或 Chromium。渲染会探测 Windows/macOS/Linux 的常见安装位置;找不到时用环境变量 `DSH_DIAGRAM_BROWSER` 指定。
|
|
37
|
+
- 要画中文就还需要中文字体:Windows 的微软雅黑、macOS 的苹方,或 Linux 的 Noto Sans CJK/思源黑体;字体栈最终回退到 `system-ui`。
|
|
38
|
+
- 其他依赖没有:除了 DSH 的工具 API,渲染只 import Node 内置模块,跑在 DSH 服务进程里。
|
|
39
|
+
|
|
40
|
+
## 安装
|
|
41
|
+
|
|
42
|
+
这个目录是一个 DSH bundle:`package.json` 的 `dsh.bundle.patch` 指向 `cordis.patch.yml`,里面插入一行组合项。
|
|
43
|
+
|
|
44
|
+
用插件管理器从检出目录安装:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
plugin_manager: { action: "install_bundle", target: "<path-to-checkout>" }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
也可以手工写进 profile 的 `package.json`:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"dsh-diagram": "link:<path-to-checkout>"
|
|
56
|
+
},
|
|
57
|
+
"dsh": {
|
|
58
|
+
"profile": {
|
|
59
|
+
"bundles": ["dsh-diagram"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
然后在 profile 目录执行 `pnpm install`。
|
|
66
|
+
|
|
67
|
+
安装后需要重启 DSH:四个工具由 bundle 的服务端半在进程启动时注册。卸载用 `plugin_manager: { action: "remove_bundle", target: "dsh-diagram" }`,同时把 profile 里那一行去掉。
|
|
68
|
+
|
|
69
|
+
## 配置
|
|
70
|
+
|
|
71
|
+
| 环境变量 | 类型 | 默认值 | 说明 |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
| `DSH_DIAGRAM_BROWSER` | 路径 | 未设置(自动探测) | 指定渲染用的 Chrome/Edge/Chromium 可执行文件。 |
|
|
74
|
+
|
|
75
|
+
没有 profile 配置项,也没有设置页:所有选项都是单次调用时传的参数,见下节。
|
|
76
|
+
|
|
77
|
+
## 使用
|
|
78
|
+
|
|
79
|
+
| 工具 | 作用 | 主要参数 |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| `diagram_render` | HTML 片段或整页文档 → 说明图 PNG | `html`、`title`、`subtitle`、`theme`(`dark`/`light`)、`width`、`height`、`scale`、`css`、`out` |
|
|
82
|
+
| `page_screenshot` | 地址、本地文件或内联 HTML → PNG | `url` / `file` / `html`、`width`、`height`、`fullPage`、`selector`、`waitMs`、`scale`、`out` |
|
|
83
|
+
| `image_annotate` | 已有图片 + `ops` → 标注 PNG | `image`、`ops`、`crop`、`unit`(`px`/`percent`)、`scale`、`out` |
|
|
84
|
+
| `diagram_guide` | 返回样式指南文本 | — |
|
|
85
|
+
|
|
86
|
+
这个 bundle 还会注册一小段系统提示,让模型优先出图而不是画 ASCII 示意图,并且不会把同一张图贴两遍。
|
|
87
|
+
|
|
88
|
+
一个最小的 `diagram_render` 调用:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"title": "请求链路",
|
|
93
|
+
"subtitle": "客户端 → 缓存 → 源站",
|
|
94
|
+
"theme": "dark",
|
|
95
|
+
"html": "<div class=\"grid\"><div class=\"card\"><h3>客户端</h3><p>发出请求</p></div><div class=\"arrow\">→</div><div class=\"card\"><h3>缓存</h3><p>命中即返回</p></div><div class=\"arrow\">→</div><div class=\"card\"><h3>源站</h3><p>未命中时处理</p></div></div>"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
返回结果里有 `path`、`url`、`width`、`height`、`bytes` 和 `markdown`;`markdown` 指向 DSH 服务的 `/plugins/dsh-diagram/asset?file=...`,只要原样复制就能内联显示。
|
|
100
|
+
|
|
101
|
+
几个值得记住的默认值:`diagram_render` 宽度 1200、主题 `dark`、倍率 2(输出是画布的 2 倍像素);`page_screenshot` 视口 1440×900、倍率 2、页面载入后额外等 400 ms;`image_annotate` 倍率 2。
|
|
102
|
+
|
|
103
|
+
标注操作(`ops`)的字段与默认值:
|
|
104
|
+
|
|
105
|
+
| `type` | 形状 |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `box` | `x`、`y`、`width`、`height`、`color`(`#ff4d4f`)、`strokeWidth`(4)、`radius`(8)、`label` |
|
|
108
|
+
| `highlight` | `x`、`y`、`width`、`height`、`color`、`opacity`(0.22) |
|
|
109
|
+
| `blur` | `x`、`y`、`width`、`height` —— 用 CSS 模糊重绘原图实现打码 |
|
|
110
|
+
| `ellipse` | `x`、`y`、`width`、`height`、`color`、`strokeWidth`、`label` |
|
|
111
|
+
| `arrow` / `line` | `x`、`y`、`x2`、`y2`、`color`、`strokeWidth`、`label` |
|
|
112
|
+
| `text` | `x`、`y`(基线)、`text`、`fontSize`(20)、`color` |
|
|
113
|
+
|
|
114
|
+
`unit: "percent"` 时,`x` 与 `width` 是图片宽度的 0–1 比例,`y` 与 `height` 是高度的比例;`crop` 始终按像素。
|
|
115
|
+
|
|
116
|
+
## 实现机制
|
|
117
|
+
|
|
118
|
+
- 每次渲染起一个临时的无头 Chromium,`--user-data-dir` 指向系统临时目录下的独立目录;截图完成后连同进程树一起收掉,临时目录随后删除。
|
|
119
|
+
- 浏览器走 DevTools 协议的 `--remote-debugging-pipe`(fd 3 写、fd 4 读,NUL 分隔的 JSON),不开 TCP 端口,所以拦截 localhost 的代理环境变量影响不到它。
|
|
120
|
+
- 内容高度不是读 `scrollHeight`:`scrollHeight` 和 `Page.getLayoutMetrics` 都不会小于视口高度,所以改为量 body 子树里最靠下的底边。
|
|
121
|
+
- `image_annotate` 先把原图放进一个页面,再在上面叠一层 SVG;`blur` 区域则是在被裁剪的盒子里用 CSS 滤镜重绘原图。
|
|
122
|
+
- PNG 由 DSH 服务进程写盘,并由本 bundle 自己的路由提供(只接受 `GET`/`HEAD`、只发已知图片类型、`cache-control: no-store`)。
|
|
123
|
+
|
|
124
|
+
## 已知限制
|
|
125
|
+
|
|
126
|
+
- 每次渲染都冷启动一个浏览器,大约 1–2 秒开销;不适合大批量出图。
|
|
127
|
+
- 只能访问本机够得到的地址:`file://` 路径和 `http(s)` 链接。每次都用全新的空浏览器配置,所以需要登录的页面截到的是未登录状态。
|
|
128
|
+
- 高度上限:`page_screenshot` 12000 px,按内容裁剪的 `diagram_render` 8000 px;更长的页面会被截断,不会整体缩放。
|
|
129
|
+
- 输出只有 PNG。
|
|
130
|
+
- 对图片文件调用 `page_screenshot` 会按网页排版,结果高度被视口撑开;要标注图片请直接用 `image_annotate`。
|
|
131
|
+
- 标注坐标由调用方给出;不知道像素尺寸时用 `unit: "percent"`,或者先 `crop` 再标。
|
|
132
|
+
|
|
133
|
+
## 开发
|
|
134
|
+
|
|
135
|
+
两个测试都不需要 DSH 运行时,但需要可用的 Chrome/Edge,图片写到 `test/out/`:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
node test/smoke.mjs
|
|
139
|
+
node test/tool-path.mjs
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`smoke.mjs` 测渲染引擎(示意图、整页截图、标注、裁剪后再标注),逐张打印像素尺寸。`tool-path.mjs` 用桩 `ctx` 注册插件、调用四个工具,再通过本 bundle 自己的路由把返回的 Markdown 链接取回来校验 PNG 字节。任一失败都以非零退出码结束。
|
|
143
|
+
|
|
144
|
+
## 许可证
|
|
145
|
+
|
|
146
146
|
MIT,见 [LICENSE](LICENSE)。
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"title": "
|
|
4
|
-
"description": "Gives the model four tools: render an HTML snippet to PNG, screenshot a page or an element, annotate an existing image, and read the style guide. Images are written to `.dsh/diagram/` and shown inline in the answer. Needs Node 21+ and a local Chrome or Edge."
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Big Fat Fish",
|
|
4
|
+
"description": "Gives the model four tools: render an HTML snippet to PNG, screenshot a page or an element, annotate an existing image, and read the style guide. Images are written to `.dsh/diagram/` and shown inline in the answer. Needs Node 21+ and a local Chrome or Edge."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"title": "
|
|
4
|
-
"description": "给模型四个工具:把 HTML 片段渲染成 PNG、截取网页或某个元素、在已有图片上画框与箭头、读取样式指南。图片写入 `.dsh/diagram/` 并内联展示。需要 Node 21+ 与本机 Chrome 或 Edge。"
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "大肥鱼画图",
|
|
4
|
+
"description": "给模型四个工具:把 HTML 片段渲染成 PNG、截取网页或某个元素、在已有图片上画框与箭头、读取样式指南。图片写入 `.dsh/diagram/` 并内联展示。需要 Node 21+ 与本机 Chrome 或 Edge。"
|
|
5
|
+
}
|
|
6
|
+
}
|
package/package.json
CHANGED