dshmarket 1.40.0 → 1.42.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/README.md +5 -1
- package/README.zh.md +5 -1
- package/client/client.js +1327 -308
- package/client/client.js.map +1 -1
- package/lib/accelerate.js +59 -30
- package/lib/backup.js +42 -2
- package/lib/catalog-local-match.js +126 -0
- package/lib/changelog.js +37 -7
- package/lib/check.js +5 -2
- package/lib/discovery-compatibility.js +260 -0
- package/lib/dsh-cli.js +19 -7
- package/lib/hot.js +19 -2
- package/lib/install.js +22 -3
- package/lib/net.js +8 -1
- package/lib/pnpm-compat.js +28 -1
- package/lib/regions.js +89 -15
- package/lib/routes.js +503 -50
- package/lib/source-migration.js +54 -0
- package/lib/sources.js +25 -64
- package/lib/types/accelerate.d.ts +2 -2
- package/lib/types/catalog-local-match.d.ts +50 -0
- package/lib/types/check.d.ts +6 -1
- package/lib/types/discovery-compatibility.d.ts +80 -0
- package/lib/types/dsh-cli.d.ts +13 -0
- package/lib/types/hot.d.ts +10 -0
- package/lib/types/install.d.ts +13 -0
- package/lib/types/net.d.ts +2 -0
- package/lib/types/pnpm-compat.d.ts +16 -2
- package/lib/types/regions.d.ts +34 -8
- package/lib/types/source-migration.d.ts +11 -0
- package/lib/types/sources.d.ts +14 -14
- package/lib/types/updates.d.ts +6 -0
- package/lib/updates.js +3 -3
- package/package.json +1 -1
- package/src/accelerate.ts +73 -27
- package/src/backup.ts +43 -2
- package/src/catalog-local-match.ts +144 -0
- package/src/changelog.ts +35 -7
- package/src/check.ts +9 -2
- package/src/client/CommentsModal.tsx +12 -9
- package/src/client/Market.module.css +69 -5
- package/src/client/MarketSection.tsx +739 -106
- package/src/client/SettingsCard.tsx +90 -4
- package/src/client/comments.ts +13 -0
- package/src/client/locales.ts +98 -6
- package/src/client/market-data.ts +205 -37
- package/src/discovery-compatibility.ts +315 -0
- package/src/dsh-cli.ts +35 -7
- package/src/hot.ts +31 -2
- package/src/install.ts +23 -3
- package/src/net.ts +7 -2
- package/src/pnpm-compat.ts +39 -1
- package/src/regions.ts +103 -15
- package/src/routes.ts +522 -51
- package/src/source-migration.ts +61 -0
- package/src/sources.ts +24 -65
- package/src/updates.ts +6 -4
package/README.md
CHANGED
|
@@ -32,12 +32,15 @@ its own dsh: it may be older than the one `npm` would give you (#139).
|
|
|
32
32
|
## What you get
|
|
33
33
|
|
|
34
34
|
- **Browse & search** the full community catalog (2300+ plugins, growing daily) — category filters, star counts, top/new sorting, bilingual descriptions that follow your UI language
|
|
35
|
+
- **Host-aware discovery** — cards show the DSH requirement declared by `engines.dsh` or lockstep `@deepseek-ai/dsh-*` peers; an opt-in filter hides only confirmed mismatches with the running host. Undeclared, malformed, unavailable, and GitHub-only entries remain visible rather than being guessed incompatible
|
|
35
36
|
- **Screenshots** — AppStore-style screenshots, auto-carousel when there's more than one, click to preview full-size: author-curated shots show right on the card (zero extra requests); plugins without curated shots fall back to automatic README extraction once you open the install dialog. Images load from GitHub hosting only
|
|
36
|
-
- **Comments** — every card opens the plugin's discussion thread in place. It is the same thread its pages on [dshmarket.com](https://dshmarket.com) and the [catalog](https://awesome-dsh-plugin.com) show, so a plugin has one conversation rather than three. Backed by GitHub Discussions through giscus: it loads when you open it, needs a GitHub account only to post, and the note above it says plainly that opening it contacts giscus.app and GitHub
|
|
37
|
+
- **Comments** — every card opens the plugin's discussion thread in place. It is the same thread its pages on [dshmarket.com](https://dshmarket.com) and the [catalog](https://awesome-dsh-plugin.com) show, so a plugin has one conversation rather than three. Backed by GitHub Discussions through giscus: it loads when you open it, needs a GitHub account only to post, and the note above it says plainly that opening it contacts giscus.app and GitHub. On local dsh web, reading stays embedded while a dedicated GitHub action opens the exact discussion in a new tab for sign-in and posting, so the cross-site return never carries or depends on the host session
|
|
38
|
+
- **Favorites** — bookmark plugins and themes from Discover or the Themes tab; a dedicated Favorites tab lists them with search, sort, and install actions. Bookmarks persist in the profile's market state (`state.json`); entries that leave the catalog can be cleared in one click
|
|
37
39
|
- **Themes** — a dedicated tab for community themes and skins: install → active immediately, switch with one click (themes are mutually exclusive, your choice survives restarts), uninstall to revert
|
|
38
40
|
- **One-click install** — confirm the source, watch live progress; most plugins go live after a page refresh, no restart
|
|
39
41
|
- **Backup & restore** — export your profile's plugin list and configuration as readable JSON, import it on another machine, store it on WebDAV with daily auto-backup, or sync through a private GitHub Gist; restores **merge** (plugins installed after the backup are kept), validate before writing, and roll back on failure
|
|
40
42
|
- **Updates** — per-plugin update checks (npm version or pinned commit vs HEAD), one-click update, or update everything at once; the market updates itself the same way
|
|
43
|
+
- **Resilient GitHub routes** — in the China download region, Git refs, README content, and avatars each keep their own fallback order. The market remembers the last working route, switches only after transport/HTTP/payload validation fails, and rejects proxy error pages disguised as HTTP 200. If every built-in route fails, **Settings → Plugins → Plugin configuration → GitHub acceleration** accepts one persistent custom HTTPS prefix; `DSHM_GITHUB_PROXY` remains the operator-owned override
|
|
41
44
|
- **Public update API** — plugin-owned settings pages can use the versioned, capability-gated [update API v1](UPDATE-API-V1.md) (beta) instead of copying package-manager logic or depending on private Market UI responses
|
|
42
45
|
- **Uninstall** — two-step confirm; plugins installed this session are removed live
|
|
43
46
|
- **Hot disable / enable** — toggles write `- id: …` + `disabled: true|false` into the profile's `cordis.patch.yml` (the official patch layer, mechanism ported from [dsh-plugin-hub](https://github.com/Noob-stupid/dsh-plugin-hub)): DSH's HMR re-composes within ~1s, no restart, and the loader re-applies the choice on every boot; hand-edited patch rows show as badges, host-infrastructure plugins are protected from toggling, and a malformed patch file is never made worse
|
|
@@ -61,6 +64,7 @@ Installs prefer repo-verified npm packages, then author-supplied prebuilt GitHub
|
|
|
61
64
|
- Terminal/CLI-surface plugins are flagged before you install them into the web profile
|
|
62
65
|
- The install endpoint accepts same-origin POST only; the market never phones home
|
|
63
66
|
- Backups can contain credentials from your profile config — the UI warns before export and upload; WebDAV sync is https-only, refuses private-network targets, and never stores your password in the browser
|
|
67
|
+
- Authenticated Gist requests always go directly to `api.github.com`; bearer tokens are never sent to a public GitHub acceleration service. GitHub source archives also stay on canonical codeload URLs so pnpm's integrity policy remains in force
|
|
64
68
|
- The restart endpoint additionally requires a direct loopback client (forwarded requests are rejected) and relaunches the exact DSH entry, arguments, environment, and working directory
|
|
65
69
|
- One-click restart launches a detached replacement. **When this host is systemd's own service process the button is hidden automatically** — the market would otherwise kill the takeover process along with the unit's cgroup and the service would not come back. The pending-change notice stays visible and says so. Detection requires both a systemd marker AND being the unit's main process, because `INVOCATION_ID` is inherited by every descendant of a unit (an ordinary terminal included) and hiding the button for those would be the worse bug. pm2 and launchd are not detected, so those deployments need the explicit setting below. Either flip **Allow restart** off in **Settings → Plugins → Plugin configuration**, or write it into the profile patch — where it has to sit under `config:`, because the loader passes only that sub-object to a plugin and a top-level `allowRestart:` is silently ignored (#227 by @Fantasymax):
|
|
66
70
|
|
package/README.zh.md
CHANGED
|
@@ -30,12 +30,15 @@ dsh plugin --profile web add dshmarket
|
|
|
30
30
|
## 你会得到
|
|
31
31
|
|
|
32
32
|
- **逛与搜**——完整社区目录(2300+ 插件,每天在涨),分类筛选、star 数、最热/最新排序,中英描述跟随界面语言
|
|
33
|
+
- **按宿主发现**——卡片展示插件通过 `engines.dsh` 或同版本线 `@deepseek-ai/dsh-*` peer 声明的 DSH 要求;可选筛选只隐藏与当前宿主明确不匹配的插件。未声明、格式异常、暂时取不到清单及仅 GitHub 发布的条目仍保持可见,不猜成不兼容
|
|
33
34
|
- **截图展示**——App Store 式截图,多图自动轮播,点开还能看大图;作者在 registry 里策展的截图列表卡片就直接显示(零额外请求),没有策展的插件则在打开安装弹窗时自动从 README 抽取;图片仅从 GitHub 图床加载
|
|
34
|
-
- **评论**——每张卡片都能就地打开该插件的讨论。它和插件在 [dshmarket.com](https://dshmarket.com) 与[目录站](https://awesome-dsh-plugin.com)上的页面共用同一条讨论,一个插件只有一处对话,而不是三处。底层是 GitHub Discussions(经由 giscus):打开即加载,只有发表评论才需要 GitHub 账号;说明里也直说打开会连接 giscus.app 与 GitHub
|
|
35
|
+
- **评论**——每张卡片都能就地打开该插件的讨论。它和插件在 [dshmarket.com](https://dshmarket.com) 与[目录站](https://awesome-dsh-plugin.com)上的页面共用同一条讨论,一个插件只有一处对话,而不是三处。底层是 GitHub Discussions(经由 giscus):打开即加载,只有发表评论才需要 GitHub 账号;说明里也直说打开会连接 giscus.app 与 GitHub。本地 dsh web 继续内嵌评论供阅读,登录和发表则通过专用 GitHub 入口在新标签页打开当前插件的精确讨论,不让跨站回跳携带或依赖宿主会话
|
|
36
|
+
- **收藏**——在「发现」或「主题」页点书签即可收藏插件/主题;「收藏」Tab 集中展示,支持搜索、排序与安装。书签写入 profile 的市场状态(`state.json`);已下架条目可一键清除
|
|
35
37
|
- **主题**——独立主题页:装完立即生效,点一下切换(主题互斥、选择跨重启保留),卸载即恢复
|
|
36
38
|
- **一键安装**——确认来源,实时进度;多数插件刷新页面即可用,无需重启
|
|
37
39
|
- **备份与恢复**——把 profile 的插件清单与配置导出为可读 JSON,换机导入,存到 WebDAV 并每日自动备份,或通过私有 GitHub Gist 跨机器同步;恢复采用**合并**方式(备份之后新装的插件会保留),写入前校验、失败自动回滚
|
|
38
40
|
- **更新**——逐插件检测(npm 版本或锁定 commit 对比 HEAD),一键更新或全部更新;市场自己也走同一通道升级
|
|
41
|
+
- **GitHub 多线路容错**——中国大陆下载区域会为 Git ref、README 与头像分别维护 fallback 顺序,记住上次可用线路,只在传输、HTTP 状态或响应内容校验失败后换线,并拒绝公共反代伪装成 HTTP 200 的 HTML 错误页。内置线路全部失效时,可到**设置 → 插件 → 插件配置 → GitHub 加速**填写一个持久化的自定义 HTTPS 前缀;运维设置的 `DSHM_GITHUB_PROXY` 始终优先
|
|
39
42
|
- **公共更新接口**——插件自己的设置页可调用带版本号、能力探测和回滚状态的[更新 API v1](UPDATE-API-V1.md)(beta),无需复制包管理逻辑,也不依赖市场 UI 的私有响应字段
|
|
40
43
|
- **卸载**——两步确认防误触;本次会话装的插件即点即卸
|
|
41
44
|
- **热禁用 / 启用**——开关会往 profile 的 `cordis.patch.yml`(官方补丁层,机制移植自 [dsh-plugin-hub](https://github.com/Noob-stupid/dsh-plugin-hub))写入 `- id: …` + `disabled: true|false`:DSH 的 HMR 约 1 秒内重新组合,无需重启,loader 每次启动都会重新应用这个选择;手工改过的补丁行会显示成徽标,宿主基础设施插件禁止开关,补丁文件格式不对时绝不会被写得更糟
|
|
@@ -58,6 +61,7 @@ dsh plugin --profile web add dshmarket
|
|
|
58
61
|
- 终端/命令行类插件装进网页版前会被明确提醒
|
|
59
62
|
- 安装接口只接受同源 POST;市场不会向任何地方上报数据
|
|
60
63
|
- 备份可能包含 profile 配置里的密钥——导出与上传前 UI 会明确提醒;WebDAV 同步仅限 https、拒绝内网地址,且密码永不落盘浏览器
|
|
64
|
+
- 带鉴权的 Gist 请求始终直连 `api.github.com`,Bearer token 不会交给公共 GitHub 加速服务;GitHub 源码归档也保持 canonical codeload URL,以保留 pnpm 的完整性校验边界
|
|
61
65
|
- 重启接口还要求客户端直接来自环回地址(拒绝代理转发请求),并使用原入口、参数、环境和工作目录重新启动 DSH
|
|
62
66
|
- 一键重启会启动脱离终端的替代进程。**当本进程就是 systemd 服务的主进程时,按钮会自动隐藏**——否则市场重启会连带杀掉 cgroup 里的接管进程,服务起不来,待重启提示会说明原因。判定要求「systemd 标记」和「本进程是该 unit 的主进程」同时成立:`INVOCATION_ID` 会被 unit 的所有后代继承(包括普通终端),只看它会误伤一大批本来能正常重启的机器。pm2 和 launchd 不做检测,这类部署需要下面的显式配置。两种做法:在**设置 → 插件 → 插件配置**里关掉「允许重启」,或者写进 profile 补丁——注意必须嵌在 `config:` 下面,因为 loader 只把这个子对象传给插件,写在顶层会静默失效(#227,感谢 @Fantasymax):
|
|
63
67
|
|