dsh-draw 0.2.1 → 0.2.2
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/CHANGELOG.md +22 -0
- package/README.es.md +38 -32
- package/README.hi.md +38 -32
- package/README.md +38 -32
- package/README.pt.md +38 -32
- package/README.zh.md +38 -32
- package/lib/client.js +3 -2
- package/lib/client.js.map +1 -1
- package/lib/index.js +11 -7
- package/lib/types/client/DrawResultCard.d.ts +1 -1
- package/lib/types/client/DrawResultCard.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +3 -2
- package/lib/types/client/present.d.ts +40 -1
- package/lib/types/client/present.d.ts.map +1 -1
- package/lib/types/event-gate.d.ts +8 -5
- package/lib/types/event-gate.d.ts.map +1 -1
- package/lib/types/event-gate.js +8 -5
- package/lib/types/session-events.d.ts +10 -8
- package/lib/types/session-events.d.ts.map +1 -1
- package/lib/types/session-events.js +12 -9
- package/lib/types/version.d.ts +1 -1
- package/lib/types/version.js +1 -1
- package/package.json +9 -9
- package/src/client/DrawResultCard.tsx +1 -2
- package/src/client/index.ts +18 -3
- package/src/client/present.ts +42 -1
- package/src/event-gate.ts +9 -6
- package/src/session-events.ts +13 -10
- package/src/version.ts +1 -1
package/README.zh.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🎨 dsh-draw
|
|
4
|
+
- **1024 商店渠道**:先 `npm i -g dsh1024`,再 `dsh1024 plugin --profile web add dsh-draw`(计入 [deepseek1024.com](https://deepseek1024.com) 安装排行)。
|
|
4
5
|
|
|
5
6
|
**DeepSeek Harness 的统一静态图像生成路由。**
|
|
6
7
|
|
|
@@ -29,6 +30,8 @@
|
|
|
29
30
|
| 引擎 | 任意 OpenAI 兼容图像端点;内置 OpenAI Images(`gpt-image-1`)与智谱 CogView(`cogview-3-flash`)预设 |
|
|
30
31
|
| 界面 | Host `image_generate` 工具 + Web 结果卡片 + Plugins 设置页签 |
|
|
31
32
|
|
|
33
|
+
浏览器半边基于 cordis `Context` 与已发布的客户端包(`dsh-client-ui-slots`、`dsh-client-ui-settings`、`dsh-client-ui-tool`、`dsh-client-locale`、`dsh-client-connection`);它不再依赖已移除的 `dsh-client-runtime` 包(工具调用块经本地结构契约读取),因此客户端接口面同样对齐 `0.1.2-alpha.1` 宿主。
|
|
34
|
+
|
|
32
35
|
## 你能得到什么
|
|
33
36
|
|
|
34
37
|
`dsh-draw` 给 harness 一个统一的 `image_generate` 工具,标准参数(`prompt`/`size`/`count`/`quality`/`style`/`engine`)按引擎翻译:
|
|
@@ -117,7 +120,7 @@ profile patch 中的覆盖示例:
|
|
|
117
120
|
|
|
118
121
|
- **权限**:插件仅对配置的引擎端点发起 HTTPS 出站请求;其余界面全部只读。设置页签唯一的写入是对官方 `ctx.credentials` 接缝的凭据设置/移除。
|
|
119
122
|
- **数据**:生成的图片经官方附件存储落盘,受 harness 附件策略约束。配额用量从 `draw/generated` 会话事件折叠;在无法安全落盘该事件的宿主上另加内存兜底账簿 —— 除此之外不存储任何东西。
|
|
120
|
-
- **会话日志**:`draw/generated` 事件记录引擎、模型、标准化请求、字节总量与附件 id —— 审计事实,绝不包含 API 密钥。仅当宿主收录该类型或支持 `ignorable` 信封时才落盘(挂载期探测);在 rc.6/rc.7
|
|
123
|
+
- **会话日志**:`draw/generated` 事件记录引擎、模型、标准化请求、字节总量与附件 id —— 审计事实,绝不包含 API 密钥。仅当宿主收录该类型或支持 `ignorable` 信封时才落盘(挂载期探测);在 rc.6/rc.7 宿主与移除信封的 `0.1.2-alpha.1` 宿主(读取时对未知类型失败关闭)上,载荷改记内存兜底账簿,生成图片不再导致会话重启后无法打开。
|
|
121
124
|
|
|
122
125
|
## 安全边界
|
|
123
126
|
|
|
@@ -131,7 +134,7 @@ profile patch 中的覆盖示例:
|
|
|
131
134
|
- **仅图像模型。** 无视频、音频或编辑端点;无视觉理解。
|
|
132
135
|
- **引擎兼容性。** 引擎需支持 OpenAI `POST /images/generations` 形状(base64 或 URL 交付);厂商专属扩展不在范围内。
|
|
133
136
|
- **成本感知是结构性的。** 插件统计调用次数与字节,但不了解引擎定价 —— 与 `dsh-budget` 配合做成本治理。
|
|
134
|
-
- **rc.6/rc.7 上的配额持久性。** 会话日志无法安全携带 `draw/generated` 的宿主(静态事件白名单、无 `ignorable`
|
|
137
|
+
- **rc.6/rc.7 与 0.1.2-alpha.1 上的配额持久性。** 会话日志无法安全携带 `draw/generated` 的宿主(静态事件白名单、无 `ignorable` 信封;`0.1.2-alpha.1` 已移除信封并在读取时对未知事件类型失败关闭)上,配额经内存兜底账簿在活会话内保持精确,但重启后重置;宿主具备插件事件面后恢复持久记账。
|
|
135
138
|
|
|
136
139
|
## 开发
|
|
137
140
|
|
|
@@ -157,39 +160,42 @@ pnpm pack # 发布用 tarball
|
|
|
157
160
|
|
|
158
161
|
## PerryLink DSH Plugin Family
|
|
159
162
|
|
|
160
|
-
|
|
163
|
+
这是 [PerryLink](https://github.com/PerryLink) 维护的 [33 个 DeepSeek Harness 插件](https://github.com/PerryLink) 之一。如果它能帮到你,其他的也会:
|
|
161
164
|
|
|
162
165
|
| Plugin | One-liner |
|
|
163
166
|
|---|---|
|
|
164
|
-
| [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) | 审批链上的第二模型自动审查,默认失败关闭 |
|
|
165
|
-
| [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) |
|
|
166
|
-
| [dsh-budget](https://github.com/PerryLink/dsh-budget) | DeepSeek Harness 的成本治理:预算、碳排与延迟一屏呈现。 |
|
|
167
|
-
| [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Claude Code /rewind
|
|
168
|
-
| [dsh-claude-move](https://github.com/PerryLink/dsh-claude-move) |
|
|
169
|
-
| [dsh-click](https://github.com/PerryLink/dsh-click) | 跨平台原生桌面控制(DeepSeek Harness),Windows 优先。 |
|
|
170
|
-
| [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) | Web
|
|
171
|
-
| [dsh-
|
|
172
|
-
| [dsh-
|
|
173
|
-
| **[dsh-
|
|
174
|
-
| [dsh-fast](https://github.com/PerryLink/dsh-fast) | DeepSeek Harness
|
|
175
|
-
| [dsh-
|
|
176
|
-
| [dsh-
|
|
177
|
-
| [dsh-
|
|
178
|
-
| [dsh-
|
|
179
|
-
| [dsh-
|
|
180
|
-
| [dsh-
|
|
181
|
-
| [dsh-
|
|
182
|
-
| [dsh-
|
|
183
|
-
| [dsh-
|
|
184
|
-
| [dsh-
|
|
185
|
-
| [dsh-
|
|
186
|
-
| [dsh-
|
|
187
|
-
| [dsh-
|
|
188
|
-
| [dsh-
|
|
189
|
-
| [dsh-
|
|
190
|
-
| [dsh-
|
|
191
|
-
| [dsh-
|
|
192
|
-
| [dsh-
|
|
167
|
+
| **[dsh-dsh-auto-review](https://github.com/PerryLink/dsh-dsh-auto-review)** | 审批链上的第二模型自动审查,默认失败关闭 | |
|
|
168
|
+
| **[dsh-dsh-background-agents](https://github.com/PerryLink/dsh-dsh-background-agents)** | 带 Web UI 侧栏、消息与中断的持久后台子代理 | |
|
|
169
|
+
| **[dsh-dsh-budget](https://github.com/PerryLink/dsh-dsh-budget)** | DeepSeek Harness 的成本治理:预算、碳排与延迟一屏呈现。 | |
|
|
170
|
+
| **[dsh-dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-dsh-checkpoint-rewind)** | Claude Code /rewind 等价:快照、会话 fork、一次性恢复 | |
|
|
171
|
+
| **[dsh-dsh-claude-move](https://github.com/PerryLink/dsh-dsh-claude-move)** | 把 Claude Code 会话、记忆、技能与 CLAUDE.md 迁入 DSH | |
|
|
172
|
+
| **[dsh-dsh-click](https://github.com/PerryLink/dsh-dsh-click)** | 跨平台原生桌面控制(DeepSeek Harness),Windows 优先。 | |
|
|
173
|
+
| **[dsh-dsh-composer-history](https://github.com/PerryLink/dsh-dsh-composer-history)** | Web 输入框的终端式历史:方向键、Ctrl+R 搜索 | |
|
|
174
|
+
| **[dsh-dsh-data-quality](https://github.com/PerryLink/dsh-dsh-data-quality)** | 数据集质量检查与引文核查(本插件可选消费的数字核查桥) | |
|
|
175
|
+
| **[dsh-dsh-defend](https://github.com/PerryLink/dsh-dsh-defend)** | DeepSeek Harness 的提示注入、越狱与密钥泄露防护。 | |
|
|
176
|
+
| **[dsh-dsh-doublecheck](https://github.com/PerryLink/dsh-dsh-doublecheck)** | 工程纪律守卫:需求质询、测试门禁、对手评审 | |
|
|
177
|
+
| **[dsh-dsh-fast](https://github.com/PerryLink/dsh-dsh-fast)** | DeepSeek Harness 只读性能诊断。 | |
|
|
178
|
+
| **[dsh-dsh-fund-research](https://github.com/PerryLink/dsh-dsh-fund-research)** | 面向中国公募基金的确定性研究报告 | |
|
|
179
|
+
| **[dsh-dsh-github](https://github.com/PerryLink/dsh-dsh-github)** | 面向 DSH 的 GitHub PR/issues 集成,每次写入经审批门控 | |
|
|
180
|
+
| **[dsh-dsh-industry-research](https://github.com/PerryLink/dsh-dsh-industry-research)** | 行业研究编排,经本插件的 `ctx.researchReport.assemble` 封存交付物 | |
|
|
181
|
+
| **[dsh-dsh-library](https://github.com/PerryLink/dsh-dsh-library)** | DeepSeek Harness 的本地文档知识库。 | |
|
|
182
|
+
| **[dsh-dsh-local-ai](https://github.com/PerryLink/dsh-dsh-local-ai)** | DeepSeek Harness 的本地模型(Ollama)接入。 | |
|
|
183
|
+
| **[dsh-dsh-lsp-actions](https://github.com/PerryLink/dsh-dsh-lsp-actions)** | 通过语言服务器的 LSP 诊断、格式化、补全、代码操作与重命名 | |
|
|
184
|
+
| **[dsh-dsh-mask](https://github.com/PerryLink/dsh-dsh-mask)** | PII 脱敏中间件:模型边界匿名化、展示层还原 | |
|
|
185
|
+
| **[dsh-dsh-mcp-panel](https://github.com/PerryLink/dsh-dsh-mcp-panel)** | 只读 MCP 运行时面板:/mcp 命令 + 带状态、工具与错误的 Settings 标签页 | |
|
|
186
|
+
| **[dsh-dsh-memento](https://github.com/PerryLink/dsh-dsh-memento)** | 审批门控的跨会话记忆:ctx.memory 接缝 + SQLite + 记忆工具 | |
|
|
187
|
+
| **[dsh-dsh-observe](https://github.com/PerryLink/dsh-dsh-observe)** | DeepSeek Harness 的 OpenTelemetry 与 Langfuse 可观测导出器。 | |
|
|
188
|
+
| **[dsh-dsh-output-styles](https://github.com/PerryLink/dsh-dsh-output-styles)** | Claude Code outputStyles 等价的运行时风格切换 | |
|
|
189
|
+
| **[dsh-dsh-permission-rules](https://github.com/PerryLink/dsh-dsh-permission-rules)** | Claude Code 风格声明式 allow/deny/ask 权限规则,带审计 | |
|
|
190
|
+
| **[dsh-dsh-plugin-guide](https://github.com/PerryLink/dsh-dsh-plugin-guide)** | 作为按需代理技能的插件开发知识库 | |
|
|
191
|
+
| **[dsh-dsh-research-report](https://github.com/PerryLink/dsh-dsh-research-report)** | 可验证研究报告引擎:内容寻址证据账本与封存版本 | |
|
|
192
|
+
| **[dsh-dsh-score](https://github.com/PerryLink/dsh-dsh-score)** | DeepSeek Harness 插件的多维质量评分。 | |
|
|
193
|
+
| **[dsh-dsh-session-pin](https://github.com/PerryLink/dsh-dsh-session-pin)** | 在 Web 侧栏置顶会话,带持久排序 | |
|
|
194
|
+
| **[dsh-dsh-session-sync](https://github.com/PerryLink/dsh-dsh-session-sync)** | DeepSeek Harness 的跨设备会话同步——会话存储的专用 git 镜像。 | |
|
|
195
|
+
| **[dsh-dsh-skill-pack-security](https://github.com/PerryLink/dsh-dsh-skill-pack-security)** | 安全审计技能包:密钥扫描、依赖与供应链审查 | |
|
|
196
|
+
| **[dsh-dsh-talk](https://github.com/PerryLink/dsh-dsh-talk)** | DeepSeek Harness 的语音优先会话闭环:对它说,听它答。 | |
|
|
197
|
+
| **[dsh-dsh-test-drive](https://github.com/PerryLink/dsh-dsh-test-drive)** | DeepSeek Harness 插件的隔离试装冒烟。 | |
|
|
198
|
+
| **[dsh-dsh-translate](https://github.com/PerryLink/dsh-dsh-translate)** | DeepSeek Harness 的厂商参数翻译与确定性 JSON 修复。 | |
|
|
193
199
|
|
|
194
200
|
## License
|
|
195
201
|
|
package/lib/client.js
CHANGED
|
@@ -4724,11 +4724,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4724
4724
|
await ctx.remote.$mount(DRAW_REMOTE);
|
|
4725
4725
|
ctx.inject(["remote.draw"], (scope) => {
|
|
4726
4726
|
const t = scope.locale.bind(NS);
|
|
4727
|
+
const slots = scope.get("slots");
|
|
4727
4728
|
const unwrap = (result, method) => {
|
|
4728
4729
|
if (!result.ok) throw new Error(`draw.${method} failed: ${result.error.code}: ${result.error.message}`);
|
|
4729
4730
|
return result.value;
|
|
4730
4731
|
};
|
|
4731
|
-
|
|
4732
|
+
slots.inject("tool.call.toolview", () => slots.register({
|
|
4732
4733
|
name: "tool.call.toolview",
|
|
4733
4734
|
key: "image_generate",
|
|
4734
4735
|
locale: NS,
|
|
@@ -4738,7 +4739,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4738
4739
|
unwrap(await scope.remote.draw.regenerate(sessionId, args), "regenerate");
|
|
4739
4740
|
} })
|
|
4740
4741
|
}, DrawResultCard));
|
|
4741
|
-
|
|
4742
|
+
slots.inject("settings.plugins.tab", () => slots.register({
|
|
4742
4743
|
name: "settings.plugins.tab",
|
|
4743
4744
|
id: "draw",
|
|
4744
4745
|
order: 40,
|