dsh-agent-plugins-market 0.4.5 → 0.5.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 +20 -14
- package/README.zh.md +20 -14
- package/client/client.js +1117 -360
- package/client/client.js.map +1 -1
- package/lib/application/catalog.js +447 -0
- package/lib/application/details.js +136 -0
- package/lib/application/queries.js +1 -0
- package/lib/{discovery → catalog}/manifests.js +20 -12
- package/lib/{paths.js → catalog/paths.js} +5 -1
- package/lib/{skills-parse.js → catalog/skills-parse.js} +7 -4
- package/lib/catalog/source-catalog.js +38 -0
- package/lib/{discovery.js → catalog/suite-scanner.js} +29 -85
- package/lib/{discovery → catalog}/surfaces.js +9 -11
- package/lib/{validate.js → catalog/validate.js} +3 -3
- package/lib/context.js +11 -13
- package/lib/contracts/market.js +27 -0
- package/lib/contracts/mcp-status.js +2 -0
- package/lib/index.js +33 -46
- package/lib/{state.js → model/state.js} +2 -2
- package/lib/routes.js +23 -20
- package/lib/{commands-mounts.js → runtime/commands-mounts.js} +10 -11
- package/lib/{hooks-mounts.js → runtime/hooks-mounts.js} +1 -1
- package/lib/{mcp-config.js → runtime/mcp-config.js} +7 -4
- package/lib/runtime/mcp-status.js +114 -0
- package/lib/runtime/reconciler.js +46 -0
- package/lib/{skills-provider.js → runtime/skills-provider.js} +26 -23
- package/lib/runtime/tool-registry-observer.js +35 -0
- package/lib/types/application/catalog.d.ts +113 -0
- package/lib/types/application/details.d.ts +12 -0
- package/lib/types/application/queries.d.ts +33 -0
- package/lib/types/{discovery → catalog}/manifests.d.ts +1 -1
- package/lib/types/catalog/source-catalog.d.ts +3 -0
- package/lib/types/catalog/suite-scanner.d.ts +9 -0
- package/lib/types/{discovery → catalog}/surfaces.d.ts +1 -1
- package/lib/types/{validate.d.ts → catalog/validate.d.ts} +1 -1
- package/lib/types/context.d.ts +2 -2
- package/lib/types/contracts/market.d.ts +153 -0
- package/lib/types/contracts/mcp-status.d.ts +38 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/{types.d.ts → model/types.d.ts} +2 -42
- package/lib/types/routes.d.ts +2 -2
- package/lib/types/{commands-mounts.d.ts → runtime/commands-mounts.d.ts} +1 -1
- package/lib/types/{hooks-mounts.d.ts → runtime/hooks-mounts.d.ts} +1 -1
- package/lib/types/{mcp-config.d.ts → runtime/mcp-config.d.ts} +1 -1
- package/lib/types/{mcp-mounts.d.ts → runtime/mcp-mounts.d.ts} +1 -1
- package/lib/types/runtime/mcp-status.d.ts +13 -0
- package/lib/types/runtime/reconciler.d.ts +33 -0
- package/lib/types/{skills-provider.d.ts → runtime/skills-provider.d.ts} +3 -3
- package/lib/types/runtime/tool-registry-observer.d.ts +14 -0
- package/package.json +34 -19
- package/schemas/README.md +2 -5
- package/lib/manager.js +0 -570
- package/lib/types/discovery.d.ts +0 -16
- package/lib/types/manager.d.ts +0 -118
- /package/lib/{git.js → catalog/git.js} +0 -0
- /package/lib/{types.js → model/types.js} +0 -0
- /package/lib/{mcp-mounts.js → runtime/mcp-mounts.js} +0 -0
- /package/lib/types/{git.d.ts → catalog/git.d.ts} +0 -0
- /package/lib/types/{paths.d.ts → catalog/paths.d.ts} +0 -0
- /package/lib/types/{skills-parse.d.ts → catalog/skills-parse.d.ts} +0 -0
- /package/lib/types/{state.d.ts → model/state.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ dsh plugin --profile <name> add dsh-agent-plugins-market
|
|
|
30
30
|
pnpm add dsh-agent-plugins-market
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Restart dsh, open **Settings → Agent Plugins Market**, add a marketplace repo as a source (e.g. `https://github.com/anthropics/claude-plugins-official`), and install suites with one click. Skills appear in the `/` slash menu; MCP tools appear as `mcp__<suite>__<server>__<tool>`; slash commands and `/agent-*` subagents register automatically.
|
|
33
|
+
Restart dsh, open **Settings → Agent Plugins Market**, add a marketplace repo as a source (e.g. `https://github.com/anthropics/claude-plugins-official`), and install suites with one click. On legacy Web shells without the `settings.section` slot, the same UI falls back to a top-level Agent Plugins Market page entry. Skills appear in the `/` slash menu; MCP tools appear as `mcp__<suite>__<server>__<tool>`; slash commands and `/agent-*` subagents register automatically.
|
|
34
34
|
|
|
35
35
|
<details>
|
|
36
36
|
<summary><strong>More install options</strong></summary>
|
|
@@ -48,38 +48,38 @@ dsh plugin --profile <name> add github:Sivan757/dsh-agent-plugins-market
|
|
|
48
48
|
```jsonc
|
|
49
49
|
// ~/.dsh/profiles/<profile>/package.json
|
|
50
50
|
{
|
|
51
|
-
"dependencies": { "dsh-agent-plugins-market": "^0.4.
|
|
51
|
+
"dependencies": { "dsh-agent-plugins-market": "^0.4.6" },
|
|
52
52
|
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-agent-plugins-market"] } }
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Build artifacts (`lib/`, `client/`) are not committed; npm publishes them via `prepack`, and GitHub installs build them automatically through the `prepare` script (requires Node + pnpm toolchain on the installing machine).
|
|
57
57
|
|
|
58
58
|
</details>
|
|
59
59
|
|
|
60
60
|
## Features
|
|
61
61
|
|
|
62
62
|
- **Plugin / suite management** — configure git repository sources (markets), browse every discoverable plugin, install / uninstall / enable / disable / refresh per source or per plugin. Source ids are derived automatically from the repository manifest JSON — no manual input.
|
|
63
|
-
- **Market page in the Web GUI** — source pills + search/actions, status tabs, a two-column card grid, and a plugin detail modal with previews for skills / MCP / hooks / commands / LSP.
|
|
63
|
+
- **Market page in the Web GUI** — source pills + search/actions, status tabs, a two-column card grid, and a plugin detail modal with previews for skills / MCP / hooks / commands / LSP. New shells render it as a localized Settings page; legacy shells without `settings.section` receive a guarded top-level page-mode fallback instead of a duplicate surface.
|
|
64
64
|
- **Runtime injection**
|
|
65
65
|
- **Skills** — a `ctx.skills` SkillProvider (project rank 250 / user rank 450); `${CLAUDE_PLUGIN_ROOT}` is substituted so Claude Code-authored skills work verbatim, and appear in the `/` slash menu.
|
|
66
66
|
- **MCP servers** — every valid `mcp.json` server of an enabled plugin mounts a live `dsh-mcp-client` child; tools appear as `mcp__<plugin>__<server>__<tool>`.
|
|
67
67
|
- **Hooks** — a plugin's `hooks/hooks.json` mounts the `dsh-hooks-claude-code` bridge on the harness interception points (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SubagentStart, SubagentStop).
|
|
68
68
|
- **Commands / subagents** — `commands/*.md` register as dsh slash commands; `agents/*.md` register as `agent-<name>` skills.
|
|
69
69
|
- **Context** — the enabled-plugin catalog (user + project sections) is injected at session start; the `agent_plugins` tool queries it.
|
|
70
|
-
- **Runtime discovery** — installed plugins are discovered from `~/.dsh/agent-plugins/.sources/<sourceId>/` (user dimension) and `<project>/.dsh/agent-plugins/.sources/<sourceId>/` (project dimension). Local sources read the working tree directly, including uncommitted changes.
|
|
70
|
+
- **Runtime discovery** — installed plugins are discovered from configured source ids under `~/.dsh/agent-plugins/.sources/<sourceId>/` (user dimension) and `<project>/.dsh/agent-plugins/.sources/<sourceId>/` (project dimension). Stale unmanaged user checkouts are ignored, while project checkouts remain state-authorized. Local sources read the working tree directly, including uncommitted changes.
|
|
71
71
|
|
|
72
72
|
## Supported plugin layouts
|
|
73
73
|
|
|
74
|
-
| Layout
|
|
75
|
-
|
|
|
76
|
-
| agent-plugins.org v1
|
|
77
|
-
| Claude Code market
|
|
78
|
-
| Universal
|
|
79
|
-
| Cursor
|
|
80
|
-
| Kimi
|
|
81
|
-
| Codex
|
|
82
|
-
| Skill collection (manifest-less) | none (synthetic)
|
|
74
|
+
| Layout | Manifest | Notes |
|
|
75
|
+
| -------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
76
|
+
| agent-plugins.org v1 | `plugin.json` | vendored 1.0.0 JSON Schema validation + spec §4 path rules |
|
|
77
|
+
| Claude Code market | `.claude-plugin/marketplace.json` + `.claude-plugin/plugin.json` | marketplace `plugins[].source` relative paths |
|
|
78
|
+
| Universal | `.plugin/plugin.json` | multi-client repos (e.g. vercel-plugin) |
|
|
79
|
+
| Cursor | `.cursor-plugin/plugin.json` | declared skills paths |
|
|
80
|
+
| Kimi | `.kimi-plugin/plugin.json` | inline mcpServers |
|
|
81
|
+
| Codex | `.codex-plugin/plugin.json` | — |
|
|
82
|
+
| Skill collection (manifest-less) | none (synthetic) | flat `SKILL.md` directory collections |
|
|
83
83
|
|
|
84
84
|
One repo may carry several dialects at once (vercel/vercel-plugin ships all of them); the suite identity comes from the highest-precedence manifest while surfaces are scanned from the directories. `mcp.json` is validated strictly against the agent-plugins.org schema; `.mcp.json` is parsed leniently — top-level server-map shorthand, `type: http` / `local` / omitted `type` (stdio by `command`) normalization, `${CLAUDE_PLUGIN_ROOT}` / `${CLAUDE_PLUGIN_DATA}` / `${NAME:-default}` placeholders, and unknown transports are tolerated per server. The marketplace manifest is authoritative for the suite set; manifest-less marketplace entries that carry skills and manifest-bearing container dirs not listed there are supplemented. Remote URL entries show as "remote reference" cards (metadata + source URL, not directly installable; add the repo as a source to install).
|
|
85
85
|
|
|
@@ -180,10 +180,16 @@ Yes — MIT licensed, published on [npm](https://www.npmjs.com/package/dsh-agent
|
|
|
180
180
|
pnpm install
|
|
181
181
|
pnpm run test # vitest over fixture suites + multi-dialect parsing
|
|
182
182
|
pnpm run typecheck
|
|
183
|
+
pnpm run lint # ESLint over the refactored source and tests
|
|
184
|
+
pnpm run format:check
|
|
185
|
+
pnpm run check:architecture
|
|
186
|
+
pnpm run check:refactor
|
|
183
187
|
pnpm run build # tsc host + tsdown client + module-loader banner
|
|
184
188
|
pnpm pack
|
|
185
189
|
```
|
|
186
190
|
|
|
191
|
+
The internal modularization decision and staged migration are documented in [`docs/design/engineering-refactor-plan.md`](docs/design/engineering-refactor-plan.md) and [`docs/adr/0001-catalog-centered-modular-refactor.md`](docs/adr/0001-catalog-centered-modular-refactor.md).
|
|
192
|
+
|
|
187
193
|
The docs website lives in [`docs-site/`](docs-site/) (Astro, deployed to GitHub Pages).
|
|
188
194
|
|
|
189
195
|
## Vendored assets
|
package/README.zh.md
CHANGED
|
@@ -30,7 +30,7 @@ dsh plugin --profile <名字> add dsh-agent-plugins-market
|
|
|
30
30
|
pnpm add dsh-agent-plugins-market
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
重启 dsh,打开 **设置 → Agent Plugins 市场**,把市场仓库添加为源(例如 `https://github.com/anthropics/claude-plugins-official
|
|
33
|
+
重启 dsh,打开 **设置 → Agent Plugins 市场**,把市场仓库添加为源(例如 `https://github.com/anthropics/claude-plugins-official`),一键安装套件。对于没有 `settings.section` slot 的旧版 Web 外壳,同一套界面会自动回退为顶层 Agent Plugins 市场页。技能出现在「/」斜杠菜单;MCP 工具以 `mcp__<套件>__<server>__<工具>` 出现;斜杠命令与 `/agent-*` 子代理自动注册。
|
|
34
34
|
|
|
35
35
|
<details>
|
|
36
36
|
<summary><strong>更多安装方式</strong></summary>
|
|
@@ -48,38 +48,38 @@ dsh plugin --profile <名字> add github:Sivan757/dsh-agent-plugins-market
|
|
|
48
48
|
```jsonc
|
|
49
49
|
// ~/.dsh/profiles/<profile>/package.json
|
|
50
50
|
{
|
|
51
|
-
"dependencies": { "dsh-agent-plugins-market": "^0.4.
|
|
51
|
+
"dependencies": { "dsh-agent-plugins-market": "^0.4.6" },
|
|
52
52
|
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-agent-plugins-market"] } }
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
构建产物(`lib/`、`client
|
|
56
|
+
构建产物(`lib/`、`client/`)不再提交进仓库;npm 通过 `prepack` 发布,GitHub 安装时由 `prepare` 脚本自动构建(安装机需具备 Node + pnpm 工具链)。
|
|
57
57
|
|
|
58
58
|
</details>
|
|
59
59
|
|
|
60
60
|
## 功能特性
|
|
61
61
|
|
|
62
62
|
- **套件管理**——配置 git 仓库源(市场),浏览每个源的套件,支持安装、卸载、启用、禁用、刷新;源 ID 自动从仓库清单 JSON 解析,无需手填。
|
|
63
|
-
- **Web
|
|
63
|
+
- **Web 市场页**——顶部源胶囊 + 搜索/操作、状态标签、两列卡片网格、套件详情弹窗(技能/MCP/hooks/命令/LSP 全部可预览)。新版外壳使用带中文/英文切换的设置页;没有 `settings.section` slot 的旧版外壳才启用受保护的顶层页面回退,不会重复渲染两份市场页。
|
|
64
64
|
- **运行时注入**
|
|
65
65
|
- **技能**:注册 `ctx.skills` SkillProvider(项目 rank 250 / 用户 rank 450),`${CLAUDE_PLUGIN_ROOT}` 自动替换,Claude Code 生态技能原样可用,出现在「/」斜杠菜单;
|
|
66
66
|
- **MCP 服务器**:启用套件的 `mcp.json` 每个合法 server 动态挂载 `dsh-mcp-client` 子插件,工具名 `mcp__<套件>__<server>__<工具>`;
|
|
67
67
|
- **Hooks**:套件 `hooks/hooks.json` 挂载 `dsh-hooks-claude-code` 桥,映射到宿主拦截点(SessionStart、UserPromptSubmit、PreToolUse、PostToolUse、Stop、SubagentStart、SubagentStop);
|
|
68
68
|
- **命令 / 子代理**:`commands/*.md` 注册为 dsh 斜杠命令;`agents/*.md` 注册为 `agent-<name>` 技能;
|
|
69
69
|
- **上下文**:会话启动注入启用套件清单(用户级 + 项目级),`agent_plugins` 工具可查询。
|
|
70
|
-
-
|
|
70
|
+
- **运行时发现**——已安装套件只从已配置的源 ID 对应目录发现:`~/.dsh/agent-plugins/.sources/<源id>/`(用户维度)与 `<项目>/.dsh/agent-plugins/.sources/<源id>/`(项目维度)。用户维度的过期未登记 checkout 会被忽略,项目维度仍按 state 中的安装记录授权;本地源直接读取工作树(含未提交改动)。
|
|
71
71
|
|
|
72
72
|
## 兼容的套件布局
|
|
73
73
|
|
|
74
|
-
| 布局
|
|
75
|
-
|
|
|
76
|
-
| agent-plugins.org v1 | `plugin.json`
|
|
77
|
-
| Claude Code 市场
|
|
78
|
-
| 通用(universal)
|
|
79
|
-
| Cursor
|
|
80
|
-
| Kimi
|
|
81
|
-
| Codex
|
|
82
|
-
| 技能集合(无清单)
|
|
74
|
+
| 布局 | 清单文件 | 说明 |
|
|
75
|
+
| -------------------- | --------------------------------------------------------------------- | ---------------------------------------------- |
|
|
76
|
+
| agent-plugins.org v1 | `plugin.json` | 内置 1.0.0 JSON Schema 校验 + 规范 §4 路径约束 |
|
|
77
|
+
| Claude Code 市场 | `.claude-plugin/marketplace.json` + 套件 `.claude-plugin/plugin.json` | marketplace `plugins[].source` 相对路径 |
|
|
78
|
+
| 通用(universal) | `.plugin/plugin.json` | 多客户端共存仓库(如 vercel-plugin) |
|
|
79
|
+
| Cursor | `.cursor-plugin/plugin.json` | 声明式 skills 路径 |
|
|
80
|
+
| Kimi | `.kimi-plugin/plugin.json` | 内联 mcpServers |
|
|
81
|
+
| Codex | `.codex-plugin/plugin.json` | — |
|
|
82
|
+
| 技能集合(无清单) | 无(合成) | 扁平 `SKILL.md` 目录集合 |
|
|
83
83
|
|
|
84
84
|
一个仓库可同时携带多种清单(如 vercel/vercel-plugin 全部都有);套件身份取优先级最高的清单,内容面(skills/commands/agents/hooks/mcp)按目录扫描。`mcp.json` 严格按 agent-plugins.org schema 校验;`.mcp.json` 宽容解析——支持顶层 server map 简写、`type: http`/`local`/省略 type(按 command 判 stdio)归一化、`${CLAUDE_PLUGIN_ROOT}` / `${CLAUDE_PLUGIN_DATA}` / `${NAME:-default}` 占位符,未知 transport 逐 server 容错。marketplace 清单权威决定套件集合;无清单但含技能的市场条目与容器内未列出的清单插件也会被补全。远程 URL 引用条目以「远程引用」卡片展示(元信息 + 源 URL,不可直接安装,可添加对应仓库为源后安装)。
|
|
85
85
|
|
|
@@ -180,10 +180,16 @@ dsh plugin --profile <名字> add dsh-agent-plugins-market
|
|
|
180
180
|
pnpm install
|
|
181
181
|
pnpm run test # vitest(fixture 套件 + 多范式解析)
|
|
182
182
|
pnpm run typecheck
|
|
183
|
+
pnpm run lint # 对重构源码与测试执行 ESLint
|
|
184
|
+
pnpm run format:check
|
|
185
|
+
pnpm run check:architecture
|
|
186
|
+
pnpm run check:refactor
|
|
183
187
|
pnpm run build # tsc 宿主 + tsdown 客户端 + 模块加载器包装
|
|
184
188
|
pnpm pack # 构建并打 tgz
|
|
185
189
|
```
|
|
186
190
|
|
|
191
|
+
内部模块化决策与分阶段迁移计划见 [`docs/design/engineering-refactor-plan.md`](docs/design/engineering-refactor-plan.md) 和 [`docs/adr/0001-catalog-centered-modular-refactor.md`](docs/adr/0001-catalog-centered-modular-refactor.md)。
|
|
192
|
+
|
|
187
193
|
文档站位于 [`docs-site/`](docs-site/)(Astro,部署到 GitHub Pages)。
|
|
188
194
|
|
|
189
195
|
## Vendored 资产
|