dsh-skill-importer 0.1.1 → 0.2.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 CHANGED
@@ -1,107 +1,138 @@
1
- # dsh-skill-importer
1
+ <div align="center">
2
+ <img src="assets/hero.svg" alt="dsh-skill-importer — Skills, right where you need them" width="100%" />
2
3
 
3
- English | [中文](README.zh.md)
4
+ <br />
4
5
 
5
- [![npm version](https://img.shields.io/npm/v/dsh-skill-importer)](https://www.npmjs.com/package/dsh-skill-importer)
6
- [![npm downloads](https://img.shields.io/npm/dm/dsh-skill-importer)](https://www.npmjs.com/package/dsh-skill-importer)
7
- [![License: MIT](https://img.shields.io/npm/l/dsh-skill-importer)](LICENSE)
6
+ <strong>Bring skill management into the DeepSeek Harness Web UI.</strong><br />
7
+ Import, discover, and invoke skills without a session, model tokens, or approval round-trips.
8
8
 
9
- A skill management plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). Import, list, and delete skills directly from the Web UI — no agent, no session, no model tokens, no approval round-trips. Files land on disk immediately and the harness hot-discovers them.
9
+ <br /><br />
10
10
 
11
- ## Features
11
+ [![npm](https://img.shields.io/npm/v/dsh-skill-importer?style=flat-square&color=5dd8bd&label=npm)](https://www.npmjs.com/package/dsh-skill-importer)
12
+ [![downloads](https://img.shields.io/npm/dm/dsh-skill-importer?style=flat-square&color=6da8ff)](https://www.npmjs.com/package/dsh-skill-importer)
13
+ [![DeepSeek Harness](https://img.shields.io/badge/DeepSeek_Harness-%E2%89%A50.1.0--rc.6-5965f2?style=flat-square)](https://github.com/deepseek-ai/deepseek-harness)
14
+ [![license](https://img.shields.io/badge/license-MIT-a786ff?style=flat-square)](LICENSE)
12
15
 
13
- - **Three skill entry points** — the `/` menu no longer lists skills directly:
14
- 1. **Composer tool-row picker** (next to the access-mode selector): a pill trigger with a name-filter search box, first-letter avatars, and bare skill names.
15
- 2. **`/skills` command** — modelled on `/model`: a popup list, name-only search, select fills `/name `.
16
- 3. **Type `/name` directly** — the native text gesture, highlighted and injected the same way.
17
- - **Installed list, grouped by location** — every copy in `.agents/skills`, `.dsh/skills`, and `~/.dsh/skills` is shown (no rank hiding on the management surface), with invocation markers and a delete button per copy.
18
- - **Workspace-aware targets** — project skills write into the active registered workspace (never the dsh process's cwd), matching how `/` and the model catalog resolve.
19
- - **Import from file** — pick a Markdown file (`SKILL.md` or `<name>.md`), frontmatter is parsed and validated (`name` kebab-case, `description` required), previewed, then written to `<target>/<name>/SKILL.md`.
20
- - **Import from URL** — the host fetches the URL (`.md` verbatim; HTML roughly extracted to text).
21
- - **Frontmatter normalization** — special characters in descriptions are quoted automatically, so strict-YAML discovery never silently skips a skill.
22
- - **Bilingual UI** — the settings section and picker copy follow the harness's zh/en locale, styled like the General settings rows.
16
+ <br />
23
17
 
24
- ## How it works
18
+ **English** · [简体中文](README.zh.md) · [Install](#installation) · [How it works](#how-it-works) · [Development](#development)
19
+ </div>
25
20
 
26
- dsh's client→host RPC is a hard-coded allowlist with no file-write channel, but [`dsh-host-webserver`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) exposes the official route-registration extension point (`ctx.webServer.register`). The plugin registers `/skill-importer/*` routes on the harness's own same-origin server:
21
+ ---
27
22
 
28
- ```
29
- browser reads file / user enters URL
30
- │ fetch (same origin)
31
- ▼
32
- host route /skill-importer/import (registered on ctx.webServer)
33
- │ direct filesystem write (host process permissions — no sandbox, no approval)
34
- ▼
35
- <target>/<name>/SKILL.md lands
36
- │
37
- ▼
38
- skill-filesystem watcher discovers it → skills/change → hot refresh
39
- ```
23
+ ## Your skill library, one click away
24
+
25
+ `dsh-skill-importer` is a lightweight plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). It turns skills into a first-class part of the Web UI: bring in Markdown from disk or a URL, see every installed copy, and insert a skill into the composer without breaking your flow.
26
+
27
+ | Import | Organize | Invoke |
28
+ | :--- | :--- | :--- |
29
+ | Upload `SKILL.md`, paste a URL, or migrate a complete skills directory from Claude Code, Codex, and similar agents. | Browse skills grouped across project and global roots. Remove any copy individually. | Use the composer picker, run `/skills`, or type `/skill-name` directly. |
30
+
31
+ ### Built for a fast loop
40
32
 
41
- - **No session**: the host process writes; no agent, model, or session involved.
42
- - **No approval**: the host owns user permissions; the agent tool sandbox never applies.
43
- - **Secure**: routes live on the loopback-only server; `POST` routes verify the `Origin` header (only `127.0.0.1`/`localhost` sources pass).
33
+ - **No agent or session** — the host writes skill files directly.
34
+ - **Zero model tokens** — imports never enter a model context.
35
+ - **Instant discovery** — the harness watcher hot-refreshes skills after they land.
36
+ - **Workspace-aware** — project skills always target the active registered workspace.
37
+ - **Bilingual UI** — English and Chinese copy follows the harness locale.
38
+ - **Safe by design** — fixed skill roots, 256 KB limit, and same-origin POST checks.
44
39
 
45
- ## Requirements
40
+ ### Batch migration with a real preflight
46
41
 
47
- - DeepSeek Harness `>= 0.1.0-rc.6` (`npx @deepseek-ai/dsh web`)
42
+ The third import entry accepts a local skills root such as `~/.claude/skills`, `~/.codex/skills`, or another `.agents/skills` directory. It scans before it writes, validates every `SKILL.md`, preserves each skill's `scripts`, `references`, `assets`, and other resources, and reports invalid entries without touching the destination.
43
+
44
+ Destination name conflicts are skipped by default. Choose **Replace** per skill, review the add/replace/skip summary, then confirm. Each accepted skill is copied through a same-root staging directory; replacements keep a temporary backup and roll back if the swap fails. A preflight is single-use, expires after ten minutes, and verifies source-content fingerprints again at commit time.
45
+
46
+ ## Three natural ways to use a skill
47
+
48
+ 1. **Composer picker** — open the pill beside the access-mode selector, search by name, and choose.
49
+ 2. **`/skills` command** — use a familiar command palette, modeled after `/model`.
50
+ 3. **Direct invocation** — type `/skill-name` and keep moving.
51
+
52
+ All three fill the composer with the same highlighted `/name ` gesture; sending injects the skill instructions through dsh's native flow.
48
53
 
49
54
  ## Installation
50
55
 
51
- ### From npm
56
+ ### 1. Add the plugin to the Web profile
52
57
 
53
58
  ```sh
54
- # 1. Install the package into the web profile
55
59
  dsh plugin --profile web add dsh-skill-importer
60
+ ```
56
61
 
57
- # 2. Add a row to $DSH_HOME/profiles/web/cordis.patch.yml:
58
- # - id: skill-importer
59
- # name: 'dsh-skill-importer'
62
+ ### 2. Enable it in the profile
60
63
 
61
- # 3. Restart dsh web
64
+ Add the following entry to `$DSH_HOME/profiles/web/cordis.patch.yml`:
65
+
66
+ ```yaml
67
+ - id: skill-importer
68
+ name: dsh-skill-importer
62
69
  ```
63
70
 
64
- ### From a local checkout (development)
71
+ ### 3. Restart dsh Web
65
72
 
66
- ```sh
67
- npm install
68
- npm run build
69
- dsh plugin --profile web add /path/to/dsh-skill-importer
70
- # + the cordis.patch.yml row above, then restart dsh web
71
- ```
73
+ Open **Settings → Skills**. Import a Markdown file or URL, or choose **Batch import** to migrate another agent's complete skills directory. Choose a target and the imported skills will appear as soon as the filesystem watcher discovers them.
74
+
75
+ > Requires DeepSeek Harness `>= 0.1.0-rc.6` via `npx @deepseek-ai/dsh web`.
76
+
77
+ ## How it works
72
78
 
73
- A **Skills** section appears in Settings.
79
+ The dsh client-to-host RPC is a fixed allowlist with no file-write channel. This plugin uses the official `ctx.webServer.register` extension point exposed by [`dsh-host-webserver`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) and registers same-origin `/skill-importer/*` routes on the harness server.
80
+
81
+ ```text
82
+ Markdown file or URL
83
+ │ same-origin fetch
84
+ ▼
85
+ /skill-importer/import
86
+ │ host filesystem write
87
+ ▼
88
+ <skill-root>/<name>/SKILL.md
89
+ │ watcher event
90
+ ▼
91
+ skills/change → hot refresh
92
+ ```
74
93
 
75
- ## Usage
94
+ POST routes verify the `Origin` header and only accept loopback sources (`127.0.0.1` or `localhost`). Writes are restricted to these standard roots:
76
95
 
77
- 1. **Import**: Settings → Skills → pick a Markdown file (or paste a URL) → choose a target directory → Import. The form resets after success; the list refreshes automatically.
78
- 2. **Use**: in any session, pick a skill from the tool-row picker, run `/skills`, or type `/name ` — all three fill the draft with `/name ` (highlighted) and sending injects the skill's instructions.
96
+ | Scope | Directory |
97
+ | :--- | :--- |
98
+ | Project | `.agents/skills` |
99
+ | Global | `~/.dsh/skills` |
79
100
 
80
101
  ## Development
81
102
 
82
103
  ```sh
83
104
  npm install
84
- npm run build # tsc emits lib/types; tsdown emits lib/index.js + lib/client.js
105
+ npm run build
85
106
  ```
86
107
 
87
- Layout:
108
+ | Area | Source |
109
+ | :--- | :--- |
110
+ | Host plugin and route registration | `src/index.ts` |
111
+ | Filesystem, URL import, and HTTP logic | `src/server.ts` |
112
+ | Shared wire types | `src/types.ts` |
113
+ | Browser plugin and `/skills` command | `src/client/index.ts` |
114
+ | Composer picker | `src/client/SkillsPicker.tsx` |
115
+ | Settings experience | `src/client/SkillImporterSection.tsx` |
116
+
117
+ Available routes: `GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete` · `POST /skill-importer/batch/scan` · `POST /skill-importer/batch/commit`
88
118
 
89
- - `src/index.ts` — host plugin body: registers the `/skill-importer/*` routes (`inject: ['webServer', 'workspaceRegistry']`)
90
- - `src/server.ts` — pure Node logic (write/delete/list/URL fetch/HTTP layer), no Cordis imports, directly smoke-testable
91
- - `src/types.ts` — shared wire types between host and client halves
92
- - `src/client/index.ts` — browser plugin body: settings section, `/skills` popupSelect, hidden lexicon source
93
- - `src/client/SkillsPicker.tsx` — composer tool-row picker (search + avatars)
94
- - `src/client/SkillImporterSection.tsx` — settings section (General-settings row style, zh/en)
119
+ ### Local checkout
120
+
121
+ ```sh
122
+ npm install
123
+ npm run build
124
+ dsh plugin --profile web add /path/to/dsh-skill-importer
125
+ ```
95
126
 
96
- Routes: `GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete`
127
+ Add the profile entry shown above, then restart dsh Web.
97
128
 
98
- ## Known limitations
129
+ ## Notes
99
130
 
100
- - Single file ≤ 256 KB.
101
- - URL import does a rough text extraction for HTML pages — prefer `.md` sources.
102
- - Targets are fixed to the three standard skill roots (no arbitrary paths; that is the security boundary).
103
- - The list polls briefly after an import (2s interval, up to 20s); Refresh syncs immediately for external changes.
131
+ - A single imported file may be up to 256 KB.
132
+ - Batch import accepts up to 200 skills per scan; each skill may contain up to 2,000 files and 10 MB of resources. Symbolic links are refused.
133
+ - URL import preserves `.md` sources; HTML pages use lightweight text extraction, so direct Markdown URLs work best.
134
+ - The installed list polls briefly after import (every 2 seconds for up to 20 seconds). **Refresh** syncs external changes immediately.
104
135
 
105
136
  ## License
106
137
 
107
- MIT
138
+ Released under the [MIT License](LICENSE).
package/README.zh.md CHANGED
@@ -1,107 +1,138 @@
1
- # dsh-skill-importer
1
+ <div align="center">
2
+ <img src="assets/hero.svg" alt="dsh-skill-importer — 在需要的地方,调用你的技能" width="100%" />
2
3
 
3
- [English](README.md) | 中文
4
+ <br />
4
5
 
5
- [![npm version](https://img.shields.io/npm/v/dsh-skill-importer)](https://www.npmjs.com/package/dsh-skill-importer)
6
- [![npm downloads](https://img.shields.io/npm/dm/dsh-skill-importer)](https://www.npmjs.com/package/dsh-skill-importer)
7
- [![License: MIT](https://img.shields.io/npm/l/dsh-skill-importer)](LICENSE)
6
+ <strong>把技能管理带进 DeepSeek Harness Web UI。</strong><br />
7
+ 无需会话、不耗模型 Token、没有审批往返,导入后立即可用。
8
8
 
9
- [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的技能管理插件:在 Web UI 里直接导入、查看、删除技能——不经过 agent、不需要会话、不消耗模型 token、无审批。文件立即落盘,harness 自动热发现。
9
+ <br /><br />
10
10
 
11
- ## 功能
11
+ [![npm](https://img.shields.io/npm/v/dsh-skill-importer?style=flat-square&color=5dd8bd&label=npm)](https://www.npmjs.com/package/dsh-skill-importer)
12
+ [![downloads](https://img.shields.io/npm/dm/dsh-skill-importer?style=flat-square&color=6da8ff)](https://www.npmjs.com/package/dsh-skill-importer)
13
+ [![DeepSeek Harness](https://img.shields.io/badge/DeepSeek_Harness-%E2%89%A50.1.0--rc.6-5965f2?style=flat-square)](https://github.com/deepseek-ai/deepseek-harness)
14
+ [![license](https://img.shields.io/badge/license-MIT-a786ff?style=flat-square)](LICENSE)
12
15
 
13
- - **三个技能入口**(`/` 菜单不再直接列技能):
14
- 1. **输入框工具行技能选择器**(权限选择旁边):pill 触发,弹出带名称筛选框的列表,首字母头像 + 纯名称
15
- 2. **`/skills` 命令**——仿 `/model`:弹出技能列表,按名称搜索,选中自动填入 `/名称 `
16
- 3. **直接输入 `/名称 `**——原生文本手势,同样高亮并注入技能正文
17
- - **已安装列表按位置分组**:`.agents/skills`、`.dsh/skills`、`~/.dsh/skills` 每处副本都展示(管理面不做 rank 隐藏),含调用策略标记,每项可单独删除
18
- - **工作区感知**:项目目标写入「当前已注册工作区」(绝不写 dsh 进程的启动目录),与 `/` 菜单、模型目录的解析一致,导入后立即可见
19
- - **从文件导入**:选本地 Markdown(`SKILL.md` 或 `<名称>.md`),前端解析并校验 frontmatter(`name` 必须 kebab-case、`description` 必填),预览确认后写入 `<目标>/<名称>/SKILL.md`
20
- - **从 URL 导入**:host 进程抓取(`.md` 原样写入;HTML 粗略提取正文)
21
- - **frontmatter 规范化**:描述等字段含特殊字符时自动加引号,严格 YAML 发现永不静默跳过
22
- - **中英双语 UI**:设置页与选择器跟随 harness 语言,样式对齐「通用设置」行
16
+ <br />
23
17
 
24
- ## 设计原理(为什么不需要"目标会话")
18
+ [English](README.md) · **简体中文** · [安装](#安装) · [工作原理](#工作原理) · [开发](#开发)
19
+ </div>
25
20
 
26
- dsh 的 client→host RPC 是硬编码白名单,没有写文件通道;但 **`dsh-host-webserver` 提供官方路由注册扩展点**(`ctx.webServer.register`)。插件在 harness 自己的同源服务器上注册 `/skill-importer/*` 路由:
21
+ ---
27
22
 
28
- ```
29
- 浏览器读文件 / 输入 URL
30
- │ fetch(同源)
31
- ▼
32
- host 路由 /skill-importer/import(注册在 ctx.webServer 上)
33
- │ 直接写文件(host 进程权限——无沙箱、无审批)
34
- ▼
35
- <目标>/<名称>/SKILL.md 落地
36
- │
37
- ▼
38
- skill-filesystem 的 watcher 发现 → skills/change → 热刷新
39
- ```
23
+ ## 你的技能库,一键即达
24
+
25
+ `dsh-skill-importer` 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的轻量技能管理插件。它把技能变成 Web UI 的一等公民:从本地或 URL 导入 Markdown、查看每一份已安装副本,并在输入框中自然调用,全程不打断工作流。
26
+
27
+ | 导入 | 管理 | 调用 |
28
+ | :--- | :--- | :--- |
29
+ | 上传 `SKILL.md`、粘贴 URL,或从 Claude Code、Codex 等 Agent 的技能目录完整迁移。 | 按项目和全局目录分组查看,每个副本都能独立删除。 | 使用输入框选择器、运行 `/skills`,或直接输入 `/skill-name`。 |
30
+
31
+ ### 为高速工作流而生
32
+
33
+ - **无需 Agent 或会话** — host 进程直接写入技能文件。
34
+ - **零模型 Token** — 导入过程不会进入模型上下文。
35
+ - **即时发现** — 文件落盘后由 harness watcher 热刷新。
36
+ - **工作区感知** — 项目技能始终写入当前注册工作区。
37
+ - **中英双语** — UI 文案自动跟随 harness 语言。
38
+ - **安全边界清晰** — 固定技能目录、256 KB 限制、同源 POST 校验。
40
39
 
41
- - **无会话**:host 进程直接写盘,与会话/agent/模型无关
42
- - **无审批**:host 拥有用户权限,不经过 agent 工具的沙箱
43
- - **安全**:路由只挂在 loopback 服务器上;`POST` 校验 `Origin`(仅放行 `127.0.0.1`/`localhost`)
40
+ ### 带完整预检的批量迁移
44
41
 
45
- ## 环境要求
42
+ 第三个导入入口支持选择 `~/.claude/skills`、`~/.codex/skills` 或其他 `.agents/skills` 目录。写入前会扫描并校验每个 `SKILL.md`,同时完整保留技能的 `scripts`、`references`、`assets` 等资源;不合规项只展示错误,绝不会写入目标目录。
46
43
 
47
- - DeepSeek Harness `>= 0.1.0-rc.6`(`npx @deepseek-ai/dsh web` 方式运行)
44
+ 目标中存在同名技能时默认跳过。用户可逐项勾选「替换」,检查新增、替换和跳过数量后再确认。每个技能先复制到目标根目录下的临时目录;替换时会暂存旧版本,交换失败自动回滚。扫描结果只能提交一次、十分钟后过期,并在提交时重新核对源内容摘要。
45
+
46
+ ## 三种自然的技能入口
47
+
48
+ 1. **输入框选择器** — 点击权限模式旁边的 pill,按名称搜索并选中。
49
+ 2. **`/skills` 命令** — 像使用 `/model` 一样打开技能命令面板。
50
+ 3. **直接调用** — 输入 `/skill-name`,继续你的工作。
51
+
52
+ 三种入口最终都会在输入框填入同一个高亮的 `/name ` 手势;发送后由 dsh 原生流程注入技能指令。
48
53
 
49
54
  ## 安装
50
55
 
51
- ### 从 npm
56
+ ### 1. 安装到 Web profile
52
57
 
53
58
  ```sh
54
- # 1. 把插件装进 web profile
55
59
  dsh plugin --profile web add dsh-skill-importer
60
+ ```
56
61
 
57
- # 2. 在 $DSH_HOME/profiles/web/cordis.patch.yml 追加一行:
58
- # - id: skill-importer
59
- # name: 'dsh-skill-importer'
62
+ ### 2. 在 profile 中启用
60
63
 
61
- # 3. 重启 dsh web
64
+ 向 `$DSH_HOME/profiles/web/cordis.patch.yml` 添加:
65
+
66
+ ```yaml
67
+ - id: skill-importer
68
+ name: dsh-skill-importer
62
69
  ```
63
70
 
64
- ### 从本地源码(开发)
71
+ ### 3. 重启 dsh Web
65
72
 
66
- ```sh
67
- npm install
68
- npm run build
69
- dsh plugin --profile web add /path/to/dsh-skill-importer
70
- # 同样追加上面的 cordis.patch.yml 行,然后重启 dsh web
71
- ```
73
+ 打开 **设置 → 技能**,选择 Markdown 文件、粘贴 URL,或通过「批量导入」迁移其他 Agent 的完整技能目录,再选择目标范围。文件系统 watcher 发现后,技能会立即出现。
74
+
75
+ > 需要 DeepSeek Harness `>= 0.1.0-rc.6`,使用 `npx @deepseek-ai/dsh web` 运行。
76
+
77
+ ## 工作原理
78
+
79
+ dsh 的 client→host RPC 是固定白名单,没有文件写入通道。本插件使用 [`dsh-host-webserver`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/webserver) 提供的官方 `ctx.webServer.register` 扩展点,在 harness 自身服务器上注册同源 `/skill-importer/*` 路由。
72
80
 
73
- 设置页左侧导航出现「技能」分区。
81
+ ```text
82
+ Markdown 文件或 URL
83
+ │ 同源 fetch
84
+ ▼
85
+ /skill-importer/import
86
+ │ host 文件系统写入
87
+ ▼
88
+ <skill-root>/<name>/SKILL.md
89
+ │ watcher 事件
90
+ ▼
91
+ skills/change → 热刷新
92
+ ```
74
93
 
75
- ## 使用
94
+ 所有 POST 路由都会校验 `Origin`,仅接受 loopback 来源(`127.0.0.1` 或 `localhost`)。写入范围固定为两个标准目录:
76
95
 
77
- 1. **导入**:设置 → 技能 → 选本地 Markdown(或填 URL)→ 选目标目录 → 导入。成功后表单自动清空,列表自动刷新。
78
- 2. **使用**:任意会话中,从工具行技能选择器选、运行 `/skills`、或直接输入 `/名称 `——三种方式都会在输入框填入 `/名称 `(带高亮),发送即注入技能指令。
96
+ | 范围 | 目录 |
97
+ | :--- | :--- |
98
+ | 项目 | `.agents/skills` |
99
+ | 全局 | `~/.dsh/skills` |
79
100
 
80
101
  ## 开发
81
102
 
82
103
  ```sh
83
104
  npm install
84
- npm run build # tsc 产出 lib/types;tsdown 产出 lib/index.js + lib/client.js
105
+ npm run build
85
106
  ```
86
107
 
87
- 结构:
108
+ | 模块 | 源码 |
109
+ | :--- | :--- |
110
+ | Host 插件与路由注册 | `src/index.ts` |
111
+ | 文件系统、URL 导入与 HTTP 逻辑 | `src/server.ts` |
112
+ | Host/client 共享类型 | `src/types.ts` |
113
+ | 浏览器插件与 `/skills` 命令 | `src/client/index.ts` |
114
+ | 输入框技能选择器 | `src/client/SkillsPicker.tsx` |
115
+ | 设置页 | `src/client/SkillImporterSection.tsx` |
116
+
117
+ 路由一览:`GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete` · `POST /skill-importer/batch/scan` · `POST /skill-importer/batch/commit`
88
118
 
89
- - `src/index.ts` — host 插件体:注册 `/skill-importer/*` 路由(`inject: ['webServer', 'workspaceRegistry']`)
90
- - `src/server.ts` — 纯 Node 逻辑(写盘/删除/列表/URL 抓取/HTTP 层),无 Cordis 依赖,可直接冒烟测试
91
- - `src/types.ts` — host/client 共享线格式类型
92
- - `src/client/index.ts` — 浏览器插件体:设置页、`/skills` popupSelect、隐形 lexicon 源
93
- - `src/client/SkillsPicker.tsx` — 工具行技能选择器(筛选 + 首字母头像)
94
- - `src/client/SkillImporterSection.tsx` — 设置页(通用设置行风格,中英双语)
119
+ ### 本地源码安装
120
+
121
+ ```sh
122
+ npm install
123
+ npm run build
124
+ dsh plugin --profile web add /path/to/dsh-skill-importer
125
+ ```
95
126
 
96
- 路由一览:`GET /skill-importer/health` · `GET /skill-importer/list` · `POST /skill-importer/import` · `POST /skill-importer/import-url` · `POST /skill-importer/delete`
127
+ 随后添加上文的 profile 配置并重启 dsh Web。
97
128
 
98
- ## 已知限制
129
+ ## 注意事项
99
130
 
100
- - 单文件 ≤ 256 KB
101
- - URL 导入对 HTML 页面只做粗略文本提取,推荐指向 `.md` 文件
102
- - 目标目录固定为三个标准技能根(不支持任意路径,这是安全边界)
103
- - 导入后列表会短暂轮询刷新(2 秒间隔,最多 20 秒);外部改动点「刷新」立即同步
131
+ - 单个导入文件最大 256 KB。
132
+ - 批量导入每次最多扫描 200 个技能;单个技能最多包含 2,000 个文件和 10 MB 资源,不接受符号链接。
133
+ - URL 导入会原样保留 `.md`;HTML 页面仅做轻量正文提取,因此推荐使用 Markdown 直链。
134
+ - 导入后列表会短暂轮询(每 2 秒一次,最多 20 秒);外部改动可点击 **刷新** 立即同步。
104
135
 
105
136
  ## License
106
137
 
107
- MIT
138
+ 基于 [MIT License](LICENSE) 开源。
@@ -0,0 +1,6 @@
1
+ # dsh-skill-importer bundle patch: one plugin row, applied as a bundle layer.
2
+ # Declared by the package's dsh.bundle manifest; `dsh plugin --profile <p> add
3
+ # dsh-skill-importer` appends it to the profile's bundle stack automatically.
4
+ - insert:
5
+ - id: skill-importer
6
+ name: 'dsh-skill-importer'