dsh-agent-plugins-market 0.4.6 → 0.5.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/README.md +19 -11
- package/README.zh.md +19 -11
- package/client/client.js +850 -434
- package/client/client.js.map +1 -1
- package/lib/application/catalog.js +544 -0
- package/lib/application/details.js +139 -0
- package/lib/application/queries.js +1 -0
- package/lib/{discovery → catalog}/manifests.js +20 -12
- package/lib/catalog/native-project.js +73 -0
- 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 +47 -0
- package/lib/{discovery.js → catalog/suite-scanner.js} +28 -86
- package/lib/{discovery → catalog}/surfaces.js +9 -11
- package/lib/{validate.js → catalog/validate.js} +3 -3
- package/lib/context.js +21 -23
- package/lib/contracts/market.js +30 -0
- package/lib/contracts/mcp-status.js +2 -0
- package/lib/index.js +42 -49
- package/lib/{state.js → model/state.js} +19 -1
- package/lib/model/types.js +21 -0
- package/lib/routes.js +58 -21
- package/lib/{commands-mounts.js → runtime/commands-mounts.js} +23 -15
- package/lib/{hooks-mounts.js → runtime/hooks-mounts.js} +4 -3
- package/lib/runtime/host-locale.js +67 -0
- package/lib/{mcp-config.js → runtime/mcp-config.js} +18 -8
- package/lib/{mcp-mounts.js → runtime/mcp-mounts.js} +16 -12
- package/lib/runtime/mcp-overrides.js +113 -0
- package/lib/{mcp-status.js → runtime/mcp-status.js} +13 -42
- package/lib/runtime/reconciler.js +51 -0
- package/lib/{skills-provider.js → runtime/skills-provider.js} +47 -35
- package/lib/runtime/tool-registry-observer.js +35 -0
- package/lib/types/application/catalog.d.ts +141 -0
- package/lib/types/application/details.d.ts +12 -0
- package/lib/types/application/queries.d.ts +37 -0
- package/lib/types/{discovery → catalog}/manifests.d.ts +1 -1
- package/lib/types/catalog/native-project.d.ts +17 -0
- 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 +3 -2
- package/lib/types/contracts/market.d.ts +179 -0
- package/lib/types/contracts/mcp-status.d.ts +38 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/{state.d.ts → model/state.d.ts} +1 -1
- package/lib/types/{types.d.ts → model/types.d.ts} +15 -43
- package/lib/types/routes.d.ts +2 -2
- package/lib/types/{commands-mounts.d.ts → runtime/commands-mounts.d.ts} +5 -3
- package/lib/types/{hooks-mounts.d.ts → runtime/hooks-mounts.d.ts} +1 -1
- package/lib/types/runtime/host-locale.d.ts +13 -0
- package/lib/types/{mcp-config.d.ts → runtime/mcp-config.d.ts} +6 -2
- package/lib/types/{mcp-mounts.d.ts → runtime/mcp-mounts.d.ts} +7 -2
- package/lib/types/runtime/mcp-overrides.d.ts +37 -0
- package/lib/types/runtime/mcp-status.d.ts +14 -0
- package/lib/types/runtime/reconciler.d.ts +36 -0
- package/lib/types/{skills-provider.d.ts → runtime/skills-provider.d.ts} +5 -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 -581
- package/lib/types/discovery.d.ts +0 -19
- package/lib/types/manager.d.ts +0 -124
- package/lib/types/mcp-status.d.ts +0 -51
- package/lib/types.js +0 -10
- /package/lib/{git.js → catalog/git.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/README.md
CHANGED
|
@@ -53,7 +53,7 @@ dsh plugin --profile <name> add github:Sivan757/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
|
|
|
@@ -68,18 +68,19 @@ The built entry point (`lib/`, `client/`) is committed to the repository, so Git
|
|
|
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
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
|
+
- **Native project layouts (zero-copy migration)** — a repository's own `.claude/` and `.agents/` directories (skills, agents) are discovered in place as read-only `project-native` suites: no install, no copying, no state file. Repositories migrating from Claude Code or agent-plugins.org conventions work as-is; a project skill shadows an installed suite skill of the same name (project wins).
|
|
71
72
|
|
|
72
73
|
## Supported plugin layouts
|
|
73
74
|
|
|
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)
|
|
75
|
+
| Layout | Manifest | Notes |
|
|
76
|
+
| -------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
77
|
+
| agent-plugins.org v1 | `plugin.json` | vendored 1.0.0 JSON Schema validation + spec §4 path rules |
|
|
78
|
+
| Claude Code market | `.claude-plugin/marketplace.json` + `.claude-plugin/plugin.json` | marketplace `plugins[].source` relative paths |
|
|
79
|
+
| Universal | `.plugin/plugin.json` | multi-client repos (e.g. vercel-plugin) |
|
|
80
|
+
| Cursor | `.cursor-plugin/plugin.json` | declared skills paths |
|
|
81
|
+
| Kimi | `.kimi-plugin/plugin.json` | inline mcpServers |
|
|
82
|
+
| Codex | `.codex-plugin/plugin.json` | — |
|
|
83
|
+
| Skill collection (manifest-less) | none (synthetic) | flat `SKILL.md` directory collections |
|
|
83
84
|
|
|
84
85
|
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
86
|
|
|
@@ -171,8 +172,9 @@ Yes — MIT licensed, published on [npm](https://www.npmjs.com/package/dsh-agent
|
|
|
171
172
|
## Known limitations
|
|
172
173
|
|
|
173
174
|
- Project-dimension MCP servers are not mounted (dsh has no per-session tool scope); the project dimension covers skills and context.
|
|
174
|
-
- Skill discovery has no file watcher: catalog changes apply after a manager action or a host restart.
|
|
175
|
+
- Skill discovery has no file watcher: catalog changes apply after a manager action or a host restart (project-dimension snapshots are cached for 5 seconds on the skill-list hot path).
|
|
175
176
|
- Claude Code hooks support the mapped bridge subset; LSP is counted and previewed but not executed.
|
|
177
|
+
- Native project layouts (`.claude/`, `.agents/`) inject skills and subagents; their `commands/*.md` are not registered as slash commands because the harness command registry is process-scoped, not session-cwd-scoped.
|
|
176
178
|
|
|
177
179
|
## Development
|
|
178
180
|
|
|
@@ -180,10 +182,16 @@ Yes — MIT licensed, published on [npm](https://www.npmjs.com/package/dsh-agent
|
|
|
180
182
|
pnpm install
|
|
181
183
|
pnpm run test # vitest over fixture suites + multi-dialect parsing
|
|
182
184
|
pnpm run typecheck
|
|
185
|
+
pnpm run lint # ESLint over the refactored source and tests
|
|
186
|
+
pnpm run format:check
|
|
187
|
+
pnpm run check:architecture
|
|
188
|
+
pnpm run check:refactor
|
|
183
189
|
pnpm run build # tsc host + tsdown client + module-loader banner
|
|
184
190
|
pnpm pack
|
|
185
191
|
```
|
|
186
192
|
|
|
193
|
+
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).
|
|
194
|
+
|
|
187
195
|
The docs website lives in [`docs-site/`](docs-site/) (Astro, deployed to GitHub Pages).
|
|
188
196
|
|
|
189
197
|
## Vendored assets
|
package/README.zh.md
CHANGED
|
@@ -53,7 +53,7 @@ dsh plugin --profile <名字> add github:Sivan757/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
|
|
|
@@ -68,18 +68,19 @@ dsh plugin --profile <名字> add github:Sivan757/dsh-agent-plugins-market
|
|
|
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
|
+
- **项目原生布局(零拷贝迁移)**——项目自己的 `.claude/`、`.agents/` 目录(skills、agents)就地发现为只读「项目原生」套件:无需安装、无需拷贝、无状态文件。从 Claude Code 或 agent-plugins.org 约定迁移过来的仓库开箱即用;同名技能发生冲突时项目侧优先(覆盖已安装套件中的同名技能)。
|
|
71
72
|
|
|
72
73
|
## 兼容的套件布局
|
|
73
74
|
|
|
74
|
-
| 布局
|
|
75
|
-
|
|
|
76
|
-
| agent-plugins.org v1 | `plugin.json`
|
|
77
|
-
| Claude Code 市场
|
|
78
|
-
| 通用(universal)
|
|
79
|
-
| Cursor
|
|
80
|
-
| Kimi
|
|
81
|
-
| Codex
|
|
82
|
-
| 技能集合(无清单)
|
|
75
|
+
| 布局 | 清单文件 | 说明 |
|
|
76
|
+
| -------------------- | --------------------------------------------------------------------- | ---------------------------------------------- |
|
|
77
|
+
| agent-plugins.org v1 | `plugin.json` | 内置 1.0.0 JSON Schema 校验 + 规范 §4 路径约束 |
|
|
78
|
+
| Claude Code 市场 | `.claude-plugin/marketplace.json` + 套件 `.claude-plugin/plugin.json` | marketplace `plugins[].source` 相对路径 |
|
|
79
|
+
| 通用(universal) | `.plugin/plugin.json` | 多客户端共存仓库(如 vercel-plugin) |
|
|
80
|
+
| Cursor | `.cursor-plugin/plugin.json` | 声明式 skills 路径 |
|
|
81
|
+
| Kimi | `.kimi-plugin/plugin.json` | 内联 mcpServers |
|
|
82
|
+
| Codex | `.codex-plugin/plugin.json` | — |
|
|
83
|
+
| 技能集合(无清单) | 无(合成) | 扁平 `SKILL.md` 目录集合 |
|
|
83
84
|
|
|
84
85
|
一个仓库可同时携带多种清单(如 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
86
|
|
|
@@ -171,8 +172,9 @@ dsh plugin --profile <名字> add dsh-agent-plugins-market
|
|
|
171
172
|
## 已知限制
|
|
172
173
|
|
|
173
174
|
- 项目维度 MCP server 不挂载(dsh 无按会话的 tool scope);项目维度覆盖技能 + 上下文。
|
|
174
|
-
-
|
|
175
|
+
- 技能发现无文件监听:目录变化在管理动作或重启后生效(项目维度快照在技能枚举热路径上有 5 秒缓存)。
|
|
175
176
|
- Claude Code hooks 仅支持 bridge 映射的子集;LSP 只计数与预览,不执行。
|
|
177
|
+
- 项目原生布局(`.claude/`、`.agents/`)注入技能与子代理;其中 `commands/*.md` 不注册为斜杠命令——宿主命令注册表是进程级作用域,无法按会话 cwd 隔离。
|
|
176
178
|
|
|
177
179
|
## 开发
|
|
178
180
|
|
|
@@ -180,10 +182,16 @@ dsh plugin --profile <名字> add dsh-agent-plugins-market
|
|
|
180
182
|
pnpm install
|
|
181
183
|
pnpm run test # vitest(fixture 套件 + 多范式解析)
|
|
182
184
|
pnpm run typecheck
|
|
185
|
+
pnpm run lint # 对重构源码与测试执行 ESLint
|
|
186
|
+
pnpm run format:check
|
|
187
|
+
pnpm run check:architecture
|
|
188
|
+
pnpm run check:refactor
|
|
183
189
|
pnpm run build # tsc 宿主 + tsdown 客户端 + 模块加载器包装
|
|
184
190
|
pnpm pack # 构建并打 tgz
|
|
185
191
|
```
|
|
186
192
|
|
|
193
|
+
内部模块化决策与分阶段迁移计划见 [`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)。
|
|
194
|
+
|
|
187
195
|
文档站位于 [`docs-site/`](docs-site/)(Astro,部署到 GitHub Pages)。
|
|
188
196
|
|
|
189
197
|
## Vendored 资产
|