dsh-image-gen 0.1.7 → 0.2.1

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.en.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  # 🎨 dsh-image-gen
8
8
 
9
- **Bring ChatGPT-like image generation to DeepSeek Harness — supporting in-chat generation, gallery overview, fullscreen preview, quick copy, and one-click download.**
9
+ **Bring ChatGPT-like conversational image generation and image editing to DeepSeek Harness, with support for text-to-image, image-to-image, continuous editing, and multiple image providers.**
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/dsh-image-gen.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/dsh-image-gen)
12
12
  [![DSH Plugin](https://img.shields.io/badge/Plugin%20For-DeepSeek%20Harness-6366f1?style=flat-square)](https://github.com/deepseek-ai)
@@ -33,11 +33,14 @@ Install the image generation plugin by running: pnpm dsh plugin --profile web ad
33
33
  Draw a cyberpunk cat on a neon street in a rainy night.
34
34
  ```
35
35
 
36
- <p align="center">The Agent will automatically call <code>generate_image</code> and display the image directly in the conversation.</p>
36
+ <p align="center">The Agent will automatically generate images and can also continue editing the previous image directly.</p>
37
37
 
38
38
  <br />
39
39
 
40
- <img src="docs/assets/chat-preview.png" alt="Chat preview" width="820" />
40
+ <div align="center">
41
+ <img src="docs/assets/generate-example.png" alt="Initial image generation conversation" width="48%" style="vertical-align: top;" />
42
+ <img src="docs/assets/edit-example.png" alt="Continued image editing conversation" width="48%" style="vertical-align: top;" />
43
+ </div>
41
44
 
42
45
  </div>
43
46
 
@@ -45,14 +48,14 @@ Draw a cyberpunk cat on a neon street in a rainy night.
45
48
 
46
49
  ## 💡 What Problem Does It Solve?
47
50
 
48
- **`dsh-image-gen` is an open-source image generation plugin built specifically for DeepSeek Harness (DSH).**
51
+ **`dsh-image-gen` is an open-source image generation and editing plugin built specifically for DeepSeek Harness (DSH).**
49
52
 
50
53
  DeepSeek Harness empowers agents to use tools for various tasks. This project adds native **multimodal image generation capabilities**:
51
54
 
52
55
  ```mermaid
53
56
  graph LR
54
57
  A[User Prompt] --> B[DeepSeek Harness Agent]
55
- B --> C[generate_image Tool]
58
+ B --> C[generate_image / edit_image]
56
59
  C --> D[Gemini / OpenAI / Seedream / DashScope]
57
60
  D --> E[Image Data]
58
61
  E --> F[In-chat Conversation Stream]
@@ -88,15 +91,16 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
88
91
 
89
92
  </details>
90
93
 
91
- ### 2. Configure API Key
94
+ ### 2. Configure API Key & Workspace Settings
92
95
 
93
96
  Open DSH Web (`http://localhost:3080`):
94
97
 
95
98
  1. Navigate to **Settings → Plugins → Image generation**.
96
- 2. Select Provider, input API Key, click **Save**.
99
+ 2. Select Provider, input API Key.
100
+ 3. Optionally enable **Save to workspace** (enabled by default) and specify subfolder, then click **Save**.
97
101
 
98
102
  <div align="center">
99
- <img src="docs/assets/settings-preview.png" alt="Settings preview" width="720" />
103
+ <img src="docs/assets/settings-preview.png?v=0.1.7" alt="Settings preview" width="720" />
100
104
  </div>
101
105
 
102
106
  ### 3. Generate Images in Chat
@@ -127,7 +131,7 @@ Click the **`[Gallery]`** Tab in the top navigation bar to browse and search all
127
131
  - 🎨 **Multi-Provider Support**: Supports Google Gemini, OpenAI Images, OpenAI Compatible API, ByteDance Seedream / Volcengine Ark, and Aliyun DashScope (Wanx / Qwen-Image).
128
132
  - 🔑 **BYOK (Bring Your Own Key)**: Uses your own API keys managed securely by DSH credentials service with write-only protection.
129
133
  - 🖼️ **Durable Session Persistence**: Images integrate with DSH Attachment and conversation lifecycle, preserved across reloads.
130
- - 💾 **Workspace File Output**: By default each generated image is also written as a file into the current session workspace (`dsh-image-gen/` subfolder); the tool result carries the absolute file path. Can be disabled or re-pointed in settings.
134
+ - 💾 **Workspace File Output**: By default each generated image is also written as a file into the current session workspace; the tool result carries the absolute file path. Can be disabled or re-pointed in settings.
131
135
  - ⚙️ **Native Web Settings**: Configure providers, keys, models, and endpoints directly in DSH settings.
132
136
 
133
137
  ---
package/README.md CHANGED
@@ -6,12 +6,13 @@
6
6
 
7
7
  # 🎨 dsh-image-gen
8
8
 
9
- **让 DeepSeek Harness 像 ChatGPT 一样在对话中直接生成图片,支持画廊汇总,全屏预览、快捷复制与一键下载。**
9
+ **让 DeepSeek Harness 拥有类似 ChatGPT 的原生对话生图与图片编辑能力,支持文生图、图生图、连续编辑,并兼容多家图像模型提供商。**
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/dsh-image-gen.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/dsh-image-gen)
12
12
  [![DSH Plugin](https://img.shields.io/badge/Plugin%20For-DeepSeek%20Harness-6366f1?style=flat-square)](https://github.com/deepseek-ai)
13
13
  [![npm downloads](https://img.shields.io/npm/dm/dsh-image-gen.svg?style=flat-square&color=emerald)](https://www.npmjs.com/package/dsh-image-gen)
14
14
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
15
+ [![LINUX DO](https://img.shields.io/badge/LINUX%20DO-社区友链-555?style=flat-square)](https://linux.do/)
15
16
 
16
17
  [English](README.en.md) | **简体中文**
17
18
 
@@ -33,11 +34,14 @@
33
34
  帮我画一张雨夜霓虹街头的赛博朋克猫咪。
34
35
  ```
35
36
 
36
- <p align="center">Agent 会自动调用 <code>generate_image</code>,生成图片并直接显示在当前对话中。</p>
37
+ <p align="center">Agent 会自动完成图片生成,也可以直接基于上一张图片继续修改。</p>
37
38
 
38
39
  <br />
39
40
 
40
- <img src="docs/assets/chat-preview.png" alt="对话生图效果预览" width="820" />
41
+ <div align="center">
42
+ <img src="docs/assets/generate-example.png" alt="首次生成图片的对话截图" width="48%" style="vertical-align: top;" />
43
+ <img src="docs/assets/edit-example.png" alt="基于上一张图片继续编辑的对话截图" width="48%" style="vertical-align: top;" />
44
+ </div>
41
45
 
42
46
  </div>
43
47
 
@@ -45,14 +49,14 @@
45
49
 
46
50
  ## 💡 它解决什么问题?
47
51
 
48
- **`dsh-image-gen` 是专为 DeepSeek Harness (DSH) 打造的开源图像生成插件。**
52
+ **`dsh-image-gen` 是专为 DeepSeek Harness (DSH) 打造的开源图像生成与编辑插件。**
49
53
 
50
- DeepSeek Harness 已经可以让 Agent 调用不同工具完成任务,本项目为它补上了原生的**多模态生图能力**:
54
+ DeepSeek Harness 已经可以让 Agent 调用不同工具完成任务,本项目为它补上了原生的**图像生成与编辑能力**:
51
55
 
52
56
  ```mermaid
53
57
  graph LR
54
58
  A[用户 Prompt] --> B[DeepSeek Harness Agent]
55
- B --> C[generate_image 工具]
59
+ B --> C[generate_image / edit_image]
56
60
  C --> D[Gemini / OpenAI / Seedream / DashScope]
57
61
  D --> E[图片数据]
58
62
  E --> F[当前 Conversation 对话流]
@@ -88,15 +92,16 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
88
92
 
89
93
  </details>
90
94
 
91
- ### 2. 配置 API Key
95
+ ### 2. 配置 API Key 与工作区设置
92
96
 
93
97
  打开 DSH Web 页面(默认 `http://localhost:3080`):
94
98
 
95
99
  1. 进入 **Settings → Plugins → Image generation**。
96
- 2. 选择 Provider,填写 API Key,点击 **保存** 即可。
100
+ 2. 选择 Provider,填写 API Key。
101
+ 3. 可按需开启 **保存到工作区**(默认开启)并自定义子目录,点击 **保存** 即可。
97
102
 
98
103
  <div align="center">
99
- <img src="docs/assets/settings-preview.png" alt="设置面板预览" width="720" />
104
+ <img src="docs/assets/settings-preview.png?v=0.1.7" alt="设置面板预览" width="720" />
100
105
  </div>
101
106
 
102
107
  ### 3. 开始对话生图
@@ -109,6 +114,14 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
109
114
 
110
115
  当前 Agent 就会自动调用 `generate_image` 工具并在对话流中返回图片。
111
116
 
117
+ 也可以继续基于上一张图进行编辑:
118
+
119
+ ```text
120
+ 给刚才那张图加上落地窗,并把窗外改成雪山。
121
+ ```
122
+
123
+ Agent 会调用 `edit_image`,复用当前会话中的图片继续修改。
124
+
112
125
  ### 4. 查看原生生图画廊
113
126
 
114
127
  点击会话顶栏的 **`[画廊]`** Tab,即可集中查看和搜索所有对话生成的历史图片:
@@ -121,14 +134,12 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
121
134
 
122
135
  ## ✨ 主要能力
123
136
 
124
- - 💬 **对话中直接生图**:不需要切换到其他网站,也不需要手动复制 Prompt,直接告诉 Agent 你想画什么即可。
125
- - 🖼️ **历史生图画廊**:顶栏自带「画廊」Tab,自动汇总所有历史生成的图片,支持关键词搜索、厂商筛选、单张删除(带防误触确认与持久化墓碑)与一键复制/下载。
126
- - 🔍 **交互式图片工具**:支持点击全屏大图预览、一键复制图片到剪贴板、本地下载与新标签页打开。
127
- - 🎨 **多 Provider 支持**:支持 Google Gemini、OpenAI Images、OpenAI Compatible API、ByteDance Seedream / 火山方舟以及阿里云 DashScope(通义万相 / Qwen-Image)。Provider、模型和 Endpoint 均可在设置中自由定制。
128
- - 🔑 **BYOK (自带 Key)**:插件使用你自己的 API Key。API Key 通过 DeepSeek Harness 的 `credentials` 服务管理,采用写保护隔离,不需要写进项目源码或配置文件,前端不存明文。
129
- - 🖼️ **图片跟随会话保存**:生成结果会接入 DeepSeek Harness 的 Attachment / Conversation 体系,重新打开历史会话后,仍然可以看到之前生成的图片。
130
- - 💾 **生成图片自动落盘到工作区**:默认在每次生成后把图片文件保存到当前会话工作区(`dsh-image-gen/` 子目录),工具结果会返回文件的绝对路径;可在设置中关闭或修改保存目录。
131
- - ⚙️ **原生设置界面**:Provider、API Key、模型和 Endpoint 都可以直接在 DSH Web 设置中修改,不需要手动编辑配置文件。
137
+ - 💬 **原生对话生图与编辑**:直接在 DeepSeek Harness 对话中生成图片,也可以基于已有图片继续修改。
138
+ - 🔁 **连续多轮编辑**:支持复用当前会话中的上传图片、历史生成图和上一轮编辑结果继续迭代。
139
+ - 🖼️ **画廊与图片工具**:自动汇总历史图片,支持搜索、筛选、全屏预览、复制、下载与删除。
140
+ - 🎨 **多 Provider 支持**:兼容 Google Gemini、OpenAI Images / Compatible、Seedream、DashScope Qwen Image。
141
+ - 🔑 **BYOK + 原生设置**:API Key、Provider、模型和 Endpoint 都可以直接在 DSH 设置中配置。
142
+ - 💾 **会话与工作区保存**:图片接入 DSH Attachment / Conversation,并可自动保存到当前工作区。
132
143
 
133
144
  ---
134
145
 
@@ -140,7 +151,7 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
140
151
  | **OpenAI Images** | `gpt-image-2` | `https://api.openai.com/v1` |
141
152
  | **OpenAI Compatible** | 自定义 | 自定义 Base URL |
142
153
  | **ByteDance Seedream / 火山方舟** | `doubao-seedream-5-0-260128` | `https://ark.cn-beijing.volces.com/api/v3` |
143
- | **Aliyun DashScope / 通义万相** | `wanx2.1-t2i-turbo` | `https://dashscope.aliyuncs.com/api/v1` |
154
+ | **Aliyun DashScope / Qwen Image** | `qwen-image-3.0` | `https://dashscope.aliyuncs.com/api/v1` |
144
155
 
145
156
  ---
146
157
 
package/README.zh-CN.md CHANGED
@@ -88,15 +88,16 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
88
88
 
89
89
  </details>
90
90
 
91
- ### 2. 配置 API Key
91
+ ### 2. 配置 API Key 与工作区设置
92
92
 
93
93
  打开 DSH Web 页面(默认 `http://localhost:3080`):
94
94
 
95
95
  1. 进入 **Settings → Plugins → Image generation**。
96
- 2. 选择 Provider,填写 API Key,点击 **保存** 即可。
96
+ 2. 选择 Provider,填写 API Key。
97
+ 3. 可按需开启 **保存到工作区**(默认开启)并自定义子目录,点击 **保存** 即可。
97
98
 
98
99
  <div align="center">
99
- <img src="docs/assets/settings-preview.png" alt="设置面板预览" width="720" />
100
+ <img src="docs/assets/settings-preview.png?v=0.1.7" alt="设置面板预览" width="720" />
100
101
  </div>
101
102
 
102
103
  ### 3. 开始对话生图
@@ -127,7 +128,7 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
127
128
  - 🎨 **多 Provider 支持**:支持 Google Gemini、OpenAI Images、OpenAI Compatible API、ByteDance Seedream / 火山方舟以及阿里云 DashScope(通义万相 / Qwen-Image)。Provider、模型和 Endpoint 均可在设置中自由定制。
128
129
  - 🔑 **BYOK (自带 Key)**:插件使用你自己的 API Key。API Key 通过 DeepSeek Harness 的 `credentials` 服务管理,采用写保护隔离,不需要写进项目源码或配置文件,前端不存明文。
129
130
  - 🖼️ **图片跟随会话保存**:生成结果会接入 DeepSeek Harness 的 Attachment / Conversation 体系,重新打开历史会话后,仍然可以看到之前生成的图片。
130
- - 💾 **生成图片自动落盘到工作区**:默认在每次生成后把图片文件保存到当前会话工作区(`dsh-image-gen/` 子目录),工具结果会返回文件的绝对路径;可在设置中关闭或修改保存目录。
131
+ - 💾 **生成图片自动落盘到工作区**:默认在每次生成后把图片文件保存到当前会话工作区,工具结果会返回文件的绝对路径;可在设置中关闭或修改保存目录。
131
132
  - ⚙️ **原生设置界面**:Provider、API Key、模型和 Endpoint 都可以直接在 DSH Web 设置中修改,不需要手动编辑配置文件。
132
133
 
133
134
  ---
package/lib/client.js CHANGED
@@ -21,7 +21,7 @@ window.__ModuleLoader__.load({
21
21
  google: "gemini-3.1-flash-image",
22
22
  openai: "gpt-image-2",
23
23
  seedream: "doubao-seedream-5-0-260128",
24
- dashscope: "wanx2.1-t2i-turbo"
24
+ dashscope: "qwen-image-3.0"
25
25
  };
26
26
  const DEFAULT_BASE_URLS = {
27
27
  google: DEFAULT_GOOGLE_ENDPOINT,
@@ -1112,6 +1112,11 @@ window.__ModuleLoader__.load({
1112
1112
  key: "generate_image",
1113
1113
  inject: () => ({ locale })
1114
1114
  }, GeneratedImageCard));
1115
+ ctx.slots.inject("tool.call.toolview", () => register({
1116
+ name: "tool.call.toolview",
1117
+ key: "edit_image",
1118
+ inject: () => ({ locale })
1119
+ }, GeneratedImageCard));
1115
1120
  ctx.slots.inject("conversation.view", () => register({
1116
1121
  name: "conversation.view",
1117
1122
  id: "gallery",