dshbase-catalog 0.2.0 → 0.3.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 +27 -0
- package/dist/catalog.json +19591 -9420
- package/dist/index.js +16 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,10 +3,15 @@ import catalog from './catalog.json' with { type: 'json' };
|
|
|
3
3
|
export const name = 'dshbase-catalog';
|
|
4
4
|
export const inject = ['tools'];
|
|
5
5
|
const plugins = catalog.plugins || [];
|
|
6
|
-
|
|
6
|
+
// 分类从数据动态派生(不再硬编码),保证与网站 plugins.json 的 15 大分类一致
|
|
7
|
+
const CATEGORIES = [...new Set(plugins.map((p) => p.category))].sort();
|
|
8
|
+
const PF = { win32: '🪟 Windows', macos: '🍎 macOS', linux: '🐧 Linux' };
|
|
7
9
|
function text(v) {
|
|
8
10
|
return [{ type: 'text', text: v }];
|
|
9
11
|
}
|
|
12
|
+
function pfTag(p) {
|
|
13
|
+
return p.platform && p.platform !== 'any' ? ` · ${PF[p.platform] || p.platform}` : '';
|
|
14
|
+
}
|
|
10
15
|
// 按星数降序排好的副本
|
|
11
16
|
const byStars = [...plugins].sort((a, b) => (b.stars || 0) - (a.stars || 0));
|
|
12
17
|
// 按收录时间降序(新收录在前)
|
|
@@ -14,8 +19,9 @@ const byNew = [...plugins].sort((a, b) => (b.added || '').localeCompare(a.added
|
|
|
14
19
|
function fmtHit(p, i) {
|
|
15
20
|
const idx = i !== undefined ? `${i + 1}. ` : '';
|
|
16
21
|
const star = `★${p.stars || 0}`;
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
// 两档:已验证 / 未验证(网站已从三档收敛,不再有 broken)
|
|
23
|
+
const status = p.test === 'verified' ? '已验证' : '未验证';
|
|
24
|
+
return `${idx}${p.name} [${status}]${pfTag(p)} ${star}\n ${p.desc}\n Install: ${p.install}`;
|
|
19
25
|
}
|
|
20
26
|
export function apply(ctx) {
|
|
21
27
|
// 1. 搜索插件
|
|
@@ -52,11 +58,12 @@ export function apply(ctx) {
|
|
|
52
58
|
const p = plugins.find((x) => x.name === args.name);
|
|
53
59
|
if (!p)
|
|
54
60
|
return `Plugin "${args.name}" not found. Use search_dsh_plugins to find it.`;
|
|
55
|
-
const status = p.test === 'verified' ? '✅ 已验证 (verified)' :
|
|
61
|
+
const status = p.test === 'verified' ? '✅ 已验证 (verified)' : '⏳ 未验证 (pending)';
|
|
56
62
|
const src = p.npm ? `npm (${p.pkg})` : 'GitHub source';
|
|
63
|
+
const pf = p.platform && p.platform !== 'any' ? (PF[p.platform] || p.platform) : 'any';
|
|
57
64
|
return [
|
|
58
65
|
`${p.name} (${p.category})`,
|
|
59
|
-
`Status: ${status} · ★${p.stars || 0} · ${src}`,
|
|
66
|
+
`Status: ${status} · ★${p.stars || 0} · ${src} · Platform: ${pf}`,
|
|
60
67
|
'',
|
|
61
68
|
p.desc,
|
|
62
69
|
p.desc_zh ? `中文: ${p.desc_zh}` : '',
|
|
@@ -73,7 +80,7 @@ export function apply(ctx) {
|
|
|
73
80
|
name: 'list_dsh_plugins',
|
|
74
81
|
description: 'List DeepSeek Harness plugins from dshbase. Use sort="hot" for most-starred, sort="new" for recently added, or pass a category to list plugins in that category.',
|
|
75
82
|
parameters: {
|
|
76
|
-
category: { type: 'string', description: 'Category name (e.g. "
|
|
83
|
+
category: { type: 'string', description: 'Category name (e.g. "Developer"). Omit for all categories.' },
|
|
77
84
|
sort: { type: 'string', description: 'Sort: "hot" (by stars, default) or "new" (recently added)' },
|
|
78
85
|
limit: { type: 'string', description: 'Max results (default 20)' },
|
|
79
86
|
},
|
|
@@ -102,8 +109,9 @@ export function apply(ctx) {
|
|
|
102
109
|
const total = plugins.length;
|
|
103
110
|
const verified = plugins.filter((p) => p.test === 'verified').length;
|
|
104
111
|
const pending = plugins.filter((p) => p.test === 'pending').length;
|
|
105
|
-
const broken = plugins.filter((p) => p.test === 'broken').length;
|
|
106
112
|
const npmCount = plugins.filter((p) => p.npm).length;
|
|
113
|
+
const winCount = plugins.filter((p) => p.platform === 'win32').length;
|
|
114
|
+
const macCount = plugins.filter((p) => p.platform === 'macos').length;
|
|
107
115
|
const catLines = CATEGORIES.map((c) => {
|
|
108
116
|
const n = plugins.filter((p) => p.category === c).length;
|
|
109
117
|
return ` ${c}: ${n}`;
|
|
@@ -113,8 +121,8 @@ export function apply(ctx) {
|
|
|
113
121
|
` Total: ${total}`,
|
|
114
122
|
` ✅ Verified: ${verified}`,
|
|
115
123
|
` ⏳ Pending: ${pending}`,
|
|
116
|
-
` ❌ Broken: ${broken}`,
|
|
117
124
|
` On npm: ${npmCount} · GitHub source: ${total - npmCount}`,
|
|
125
|
+
` Platform-specific: ${winCount} Windows · ${macCount} macOS`,
|
|
118
126
|
'',
|
|
119
127
|
'By category:',
|
|
120
128
|
catLines,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dshbase-catalog",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Query the dshbase plugin directory from inside DeepSeek Harness — search, list, and get install commands for
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Query the dshbase plugin directory from inside DeepSeek Harness — search, list, and get install commands for 1700+ plugins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|