dsh-plugin-read-image-preview 1.6.0 → 1.7.0
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 +4 -3
- package/client.js +20 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
| 位置 | 做法 |
|
|
8
8
|
| --- | --- |
|
|
9
|
-
| read_image
|
|
10
|
-
|
|
|
9
|
+
| read_image 行 | **整行认领** `tool.call.toolview`(key `read_image`,priority `-1`),图片直接展开显示,下面一行路径/尺寸/体积/格式(v1.7 恢复 1.4 的自动展开;官方行默认折叠所以不再使用官方行头与 Inspect) |
|
|
10
|
+
| 用户消息里的图、助手消息里的图、轨迹里的图 | 只替换官方的**图库**位置(`conversation.chat.user.images` / `conversation.chat.message.images`,0.2.0 叫 `conversation.message.images`;`conversation.trajectory.images`),priority `-1`;官方行自己的标题、路径、尺寸、Inspect 原样保留 |
|
|
11
|
+
| computer-use 各工具、generate_image | 这些工具没有官方图片行,整格认领 `tool.call.toolview`(priority `-1`),渲染同一个图库加一行信息(路径、尺寸、体积、格式、复制路径、在编辑器中打开) |
|
|
11
12
|
| 输入框右侧 | `✂ 截图` 按钮 |
|
|
12
13
|
| 设置 → 截图与标注 | 截图目录管理与按期清理 |
|
|
13
14
|
|
|
14
|
-
> **v1.
|
|
15
|
+
> **v1.7:read_image 恢复自动展开。** v1.6 曾把 read_image 行交还官方(只填官方图库 slot),代价是官方行默认折叠、要点开才看到图;v1.7 重新整行接管该工具,图片默认展开显示,同时保留 v1.6 的查看器(缩放/标注/裁剪/发输入框)。官方 read_image 行头与 Inspect 在该工具上不再出现。两版 dsh 的消息图片 slot 名不同,全部注册是安全的:`slots.inject` 会一直等到 slot 被声明,没有的名字永远不会激活。
|
|
15
16
|
|
|
16
17
|
图库:单张按真实宽高比显示缩略图(`min(420px, 100%)` × `max-height: 300px`),`<img>` 在字节到达前就带好 `width/height`,晚到的图片不会引起布局跳变(v1.4.1 修过的聊天吸底问题);多张一律平铺成小图,全部可点开,查看器里 `←`/`→` 切换;透明 PNG/WebP/GIF 自动铺棋盘格;加载失败点一下重试。
|
|
17
18
|
|
package/client.js
CHANGED
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
* Three surfaces share one full-screen viewer (zoom, pan, annotate, then send
|
|
5
5
|
* to the composer, copy, or save):
|
|
6
6
|
*
|
|
7
|
-
* - Image galleries. The official image positions —
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* - Image galleries. The official image positions — user and assistant message
|
|
8
|
+
* images, trajectory images — are filled at priority -1 with this plugin's
|
|
9
|
+
* gallery, so the official rows keep their own chrome (title, path, sizes,
|
|
10
|
+
* Inspect) and only the pictures and the viewer are ours. Older and newer
|
|
11
|
+
* hosts name the message slots differently; registering every name is safe
|
|
12
|
+
* because `slots.inject` waits for a declaration that never comes.
|
|
13
|
+
* - The whole `read_image` card (1.7): the official row renders its picture
|
|
14
|
+
* inside a collapsed-by-default body, so the plugin claims the `read_image`
|
|
15
|
+
* key of `tool.call.toolview` and renders the image expanded with a
|
|
16
|
+
* path/size bar. The result content already carries the durable image
|
|
17
|
+
* attachment, so the same card renders it without the host route 1.4 used.
|
|
14
18
|
* - Tool cards for image-bearing tools that have no official image row
|
|
15
19
|
* (computer-use, generate_image): their keyed `tool.call.toolview` cell is
|
|
16
20
|
* claimed at priority -1 and renders the same gallery plus one metadata line.
|
|
@@ -1006,9 +1010,10 @@ window.__ModuleLoader__.load({
|
|
|
1006
1010
|
|
|
1007
1011
|
/**
|
|
1008
1012
|
* The claim list: every tool whose whole card this plugin owns, with the
|
|
1009
|
-
* Chinese label shown while the call runs. read_image is
|
|
1010
|
-
* official row
|
|
1011
|
-
* plugin
|
|
1013
|
+
* Chinese label shown while the call runs. `read_image` is prepended (1.7):
|
|
1014
|
+
* the official row shows its picture inside a collapsed-by-default body, so
|
|
1015
|
+
* this plugin claims the whole card to render it expanded. Adding an
|
|
1016
|
+
* image-bearing tool = adding one line.
|
|
1012
1017
|
*/
|
|
1013
1018
|
const TOOL_LABELS = {
|
|
1014
1019
|
generate_image: '绘图',
|
|
@@ -1025,7 +1030,7 @@ window.__ModuleLoader__.load({
|
|
|
1025
1030
|
computer_sequence: '连续动作',
|
|
1026
1031
|
}
|
|
1027
1032
|
|
|
1028
|
-
const IMAGE_TOOL_KEYS = Object.keys(TOOL_LABELS)
|
|
1033
|
+
const IMAGE_TOOL_KEYS = ['read_image'].concat(Object.keys(TOOL_LABELS))
|
|
1029
1034
|
|
|
1030
1035
|
/**
|
|
1031
1036
|
* Every official image position this plugin's gallery fills. The message
|
|
@@ -2966,9 +2971,10 @@ window.__ModuleLoader__.load({
|
|
|
2966
2971
|
* Wire the plugin into the page.
|
|
2967
2972
|
*
|
|
2968
2973
|
* - the image galleries of the official image positions, at priority -1;
|
|
2969
|
-
* - the whole card of every image-bearing tool without
|
|
2970
|
-
* row, at priority -1 (if one of our entries ever
|
|
2971
|
-
* error boundary abdicates it and the previous card
|
|
2974
|
+
* - the whole card of `read_image` and of every image-bearing tool without
|
|
2975
|
+
* an official image row, at priority -1 (if one of our entries ever
|
|
2976
|
+
* throws, the slot's error boundary abdicates it and the previous card
|
|
2977
|
+
* returns);
|
|
2972
2978
|
* - the composer's ✂ button and the 截图与标注 settings page.
|
|
2973
2979
|
*/
|
|
2974
2980
|
function apply(ctx) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-read-image-preview",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": ["dsh-plugin", "deepseek-harness", "dsh", "image", "preview", "screenshot", "tool-card", "ui"],
|
|
6
6
|
"publishConfig": { "registry": "https://registry.npmjs.org" },
|