dsh-preview-market 0.1.3 → 0.1.5
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 +9 -0
- package/README.md +3 -2
- package/README.zh.md +3 -2
- package/VERIFY.md +3 -3
- package/catalog/README.md +7 -5
- package/catalog/plugins/439436269-ctrl__dsh-preview-media.json +1 -1
- package/catalog/plugins/439436269-ctrl__dsh-preview-snip.json +14 -0
- package/catalog.json +17 -1
- package/lib/catalog.js +11 -8
- package/lib/client.js +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
- Catalog version for `dsh-preview-media` follows the media transport fallback release `0.1.5`.
|
|
6
|
+
|
|
7
|
+
## 0.1.4
|
|
8
|
+
|
|
9
|
+
- Catalog entries can now be `kind: "tool"` (preview enhancements with no file extensions); `dsh-preview-snip` is the first one.
|
|
10
|
+
- Cards show `Type: Tool` instead of a formats line for tool entries; install/toggle/configure stay the same.
|
|
11
|
+
|
|
3
12
|
## 0.1.3
|
|
4
13
|
|
|
5
14
|
- Catalog entries now live in `catalog/plugins/<owner>__<repo>.json` — one file per plugin, so third parties can submit a PR without editing market code.
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Upgrading from `dsh-media-preview` / `dsh-blend-preview` / `dsh-stl-preview`? Se
|
|
|
23
23
|
- **Install / update** — delegates to `dsh-market` when it is present. Without it, the card shows the exact `dsh plugin --profile <profile> add <package>@<version>` command to copy.
|
|
24
24
|
- **Independent plugins** — media, Blender and STL remain separate packages; this page has no renderer and does not merge their code.
|
|
25
25
|
|
|
26
|
-
## Catalog (0.1.
|
|
26
|
+
## Catalog (0.1.5)
|
|
27
27
|
|
|
28
28
|
Every plugin is **one file** under [`catalog/plugins/`](catalog/plugins/), named `<owner>__<repo>.json`. A third-party submission adds exactly one file plus the regenerated `catalog.json` snapshot — no market code change. The Host loads, validates and merges all files at startup; the format and PR steps are in [`catalog/README.md`](catalog/README.md).
|
|
29
29
|
|
|
@@ -32,6 +32,7 @@ Every plugin is **one file** under [`catalog/plugins/`](catalog/plugins/), named
|
|
|
32
32
|
| `dsh-preview-media` | mp4/mov/webm/mkv + mp3/flac/wav/… | — |
|
|
33
33
|
| `dsh-preview-blender` | `.blend` | Blender 3.6+ |
|
|
34
34
|
| `dsh-preview-stl` | `.stl` | — |
|
|
35
|
+
| `dsh-preview-snip` | Tool: circle/quote in image or PDF preview | — |
|
|
35
36
|
|
|
36
37
|
## Configuration
|
|
37
38
|
|
|
@@ -85,4 +86,4 @@ The client bundle is `lib/client.js` (classic `__ModuleLoader__.load` factory, n
|
|
|
85
86
|
|
|
86
87
|
## Status
|
|
87
88
|
|
|
88
|
-
`0.1.
|
|
89
|
+
`0.1.5` — top-level Settings → Preview market section with Discover / Installed tabs, plus the Settings → Plugins tab. The catalog is one file per plugin under `catalog/plugins/` (preview plugins and tool entries such as the preview snip), so third-party entries are a one-file PR. Enable/disable goes through dsh-market. One-click install requires the package in the connected dsh-market registry; otherwise use the copyable command. Configuration stays in each child plugin's own Settings → Plugins page.
|
package/README.zh.md
CHANGED
|
@@ -23,7 +23,7 @@ dsh plugin --profile <profile> add dsh-preview-market
|
|
|
23
23
|
- **安装/更新** — 检测到 dsh-market 时委托给它;没有时显示可复制的 `dsh plugin --profile <profile> add <包>@<版本>` 命令。
|
|
24
24
|
- **独立插件** — media、Blender、STL 仍是独立包;本页不注册渲染器,也不合并它们的代码。
|
|
25
25
|
|
|
26
|
-
## 目录(0.1.
|
|
26
|
+
## 目录(0.1.5)
|
|
27
27
|
|
|
28
28
|
每个插件是 [`catalog/plugins/`](catalog/plugins/) 下的**一个文件**,命名为 `<owner>__<repo>.json`。三方收录只需新增一个文件 + 重新生成 `catalog.json`,不用改市场代码;Host 启动时读取、校验并合并全部文件。字段与 PR 步骤见 [`catalog/README.md`](catalog/README.md)。
|
|
29
29
|
|
|
@@ -32,6 +32,7 @@ dsh plugin --profile <profile> add dsh-preview-market
|
|
|
32
32
|
| `dsh-preview-media` | mp4/mov/webm/mkv + mp3/flac/wav/… | — |
|
|
33
33
|
| `dsh-preview-blender` | `.blend` | Blender 3.6+ |
|
|
34
34
|
| `dsh-preview-stl` | `.stl` | — |
|
|
35
|
+
| `dsh-preview-snip` | 工具:图片/PDF 圈选或引用选中 | — |
|
|
35
36
|
|
|
36
37
|
## 配置
|
|
37
38
|
|
|
@@ -59,4 +60,4 @@ node --test test/*.test.js
|
|
|
59
60
|
|
|
60
61
|
## 状态
|
|
61
62
|
|
|
62
|
-
`0.1.
|
|
63
|
+
`0.1.5` — 顶层「设置 → 预览市场」+ 发现/已安装两个 tab,同时保留「设置 → 插件」里的入口。目录改为 `catalog/plugins/` 下一插件一文件,支持预览插件和 `kind: "tool"` 的增强工具(如预览圈选),三方收录只需一个文件 PR。启用/停用走 dsh-market;一键安装要求对应包已进入所连接 dsh-market 的 registry,否则用可复制命令。配置仍在各子插件自己的 设置 → 插件 页面。
|
package/VERIFY.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Verification record — dsh-preview-market 0.1.
|
|
1
|
+
# Verification record — dsh-preview-market 0.1.4
|
|
2
2
|
|
|
3
3
|
## Unit tests (2026-10-23)
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
| File | Covers |
|
|
8
8
|
|---|---|
|
|
9
9
|
| `test/config.test.js` | defaults, `/api` route fence, route normalization, boolean normalization |
|
|
10
|
-
| `test/catalog.test.js` | one file per entry,
|
|
10
|
+
| `test/catalog.test.js` | one file per entry, preview/tool schema, filename/repository match, duplicates, payload shape |
|
|
11
11
|
| `test/catalog-file.test.js` | `catalog.json` snapshot matches the files |
|
|
12
12
|
| `test/installed.test.js` | profile `package.json` + `node_modules` inventory, missing profile, `profileContext` resolution |
|
|
13
13
|
| `test/client.test.js` | bundle registers the `settings.section` and `settings.plugins.tab` entries |
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
node scripts/e2e-section.mjs --base http://127.0.0.1:59010 --token <token>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Result: **PASS** — the Settings nav contains `预览市场` immediately after `插件市场`; opening it shows the `发现` / `已安装` tabs and the
|
|
35
|
+
Result: **PASS** — the Settings nav contains `预览市场` immediately after `插件市场`; opening it shows the `发现` / `已安装` tabs and the four catalog cards (`dsh-preview-media`, `dsh-preview-blender`, `dsh-preview-stl`, and the `kind: "tool"` entry `dsh-preview-snip`). No page errors. Screenshot: `docs/preview-market-section.png`.
|
|
36
36
|
|
|
37
37
|
## Settings tab e2e (2026-10-23, preview-test)
|
|
38
38
|
|
package/catalog/README.md
CHANGED
|
@@ -29,13 +29,15 @@ The filename must match the repository URL: `https://github.com/<owner>/<repo>`
|
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Required: `name`, `npm`, `capability`, `kind`, `repo`, `version`, `
|
|
32
|
+
Required: `name`, `npm`, `capability`, `kind`, `repo`, `version`, `description.zh`, `description.en`.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Required for preview kinds (`media`, `three`): `extensions` (non-empty), `formats`.
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- `
|
|
36
|
+
Optional: `minDsh`, `requires` (defaults to `[]`). `tool` entries omit `extensions` and `formats`; the loader normalizes them to `[]` / `{}`.
|
|
37
|
+
|
|
38
|
+
- `kind` is `media`, `three`, or `tool`; `three` entries get the shared WebGL viewport, `tool` entries are preview enhancements with no file extensions.
|
|
39
|
+
- `extensions` drives the document-preview registration in the child plugin; the catalog only displays it. It is required for preview kinds and omitted for `tool`.
|
|
40
|
+
- `formats` groups extensions for the card, e.g. `{ "video": [...], "audio": [...] }`. Also omitted for `tool`.
|
|
39
41
|
|
|
40
42
|
## Submit a plugin
|
|
41
43
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-preview-snip",
|
|
3
|
+
"npm": "dsh-preview-snip",
|
|
4
|
+
"capability": "snip",
|
|
5
|
+
"kind": "tool",
|
|
6
|
+
"repo": "https://github.com/439436269-ctrl/dsh-preview-snip",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"minDsh": "0.2.0-rc.2",
|
|
9
|
+
"requires": [],
|
|
10
|
+
"description": {
|
|
11
|
+
"zh": "图片/PDF 预览圈选截图,或引用选中文字,直接插入输入框。",
|
|
12
|
+
"en": "Circle an image/PDF preview region or quote selected text into the composer."
|
|
13
|
+
}
|
|
14
|
+
}
|
package/catalog.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"capability": "media",
|
|
32
32
|
"kind": "media",
|
|
33
33
|
"repo": "https://github.com/439436269-ctrl/dsh-preview-media",
|
|
34
|
-
"version": "0.1.
|
|
34
|
+
"version": "0.1.5",
|
|
35
35
|
"minDsh": "0.2.0-rc.2",
|
|
36
36
|
"requires": [],
|
|
37
37
|
"extensions": [
|
|
@@ -97,6 +97,22 @@
|
|
|
97
97
|
"en": "Video and audio in the right-Sidebar document preview, streamed with HTTP Range and seekable in the desktop app."
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
+
{
|
|
101
|
+
"name": "dsh-preview-snip",
|
|
102
|
+
"npm": "dsh-preview-snip",
|
|
103
|
+
"capability": "snip",
|
|
104
|
+
"kind": "tool",
|
|
105
|
+
"repo": "https://github.com/439436269-ctrl/dsh-preview-snip",
|
|
106
|
+
"version": "0.1.0",
|
|
107
|
+
"minDsh": "0.2.0-rc.2",
|
|
108
|
+
"requires": [],
|
|
109
|
+
"description": {
|
|
110
|
+
"zh": "图片/PDF 预览圈选截图,或引用选中文字,直接插入输入框。",
|
|
111
|
+
"en": "Circle an image/PDF preview region or quote selected text into the composer."
|
|
112
|
+
},
|
|
113
|
+
"extensions": [],
|
|
114
|
+
"formats": {}
|
|
115
|
+
},
|
|
100
116
|
{
|
|
101
117
|
"name": "dsh-preview-stl",
|
|
102
118
|
"npm": "dsh-preview-stl",
|
package/lib/catalog.js
CHANGED
|
@@ -22,8 +22,6 @@ const REQUIRED = [
|
|
|
22
22
|
"kind",
|
|
23
23
|
"repo",
|
|
24
24
|
"version",
|
|
25
|
-
"extensions",
|
|
26
|
-
"formats",
|
|
27
25
|
"description"
|
|
28
26
|
];
|
|
29
27
|
|
|
@@ -61,15 +59,20 @@ function loadCatalog() {
|
|
|
61
59
|
for (const key of REQUIRED) {
|
|
62
60
|
if (entry[key] === undefined) throw new Error(`catalog/plugins/${file}: missing ${key}`);
|
|
63
61
|
}
|
|
64
|
-
if (!Array.isArray(entry.extensions) || entry.extensions.length === 0) {
|
|
65
|
-
throw new Error(`catalog/plugins/${file}: extensions must be a non-empty array`);
|
|
66
|
-
}
|
|
67
|
-
if (typeof entry.formats !== "object" || entry.formats === null) {
|
|
68
|
-
throw new Error(`catalog/plugins/${file}: formats must be an object`);
|
|
69
|
-
}
|
|
70
62
|
if (typeof entry.description?.zh !== "string" || typeof entry.description?.en !== "string") {
|
|
71
63
|
throw new Error(`catalog/plugins/${file}: description.zh/en must be strings`);
|
|
72
64
|
}
|
|
65
|
+
if (entry.kind === "tool") {
|
|
66
|
+
entry.extensions = [];
|
|
67
|
+
entry.formats = {};
|
|
68
|
+
} else {
|
|
69
|
+
if (!Array.isArray(entry.extensions) || entry.extensions.length === 0) {
|
|
70
|
+
throw new Error(`catalog/plugins/${file}: extensions must be a non-empty array`);
|
|
71
|
+
}
|
|
72
|
+
if (typeof entry.formats !== "object" || entry.formats === null) {
|
|
73
|
+
throw new Error(`catalog/plugins/${file}: formats must be an object`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
73
76
|
if (seen.has(entry.name)) throw new Error(`duplicate catalog name: ${entry.name}`);
|
|
74
77
|
seen.add(entry.name);
|
|
75
78
|
entry.requires = Array.isArray(entry.requires) ? entry.requires : [];
|
package/lib/client.js
CHANGED
|
@@ -38,6 +38,8 @@ window.__ModuleLoader__.load({
|
|
|
38
38
|
empty: "目录为空。",
|
|
39
39
|
requires: "需要",
|
|
40
40
|
formats: "格式",
|
|
41
|
+
type: "类型",
|
|
42
|
+
tool: "工具",
|
|
41
43
|
profile: "当前 profile",
|
|
42
44
|
market: "dsh-market",
|
|
43
45
|
marketOn: "已连接,可一键安装",
|
|
@@ -78,6 +80,8 @@ window.__ModuleLoader__.load({
|
|
|
78
80
|
empty: "The catalog is empty.",
|
|
79
81
|
requires: "Requires",
|
|
80
82
|
formats: "Formats",
|
|
83
|
+
type: "Type",
|
|
84
|
+
tool: "Tool",
|
|
81
85
|
profile: "Profile",
|
|
82
86
|
market: "dsh-market",
|
|
83
87
|
marketOn: "connected, one-click install available",
|
|
@@ -131,7 +135,8 @@ window.__ModuleLoader__.load({
|
|
|
131
135
|
const newer = current !== "" && current !== item.version;
|
|
132
136
|
const formats = item.formats !== undefined
|
|
133
137
|
? Object.values(item.formats).flat().slice(0, 10)
|
|
134
|
-
: item.extensions.slice(0, 10);
|
|
138
|
+
: (item.extensions ?? []).slice(0, 10);
|
|
139
|
+
const isTool = item.kind === "tool";
|
|
135
140
|
return React.createElement(
|
|
136
141
|
"article",
|
|
137
142
|
{ className: "dsh-pm-card", "data-installed": current !== "" ? "true" : "false" },
|
|
@@ -149,7 +154,9 @@ window.__ModuleLoader__.load({
|
|
|
149
154
|
React.createElement(
|
|
150
155
|
"div",
|
|
151
156
|
{ className: "dsh-pm-meta" },
|
|
152
|
-
|
|
157
|
+
formats.length > 0
|
|
158
|
+
? React.createElement("span", null, `${t("formats")}: ${formats.join(", ")}`)
|
|
159
|
+
: React.createElement("span", null, `${t("type")}: ${isTool ? t("tool") : item.kind}`),
|
|
153
160
|
item.requires.length > 0
|
|
154
161
|
? React.createElement("span", { className: "dsh-pm-requires" }, `${t("requires")}: ${item.requires.join(", ")}`)
|
|
155
162
|
: null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-preview-market",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Vertical preview market for DeepSeek Harness: discover, install and configure preview plugins (media, Blender, STL, ...) from one panel.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|