dsh-solmirror 0.11.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Solmirror · 北京瞬镜科技
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # dsh-solmirror
2
+
3
+ [![npm version](https://img.shields.io/npm/v/dsh-solmirror.svg)](https://www.npmjs.com/package/dsh-solmirror)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+
6
+ 把[瞬镜开放平台](https://aigcserver.solmirror.cn)(Solmirror)的图片、视频生成能力接入 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh):智能体直接用提示词生成图片和视频,结果在对话内播放、展示,按平台价格计积分,失败自动退款。
7
+
8
+ > Bring Solmirror's image & video generation models into dsh as MCP tools — with reference uploads, cost estimates, background-tracked video jobs and in-chat playback.
9
+
10
+ ## 功能特性
11
+
12
+ - **7 个 MCP 工具**:模型目录(`list_models`)、估价(`estimate_cost`)、参考素材上传(`upload_reference`)、文生图/图生图(`generate_image`)、文生视频/图生视频/参考视频·参考音色(`generate_video`)、结果查询(`get_generation`)、媒体地址(`get_media_url`)
13
+ - **视频生成走 dsh 原生后台任务**:提交即返,完成/失败自动通知,agent 无需轮询
14
+ - **对话内媒体面**:生成中显示跟随比例的进度占位,视频内嵌播放器、图片出图墙,历史会话回看同样有效
15
+ - **设置页配置**:API 密钥、服务器地址、可见模型组、测试连接;密钥只存本机 dsh 凭据存储,不回显明文
16
+ - **参考素材可复用**:本地图片/视频/音频上传一次得到素材标识,多次生成直接引用
17
+
18
+ ## 安装
19
+
20
+ **方式一:npm(推荐,可在 dsh 插件页一键更新)**
21
+
22
+ ```sh
23
+ dsh plugin --profile <你的profile> add dsh-solmirror
24
+ ```
25
+
26
+ 或在 dsh 网页 → 侧栏「插件」→ 添加插件,输入 `dsh-solmirror`。
27
+
28
+ **方式二:从源码安装**
29
+
30
+ ```sh
31
+ dsh plugin --profile <你的profile> add github:cthulhu-tww/dsh-solmirror
32
+ ```
33
+
34
+ ## 配置
35
+
36
+ 打开 dsh 网页 → 左下角 **设置 → 瞬镜开放平台**:
37
+
38
+ | 配置项 | 说明 |
39
+ |---|---|
40
+ | API 密钥 | 在瞬镜「开放平台 → API 密钥」创建的 `sk-…`,粘贴保存。只存在本机,不回显明文 |
41
+ | 服务器地址 | `https://aigcserver.solmirror.cn/mcp`(也可从瞬镜平台「插件接入」页一键复制) |
42
+ | 可见模型组 | 勾选后智能体只能看到并使用这些模型组;不勾 = 全部可见 |
43
+ | 测试连接 | 用当前密钥和地址向瞬镜服务发起一次验证,即时反馈是否可用 |
44
+
45
+ 保存即生效,无需重启 dsh(新配置几秒内自动应用);想立即确认,点「测试连接」。
46
+
47
+ ## 工具一览
48
+
49
+ | 工具 | 说明 |
50
+ |---|---|
51
+ | `list_models` | 查看可用的图片/视频模型与能力(按「可见模型组」过滤) |
52
+ | `estimate_cost` | 生成前估价:按参数算出本次要扣多少积分,只询价、不生成、不扣费 |
53
+ | `generate_image` | 文生图/图生图,支持参考图 |
54
+ | `generate_video` | 文生视频/图生视频/参考视频生成;部分模型支持参考音色——上传音频作为素材后,在台词处标注(参考音频1),对应角色会用该音色说话 |
55
+ | `upload_reference` | 上传本地参考素材(图片/视频/音频),返回素材标识,生成时引用。同一素材可重复使用:没用过的保留 1 天、用过的自最后一次使用保留 3 天,过期重新上传即可。支持 jpg/png/webp/gif、mp4/mov/webm(≤30 秒)、mp3/wav(≤60 秒),单文件 ≤50MB,不合规会当场报错 |
56
+ | `get_generation` | 查询生成结果 |
57
+ | `get_media_url` | 获取产物的临时查看/下载地址 |
58
+
59
+ ## 积分说明
60
+
61
+ 生成按平台实时计价扣积分,与站内同价:个人密钥扣个人积分,企业密钥扣企业积分池;生成失败或审核不通过自动退款。生成前可用 `estimate_cost` 询价。历史生成记录可在瞬镜平台「开放平台 → 生成记录」查看。
62
+
63
+ ## 许可证
64
+
65
+ [MIT](LICENSE)