@capyclaw/skills-service 0.1.2 → 0.1.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 (2) hide show
  1. package/package.json +1 -1
  2. package/server.mjs +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capyclaw/skills-service",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "DSH 独立技能服务:聚合 @capyclaw/ppt-skill-* 的 SKILL.md 内容,HTTP 面暴露(GET /healthz、/skills、/skills/:name)。服务解耦标准形态:技能内容不再进程内注册,dsh 侧经 broker 的 skills 瘦客户端访问。",
5
5
  "type": "module",
6
6
  "main": "./server.mjs",
package/server.mjs CHANGED
@@ -67,12 +67,14 @@ async function loadProviders(dirs) {
67
67
  return providers
68
68
  }
69
69
 
70
- /** 候选技能目录:三种布局都要覆盖。
70
+ /** 候选技能目录:四种布局都要覆盖。
71
71
  * dev 树:../plugin/dsh-ppt-skill-*(磁盘目录保留旧名)。
72
- * npm 扁平安装:node_modules/@capyclaw/ppt-skill-*——注意父目录本身就是 @capyclaw
73
- * 作用域目录,ppt-skill-* 是它的直接子项,不是再嵌一层 @capyclaw。
74
- * pnpm 安装:本包真实路径在 <profile>/node_modules/.pnpm/<pkg>/node_modules/@capyclaw/skills-service,
75
- * 上溯 4 级是 <profile>/node_modules,套件依赖平铺在其 @capyclaw/ 下。 */
72
+ * npm 扁平安装:node_modules/@capyclaw/ppt-skill-*——父目录本身就是 @capyclaw
73
+ * 作用域目录,ppt-skill-* 是它的直接子项。
74
+ * pnpm 提升可见时:<profile>/node_modules/@capyclaw/ppt-skill-*(同上)。
75
+ * pnpm 严格布局:本包真实路径在 <profile>/node_modules/.pnpm/<pkg>/node_modules/@capyclaw/skills-service,
76
+ * 上溯 4 级是 .pnpm;技能包以虚拟目录 @capyclaw+ppt-skill-<x>@<ver> 平铺在 .pnpm 下,
77
+ * 每个虚拟目录的真实树在其 node_modules/@capyclaw/ 里。 */
76
78
  function defaultProviderDirs() {
77
79
  const roots = [
78
80
  path.resolve(HERE, '..', 'plugin'),
@@ -104,6 +106,11 @@ function defaultProviderDirs() {
104
106
  for (const s of scoped) {
105
107
  if (s.isDirectory() && s.name.startsWith('ppt-skill-')) add(path.join(root, e.name, s.name))
106
108
  }
109
+ } else if (e.name.startsWith('@capyclaw+ppt-skill-') && e.name.includes('@', '@capyclaw+ppt-skill-'.length)) {
110
+ // pnpm 虚拟目录:@capyclaw+ppt-skill-<x>@<version> → 真实树在 <dir>/node_modules/@capyclaw/<x>
111
+ const base = e.name.slice('@capyclaw+'.length).split('@')[0]
112
+ const real = path.join(root, e.name, 'node_modules', '@capyclaw', base)
113
+ if (fs.existsSync(path.join(real, 'package.json'))) add(real)
107
114
  }
108
115
  }
109
116
  }