@nanmicoder/dsh-skills-hub 0.0.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.
Files changed (67) hide show
  1. package/AGENTS.md +9 -0
  2. package/CONTRIBUTING.md +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +120 -0
  5. package/README_EN.md +120 -0
  6. package/README_ZH.md +5 -0
  7. package/assets/readme/hero-en.png +0 -0
  8. package/assets/readme/hero-zh.png +0 -0
  9. package/assets/readme/marketplace.png +0 -0
  10. package/compatibility.json +10 -0
  11. package/cordis.patch.yml +5 -0
  12. package/docs/COMPATIBILITY.md +31 -0
  13. package/docs/CONTRACT.md +125 -0
  14. package/docs/RELEASE.md +24 -0
  15. package/lib/client.js +25115 -0
  16. package/lib/client.js.map +1 -0
  17. package/lib/config.js +51 -0
  18. package/lib/index.js +176 -0
  19. package/lib/market/cache.js +113 -0
  20. package/lib/market/clawhub-provider.js +598 -0
  21. package/lib/market/install-service.js +394 -0
  22. package/lib/market/market-service.js +312 -0
  23. package/lib/market/provider-fetch.js +216 -0
  24. package/lib/market/skillhub-provider.js +277 -0
  25. package/lib/market/types.js +82 -0
  26. package/lib/skills/installed.js +426 -0
  27. package/lib/skills/management.js +36 -0
  28. package/lib/skills/read-text.js +23 -0
  29. package/lib/skills/root.js +112 -0
  30. package/lib/types/client/api.d.ts +106 -0
  31. package/lib/types/client/components/FilterBar.d.ts +20 -0
  32. package/lib/types/client/components/FrontmatterPanel.d.ts +15 -0
  33. package/lib/types/client/components/InstallConfirmDialog.d.ts +31 -0
  34. package/lib/types/client/components/InstallStateBadge.d.ts +11 -0
  35. package/lib/types/client/components/InstalledSkills.d.ts +3 -0
  36. package/lib/types/client/components/MarkdownView.d.ts +4 -0
  37. package/lib/types/client/components/MarketDisclaimer.d.ts +10 -0
  38. package/lib/types/client/components/MarketHome.d.ts +12 -0
  39. package/lib/types/client/components/SecurityBadge.d.ts +16 -0
  40. package/lib/types/client/components/SkillAvatar.d.ts +14 -0
  41. package/lib/types/client/components/SkillCard.d.ts +17 -0
  42. package/lib/types/client/components/SkillDetailView.d.ts +21 -0
  43. package/lib/types/client/components/SourceStatusBar.d.ts +13 -0
  44. package/lib/types/client/icons.d.ts +71 -0
  45. package/lib/types/client/index.d.ts +56 -0
  46. package/lib/types/client/locale-context.d.ts +31 -0
  47. package/lib/types/client/locales.d.ts +117 -0
  48. package/lib/types/client/page/MarketPage.d.ts +21 -0
  49. package/lib/types/client/skill-markdown.d.ts +2 -0
  50. package/lib/types/client/state.d.ts +119 -0
  51. package/lib/types/config.d.ts +51 -0
  52. package/lib/types/index.d.ts +42 -0
  53. package/lib/types/market/cache.d.ts +49 -0
  54. package/lib/types/market/clawhub-provider.d.ts +28 -0
  55. package/lib/types/market/install-service.d.ts +75 -0
  56. package/lib/types/market/market-service.d.ts +74 -0
  57. package/lib/types/market/provider-fetch.d.ts +61 -0
  58. package/lib/types/market/skillhub-provider.d.ts +13 -0
  59. package/lib/types/market/types.d.ts +163 -0
  60. package/lib/types/skills/installed.d.ts +117 -0
  61. package/lib/types/skills/management.d.ts +7 -0
  62. package/lib/types/skills/read-text.d.ts +5 -0
  63. package/lib/types/skills/root.d.ts +48 -0
  64. package/lib/types/web-routes.d.ts +74 -0
  65. package/lib/web-routes.js +427 -0
  66. package/package.json +160 -0
  67. package/release-notes/v0.0.1.md +11 -0
package/AGENTS.md ADDED
@@ -0,0 +1,9 @@
1
+ # Skills Hub development
2
+
3
+ Read `CONTRIBUTING.md`, `docs/COMPATIBILITY.md` and `docs/RELEASE.md` for implementation and release work. The current package name is `@nanmicoder/dsh-skills-hub`; the unscoped npm name belongs to another project. The plugin's first release is 0.0.1; Harness versions are tracked separately.
4
+
5
+ Use the pinned pnpm version and lockfile, keep Harness development dependencies on one exact cohort, and run `pnpm pack:check` before delivery. Regenerate and retain `lib/` for Git installs. Avoid absolute local paths in committed metadata or runtime bundles. Never claim an untested host version is supported.
6
+
7
+ For interactive browser automation, use the `ego-browser` skill from Ego Lite. Do not use another browser-control skill unless explicitly requested or Ego Lite is unavailable.
8
+
9
+ Publication is separate from preparing a release: do not publish, push tags, change repository visibility or edit a user's active profile unless the user authorized those actions. Existing authorization takes precedence over generic workflow prompts. Use isolated profiles and disposable skills for tests.
@@ -0,0 +1,11 @@
1
+ # Contributing
2
+
3
+ Use Node.js `^22.19.0 || >=24` and the pnpm version pinned in `package.json`. Keep one lockfile. Run `pnpm install --frozen-lockfile`, then `pnpm pack:check` before submitting a change.
4
+
5
+ Separate host code (`src/`) from browser code (`src/client/`). Client value imports from Harness must be platform module-table entries; type-only imports are fine. Use CSS Modules and `--dsw-*` theme variables. Keep loading, empty, failure, retry and disabled states accessible, and respect reduced motion.
6
+
7
+ Skill installs must not overwrite existing directories. Local removal must revalidate its root and target and require an explicit confirmation; never trust a path supplied by the browser. Cover filesystem traversal, symlinks, conflicts and provider failures with meaningful tests. Follow the contracts in `docs/CONTRACT.md` and update them when APIs change.
8
+
9
+ The supported Harness cohort lives in `compatibility.json`. Keep all development packages on that exact cohort and document source/tag evidence before broadening support. Do not copy historical support ranges from another plugin.
10
+
11
+ Commit regenerated `lib/` with source changes because Git installations consume it. Release metadata, compatibility, English/Chinese installation commands and release notes must agree. Follow `docs/RELEASE.md`; a passing test suite is not evidence that publication or real desktop acceptance happened.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NanmiCoder
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ <p align="right">
2
+ <strong>简体中文</strong> · <a href="./README_EN.md">English</a>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="./assets/readme/hero-zh.png" width="100%" alt="Skills Hub:发现技能,装进你的工作流。3D 技能文档汇入蓝色收纳座的概念插画。">
7
+ </p>
8
+
9
+ <p align="center">
10
+ <strong>DeepSeek Harness 的技能市场与本机技能管理器</strong><br>
11
+ 浏览 ClawHub 与 SkillHub,读懂 SKILL.md,再安装到你的 Harness。
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="#快速开始">快速开始</a> · <a href="./docs/COMPATIBILITY.md">兼容性</a> · <a href="./docs/RELEASE.md">发布指南</a> · <a href="./LICENSE">MIT</a>
16
+ </p>
17
+
18
+ ## 技能发现和本机管理,在同一个面板里
19
+
20
+ **Skills Hub** 把两个技能市场与本机用户技能放进 Harness 侧栏。无需在网站、下载目录和技能文件夹之间来回切换:搜索、查看文档、确认安装,再到「已安装技能」里统一管理。
21
+
22
+ <p align="center">
23
+ <img src="./assets/readme/marketplace.png" width="100%" alt="Skills Hub 在 DeepSeek Harness 中的实际界面:技能卡片、搜索与筛选、来源健康状态,以及已安装技能入口。">
24
+ </p>
25
+
26
+ *实际 Harness 0.2.0-rc.2 界面;市场内容随上游更新。顶部 3D Hero 为概念插画。*
27
+
28
+ | 你要做的事 | Skills Hub 怎么帮你 |
29
+ | --- | --- |
30
+ | **找一个技能** | 聚合 ClawHub 与 SkillHub,支持搜索和筛选;向下滚动自动加载更多。 |
31
+ | **先看清,再安装** | 渲染 Markdown、表格和代码块,预览包内文件与上游安全报告;列表和详情都有骨架屏。 |
32
+ | **整理已安装技能** | 搜索市场安装和本机用户技能,查看来源、实际路径与正文,再确认卸载。 |
33
+
34
+ ## 快速开始
35
+
36
+ **插件 `0.0.1` · 宿主 `0.2.0-rc.2`**。面向 DeepSeek Harness 0.2.0 桌面端产品线;其他宿主版本尚未验证。[查看验收范围 →](./docs/COMPATIBILITY.md)
37
+
38
+ 在运行桌面端的 profile 中安装:
39
+
40
+ ```sh
41
+ dsh plugin --profile desktop add @nanmicoder/dsh-skills-hub@0.0.1
42
+ ```
43
+
44
+ 完全退出并重新打开 Harness,在侧栏点击 **技能市场**。使用其他 profile 时,把 `desktop` 替换成对应名称。
45
+
46
+ 1. **浏览**:搜索关键词,或按来源、安全状态筛选。
47
+ 2. **预览**:打开技能,阅读概览和文件内容。
48
+ 3. **安装**:核对来源并确认;在「已安装技能」中查看、搜索或卸载。
49
+
50
+ > 包名必须带 `@nanmicoder/`。npm 上不带 scope 的 `dsh-skills-hub` 属于其他作者。
51
+
52
+ <details>
53
+ <summary><strong>从源码安装</strong></summary>
54
+
55
+ 需要 Node.js `^22.19.0 || >=24` 和 pnpm `10.33.0`。
56
+
57
+ ```sh
58
+ pnpm install --frozen-lockfile
59
+ pnpm pack --pack-destination artifacts
60
+ dsh plugin --profile desktop add ./artifacts/nanmicoder-dsh-skills-hub-0.0.1.tgz
61
+ ```
62
+
63
+ 同样需要完全重启 Harness。构建产物随源码保留,打包前会重新构建和检查。
64
+
65
+ </details>
66
+
67
+ ## 已安装管理,路径清楚,操作明确
68
+
69
+ 列表覆盖配置的安装目录、`$DSH_HOME/skills` 与共享 agents 用户技能目录。目录式技能、平铺 Markdown 和符号链接都能识别;同名但不同路径的技能分别展示。
70
+
71
+ - **确认后卸载**:展示将要删除的实际位置。
72
+ - **链接只删链接**:保留它指向的原始技能文件。
73
+ - **管理用户技能**:项目级和内置技能不在这个主机级列表中。
74
+
75
+ 安装过程不执行技能脚本,也不会覆盖已有目录。技能可能指示 agent 后续运行第三方代码;安全标签来自上游报告,不代表独立审计。请在安装前查看内容和发布者。
76
+
77
+ <details>
78
+ <summary><strong>配置与移除插件</strong></summary>
79
+
80
+ 默认配置即可使用。高级配置写在插件行中:
81
+
82
+ ```yaml
83
+ - id: skills-hub
84
+ name: '@nanmicoder/dsh-skills-hub'
85
+ config:
86
+ allowUninstall: false
87
+ timeoutMs: 30000
88
+ ```
89
+
90
+ | 配置项 | 默认值 | 说明 |
91
+ | --- | --- | --- |
92
+ | `skillsRoot` | `null` | 安装目录;默认是 Harness 用户技能目录。 |
93
+ | `clawhubBaseUrl` | `https://clawhub.ai` | ClawHub API 地址。 |
94
+ | `skillhubBaseUrl` | `https://api.skillhub.cn` | SkillHub API 地址。 |
95
+ | `timeoutMs` | `15000` | 单次上游请求超时,单位毫秒。 |
96
+ | `requestRetries` | `1` | 网络及服务器错误重试次数。 |
97
+ | `allowUninstall` | `true` | 是否允许在面板卸载技能。 |
98
+ | `pageSize` | `24` | 市场分页大小。 |
99
+
100
+ 移除插件本身:
101
+
102
+ ```sh
103
+ dsh plugin --profile desktop remove @nanmicoder/dsh-skills-hub
104
+ ```
105
+
106
+ 这不会删除已安装的技能。文件扫描范围与接口见[实现约定](./docs/CONTRACT.md)。
107
+
108
+ </details>
109
+
110
+ ## 开发与发布
111
+
112
+ ```sh
113
+ pnpm install --frozen-lockfile
114
+ pnpm check # 类型、构建、回归测试与版本检查
115
+ pnpm pack:check # 另检查 npm 包内容及运行时依赖闭包
116
+ ```
117
+
118
+ [贡献指南](./CONTRIBUTING.md) · [维护规范](./AGENTS.md) · [兼容性与验收](./docs/COMPATIBILITY.md) · [0.0.1 发布流程](./docs/RELEASE.md)
119
+
120
+ MIT 许可证。详见 [LICENSE](./LICENSE)。
package/README_EN.md ADDED
@@ -0,0 +1,120 @@
1
+ <p align="right">
2
+ <a href="./README.md">简体中文</a> · <strong>English</strong>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img src="./assets/readme/hero-en.png" width="100%" alt="Skills Hub for DeepSeek Harness. Your skills. One place. A conceptual 3D library of skill documents in a blue dock.">
7
+ </p>
8
+
9
+ <p align="center">
10
+ <strong>A skill marketplace and local skill manager for DeepSeek Harness</strong><br>
11
+ Browse ClawHub and SkillHub, read SKILL.md, then install into Harness.
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="#quick-start">Quick start</a> · <a href="./docs/COMPATIBILITY.md">Compatibility</a> · <a href="./docs/RELEASE.md">Release guide</a> · <a href="./LICENSE">MIT</a>
16
+ </p>
17
+
18
+ ## Discovery and local management, in one panel
19
+
20
+ **Skills Hub** brings two marketplaces and your local user skills into the Harness sidebar. Search, inspect the instructions, confirm an installation, and manage it from the **Installed** view.
21
+
22
+ <p align="center">
23
+ <img src="./assets/readme/marketplace.png" width="100%" alt="Actual Skills Hub panel in DeepSeek Harness: skill cards, search, filters, source health and the installed-skills entry.">
24
+ </p>
25
+
26
+ *Actual Harness 0.2.0-rc.2 interface, shown in Chinese. Catalogue content changes upstream. The 3D hero is a conceptual illustration.*
27
+
28
+ | What you want to do | How Skills Hub helps |
29
+ | --- | --- |
30
+ | **Find a skill** | Search and filter ClawHub and SkillHub together. More results load as you scroll. |
31
+ | **Inspect before installing** | Read Markdown, tables and code blocks; preview package files and upstream security reports. List and detail skeletons make loading visible. |
32
+ | **Manage installed skills** | Search marketplace installations and local user skills, inspect their source, path and instructions, then confirm removal. |
33
+
34
+ ## Quick start
35
+
36
+ **Plugin `0.0.1` · Harness `0.2.0-rc.2`.** Targets the DeepSeek Harness 0.2.0 desktop release line; other host versions have not been validated. [See acceptance scope →](./docs/COMPATIBILITY.md)
37
+
38
+ Install into your desktop profile:
39
+
40
+ ```sh
41
+ dsh plugin --profile desktop add @nanmicoder/dsh-skills-hub@0.0.1
42
+ ```
43
+
44
+ Fully quit and reopen Harness, then choose **Skills Hub** in the sidebar. Replace `desktop` with your profile name if needed.
45
+
46
+ 1. **Browse**: search a keyword or filter by source and security status.
47
+ 2. **Preview**: open a skill and read its overview and files.
48
+ 3. **Install**: confirm its source; use **Installed** to inspect, search or remove it later.
49
+
50
+ > Keep the `@nanmicoder/` scope. The unscoped npm package `dsh-skills-hub` belongs to another author.
51
+
52
+ <details>
53
+ <summary><strong>Install from source</strong></summary>
54
+
55
+ Requires Node.js `^22.19.0 || >=24` and pnpm `10.33.0`.
56
+
57
+ ```sh
58
+ pnpm install --frozen-lockfile
59
+ pnpm pack --pack-destination artifacts
60
+ dsh plugin --profile desktop add ./artifacts/nanmicoder-dsh-skills-hub-0.0.1.tgz
61
+ ```
62
+
63
+ Restart Harness afterward. Build artifacts are committed with source and rebuilt and checked before packing.
64
+
65
+ </details>
66
+
67
+ ## Local management with explicit paths
68
+
69
+ The list covers the configured installation root, `$DSH_HOME/skills` and the shared agents user skills directory. It discovers directory-based skills, flat Markdown files and symlinks. Skills with the same name at different paths remain separate entries.
70
+
71
+ - **Confirm removals** after checking the exact location.
72
+ - **Unlink linked skills** without deleting their original files.
73
+ - **Manage user skills**; project-specific and bundled skills are outside this host-level list.
74
+
75
+ Installation does not execute skill scripts or overwrite existing directories. Skills may instruct an agent to run third-party code later. Security labels are upstream reports, not independent audits; review the contents and publisher before installing.
76
+
77
+ <details>
78
+ <summary><strong>Configuration and plugin removal</strong></summary>
79
+
80
+ Defaults work out of the box. Advanced settings belong in the plugin row:
81
+
82
+ ```yaml
83
+ - id: skills-hub
84
+ name: '@nanmicoder/dsh-skills-hub'
85
+ config:
86
+ allowUninstall: false
87
+ timeoutMs: 30000
88
+ ```
89
+
90
+ | Key | Default | Meaning |
91
+ | --- | --- | --- |
92
+ | `skillsRoot` | `null` | Installation root; defaults to Harness's user skills directory. |
93
+ | `clawhubBaseUrl` | `https://clawhub.ai` | ClawHub API origin. |
94
+ | `skillhubBaseUrl` | `https://api.skillhub.cn` | SkillHub API origin. |
95
+ | `timeoutMs` | `15000` | Per-request upstream timeout in milliseconds. |
96
+ | `requestRetries` | `1` | Retries for network and server failures. |
97
+ | `allowUninstall` | `true` | Allow skill removal from the panel. |
98
+ | `pageSize` | `24` | Marketplace page size. |
99
+
100
+ Remove the plugin itself:
101
+
102
+ ```sh
103
+ dsh plugin --profile desktop remove @nanmicoder/dsh-skills-hub
104
+ ```
105
+
106
+ This does not delete installed skills. See the [implementation contract](./docs/CONTRACT.md) for discovery scope and APIs.
107
+
108
+ </details>
109
+
110
+ ## Develop and release
111
+
112
+ ```sh
113
+ pnpm install --frozen-lockfile
114
+ pnpm check # types, build, regression tests and release metadata
115
+ pnpm pack:check # also inspect package contents and runtime import closure
116
+ ```
117
+
118
+ [Contributing](./CONTRIBUTING.md) · [Maintenance rules](./AGENTS.md) · [Compatibility and acceptance](./docs/COMPATIBILITY.md) · [0.0.1 release guide](./docs/RELEASE.md)
119
+
120
+ MIT. See [LICENSE](./LICENSE).
package/README_ZH.md ADDED
@@ -0,0 +1,5 @@
1
+ # Skills Hub · 简体中文
2
+
3
+ 中文文档已成为仓库默认首页,请查看 [README.md](./README.md)。
4
+
5
+ [English documentation](./README_EN.md)
Binary file
Binary file
Binary file
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "pluginVersion": "0.0.1",
4
+ "recommendedHost": "0.2.0-rc.2",
5
+ "hostTag": "dsh-v0.2.0-rc.2",
6
+ "hostCommit": "639ed015397290b3745d163aafe02ffee4aa3f84",
7
+ "desktopReleaseLine": "0.2.0",
8
+ "previewTag": "next",
9
+ "supportedHosts": ["0.2.0-rc.2"]
10
+ }
@@ -0,0 +1,5 @@
1
+ # Add only our own plugin row. This layer does not replace any official DSH
2
+ # component: the profile keeps every bundle it already had.
3
+ - insert:
4
+ - id: skills-hub
5
+ name: "@nanmicoder/dsh-skills-hub"
@@ -0,0 +1,31 @@
1
+ # Harness compatibility
2
+
3
+ The build and peer dependency baseline is **`0.2.0-rc.2`** for every `@deepseek-ai/dsh-*` package. The source reference is tag `dsh-v0.2.0-rc.2`, commit `639ed015397290b3745d163aafe02ffee4aa3f84` in `deepseek-ai/deepseek-harness`. These are the precise package coordinates behind the requested desktop 0.2.0 release line; an untagged future `0.2.0` package is not silently covered.
4
+
5
+ The referenced packages were confirmed on npm. A clean install resolves one cohort, with `autoInstallPeers: false`; missing host peers used by development packages are explicitly provided at the same version. No local workspace overrides or private filesystem paths are needed.
6
+
7
+ The plugin uses the host's Cordis service lifecycle, lazy `webServer` binding, connection request gate, user/configured skill roots, web-client slot registration, layout services and the browser module-loader factory protocol. It does not replace official profile components. The patch inserts a single row named `@nanmicoder/dsh-skills-hub`. The browser bundle registers that same package ID and externalizes only platform modules. Markdown processing is bundled, so it does not depend on an optional host Markdown renderer service.
8
+
9
+ ## Acceptance procedure
10
+
11
+ Use the exact source tag or installed desktop cohort, a temporary `DSH_HOME`, an isolated profile and disposable skills. Do not change the user's real profile for acceptance.
12
+
13
+ 1. Build and pack the plugin. Install the tarball into the isolated profile.
14
+ 2. Dump the resolved profile and confirm the scoped plugin row.
15
+ 3. Cold-boot the host; confirm no pending plugin service and the advertised `lib/client.js` bundle returns successfully.
16
+ 4. Open Skills Hub in the actual host browser. Confirm module registration, DOM mount, and absence of page errors.
17
+ 5. Verify initial skeleton, detail skeleton, rendered Markdown and automatic next-page loading. Test an empty list and source failure/retry.
18
+ 6. Install a disposable market skill. Confirm its files and the Installed row; uninstall and confirm removal. Add a temporary local skill under a configured root, refresh and remove it through the local confirmation path.
19
+ 7. Check light/dark layout and keyboard-accessible controls. Record actual results separately from automated fixture coverage.
20
+
21
+ `pnpm pack:check` covers static typing, source and manifest contracts, regression tests, clean build, release metadata and tarball import closure. It does not by itself certify a running desktop session or upstream network availability. Future host cohorts must repeat this acceptance before widening peer ranges.
22
+
23
+ ## 0.0.1 acceptance record — 2026-09-30
24
+
25
+ Validation used the published npm `@deepseek-ai/dsh@0.2.0-rc.2` runtime with every Harness dependency overridden to the same cohort, on macOS arm64 / Node 26.7.0. The plugin was installed from its npm tarball into a disposable Web profile, with isolated `DSH_HOME` and `DSH_AGENTS_HOME`. The complete published host started without startup warnings. The earlier source-checkout trial lacked unrelated built host packages and is not the compatibility evidence.
26
+
27
+ Ego Lite drove the actual host UI. Slow fixture upstream responses made the loading states observable: eight initial card skeletons, the detail skeleton, and automatic growth from 24 to 48 cards after a wheel scroll. Headings, a GFM table and fenced code rendered as DOM; injected HTML scripts did not execute and no `javascript:` links remained. A fixture skill was installed through the confirmation dialog and appeared in Installed. A local skill preview rendered its body without YAML frontmatter. Both entries were removed through confirmation dialogs and their filesystem entries disappeared. Light and dark themes were inspected; the layout had no horizontal viewport overflow. This verifies the shared Web client and host plugin protocol, not a native desktop installer or OS-specific shell integration.
28
+
29
+ `pnpm pack:check` passed 44 tests without failures or skips, including live provider list/detail/file/install/uninstall, request-origin fencing, local removal policy, duplicate paths, symlink preservation, bounded file reads, Markdown rendering and controller concurrency. A final clean build and tarball closure check followed the visual/style fixes. npm publication dry-run and registry name/version preflight succeeded. No package was published, Git tag created, repository visibility changed or active user profile modified. Local npm authentication was absent (`npm whoami`: `ENEEDAUTH`); publication requires an authorized login or the documented CI secret.
30
+
31
+ Local-only logs and screenshots are kept in the ignored `artifacts/` directory. CI covers Node 22.19 and 24; those CI jobs and a native desktop launch were not run in this local acceptance.
@@ -0,0 +1,125 @@
1
+ # Skills Hub 0.0.1 implementation contract
2
+
3
+ This document describes the shipped code, not a migration plan. The TypeScript models in `src/market/types.ts`, `src/skills/installed.ts` and `src/client/api.ts` define the detailed wire shapes. Update this document with API changes.
4
+
5
+ ## 1. Package and host
6
+
7
+ The package is `@nanmicoder/dsh-skills-hub`, version `0.0.1`. Its supported host package cohort is exactly `0.2.0-rc.2`; the desktop release line is 0.2.0. The exact upstream tag and commit are recorded in `compatibility.json` and [COMPATIBILITY.md](COMPATIBILITY.md).
8
+
9
+ `cordis.patch.yml` inserts one row (`id: skills-hub`) named after the scoped package. `lib/index.js` is the host entry. `lib/client.js` is the browser factory registered with `window.__ModuleLoader__.load` under that same package name. The plugin adds a global sidebar panel and does not replace built-in components or require an agent session.
10
+
11
+ ## 2. Host/browser boundary
12
+
13
+ The host performs provider requests and filesystem operations. It binds the available `webServer`/`httpServer` lazily, scopes route disposal to Cordis effects, and resolves the connection request gate for each request so late service activation is respected. Headless profiles may load the plugin without mounting a web surface.
14
+
15
+ The browser only calls same-origin `/api/skills-hub/*` endpoints, with same-origin credentials. Shared market imports in browser code are type-only. Browser runtime externals must belong to the Harness platform module table; host services and Node modules must not enter the browser bundle.
16
+
17
+ `react-markdown` and `remark-gfm` are development dependencies compiled into the browser artifact. Rendering supports headings, tables, task lists and fenced code without relying on an optional host renderer. Raw HTML is skipped; dangerous URL protocols are filtered by the renderer, and external links use `noopener noreferrer`.
18
+
19
+ The bundler explicitly selects the browser platform even though its output is a CommonJS factory. Both build-time import checks and manifest checks guard this boundary. CSS Modules use `--dsw-*` theme tokens and relative source IDs for portable output.
20
+
21
+ ## 3. Filesystem scope and installed identities
22
+
23
+ The installation root is `skillsRoot` when configured, otherwise `$DSH_HOME/skills` (default Harness home: `~/.dsh`). Discovery scans, in order:
24
+
25
+ 1. The installation root.
26
+ 2. `$DSH_HOME/skills`.
27
+ 3. `$DSH_AGENTS_HOME/skills`, defaulting to `~/.agents/skills`.
28
+
29
+ Duplicate roots collapse. Tilde prefixes are expanded and configured relative paths resolve against the host working directory. Session/project `.dsh/skills` and `.agents/skills` roots are deliberately excluded because this panel has no session working directory. This is a user-root inventory, not an enumeration of every skill a particular session or plugin provider might expose.
30
+
31
+ Discovery recognizes directory bundles containing `SKILL.md`, flat Markdown skill files and valid symlink entries. It reads names/descriptions from bounded frontmatter and measures files with traversal limits. The Installed view is populated from this filesystem scan independently of market availability; it does not invent market entries for local skills.
32
+
33
+ An `InstalledSkillRecord` has:
34
+
35
+ | Field | Meaning |
36
+ | --- | --- |
37
+ | `key` | Opaque 64-character hexadecimal identity for the exact filesystem entry; use this for local management. |
38
+ | `id` | Market `source:slug` when a valid provenance sidecar exists; otherwise a local identity. Not unique across duplicate installations. |
39
+ | `source` | `clawhub`, `skillhub` or `local`. |
40
+ | `slug`, `name`, `dirName` | Logical skill and display identity. |
41
+ | `dirPath` | Absolute path of the bundle directory, flat file or symlink entry, shown before removal. |
42
+ | `linked` | Entry is a symlink; removal unlinks it, never its target. |
43
+ | `managed` | Valid `.skills-hub.json` marketplace provenance was discovered. |
44
+ | `removable` | Whether UI removal is allowed; the list reflects `allowUninstall`. The server independently enforces that switch. |
45
+ | `bytes`, `fileCount` | Bounded scan statistics. |
46
+ | `version`, `summary`, `installedAt` | Optional metadata. |
47
+
48
+ Duplicate names/market IDs in separate roots remain separate rows with separate keys. Local endpoints accept keys, never arbitrary client-supplied paths. They freshly scan the allowed roots to resolve the entry. Removal renames the selected entry to a hidden temporary sibling before deletion; removing a link preserves its target. A flat file removal preserves its sibling files.
49
+
50
+ Market installation uses staging and atomic publication, rejects directory conflicts, validates file paths and hashes when supplied, and writes a `.skills-hub.json` sidecar. The market-ID uninstall endpoint requires valid matching provenance; the explicit local-management endpoint can remove unmanaged entries after the UI confirmation. Both honor `allowUninstall`.
51
+
52
+ After mutations the plugin refreshes its installed lookup. Harness's filesystem watcher handles skill catalog invalidation; the plugin does not forge filesystem observation events. Reading the catalog is best-effort and does not replace that watcher.
53
+
54
+ ## 4. Marketplace models and limits
55
+
56
+ Providers normalize ClawHub and SkillHub into `NormalizedSkill`. A market ID is `clawhub:<slug>` or `skillhub:<slug>`. The model includes name/summary/author, statistics, tags, version, security status and installation state. SkillHub mirrors may be deduplicated into their ClawHub originals.
57
+
58
+ `NormalizedSkillDetail` adds Markdown `description`, optional frontmatter/license, `files` and `totalSize`. File metadata includes relative path, byte size, language, optional hash/content type and `tooBig`. File previews include `content`, `size`, `language` and `truncated`.
59
+
60
+ Source status is `ok`, `degraded`, `failed` or `cached`, with optional fetch time/cache/error metadata. Provider failures remain visible independently; an unavailable source must not silently look like an empty marketplace.
61
+
62
+ Current market limits are 5 MiB per file, 20 MiB total and 200 files per install. Market previews truncate after 300 KiB. ClawHub search results are capped at 50 because that search endpoint does not paginate. Local installed Markdown previews are limited to 2 MiB and reject oversized content.
63
+
64
+ ## 5. HTTP and browser behavior
65
+
66
+ ### 5.1 Transport and validation
67
+
68
+ One host prefix route serves the endpoints below. Responses are JSON with `Cache-Control: no-store`. Failures use `{ "error": { "code": "…", "message": "…" } }` and an appropriate non-2xx status. Methods, route depth, IDs, enum filters, body sizes and paths are validated. The connection gate can reject requests with 401/403.
69
+
70
+ The browser surfaces transport failures as `NETWORK_ERROR`; invalid successful JSON becomes `MARKET_UPSTREAM_BAD_RESPONSE`. Aborted superseded reads are control flow and must not appear as user-visible errors.
71
+
72
+ ### 5.2 Endpoints
73
+
74
+ All paths below are relative to `/api/skills-hub`.
75
+
76
+ | Method | Path / input | Success body |
77
+ | --- | --- | --- |
78
+ | GET | `/status` | `{ sources }` keyed by market source. |
79
+ | GET | `/skills?q=&source=&security=&installed=&cursor=&limit=` | `{ items, nextCursor, sources }`. |
80
+ | GET | `/skills/:source/:slug` | `{ skill, sourceStatus }`. |
81
+ | GET | `/skills/:source/:slug/file?path=…` | `{ file }`. |
82
+ | POST | `/install`, JSON `{ id }` | `{ ok: true, installedPath, skill }`. |
83
+ | POST | `/uninstall`, JSON `{ id }` | `{ ok: true, removedPath, skill }`; market-managed installation only. |
84
+ | GET | `/installed` | `{ items: InstalledSkillRecord[] }`; no provider request. |
85
+ | GET | `/installed/detail?key=…` | `{ item, markdown }`; reads the selected local copy. |
86
+ | POST | `/installed/uninstall`, JSON `{ key }` | `{ ok: true, removedPath, item }`; exact discovered entry. |
87
+
88
+ List `source` is `all`, `clawhub` or `skillhub`. `security` is `all`, `verified`, `benign`, `unknown` or `flagged`. `installed` is `all`, `installed` or `installable`; this filters the remote catalog and is distinct from the independent Installed view. `limit` is 1–100, defaulting to configured `pageSize`. Cursors are opaque and `null` means exhausted.
89
+
90
+ ### 5.3 Interaction contract
91
+
92
+ The marketplace shows skeleton cards on initial loading and a detail skeleton immediately after opening a card. An intersection observer inside the actual list scroll area loads the next page as the sentinel approaches view. It preserves loaded cards, deduplicates results and avoids concurrent duplicate loads. Pagination failures expose retry without discarding existing results.
93
+
94
+ Search/filter changes cancel superseded requests, reset pagination and reject stale responses. Installed management has its own loading, empty, error, search and refresh states. Its local detail reads the exact selected entry, and removal requires a confirmation showing its path; symlink removals explain that the target is preserved. Successful mutations update the displayed list and installed state. Buttons expose disabled/pending state during mutations.
95
+
96
+ ## 6. Configuration
97
+
98
+ `src/config.ts` is the configuration source of truth. Defaults:
99
+
100
+ | Key | Default |
101
+ | --- | --- |
102
+ | `skillsRoot` | `null` |
103
+ | `clawhubBaseUrl` | `https://clawhub.ai` |
104
+ | `skillhubBaseUrl` | `https://api.skillhub.cn` |
105
+ | `timeoutMs` | `15000` |
106
+ | `requestRetries` | `1` |
107
+ | `allowUninstall` | `true` |
108
+ | `pageSize` | `24` |
109
+
110
+ Timeout is at least 1000 ms, retries are nonnegative, and page size is 1–100. The uninstall switch covers market and local removal. Installation does not execute skill scripts; reviewing and later following third-party instructions remains a separate trust decision.
111
+
112
+ ## 7. Build, verification and release
113
+
114
+ Use the `packageManager` version in `package.json` and the single pnpm lockfile. All development `@deepseek-ai/dsh-*` packages use the exact supported cohort.
115
+
116
+ - `pnpm typecheck`: host and client TypeScript programs.
117
+ - `pnpm build`: clean `lib/`, compile both programs and bundle the client.
118
+ - `pnpm verify`: manifest checks and regression tests, including filesystem and HTTP behavior.
119
+ - `pnpm verify:release`: package, release note and compatibility metadata coherence.
120
+ - `pnpm check`: typecheck, build, verify and release metadata.
121
+ - `pnpm pack:check`: complete check plus npm tarball export/runtime-import closure and leak checks.
122
+
123
+ `prepack` and `prepublishOnly` run the complete check. Git retains generated `lib/`; npm includes the browser bundle and declarations while excluding intermediate `lib/client/` JavaScript. The registry preflight refuses collisions, existing versions and backwards stable releases. CI and publication workflow details live in [RELEASE.md](RELEASE.md).
124
+
125
+ Automated tests are distinct from exact-host/browser acceptance. The supported cohort, evidence and remaining scope belong in [COMPATIBILITY.md](COMPATIBILITY.md); widening peer ranges requires renewed host verification.
@@ -0,0 +1,24 @@
1
+ # Release 0.0.1
2
+
3
+ Package: `@nanmicoder/dsh-skills-hub`. Repository: `NanmiCoder/dsh-skills-hub`. Tag: `v0.0.1`. npm channel: `latest`. This is an initial plugin release, independent of the host's `0.2.0-rc.2` version.
4
+
5
+ ## Before making the repository public
6
+
7
+ 1. Run `pnpm install --frozen-lockfile` and `pnpm pack:check` on the intended release commit.
8
+ 2. Perform the exact-host acceptance described in [COMPATIBILITY.md](COMPATIBILITY.md), including a browser mount and real install/uninstall in a temporary skills root. Record the host tag, plugin commit, commands and results; fixture tests alone do not prove host acceptance.
9
+ 3. Review `git diff`, generated `lib/`, package contents and release notes. Commit source and build artifacts together. Never include credentials, profiles or acceptance-home contents.
10
+ 4. Confirm npm account permission for the `@nanmicoder` scope. The unscoped name is owned by someone else. Changing GitHub visibility alone does not grant npm permissions.
11
+
12
+ ## GitHub Actions publication
13
+
14
+ Publication runs online in `.github/workflows/release.yml`, matching the AgentTeams release model. Push `v0.0.1` to trigger it, or dispatch the workflow with an explicit version. Both Node 22.19 and 24 must pass validation. The Node 24 job uploads the built tarball and SHA-256 checksum; the publication job verifies and publishes that exact artifact using npm 11.19.0. It does not rebuild during publication. A GitHub Release is published only after npm succeeds.
15
+
16
+ Configure npm Trusted Publishing for GitHub owner `NanmiCoder`, repository `dsh-skills-hub`, workflow `release.yml`, environment `npm`, allowing direct publication. OIDC uses `id-token: write`; routine releases need no local npm login and no stored npm token. The existing AgentTeams trust binding is package-specific and does not authorize this new package.
17
+
18
+ For a brand-new package, npm requires an initial publication before its trusted publisher can be configured. If initial publication uses a short-lived granular token, place it only in this repository's `npm` environment as `NPM_TOKEN`, publish through the same Action, then remove/revoke the bootstrap token after configuring OIDC. Never commit or print credentials. npm may require browser-based security-key verification for these account operations.
19
+
20
+ Before tagging, commit all source and generated artifacts, confirm the version and release notes, and ensure the working tree is clean. Registry preflight rejects duplicate versions, repository collisions and backwards movement of `latest`. Do not move a published tag. The exact-commit bypass supported by the standalone preflight utility is not used by the online publication workflow.
21
+
22
+ ## After publication / recovery
23
+
24
+ Install `@nanmicoder/dsh-skills-hub@0.0.1` into an isolated profile and repeat the smoke flow. Compare the downloaded package and expected version before announcing availability. If a release is faulty, publish a new fixed version or deprecate the faulty version with a clear message; do not rewrite published Git tags or assume deleting a GitHub Release retracts npm. Preserve user skills when removing or replacing the plugin.