@nanmicoder/dsh-skills-hub 0.0.1 → 0.0.3

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/CONTRIBUTING.md +22 -0
  2. package/README.md +32 -82
  3. package/README_EN.md +32 -82
  4. package/README_ZH.md +2 -0
  5. package/assets/readme/marketplace.png +0 -0
  6. package/compatibility.json +1 -1
  7. package/docs/CATALOG.md +39 -0
  8. package/docs/COMPATIBILITY.md +46 -0
  9. package/docs/CONFIGURATION.md +38 -0
  10. package/docs/CONTRACT.md +35 -12
  11. package/docs/RELEASE.md +5 -5
  12. package/lib/catalog/catalog.js +89 -0
  13. package/lib/catalog/skills.json +8673 -0
  14. package/lib/client.js +3349 -1728
  15. package/lib/client.js.map +1 -1
  16. package/lib/config.js +2 -0
  17. package/lib/index.js +16 -6
  18. package/lib/market/cache.js +104 -30
  19. package/lib/market/clawhub-provider.js +139 -22
  20. package/lib/market/disk-cache.js +113 -0
  21. package/lib/market/install-service.js +24 -11
  22. package/lib/market/market-service.js +161 -32
  23. package/lib/market/provider-fetch.js +9 -2
  24. package/lib/market/skillhub-provider.js +6 -2
  25. package/lib/market/types.js +2 -1
  26. package/lib/skills/installed.js +5 -0
  27. package/lib/skills/management.js +182 -4
  28. package/lib/skills/root.js +1 -1
  29. package/lib/types/catalog/catalog.d.ts +73 -0
  30. package/lib/types/client/api.d.ts +45 -8
  31. package/lib/types/client/components/CategoryBar.d.ts +13 -0
  32. package/lib/types/client/components/FilterBar.d.ts +4 -0
  33. package/lib/types/client/components/InstallConfirmDialog.d.ts +20 -11
  34. package/lib/types/client/components/InstalledSkillDetail.d.ts +24 -0
  35. package/lib/types/client/components/InstalledSkills.d.ts +18 -1
  36. package/lib/types/client/components/MarkdownView.d.ts +7 -1
  37. package/lib/types/client/components/MarketSkillDetail.d.ts +34 -0
  38. package/lib/types/client/components/SkillAvatar.d.ts +1 -1
  39. package/lib/types/client/components/SkillDetailShell.d.ts +86 -0
  40. package/lib/types/client/components/SkillFiles.d.ts +32 -0
  41. package/lib/types/client/components/SourceStatusBar.d.ts +4 -0
  42. package/lib/types/client/icons.d.ts +4 -0
  43. package/lib/types/client/locales.d.ts +94 -0
  44. package/lib/types/client/relative-time.d.ts +13 -0
  45. package/lib/types/client/skill-insights.d.ts +30 -0
  46. package/lib/types/client/skill-markdown.d.ts +39 -0
  47. package/lib/types/client/state.d.ts +36 -7
  48. package/lib/types/config.d.ts +2 -0
  49. package/lib/types/market/cache.d.ts +62 -14
  50. package/lib/types/market/clawhub-provider.d.ts +15 -0
  51. package/lib/types/market/disk-cache.d.ts +16 -0
  52. package/lib/types/market/install-service.d.ts +1 -0
  53. package/lib/types/market/market-service.d.ts +40 -6
  54. package/lib/types/market/provider-fetch.d.ts +2 -0
  55. package/lib/types/market/types.d.ts +29 -0
  56. package/lib/types/skills/installed.d.ts +4 -0
  57. package/lib/types/skills/management.d.ts +63 -2
  58. package/lib/types/skills/root.d.ts +8 -0
  59. package/lib/types/web-routes.d.ts +3 -1
  60. package/lib/web-routes.js +85 -8
  61. package/package.json +1 -1
  62. package/release-notes/v0.0.1.md +1 -1
  63. package/release-notes/v0.0.2.md +12 -0
  64. package/release-notes/v0.0.3.md +12 -0
  65. package/lib/types/client/components/InstallStateBadge.d.ts +0 -11
  66. package/lib/types/client/components/SecurityBadge.d.ts +0 -16
  67. package/lib/types/client/components/SkillDetailView.d.ts +0 -21
package/docs/RELEASE.md CHANGED
@@ -1,8 +1,8 @@
1
- # Release 0.0.1
1
+ # Release 0.0.3
2
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.
3
+ Package: `@nanmicoder/dsh-skills-hub`. Repository: `NanmiCoder/dsh-skills-hub`. Tag: `v0.0.3`. npm channel: `latest`. This plugin release is independent of the host's `0.2.0-rc.2` version and retains that exact compatibility cohort.
4
4
 
5
- ## Before making the repository public
5
+ ## Before publication
6
6
 
7
7
  1. Run `pnpm install --frozen-lockfile` and `pnpm pack:check` on the intended release commit.
8
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.
@@ -11,7 +11,7 @@ Package: `@nanmicoder/dsh-skills-hub`. Repository: `NanmiCoder/dsh-skills-hub`.
11
11
 
12
12
  ## GitHub Actions publication
13
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.
14
+ Publication runs online in `.github/workflows/release.yml`, matching the AgentTeams release model. Push `v0.0.3` 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
15
 
16
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
17
 
@@ -21,4 +21,4 @@ Before tagging, commit all source and generated artifacts, confirm the version a
21
21
 
22
22
  ## After publication / recovery
23
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.
24
+ Install `@nanmicoder/dsh-skills-hub@0.0.3` 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.
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Curated catalogue — the marketplace's home list.
3
+ *
4
+ * The upstream registries hold ~80k ClawHub and ~110k SkillHub skills; nobody
5
+ * chooses from that. The home list is instead a few hundred skills reviewed in
6
+ * this repository (`catalog/curation.json`) and snapshotted by
7
+ * `scripts/catalog-refresh.mjs` into `skills.json`, which ships with the plugin.
8
+ *
9
+ * Only the *list* comes from the snapshot. Opening a card, reading a file and
10
+ * installing still go to the owning registry (through the usual cache), so a
11
+ * reader never installs the snapshot's version of anything.
12
+ */
13
+ import data from './skills.json' with { type: 'json' };
14
+ import { skillId, } from "../market/types.js";
15
+ const catalog = data;
16
+ export function getCatalog() {
17
+ return catalog;
18
+ }
19
+ const bySkillId = new Map(catalog.skills.map((entry) => [skillId(entry.source, entry.slug), entry]));
20
+ export function catalogEntryFor(source, slug) {
21
+ return bySkillId.get(skillId(source, slug));
22
+ }
23
+ /** Category bar entries, in editorial order, with how many skills each holds. */
24
+ export function catalogCategories() {
25
+ const counts = new Map();
26
+ for (const entry of catalog.skills)
27
+ counts.set(entry.category, (counts.get(entry.category) ?? 0) + 1);
28
+ return catalog.categories
29
+ .map((category, index) => ({ ...category, sortOrder: index, count: counts.get(category.key) ?? 0 }))
30
+ .filter((category) => category.count > 0);
31
+ }
32
+ /** ClawHub owners the catalogue pins, for the provider's slug disambiguation. */
33
+ export function catalogClawhubOwners() {
34
+ return catalog.skills.filter((entry) => entry.source === 'clawhub').map((entry) => [entry.slug, entry.owner]);
35
+ }
36
+ export function catalogEntryToSkill(entry) {
37
+ return {
38
+ id: skillId(entry.source, entry.slug),
39
+ source: entry.source,
40
+ slug: entry.slug,
41
+ name: entry.name,
42
+ summary: entry.summary,
43
+ author: { handle: entry.owner },
44
+ stats: { ...entry.stats },
45
+ tags: [...entry.tags],
46
+ category: entry.category,
47
+ version: entry.version,
48
+ updatedAt: entry.updatedAt,
49
+ iconUrl: entry.iconUrl,
50
+ securityStatus: entry.security,
51
+ requiresApiKey: entry.requiresApiKey,
52
+ featured: entry.featured === true ? true : undefined,
53
+ installState: 'installable',
54
+ };
55
+ }
56
+ /** Fold case and width so `GitHub`, `github` and full-width input all match. */
57
+ function fold(text) {
58
+ return text.normalize('NFKC').toLowerCase();
59
+ }
60
+ /**
61
+ * Entries matching every whitespace-separated term, in catalogue order.
62
+ *
63
+ * A name/slug hit ranks above a summary or tag hit: typing a skill's name
64
+ * should put that skill first, not the one that mentions it most.
65
+ */
66
+ export function filterCatalog(params) {
67
+ const terms = fold(params.q ?? '').split(/\s+/).filter(Boolean);
68
+ const strong = [];
69
+ const weak = [];
70
+ for (const entry of catalog.skills) {
71
+ if (params.category && entry.category !== params.category)
72
+ continue;
73
+ if (params.source && params.source !== 'all' && entry.source !== params.source)
74
+ continue;
75
+ if (terms.length === 0) {
76
+ strong.push(entry);
77
+ continue;
78
+ }
79
+ const head = fold(`${entry.name} ${entry.slug}`);
80
+ const body = fold(`${entry.summary} ${entry.summaryEn ?? ''} ${entry.tags.join(' ')} ${entry.owner}`);
81
+ if (!terms.every((term) => head.includes(term) || body.includes(term)))
82
+ continue;
83
+ if (terms.every((term) => head.includes(term)))
84
+ strong.push(entry);
85
+ else
86
+ weak.push(entry);
87
+ }
88
+ return [...strong, ...weak];
89
+ }