dsh-image-gen 0.1.6 â 0.2.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.en.md +171 -166
- package/README.md +187 -169
- package/README.zh-CN.md +171 -169
- package/lib/client.js +80 -1
- package/lib/client.js.map +1 -1
- package/lib/index.js +799 -192
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/config.d.ts +6 -0
- package/lib/types/dashscope.d.ts +12 -3
- package/lib/types/google.d.ts +14 -3
- package/lib/types/index.d.ts +0 -3
- package/lib/types/openai-compatible.d.ts +15 -3
- package/lib/types/reference-image.d.ts +38 -0
- package/lib/types/seedream.d.ts +17 -0
- package/lib/types/shared.d.ts +1 -1
- package/lib/types/workspace-save.d.ts +52 -0
- package/package.json +37 -34
package/README.en.md
CHANGED
|
@@ -1,166 +1,171 @@
|
|
|
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
|
|
37
|
-
|
|
38
|
-
<br />
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
#
|
|
74
|
-
dsh plugin --profile web add dsh-image-gen@latest
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
# Method
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
- đŧī¸ **
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
pnpm
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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 generate images and can also continue editing the previous image directly.</p>
|
|
37
|
+
|
|
38
|
+
<br />
|
|
39
|
+
|
|
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>
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## đĄ What Problem Does It Solve?
|
|
50
|
+
|
|
51
|
+
**`dsh-image-gen` is an open-source image generation plugin built specifically for DeepSeek Harness (DSH).**
|
|
52
|
+
|
|
53
|
+
DeepSeek Harness empowers agents to use tools for various tasks. This project adds native **multimodal image generation capabilities**:
|
|
54
|
+
|
|
55
|
+
```mermaid
|
|
56
|
+
graph LR
|
|
57
|
+
A[User Prompt] --> B[DeepSeek Harness Agent]
|
|
58
|
+
B --> C[generate_image Tool]
|
|
59
|
+
C --> D[Gemini / OpenAI / Seedream / DashScope]
|
|
60
|
+
D --> E[Image Data]
|
|
61
|
+
E --> F[In-chat Conversation Stream]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## đ Quick Install & Usage
|
|
67
|
+
|
|
68
|
+
### 1. Install Plugin
|
|
69
|
+
|
|
70
|
+
In your DeepSeek Harness workspace root:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Recommended: Install or upgrade to latest release
|
|
74
|
+
pnpm dsh plugin --profile web add dsh-image-gen@latest
|
|
75
|
+
|
|
76
|
+
# If dsh is installed globally:
|
|
77
|
+
dsh plugin --profile web add dsh-image-gen@latest
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
<details>
|
|
81
|
+
<summary><b>đ ī¸ Alternative Installations (Git Repo / Local Dev)</b></summary>
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Method B: Install directly from GitHub
|
|
85
|
+
pnpm dsh plugin --profile web add git+https://github.com/shanliuling/dsh-image-gen.git
|
|
86
|
+
|
|
87
|
+
# Method C: Clone & install locally
|
|
88
|
+
git clone https://github.com/shanliuling/dsh-image-gen.git
|
|
89
|
+
pnpm dsh plugin --profile web add ./dsh-image-gen
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
</details>
|
|
93
|
+
|
|
94
|
+
### 2. Configure API Key & Workspace Settings
|
|
95
|
+
|
|
96
|
+
Open DSH Web (`http://localhost:3080`):
|
|
97
|
+
|
|
98
|
+
1. Navigate to **Settings â Plugins â Image generation**.
|
|
99
|
+
2. Select Provider, input API Key.
|
|
100
|
+
3. Optionally enable **Save to workspace** (enabled by default) and specify subfolder, then click **Save**.
|
|
101
|
+
|
|
102
|
+
<div align="center">
|
|
103
|
+
<img src="docs/assets/settings-preview.png?v=0.1.7" alt="Settings preview" width="720" />
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
### 3. Generate Images in Chat
|
|
107
|
+
|
|
108
|
+
Simply prompt in the chat input:
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
Generate a minimalist modern architecture living room illustration.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The Agent will call `generate_image` and return the image directly in the conversation stream.
|
|
115
|
+
|
|
116
|
+
### 4. Browse Native Image Gallery
|
|
117
|
+
|
|
118
|
+
Click the **`[Gallery]`** Tab in the top navigation bar to browse and search all generated images across conversations:
|
|
119
|
+
|
|
120
|
+
<div align="center">
|
|
121
|
+
<img src="docs/assets/gallery-preview.png" alt="Gallery preview" width="820" />
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## ⨠Key Features
|
|
127
|
+
|
|
128
|
+
- đŦ **In-Chat Image Generation**: Tell your Agent what you want to draw without switching tabs or tools.
|
|
129
|
+
- đŧī¸ **Native Image Gallery**: Dedicated "Gallery" tab automatically collecting all generated images with keyword search, provider filtering, single-item deletion (with confirmation and persistent tombstones), and quick copy/download.
|
|
130
|
+
- đ **Interactive Image Tools**: High-res fullscreen preview, one-click copy to clipboard, local download, and open in new tab.
|
|
131
|
+
- đ¨ **Multi-Provider Support**: Supports Google Gemini, OpenAI Images, OpenAI Compatible API, ByteDance Seedream / Volcengine Ark, and Aliyun DashScope (Wanx / Qwen-Image).
|
|
132
|
+
- đ **BYOK (Bring Your Own Key)**: Uses your own API keys managed securely by DSH credentials service with write-only protection.
|
|
133
|
+
- đŧī¸ **Durable Session Persistence**: Images integrate with DSH Attachment and conversation lifecycle, preserved across reloads.
|
|
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.
|
|
135
|
+
- âī¸ **Native Web Settings**: Configure providers, keys, models, and endpoints directly in DSH settings.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## đĻ Supported Providers
|
|
140
|
+
|
|
141
|
+
| Provider | Default Model | Default Endpoint / Base URL |
|
|
142
|
+
| :--- | :--- | :--- |
|
|
143
|
+
| **Google Gemini** | `gemini-3.1-flash-image` | `https://generativelanguage.googleapis.com/v1beta/interactions` |
|
|
144
|
+
| **OpenAI Images** | `gpt-image-2` | `https://api.openai.com/v1` |
|
|
145
|
+
| **OpenAI Compatible** | Custom | Custom Base URL |
|
|
146
|
+
| **ByteDance Seedream / Volcengine Ark** | `doubao-seedream-5-0-260128` | `https://ark.cn-beijing.volces.com/api/v3` |
|
|
147
|
+
| **Aliyun DashScope / Wanx** | `wanx2.1-t2i-turbo` | `https://dashscope.aliyuncs.com/api/v1` |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## đ ī¸ Local Development
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
git clone https://github.com/shanliuling/dsh-image-gen.git
|
|
155
|
+
cd dsh-image-gen
|
|
156
|
+
|
|
157
|
+
pnpm install
|
|
158
|
+
pnpm run typecheck
|
|
159
|
+
pnpm run test
|
|
160
|
+
pnpm run build
|
|
161
|
+
|
|
162
|
+
pnpm run pack:check
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## đ License
|
|
168
|
+
|
|
169
|
+
Open-sourced under the [MIT License](LICENSE).
|
|
170
|
+
|
|
171
|
+
If this plugin helps you, feel free to give it a âī¸ **Star**!
|