@deepwhale-cn/dsh-badge 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +29 -2
- package/README.zh.md +30 -0
- package/assets/deepwhale-badge.md +32 -0
- package/assets/deepwhale-badge.png +0 -0
- package/cordis.patch.yml +4 -0
- package/icon.svg +13 -0
- package/lib/index.js +73 -0
- package/package.json +51 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 温州深鲸智能科技有限公司
|
|
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
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @deepwhale-cn/dsh-badge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给用深鲸桌面(DeepWhale Desktop)产出的文档、PR、MR 加「powered by dwh」署名徽章。
|
|
4
|
+
|
|
5
|
+
格式与官方 `@deepseek-ai/dsh-skill-badge` 一致:一个 skill provider 插件,正文在 `assets/deepwhale-badge.md`,资源目录 `assets/`。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
dsh plugin --profile <你的 profile> add @deepwhale-cn/dsh-badge
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
或手动在组合里插一行:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
- insert:
|
|
17
|
+
- id: deepwhale-badge
|
|
18
|
+
name: '@deepwhale-cn/dsh-badge'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
装好后会话的 skill 目录里会出现 `deepwhale-badge`,模型在产出内容时可以按它的说明加徽章。
|
|
22
|
+
|
|
23
|
+
## 内容
|
|
24
|
+
|
|
25
|
+
- `assets/deepwhale-badge.md`:徽章用法(Markdown 片段、尺寸、摆放规则、免责说明)
|
|
26
|
+
- `assets/deepwhale-badge.png`:726×120 源图,按 121×20 显示(胶囊圆角、透明背景)
|
|
27
|
+
|
|
28
|
+
## 许可
|
|
29
|
+
|
|
30
|
+
MIT。徽章只表示「内容用深鲸桌面生成」,不代表 DeepSeek 官方或深鲸官方背书。
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @deepwhale-cn/dsh-badge
|
|
2
|
+
|
|
3
|
+
给用深鲸桌面(DeepWhale Desktop)产出的文档、PR、MR 加「powered by dwh」署名徽章。
|
|
4
|
+
|
|
5
|
+
格式与官方 `@deepseek-ai/dsh-skill-badge` 一致:一个 skill provider 插件,正文在 `assets/deepwhale-badge.md`,资源目录 `assets/`。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
dsh plugin --profile <你的 profile> add @deepwhale-cn/dsh-badge
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
或手动在组合里插一行:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
- insert:
|
|
17
|
+
- id: deepwhale-badge
|
|
18
|
+
name: '@deepwhale-cn/dsh-badge'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
装好后会话的 skill 目录里会出现 `deepwhale-badge`,模型在产出内容时可以按它的说明加徽章。
|
|
22
|
+
|
|
23
|
+
## 内容
|
|
24
|
+
|
|
25
|
+
- `assets/deepwhale-badge.md`:徽章用法(Markdown 片段、尺寸、摆放规则、免责说明)
|
|
26
|
+
- `assets/deepwhale-badge.png`:726×120 源图,按 121×20 显示(胶囊圆角、透明背景)
|
|
27
|
+
|
|
28
|
+
## 许可
|
|
29
|
+
|
|
30
|
+
MIT。徽章只表示「内容用深鲸桌面生成」,不代表 DeepSeek 官方或深鲸官方背书。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# DWH Badge
|
|
2
|
+
|
|
3
|
+
给用深鲸桌面(DeepWhale Desktop)产出的内容加署名徽章。样式对齐官方 `dsh-badge`:全白鲸鱼 + 大号 "powered by" + 品牌蓝后缀块(小写 dwh),**胶囊圆角、透明背景**。
|
|
4
|
+
|
|
5
|
+
## Assets
|
|
6
|
+
|
|
7
|
+
- 本地 PNG:[`deepwhale-badge.png`](deepwhale-badge.png),726×120 源图;显示时按 **121×20**
|
|
8
|
+
- Shields.io 图片地址:`https://img.shields.io/badge/powered_by-dwh-005A8C?style=flat&logoColor=white`
|
|
9
|
+
- 项目地址:`https://deepwhale.org.cn`
|
|
10
|
+
|
|
11
|
+
## Markdown
|
|
12
|
+
|
|
13
|
+
带链接(推荐):
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
[](https://deepwhale.org.cn)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
不带链接:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+

|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 使用规则
|
|
26
|
+
|
|
27
|
+
- GitHub / GitLab 的 Markdown 用 Shields.io 地址;用户没要求链接时用不带链接的写法。
|
|
28
|
+
- 飞书等对远程图片导入不稳定的系统,直接上传本 skill 目录里的 `deepwhale-badge.png`,不要另生成一张。
|
|
29
|
+
- 保持 **121×20** 尺寸与宽高比(胶囊圆角、透明背景,不要改成方形)。
|
|
30
|
+
- 徽章放在被署名文档/章节的**末尾**,除非用户指定了其它位置。
|
|
31
|
+
- 不替换配色、文案、logo 或项目地址(后缀固定为小写 **dwh**)。
|
|
32
|
+
- 它只表示「这个内容是用深鲸桌面做的」,**不代表 DeepSeek 官方或深鲸官方的背书**;不要放在会被误读成官方认证的位置。
|
|
Binary file
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 696 458" width="696" height="458"><defs>
|
|
2
|
+
<linearGradient id="bg" x1="0.12" y1="0" x2="0.38" y2="0.95">
|
|
3
|
+
<stop offset="0" stop-color="#42C3D6"/>
|
|
4
|
+
<stop offset="0.22" stop-color="#17A8BE"/>
|
|
5
|
+
<stop offset="0.55" stop-color="#0A6E92"/>
|
|
6
|
+
<stop offset="0.82" stop-color="#034E7A"/>
|
|
7
|
+
<stop offset="1" stop-color="#003A6E"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="sp" x1="0" y1="0" x2="0.2" y2="1">
|
|
10
|
+
<stop offset="0" stop-color="#9BE0F5"/>
|
|
11
|
+
<stop offset="1" stop-color="#5FC4E8"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
</defs><path d="M325.05,453.46L317.68,448.92L307.71,450.08C294.66,451.60 247.15,450.69 233.50,448.66C212.10,445.48 208.00,444.70 193.00,440.97C174.69,436.41 164.93,433.16 148.00,426.02C131.64,419.11 128.14,417.31 111.50,407.24C80.68,388.59 51.72,361.66 34.32,335.50C13.67,304.46 4.63,280.23 0.99,246.18C-0.05,236.44 0.00,235.62 2.04,231.41C4.29,226.78 20.16,211.16 33.50,200.46C65.47,174.82 104.26,158.96 147.37,153.91C167.61,151.53 210.48,154.36 232.79,159.53C249.42,163.39 274.86,171.49 288.50,177.27C314.84,188.42 320.60,191.20 360.00,211.77C403.18,234.31 434.59,240.11 469.50,231.99C491.58,226.86 513.57,212.05 530.28,191.05C536.15,183.68 536.20,183.56 535.58,178.55C535.23,175.77 533.40,170.31 531.50,166.40C527.02,157.21 516.05,146.65 503.04,139.00C491.59,132.27 477.87,119.58 471.09,109.44C465.60,101.24 460.77,89.58 458.36,78.74C456.07,68.45 456.04,48.59 458.30,38.89C461.53,25.04 464.36,24.63 469.44,37.25C473.22,46.65 477.58,52.94 483.20,57.09C489.45,61.71 501.04,66.87 509.84,68.96C514.05,69.96 521.50,71.72 526.39,72.86C548.49,78.03 562.55,89.83 567.59,107.43C568.63,111.05 569.71,113.99 569.99,113.97C570.27,113.96 571.77,111.10 573.33,107.61C582.61,86.81 603.08,75.15 635.84,72.01C647.04,70.93 654.65,68.54 663.32,63.38C675.13,56.35 678.76,51.71 683.11,38.13C684.41,34.07 686.06,30.53 686.77,30.26C690.82,28.70 694.65,39.74 695.70,56.00C696.32,65.49 693.58,82.65 689.82,92.84C685.61,104.24 674.63,120.69 665.78,128.85C656.53,137.38 640.77,147.02 628.58,151.63C614.57,156.92 606.59,161.60 598.29,169.41C588.43,178.68 584.14,186.35 580.58,201.04C565.50,263.33 562.79,271.80 549.40,298.35C535.38,326.15 513.84,354.04 489.21,376.27C479.46,385.07 458.75,400.44 447.44,407.26C438.27,412.79 411.41,425.68 403.56,428.31C399.74,429.60 396.44,431.17 396.23,431.81C396.02,432.45 401.28,438.49 407.92,445.24C414.56,451.98 419.99,457.61 420.00,457.75C420.00,457.89 400.29,458.00 376.20,458.00L332.41,458.00L325.05,453.46Z M156.67,150.25C156.42,149.84 155.50,146.65 154.61,143.17C151.64,131.50 143.80,113.77 138.16,106.00C130.87,95.94 119.16,86.75 111.87,85.35C99.92,83.07 93.49,73.74 99.02,66.71C101.94,62.99 106.95,61.65 114.84,62.50C121.50,63.21 121.50,63.21 119.65,61.17C118.64,60.05 115.58,58.33 112.86,57.35C106.78,55.17 102.27,51.39 101.43,47.78C100.92,45.60 101.40,44.44 103.82,42.03C109.44,36.41 116.68,38.46 127.27,48.69C133.24,54.46 134.31,55.12 135.57,53.86C136.76,52.67 136.82,51.39 135.91,46.46C135.30,43.18 134.97,37.26 135.17,33.30C135.57,25.30 137.20,22.19 143.09,18.18C147.29,15.32 152.18,15.90 156.23,19.74C160.22,23.53 161.31,28.09 161.41,41.50C161.48,51.45 161.76,53.50 163.00,53.50C163.82,53.50 165.26,51.92 166.18,50.00C167.11,48.08 169.14,43.82 170.69,40.54C174.50,32.47 179.51,25.98 185.80,20.97C190.83,16.97 198.68,13.66 201.27,14.46C201.95,14.66 203.75,15.11 205.28,15.44C208.62,16.18 211.99,21.23 211.99,25.50C211.99,29.95 209.23,33.73 199.52,42.55C191.11,50.20 185.00,57.56 185.00,60.05C185.00,60.70 186.86,59.56 189.13,57.50C191.40,55.45 196.15,52.42 199.70,50.76C205.03,48.27 206.92,47.85 210.65,48.37C216.36,49.15 216.90,49.50 218.62,53.64C219.86,56.59 219.84,57.40 218.53,59.93C216.85,63.20 212.03,67.00 209.58,67.00C207.73,67.00 198.06,72.22 193.23,75.83C188.64,79.26 180.81,89.40 177.27,96.50C170.59,109.91 167.02,125.89 167.13,141.89C167.16,147.01 166.77,149.53 165.84,150.12C164.18,151.17 157.28,151.27 156.67,150.25Z M110.20,101.80C107.18,98.78 110.25,93.99 113.94,95.97C117.13,97.67 116.04,103.00 112.50,103.00C111.90,103.00 110.86,102.46 110.20,101.80Z M86.00,92.29C83.15,91.25 80.00,87.64 80.00,85.41C80.00,82.08 85.64,77.70 88.91,78.50C92.22,79.31 93.70,80.82 94.54,84.22C95.08,86.42 94.62,87.53 92.18,89.97C89.09,93.07 88.61,93.25 86.00,92.29Z M206.25,87.04C202.81,85.42 200.00,83.69 200.00,83.22C200.00,80.72 207.51,76.00 211.48,76.00C214.61,76.00 219.00,80.08 219.00,83.00C219.00,85.01 214.93,90.00 213.30,90.00C212.86,90.00 209.69,88.67 206.25,87.04Z M227.58,59.08C225.09,56.33 227.06,52.76 230.82,53.19C234.15,53.58 235.16,57.68 232.40,59.69C230.06,61.41 229.63,61.35 227.58,59.08Z M84.69,51.91C79.92,49.07 81.15,40.93 86.57,39.57C89.92,38.73 93.74,41.12 94.61,44.60C95.93,49.85 89.37,54.69 84.69,51.91Z M115.17,25.69C109.03,19.14 117.67,9.67 124.00,16.00C128.06,20.06 125.20,28.00 119.67,28.00C118.40,28.00 116.37,26.96 115.17,25.69Z M163.07,11.37C161.93,9.92 161.00,8.15 161.00,7.44C161.00,5.27 166.06,0.00 168.13,-0.00C170.64,-0.00 175.00,4.33 175.00,6.82C175.00,10.07 171.16,14.00 168.00,14.00C166.11,14.00 164.45,13.11 163.07,11.37Z" fill="url(#bg)" fill-rule="evenodd"/><path d="M154.98,141.75C154.91,138.05 144.57,115.07 139.61,107.62C131.50,95.44 120.29,86.38 111.00,84.51C104.50,83.20 99.19,79.36 97.89,75.02C96.89,71.70 96.97,70.70 98.37,68.56C101.62,63.60 104.28,62.67 113.54,63.25C118.19,63.54 122.00,63.45 122.00,63.04C122.00,61.60 118.40,59.13 112.51,56.54C109.22,55.09 105.50,52.94 104.26,51.77C99.21,47.03 103.15,40.00 110.86,40.00C116.55,40.00 120.23,42.08 128.27,49.83C137.00,58.25 137.59,57.76 135.97,43.35C134.53,30.56 135.42,25.73 140.06,21.09C147.51,13.64 157.44,17.36 160.04,28.58C160.54,30.73 160.96,37.31 160.98,43.19C160.99,49.51 161.43,54.15 162.04,54.53C163.75,55.58 165.66,53.27 168.10,47.21C175.82,28.04 188.59,15.66 200.76,15.55C205.48,15.51 206.48,15.86 208.58,18.31C210.32,20.32 211.00,22.31 211.00,25.36C211.00,30.80 207.43,35.78 198.01,43.49C191.26,49.01 183.00,59.62 183.00,62.76C183.00,63.69 185.15,62.26 188.48,59.11C198.65,49.49 211.16,46.07 216.55,51.45C219.80,54.71 219.64,58.25 216.06,62.23C213.52,65.05 212.87,65.33 211.31,64.25C207.29,61.46 204.86,60.96 200.74,62.07C193.29,64.08 184.70,70.67 180.00,78.00C176.24,83.87 174.85,83.87 177.50,78.00C180.39,71.59 178.65,72.36 173.64,79.71C166.10,90.80 163.52,100.48 160.00,130.95C158.97,139.87 157.90,143.00 155.88,143.00C155.39,143.00 154.99,142.44 154.98,141.75Z M110.00,100.50C109.01,99.30 109.01,98.70 110.00,97.50C110.68,96.67 111.81,96.00 112.50,96.00C113.19,96.00 114.32,96.67 115.00,97.50C115.99,98.70 115.99,99.30 115.00,100.50C114.32,101.33 113.19,102.00 112.50,102.00C111.81,102.00 110.68,101.33 110.00,100.50Z M83.00,90.00C78.63,85.63 81.74,79.00 88.17,79.00C93.52,79.00 96.16,87.37 91.78,90.44C88.75,92.57 85.40,92.40 83.00,90.00Z M210.35,88.04C207.18,87.29 202.00,82.96 202.00,81.07C202.00,79.45 207.59,77.00 211.30,77.00C215.27,77.00 218.00,79.52 218.00,83.17C218.00,85.32 215.23,89.21 213.92,88.90C213.69,88.84 212.08,88.46 210.35,88.04Z M110.50,71.57C114.23,68.56 112.97,66.72 107.48,67.18C103.44,67.52 101.28,69.68 102.31,72.36C103.22,74.73 107.04,74.36 110.50,71.57Z M228.05,58.56C225.35,55.30 229.81,51.39 232.81,54.38C234.08,55.66 234.21,56.44 233.38,57.77C231.92,60.09 229.60,60.43 228.05,58.56Z M210.81,54.25C210.41,52.14 206.45,51.38 204.46,53.04C202.34,54.79 203.64,56.00 207.63,56.00C210.44,56.00 211.08,55.65 210.81,54.25Z M83.56,49.78C81.59,46.97 81.60,45.54 83.62,42.46C86.72,37.73 94.00,40.33 94.00,46.17C94.00,51.54 86.58,54.10 83.56,49.78Z M113.75,47.26C114.30,45.58 109.27,43.33 107.94,44.66C107.39,45.21 107.23,46.44 107.59,47.39C108.35,49.36 113.09,49.27 113.75,47.26Z M87.00,44.00C87.00,43.45 86.33,43.00 85.50,43.00C84.67,43.00 84.00,43.45 84.00,44.00C84.00,44.55 84.67,45.00 85.50,45.00C86.33,45.00 87.00,44.55 87.00,44.00Z M182.05,36.41C183.95,34.44 187.22,31.94 189.31,30.86C191.87,29.54 193.01,28.34 192.77,27.20C191.67,21.91 177.00,32.84 177.00,38.95C177.00,40.84 178.55,40.06 182.05,36.41Z M144.77,33.25C147.41,27.66 147.55,26.15 145.46,25.35C142.56,24.23 140.00,27.90 140.00,33.15C140.00,39.46 141.82,39.49 144.77,33.25Z M115.07,24.37C113.93,22.92 113.00,21.10 113.00,20.32C113.00,18.40 117.53,14.00 119.50,14.00C121.67,14.00 126.00,18.49 126.00,20.73C126.00,26.73 118.81,29.12 115.07,24.37Z M164.22,12.44C159.74,9.31 162.74,1.00 168.35,1.00C173.50,1.00 175.87,8.13 172.00,12.00C169.60,14.40 167.21,14.54 164.22,12.44Z" fill="url(#sp)" fill-rule="evenodd"/><path d="M257.50,437.40C255.30,437.19 248.32,436.53 242.00,435.95C226.01,434.47 193.71,427.87 179.44,423.17C128.64,406.44 90.47,381.74 58.76,345.08C37.31,320.29 20.13,286.09 17.45,262.86C16.06,250.80 17.47,250.22 41.44,253.02C63.38,255.58 98.22,262.65 112.61,267.47C126.74,272.20 141.24,279.79 151.81,287.99C161.80,295.73 168.31,302.42 179.53,316.47C201.32,343.72 221.92,358.29 247.57,364.59C251.38,365.53 255.04,366.71 255.71,367.23C256.37,367.75 259.01,372.07 261.57,376.84C274.44,400.77 284.61,415.47 297.85,429.25C301.41,432.96 304.02,436.32 303.63,436.70C302.88,437.45 264.14,438.04 257.50,437.40Z M385.73,418.18C382.32,414.23 359.95,378.63 358.50,374.86C358.01,373.59 359.78,373.13 368.96,372.14C401.41,368.62 431.83,359.84 458.50,346.29C497.20,326.64 525.24,300.76 546.04,265.50C552.27,254.94 551.86,255.53 552.52,256.19C554.31,257.97 539.38,291.95 529.87,307.74C511.88,337.62 485.39,366.13 457.00,386.13C442.65,396.24 417.70,409.21 401.00,415.22C388.27,419.81 387.30,420.00 385.73,418.18Z M170.80,252.60C166.98,247.99 161.29,246.42 156.56,248.67C153.92,249.93 152.69,250.09 151.86,249.26C148.74,246.14 156.84,235.68 163.33,234.47C167.94,233.60 173.49,236.12 175.97,240.19C179.17,245.43 178.31,256.14 174.71,255.93C174.05,255.89 172.29,254.39 170.80,252.60Z M84.50,44.00C84.84,43.45 85.32,43.00 85.56,43.00C85.80,43.00 86.00,43.45 86.00,44.00C86.00,44.55 85.52,45.00 84.94,45.00C84.36,45.00 84.16,44.55 84.50,44.00Z" fill="#FFFFFF" fill-rule="evenodd"/></svg>
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `deepwhale-badge` skill provider(深鲸桌面署名徽章)。
|
|
3
|
+
*
|
|
4
|
+
* 结构与官方 `@deepseek-ai/dsh-skill-badge` 完全一致:
|
|
5
|
+
* - 实现只做一件事:往 `ctx.skills` 注册一个 provider;
|
|
6
|
+
* - skill 正文放在 `assets/deepwhale-badge.md`,资源目录是 `assets/`;
|
|
7
|
+
* - provider 是不可变的:list() 永远返回同一份候选,get() 读同一份正文。
|
|
8
|
+
*
|
|
9
|
+
* 为什么做成插件而不是本地 skill 目录:装完即可用、随版本更新,用户不用管文件放哪。
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readFile } from 'node:fs/promises';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
// 与官方 dsh-badge 同一个 rank:打包型 skill provider 的标准优先级。
|
|
16
|
+
// 运行时从 @deepseek-ai/dsh-skill 取;单元测试(没有运行时依赖)用同一常量兜底。
|
|
17
|
+
let BUNDLED_SKILL_RANK = 600;
|
|
18
|
+
try {
|
|
19
|
+
({ BUNDLED_SKILL_RANK } = await import('@deepseek-ai/dsh-skill'));
|
|
20
|
+
} catch {
|
|
21
|
+
// 离线环境/单测:保留兜底值
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const PROVIDER_NAME = 'deepwhale-badge';
|
|
25
|
+
const SKILL_BODY_URL = new URL('../assets/deepwhale-badge.md', import.meta.url);
|
|
26
|
+
const RESOURCE_BASE = {
|
|
27
|
+
kind: 'directory',
|
|
28
|
+
path: fileURLToPath(new URL('../assets/', import.meta.url)),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const CANDIDATE = {
|
|
32
|
+
name: 'deepwhale-badge',
|
|
33
|
+
description:
|
|
34
|
+
'给用深鲸桌面(DeepWhale Desktop)产出的文档、PR、MR 或其他内容添加「powered by deepwhale」署名徽章。当用户提到深鲸徽章、deepwhale 徽章、署名、powered by deepwhale 时使用。',
|
|
35
|
+
invocation: {
|
|
36
|
+
modelInvocable: true,
|
|
37
|
+
userInvocable: true,
|
|
38
|
+
},
|
|
39
|
+
provider: PROVIDER_NAME,
|
|
40
|
+
source: 'bundled',
|
|
41
|
+
resourceBase: RESOURCE_BASE,
|
|
42
|
+
rank: BUNDLED_SKILL_RANK,
|
|
43
|
+
locator: SKILL_BODY_URL,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const provider = {
|
|
47
|
+
name: PROVIDER_NAME,
|
|
48
|
+
list: () => Promise.resolve([CANDIDATE]),
|
|
49
|
+
async get(_candidate) {
|
|
50
|
+
return {
|
|
51
|
+
name: CANDIDATE.name,
|
|
52
|
+
description: CANDIDATE.description,
|
|
53
|
+
invocation: CANDIDATE.invocation,
|
|
54
|
+
provider: CANDIDATE.provider,
|
|
55
|
+
source: CANDIDATE.source,
|
|
56
|
+
resourceBase: RESOURCE_BASE,
|
|
57
|
+
content: await readFile(SKILL_BODY_URL, 'utf8'),
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** Cordis 插件名 */
|
|
63
|
+
export const name = 'deepwhale-badge';
|
|
64
|
+
|
|
65
|
+
/** 依赖 skills 服务 */
|
|
66
|
+
export const inject = ['skills'];
|
|
67
|
+
|
|
68
|
+
/** 把 provider 注册到 ctx.skills */
|
|
69
|
+
export function apply(ctx) {
|
|
70
|
+
ctx.skills.registerProvider(() => provider);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { provider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepwhale-cn/dsh-badge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "深鲸桌面署名徽章 skill:给用深鲸桌面产出的文档/PR 加「powered by dwh」胶囊徽章",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"default": "./lib/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"dsh": ">=0.1.0-rc.6 <0.3.0",
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"lib",
|
|
20
|
+
"assets",
|
|
21
|
+
"cordis.patch.yml",
|
|
22
|
+
"README.md",
|
|
23
|
+
"README.zh.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"icon.svg"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"dsh",
|
|
29
|
+
"dsh-plugin",
|
|
30
|
+
"deepwhale",
|
|
31
|
+
"badge",
|
|
32
|
+
"attribution"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"author": "温州深鲸智能科技有限公司 <contact@deepwhale.org.cn>",
|
|
36
|
+
"homepage": "https://deepwhale.org.cn",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/feely0208/dsh-badge.git"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@deepseek-ai/dsh-skill": "*"
|
|
43
|
+
},
|
|
44
|
+
"icon": "./icon.svg",
|
|
45
|
+
"meta": {
|
|
46
|
+
"title": "深鲸徽章",
|
|
47
|
+
"description": "给用深鲸桌面产出的文档 / PR 加「powered by dwh」署名徽章(胶囊圆角,121×20)。"
|
|
48
|
+
},
|
|
49
|
+
"dsh": {
|
|
50
|
+
"bundle": {
|
|
51
|
+
"patch": "./cordis.patch.yml"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
6
54
|
}
|