dsh-image-gen 0.1.3 → 0.1.5
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 +166 -0
- package/README.md +16 -7
- package/README.zh-CN.md +16 -7
- package/lib/client.js +870 -67
- package/lib/client.js.map +1 -1
- package/lib/index.js +131 -5
- package/lib/types/client/gallery-store.d.ts +41 -0
- package/lib/types/client/gallery-view.d.ts +63 -0
- package/lib/types/client/index.d.ts +8 -8
- package/lib/types/config.d.ts +12 -2
- package/lib/types/dashscope.d.ts +16 -0
- package/lib/types/shared.d.ts +3 -1
- package/package.json +128 -124
package/README.en.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="docs/assets/hero-poster.webp" alt="dsh-image-gen poster" width="100%" style="max-width: 860px; border-radius: 12px;" />
|
|
4
|
+
|
|
5
|
+
<br /><br />
|
|
6
|
+
|
|
7
|
+
# 🎨 dsh-image-gen
|
|
8
|
+
|
|
9
|
+
**Bring ChatGPT-like image generation to DeepSeek Harness — supporting in-chat generation, gallery overview, fullscreen preview, quick copy, and one-click download.**
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/dsh-image-gen)
|
|
12
|
+
[](https://github.com/deepseek-ai)
|
|
13
|
+
[](https://www.npmjs.com/package/dsh-image-gen)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
|
|
16
|
+
**English** | [简体中文](README.md)
|
|
17
|
+
|
|
18
|
+
<br />
|
|
19
|
+
|
|
20
|
+
<p align="center">💬 <b>Prompt your DeepSeek Harness Agent to install:</b></p>
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
Install the image generation plugin by running: pnpm dsh plugin --profile web add dsh-image-gen@latest
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
<p align="center"><sub>(Or run manually in terminal: <code>pnpm dsh plugin --profile web add dsh-image-gen@latest</code>)</sub></p>
|
|
27
|
+
|
|
28
|
+
<br />
|
|
29
|
+
|
|
30
|
+
<p align="center">After installation, enter your API Key in DSH Settings, then tell the Agent:</p>
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
Draw a cyberpunk cat on a neon street in a rainy night.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
<p align="center">The Agent will automatically call <code>generate_image</code> and display the image directly in the conversation.</p>
|
|
37
|
+
|
|
38
|
+
<br />
|
|
39
|
+
|
|
40
|
+
<img src="docs/assets/chat-preview.png" alt="Chat preview" width="820" />
|
|
41
|
+
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 💡 What Problem Does It Solve?
|
|
47
|
+
|
|
48
|
+
**`dsh-image-gen` is an open-source image generation plugin built specifically for DeepSeek Harness (DSH).**
|
|
49
|
+
|
|
50
|
+
DeepSeek Harness empowers agents to use tools for various tasks. This project adds native **multimodal image generation capabilities**:
|
|
51
|
+
|
|
52
|
+
```mermaid
|
|
53
|
+
graph LR
|
|
54
|
+
A[User Prompt] --> B[DeepSeek Harness Agent]
|
|
55
|
+
B --> C[generate_image Tool]
|
|
56
|
+
C --> D[Gemini / OpenAI / Seedream / DashScope]
|
|
57
|
+
D --> E[Image Data]
|
|
58
|
+
E --> F[In-chat Conversation Stream]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🚀 Quick Install & Usage
|
|
64
|
+
|
|
65
|
+
### 1. Install Plugin
|
|
66
|
+
|
|
67
|
+
In your DeepSeek Harness workspace root:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Recommended: Install or upgrade to latest release
|
|
71
|
+
pnpm dsh plugin --profile web add dsh-image-gen@latest
|
|
72
|
+
|
|
73
|
+
# If dsh is installed globally:
|
|
74
|
+
dsh plugin --profile web add dsh-image-gen@latest
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
<details>
|
|
78
|
+
<summary><b>🛠️ Alternative Installations (Git Repo / Local Dev)</b></summary>
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Method B: Install directly from GitHub
|
|
82
|
+
pnpm dsh plugin --profile web add git+https://github.com/shanliuling/dsh-image-gen.git
|
|
83
|
+
|
|
84
|
+
# Method C: Clone & install locally
|
|
85
|
+
git clone https://github.com/shanliuling/dsh-image-gen.git
|
|
86
|
+
pnpm dsh plugin --profile web add ./dsh-image-gen
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
</details>
|
|
90
|
+
|
|
91
|
+
### 2. Configure API Key
|
|
92
|
+
|
|
93
|
+
Open DSH Web (`http://localhost:3080`):
|
|
94
|
+
|
|
95
|
+
1. Navigate to **Settings → Plugins → Image generation**.
|
|
96
|
+
2. Select Provider, input API Key, click **Save**.
|
|
97
|
+
|
|
98
|
+
<div align="center">
|
|
99
|
+
<img src="docs/assets/settings-preview.png" alt="Settings preview" width="720" />
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
### 3. Generate Images in Chat
|
|
103
|
+
|
|
104
|
+
Simply prompt in the chat input:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Generate a minimalist modern architecture living room illustration.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The Agent will call `generate_image` and return the image directly in the conversation stream.
|
|
111
|
+
|
|
112
|
+
### 4. Browse Native Image Gallery
|
|
113
|
+
|
|
114
|
+
Click the **`[Gallery]`** Tab in the top navigation bar to browse and search all generated images across conversations:
|
|
115
|
+
|
|
116
|
+
<div align="center">
|
|
117
|
+
<img src="docs/assets/gallery-preview.png" alt="Gallery preview" width="820" />
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## ✨ Key Features
|
|
123
|
+
|
|
124
|
+
- 💬 **In-Chat Image Generation**: Tell your Agent what you want to draw without switching tabs or tools.
|
|
125
|
+
- 🖼️ **Native Image Gallery**: Dedicated "Gallery" tab automatically collecting all generated images with keyword search, provider filtering, and quick copy/download.
|
|
126
|
+
- 🔍 **Interactive Image Tools**: High-res fullscreen preview, one-click copy to clipboard, local download, and open in new tab.
|
|
127
|
+
- 🎨 **Multi-Provider Support**: Supports Google Gemini, OpenAI Images, OpenAI Compatible API, ByteDance Seedream / Volcengine Ark, and Aliyun DashScope (Wanx / Qwen-Image).
|
|
128
|
+
- 🔑 **BYOK (Bring Your Own Key)**: Uses your own API keys managed securely by DSH credentials service with write-only protection.
|
|
129
|
+
- 🖼️ **Durable Session Persistence**: Images integrate with DSH Attachment and conversation lifecycle, preserved across reloads.
|
|
130
|
+
- ⚙️ **Native Web Settings**: Configure providers, keys, models, and endpoints directly in DSH settings.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 📦 Supported Providers
|
|
135
|
+
|
|
136
|
+
| Provider | Default Model | Default Endpoint / Base URL |
|
|
137
|
+
| :--- | :--- | :--- |
|
|
138
|
+
| **Google Gemini** | `gemini-3.1-flash-image` | `https://generativelanguage.googleapis.com/v1beta/interactions` |
|
|
139
|
+
| **OpenAI Images** | `gpt-image-2` | `https://api.openai.com/v1` |
|
|
140
|
+
| **OpenAI Compatible** | Custom | Custom Base URL |
|
|
141
|
+
| **ByteDance Seedream / Volcengine Ark** | `doubao-seedream-5-0-260128` | `https://ark.cn-beijing.volces.com/api/v3` |
|
|
142
|
+
| **Aliyun DashScope / Wanx** | `wanx2.1-t2i-turbo` | `https://dashscope.aliyuncs.com/api/v1` |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 🛠️ Local Development
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
git clone https://github.com/shanliuling/dsh-image-gen.git
|
|
150
|
+
cd dsh-image-gen
|
|
151
|
+
|
|
152
|
+
pnpm install
|
|
153
|
+
pnpm run typecheck
|
|
154
|
+
pnpm run test
|
|
155
|
+
pnpm run build
|
|
156
|
+
|
|
157
|
+
pnpm run pack:check
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 📄 License
|
|
163
|
+
|
|
164
|
+
Open-sourced under the [MIT License](LICENSE).
|
|
165
|
+
|
|
166
|
+
If this plugin helps you, feel free to give it a ⭐️ **Star**!
|
package/README.md
CHANGED
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# 🎨 dsh-image-gen
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**让 DeepSeek Harness 像 ChatGPT 一样,在对话里直接生成图片。**
|
|
12
|
-
|
|
13
|
-
支持 Google Gemini、OpenAI Images、OpenAI Compatible API、字节 Seedream / 火山方舟。
|
|
9
|
+
**让 DeepSeek Harness 像 ChatGPT 一样在对话中直接生成图片,支持画廊汇总,全屏预览、快捷复制与一键下载。**
|
|
14
10
|
|
|
15
11
|
[](https://www.npmjs.com/package/dsh-image-gen)
|
|
16
12
|
[](https://github.com/deepseek-ai)
|
|
17
13
|
[](https://www.npmjs.com/package/dsh-image-gen)
|
|
18
14
|
[](LICENSE)
|
|
19
15
|
|
|
16
|
+
[English](README.en.md) | **简体中文**
|
|
17
|
+
|
|
20
18
|
<br />
|
|
21
19
|
|
|
22
20
|
<p align="center">💬 <b>直接对你的 DeepSeek Harness Agent 发送以下提示词:</b></p>
|
|
@@ -55,7 +53,7 @@ DeepSeek Harness 已经可以让 Agent 调用不同工具完成任务,本项
|
|
|
55
53
|
graph LR
|
|
56
54
|
A[用户 Prompt] --> B[DeepSeek Harness Agent]
|
|
57
55
|
B --> C[generate_image 工具]
|
|
58
|
-
C --> D[Gemini / OpenAI / Seedream]
|
|
56
|
+
C --> D[Gemini / OpenAI / Seedream / DashScope]
|
|
59
57
|
D --> E[图片数据]
|
|
60
58
|
E --> F[当前 Conversation 对话流]
|
|
61
59
|
```
|
|
@@ -111,12 +109,22 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
|
|
|
111
109
|
|
|
112
110
|
当前 Agent 就会自动调用 `generate_image` 工具并在对话流中返回图片。
|
|
113
111
|
|
|
112
|
+
### 4. 查看原生生图画廊
|
|
113
|
+
|
|
114
|
+
点击会话顶栏的 **`[画廊]`** Tab,即可集中查看和搜索所有对话生成的历史图片:
|
|
115
|
+
|
|
116
|
+
<div align="center">
|
|
117
|
+
<img src="docs/assets/gallery-preview.png" alt="原生生图画廊预览" width="820" />
|
|
118
|
+
</div>
|
|
119
|
+
|
|
114
120
|
---
|
|
115
121
|
|
|
116
122
|
## ✨ 主要能力
|
|
117
123
|
|
|
118
124
|
- 💬 **对话中直接生图**:不需要切换到其他网站,也不需要手动复制 Prompt,直接告诉 Agent 你想画什么即可。
|
|
119
|
-
-
|
|
125
|
+
- 🖼️ **历史生图画廊**:顶栏自带「画廊」Tab,自动汇总所有历史生成的图片,支持关键词搜索、厂商筛选与一键复制/下载。
|
|
126
|
+
- 🔍 **交互式图片工具**:支持点击全屏大图预览、一键复制图片到剪贴板、本地下载与新标签页打开。
|
|
127
|
+
- 🎨 **多 Provider 支持**:支持 Google Gemini、OpenAI Images、OpenAI Compatible API、ByteDance Seedream / 火山方舟以及阿里云 DashScope(通义万相 / Qwen-Image)。Provider、模型和 Endpoint 均可在设置中自由定制。
|
|
120
128
|
- 🔑 **BYOK (自带 Key)**:插件使用你自己的 API Key。API Key 通过 DeepSeek Harness 的 `credentials` 服务管理,采用写保护隔离,不需要写进项目源码或配置文件,前端不存明文。
|
|
121
129
|
- 🖼️ **图片跟随会话保存**:生成结果会接入 DeepSeek Harness 的 Attachment / Conversation 体系,重新打开历史会话后,仍然可以看到之前生成的图片。
|
|
122
130
|
- ⚙️ **原生设置界面**:Provider、API Key、模型和 Endpoint 都可以直接在 DSH Web 设置中修改,不需要手动编辑配置文件。
|
|
@@ -131,6 +139,7 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
|
|
|
131
139
|
| **OpenAI Images** | `gpt-image-2` | `https://api.openai.com/v1` |
|
|
132
140
|
| **OpenAI Compatible** | 自定义 | 自定义 Base URL |
|
|
133
141
|
| **ByteDance Seedream / 火山方舟** | `doubao-seedream-5-0-260128` | `https://ark.cn-beijing.volces.com/api/v3` |
|
|
142
|
+
| **Aliyun DashScope / 通义万相** | `wanx2.1-t2i-turbo` | `https://dashscope.aliyuncs.com/api/v1` |
|
|
134
143
|
|
|
135
144
|
---
|
|
136
145
|
|
package/README.zh-CN.md
CHANGED
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# 🎨 dsh-image-gen
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**让 DeepSeek Harness 像 ChatGPT 一样,在对话里直接生成图片。**
|
|
12
|
-
|
|
13
|
-
支持 Google Gemini、OpenAI Images、OpenAI Compatible API、字节 Seedream / 火山方舟。
|
|
9
|
+
**让 DeepSeek Harness 像 ChatGPT 一样在对话中直接生成图片,支持画廊汇总,全屏预览、快捷复制与一键下载。**
|
|
14
10
|
|
|
15
11
|
[](https://www.npmjs.com/package/dsh-image-gen)
|
|
16
12
|
[](https://github.com/deepseek-ai)
|
|
17
13
|
[](https://www.npmjs.com/package/dsh-image-gen)
|
|
18
14
|
[](LICENSE)
|
|
19
15
|
|
|
16
|
+
[English](README.en.md) | **简体中文**
|
|
17
|
+
|
|
20
18
|
<br />
|
|
21
19
|
|
|
22
20
|
<p align="center">💬 <b>直接对你的 DeepSeek Harness Agent 发送以下提示词:</b></p>
|
|
@@ -55,7 +53,7 @@ DeepSeek Harness 已经可以让 Agent 调用不同工具完成任务,本项
|
|
|
55
53
|
graph LR
|
|
56
54
|
A[用户 Prompt] --> B[DeepSeek Harness Agent]
|
|
57
55
|
B --> C[generate_image 工具]
|
|
58
|
-
C --> D[Gemini / OpenAI / Seedream]
|
|
56
|
+
C --> D[Gemini / OpenAI / Seedream / DashScope]
|
|
59
57
|
D --> E[图片数据]
|
|
60
58
|
E --> F[当前 Conversation 对话流]
|
|
61
59
|
```
|
|
@@ -111,12 +109,22 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
|
|
|
111
109
|
|
|
112
110
|
当前 Agent 就会自动调用 `generate_image` 工具并在对话流中返回图片。
|
|
113
111
|
|
|
112
|
+
### 4. 查看原生生图画廊
|
|
113
|
+
|
|
114
|
+
点击会话顶栏的 **`[画廊]`** Tab,即可集中查看和搜索所有对话生成的历史图片:
|
|
115
|
+
|
|
116
|
+
<div align="center">
|
|
117
|
+
<img src="docs/assets/gallery-preview.png" alt="原生生图画廊预览" width="820" />
|
|
118
|
+
</div>
|
|
119
|
+
|
|
114
120
|
---
|
|
115
121
|
|
|
116
122
|
## ✨ 主要能力
|
|
117
123
|
|
|
118
124
|
- 💬 **对话中直接生图**:不需要切换到其他网站,也不需要手动复制 Prompt,直接告诉 Agent 你想画什么即可。
|
|
119
|
-
-
|
|
125
|
+
- 🖼️ **历史生图画廊**:顶栏自带「画廊」Tab,自动汇总所有历史生成的图片,支持关键词搜索、厂商筛选与一键复制/下载。
|
|
126
|
+
- 🔍 **交互式图片工具**:支持点击全屏大图预览、一键复制图片到剪贴板、本地下载与新标签页打开。
|
|
127
|
+
- 🎨 **多 Provider 支持**:支持 Google Gemini、OpenAI Images、OpenAI Compatible API、ByteDance Seedream / 火山方舟以及阿里云 DashScope(通义万相 / Qwen-Image)。Provider、模型和 Endpoint 均可在设置中自由定制。
|
|
120
128
|
- 🔑 **BYOK (自带 Key)**:插件使用你自己的 API Key。API Key 通过 DeepSeek Harness 的 `credentials` 服务管理,采用写保护隔离,不需要写进项目源码或配置文件,前端不存明文。
|
|
121
129
|
- 🖼️ **图片跟随会话保存**:生成结果会接入 DeepSeek Harness 的 Attachment / Conversation 体系,重新打开历史会话后,仍然可以看到之前生成的图片。
|
|
122
130
|
- ⚙️ **原生设置界面**:Provider、API Key、模型和 Endpoint 都可以直接在 DSH Web 设置中修改,不需要手动编辑配置文件。
|
|
@@ -131,6 +139,7 @@ pnpm dsh plugin --profile web add ./dsh-image-gen
|
|
|
131
139
|
| **OpenAI Images** | `gpt-image-2` | `https://api.openai.com/v1` |
|
|
132
140
|
| **OpenAI Compatible** | 自定义 | 自定义 Base URL |
|
|
133
141
|
| **ByteDance Seedream / 火山方舟** | `doubao-seedream-5-0-260128` | `https://ark.cn-beijing.volces.com/api/v3` |
|
|
142
|
+
| **Aliyun DashScope / 通义万相** | `wanx2.1-t2i-turbo` | `https://dashscope.aliyuncs.com/api/v1` |
|
|
134
143
|
|
|
135
144
|
---
|
|
136
145
|
|