dsh-prompt-customizer 0.3.0 → 0.3.1
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 -21
- package/README.en.md +165 -47
- package/README.i18n.yaml +2 -2
- package/README.md +169 -78
- package/client/client.js +1742 -416
- package/client/client.js.map +1 -1
- package/cordis.patch.yml +8 -8
- package/lib/catalog.js +131 -0
- package/lib/effective.js +109 -0
- package/lib/index.js +867 -270
- package/lib/promotion.js +80 -0
- package/lib/schema.js +114 -51
- package/lib/sectionOps.d.mts +32 -0
- package/lib/sectionOps.mjs +134 -0
- package/lib/store.js +124 -0
- package/package.json +64 -62
- package/src/client/PresetsTab.tsx +203 -110
- package/src/client/PreviewTab.tsx +92 -61
- package/src/client/PreviewTools.tsx +33 -31
- package/src/client/SectionsTab.tsx +553 -202
- package/src/client/ToolsTab.tsx +266 -48
- package/src/client/index.ts +400 -116
- package/src/client/locales.ts +225 -101
- package/src/client/preset-io.ts +225 -0
- package/src/client/presets.ts +408 -268
- package/src/client/styles.ts +49 -41
- package/src/client/types.ts +120 -50
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export type PreviewTool = { name: string; description: string } | string
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
1
|
+
/** 工具预览:当前定制(黑名单过滤之后)最终对模型可见的工具目录,
|
|
2
|
+
* 只读、清单式呈现:列出即代表模型看得见 —— 这里没有「已屏蔽」状态。
|
|
3
|
+
* 本视图绝不修改黑名单配置。 */
|
|
4
|
+
import { createElement as h, type ReactElement } from 'react'
|
|
5
|
+
import type { Translate } from './locales.ts'
|
|
6
|
+
import { s } from './styles.ts'
|
|
7
|
+
|
|
8
|
+
/** 预览工具条目:对象形态或纯字符串工具名(统一归一化为对象)。 */
|
|
9
|
+
export type PreviewTool = { name: string; description: string } | string
|
|
10
|
+
|
|
11
|
+
/** 把字符串形态的条目补全为 { name, description: '' }。 */
|
|
12
|
+
|
|
13
|
+
function norm(tool: PreviewTool): { name: string; description: string } {
|
|
14
|
+
return typeof tool === 'string' ? { name: tool, description: '' } : tool
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function PreviewTools({ tools, t }: { tools: PreviewTool[]; t: Translate }): ReactElement {
|
|
18
|
+
if (tools.length === 0) return h('div', { style: s.muted }, t('empty'))
|
|
19
|
+
return h('div', { style: s.list }, [
|
|
20
|
+
h('div', { style: s.rowTitle }, [
|
|
21
|
+
h('span', { style: s.orderTag }, `${tools.length} ${t('previewToolCount')}`),
|
|
22
|
+
]),
|
|
23
|
+
tools.map((tool) => {
|
|
24
|
+
const { name, description } = norm(tool)
|
|
25
|
+
return h('div', { key: name, style: s.row }, [
|
|
26
|
+
h('div', { style: s.rowBody }, [
|
|
27
|
+
h('div', { style: s.rowTitle }, h('span', { style: s.code }, name)),
|
|
28
|
+
h('div', { style: s.preview }, String(description ?? '').slice(0, 140)),
|
|
29
|
+
]),
|
|
30
|
+
])
|
|
31
|
+
}),
|
|
32
|
+
])
|
|
33
|
+
}
|