dsh-skill-hub 0.3.10 → 0.3.11

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 (121) hide show
  1. package/CONTRIBUTING.md +31 -3
  2. package/README.md +1 -1
  3. package/README.zh.md +1 -1
  4. package/lib/client.js +1440 -1335
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +788 -766
  7. package/lib/types/client/api.d.ts +1 -5
  8. package/lib/types/client/locales/common.d.ts +1 -3
  9. package/lib/types/client/locales/market.d.ts +13 -5
  10. package/lib/types/client/locales/settings.d.ts +0 -2
  11. package/lib/types/client/locales/skills.d.ts +11 -13
  12. package/lib/types/client/locales.d.ts +25 -23
  13. package/lib/types/client/panel/CollectionCard.d.ts +52 -0
  14. package/lib/types/client/panel/GroupSummary.d.ts +13 -4
  15. package/lib/types/client/panel/GroupSwitchButton.d.ts +24 -0
  16. package/lib/types/client/panel/PanelDialogs.d.ts +49 -0
  17. package/lib/types/client/panel/ProjectTree.d.ts +31 -0
  18. package/lib/types/client/panel/ReorderButtons.d.ts +15 -0
  19. package/lib/types/client/panel/SkillDetailView.d.ts +0 -1
  20. package/lib/types/client/panel/SkillHubPanel.d.ts +5 -4
  21. package/lib/types/client/panel/SkillRow.d.ts +23 -5
  22. package/lib/types/client/panel/hooks/shared.d.ts +6 -0
  23. package/lib/types/client/panel/hooks/useCatalogFlow.d.ts +1 -1
  24. package/lib/types/client/panel/hooks/useGroupFlow.d.ts +1 -2
  25. package/lib/types/client/panel/hooks/useMarketFlow.d.ts +11 -10
  26. package/lib/types/client/panel/hooks/useRepoImportFlow.d.ts +38 -0
  27. package/lib/types/client/panel/hooks/useSourceFlow.d.ts +1 -1
  28. package/lib/types/client/panel/useDragReorder.d.ts +34 -0
  29. package/lib/types/client/panel/useSkillHub.d.ts +1 -3
  30. package/lib/types/client/settings-card.d.ts +29 -39
  31. package/lib/types/concurrency.d.ts +6 -0
  32. package/lib/types/error-text.d.ts +7 -0
  33. package/lib/types/provider.d.ts +7 -0
  34. package/lib/types/repo/api.d.ts +36 -0
  35. package/lib/types/repo/discovery.d.ts +51 -0
  36. package/lib/types/repo/github-client.d.ts +0 -1
  37. package/lib/types/repo/install.d.ts +28 -0
  38. package/lib/types/repo/types.d.ts +22 -0
  39. package/lib/types/repo.d.ts +9 -120
  40. package/lib/types/routes/catalog-data.d.ts +31 -0
  41. package/lib/types/routes/collection.d.ts +13 -0
  42. package/lib/types/routes/deps.d.ts +70 -0
  43. package/lib/types/routes/helpers.d.ts +10 -110
  44. package/lib/types/routes/http.d.ts +39 -0
  45. package/lib/types/routes/route-state.d.ts +0 -2
  46. package/lib/types/skillfs/frontmatter.d.ts +20 -0
  47. package/lib/types/skillfs/paths.d.ts +7 -0
  48. package/lib/types/skillfs/scan.d.ts +40 -0
  49. package/lib/types/skillfs.d.ts +4 -64
  50. package/lib/types/stats/persistence.d.ts +48 -0
  51. package/lib/types/stats/scan.d.ts +52 -0
  52. package/lib/types/stats.d.ts +5 -84
  53. package/package.json +29 -28
  54. package/src/client/SkillHubSettingsCard.tsx +40 -98
  55. package/src/client/api.ts +0 -15
  56. package/src/client/locales/common.ts +2 -6
  57. package/src/client/locales/market.ts +25 -9
  58. package/src/client/locales/settings.ts +0 -4
  59. package/src/client/locales/skills.ts +22 -26
  60. package/src/client/panel/CollectionCard.tsx +125 -0
  61. package/src/client/panel/GroupSummary.tsx +16 -6
  62. package/src/client/panel/GroupSwitchButton.tsx +40 -0
  63. package/src/client/panel/MarketSourceRow.tsx +1 -1
  64. package/src/client/panel/PanelDialogs.tsx +161 -0
  65. package/src/client/panel/ProjectTree.tsx +106 -0
  66. package/src/client/panel/ReorderButtons.tsx +42 -0
  67. package/src/client/panel/RepoScanCard.tsx +21 -11
  68. package/src/client/panel/ScenesView.tsx +51 -26
  69. package/src/client/panel/SkillDetailView.tsx +1 -3
  70. package/src/client/panel/SkillHubPanel.tsx +99 -123
  71. package/src/client/panel/SkillRow.tsx +36 -17
  72. package/src/client/panel/SourcesView.tsx +103 -174
  73. package/src/client/panel/hooks/shared.ts +18 -0
  74. package/src/client/panel/hooks/useCatalogFlow.ts +14 -33
  75. package/src/client/panel/hooks/useGroupFlow.ts +8 -53
  76. package/src/client/panel/hooks/useMarketFlow.ts +26 -202
  77. package/src/client/panel/hooks/useMetaFlow.ts +2 -2
  78. package/src/client/panel/hooks/useRepoImportFlow.ts +197 -0
  79. package/src/client/panel/hooks/useSourceFlow.ts +11 -36
  80. package/src/client/panel/panel.module.css +121 -75
  81. package/src/client/panel/useDragReorder.ts +54 -0
  82. package/src/client/panel/useSkillHub.ts +12 -7
  83. package/src/client/settings-card.module.css +1 -1
  84. package/src/client/settings-card.tsx +52 -83
  85. package/src/concurrency.test.ts +33 -0
  86. package/src/concurrency.ts +19 -0
  87. package/src/error-text.test.ts +19 -0
  88. package/src/error-text.ts +10 -0
  89. package/src/index.ts +7 -7
  90. package/src/provider.test.ts +16 -0
  91. package/src/provider.ts +21 -2
  92. package/src/repo/api.ts +125 -0
  93. package/src/repo/discovery.ts +201 -0
  94. package/src/repo/github-client.ts +5 -10
  95. package/src/repo/install.ts +150 -0
  96. package/src/repo/types.ts +25 -0
  97. package/src/repo.ts +30 -503
  98. package/src/routes/catalog-data.ts +230 -0
  99. package/src/routes/catalog.ts +49 -46
  100. package/src/routes/collection.ts +36 -0
  101. package/src/routes/config.ts +2 -0
  102. package/src/routes/deps.ts +100 -0
  103. package/src/routes/groups.ts +15 -21
  104. package/src/routes/helpers.test.ts +57 -0
  105. package/src/routes/helpers.ts +43 -424
  106. package/src/routes/http.ts +119 -0
  107. package/src/routes/market.ts +10 -14
  108. package/src/routes/repo-import.ts +10 -12
  109. package/src/routes/route-state.test.ts +82 -0
  110. package/src/routes/route-state.ts +11 -6
  111. package/src/routes/sources.ts +18 -36
  112. package/src/routes.test.ts +40 -0
  113. package/src/skillfs/frontmatter.ts +179 -0
  114. package/src/skillfs/paths.ts +40 -0
  115. package/src/skillfs/scan.ts +175 -0
  116. package/src/skillfs.ts +11 -373
  117. package/src/stats/persistence.ts +85 -0
  118. package/src/stats/scan.ts +271 -0
  119. package/src/stats.test.ts +26 -0
  120. package/src/stats.ts +20 -363
  121. package/src/update.ts +8 -42
package/CONTRIBUTING.md CHANGED
@@ -9,20 +9,48 @@ Thanks for considering a contribution to **dsh-skill-hub**. This project is a
9
9
 
10
10
  Please keep both halves on official APIs — no dsh source patches.
11
11
 
12
+ ## Layout
13
+
14
+ ```
15
+ src/index.ts cordis plugin entry (config schema, settings namespace, stats wiring)
16
+ src/routes.ts route-family aggregator (wraps every domain handler in the shared fences)
17
+ src/routes/ one file per domain + shared layers:
18
+ http.ts (fences/JSON/error mapping), deps.ts (route deps + writable-skill
19
+ resolution), catalog-data.ts (catalog/detail assembly), collection.ts
20
+ (origin collections), route-state.ts (throttles + import-job table),
21
+ helpers.ts (barrel)
22
+ src/store.ts sidecar store barrel (paths / migrate / store)
23
+ src/skillfs.ts writable-root file ops + barrel (skillfs/paths.ts, frontmatter.ts, scan.ts)
24
+ src/repo.ts GitHub repo helpers barrel (repo/types.ts, discovery.ts, api.ts, install.ts,
25
+ github-client.ts = shared request layer)
26
+ src/stats.ts session-log statistics reader + barrel (stats/persistence.ts, stats/scan.ts)
27
+ src/provider.ts the hub's own ctx.skills provider (global layer)
28
+ src/protocol.ts wire contract barrel (protocol/<domain>.ts)
29
+ src/concurrency.ts bounded-concurrency map
30
+ src/error-text.ts unknown → one-line error text
31
+ src/client/index.tsx browser-half entry (slots + locale registration)
32
+ src/client/api.ts the panel's only data access path
33
+ src/client/panel/ panel shell, views, dialogs, hooks/ (one hook per domain + aggregator)
34
+ src/client/locales/ dictionaries by view (common/skills/market/sources/detail/settings)
35
+ ```
36
+
12
37
  ## Development setup
13
38
 
14
39
  ```bash
15
40
  npm install
16
41
  npm run typecheck # tsc --noEmit
17
- npm test # vitest (152 tests across 8 suites)
42
+ npm test # vitest (217 tests across 13 suites)
18
43
  npm run build # tsc declarations + tsdown bundles (lib/index.js + lib/client.js)
19
44
  ```
20
45
 
21
46
  ## Before opening a pull request
22
47
 
23
48
  1. **Typecheck** — `npm run typecheck` must pass.
24
- 2. **Tests** — `npm test` must pass; add/adjust tests for any behavior change. The suites live in
25
- `src/*.test.ts` and mirror the real route/store/filesystem/provider behavior.
49
+ 2. **Tests** — `npm test` must pass; add/adjust tests for any behavior change. Suites sit next to the
50
+ code they cover (`src/*.test.ts`, `src/routes/*.test.ts`) and mirror the real
51
+ route/store/filesystem/provider behavior. The browser half has no component-test harness
52
+ (vitest runs in the node environment); keep browser changes mechanical and verify them in the
53
+ live GUI.
26
54
  3. **Build** — `npm run build` must produce `lib/index.js` and `lib/client.js`.
27
55
  4. **Keep the diff focused** — one logical change per PR, with a clear title and description.
28
56
  5. **Documentation** — update `README.md` (including the embedded Chinese collapsible section) when
package/README.md CHANGED
@@ -24,7 +24,7 @@ dsh plugin --profile web add dsh-skill-hub
24
24
  # restart dsh web → Settings → 技能 → Market → scan → import
25
25
  ```
26
26
 
27
- Requires `Node ^22.19 || >=24` + dsh web (`0.1.2-alpha.5`, `0.1.x` forward compatible).
27
+ Requires `Node ^22.19 || >=24` + dsh web (`0.1.5-alpha.1`, `0.1.x` forward compatible).
28
28
 
29
29
  ## Features
30
30
 
package/README.zh.md CHANGED
@@ -24,7 +24,7 @@ dsh plugin --profile web add dsh-skill-hub
24
24
  # 重启 dsh web → 设置 → 技能 → 市场 → 扫描 → 导入
25
25
  ```
26
26
 
27
- 要求 `Node ^22.19 || >=24` + dsh web(`0.1.2-alpha.5`,兼容后续 `0.1.x`)。
27
+ 要求 `Node ^22.19 || >=24` + dsh web(`0.1.5-alpha.1`,兼容后续 `0.1.x`)。
28
28
 
29
29
  ## 功能
30
30