@deepseek-ai/dsh-skill 0.1.5-rc.1 → 0.1.6-alpha.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.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/skill/skill/README.md
5
- README.md: 5bddf8483547fc08aebeadf11c835c18482b9abe
6
- README.zh.md: 0bf87d9a8468b49d1cd1ed4da6e3d3ade23825f3
5
+ README.md: 00857c826d5f4a1893766d0305d475866250144e
6
+ README.zh.md: b2f150cda8c8eba94c5149a12c224582e24bc4e9
package/README.md CHANGED
@@ -65,6 +65,8 @@ An invocation policy on every skill decides which surfaces may advertise and loa
65
65
 
66
66
  A skill that any provider reports appears in the merged catalog, and loading it by its exact kebab-case name returns the body; an invalid name returns no skill rather than throwing. A provider that fails discovery is logged and skipped, and the observation is reported incomplete so consumers keep their last-good catalog; an explicit incomplete observation still contributes its candidates. A malformed candidate fails fast — the registry validates names, descriptions, invocation booleans, and provider ownership before caching or returning anything.
67
67
 
68
+ Skill summaries retain the winning provider’s optional instruction-file `path` for discovery consumers that offer file previews. Listing still reads no skill body, and model-facing catalogs continue to select only their owned routing fields.
69
+
68
70
  -----
69
71
 
70
72
  <a id="understand-the-implementation"></a>
@@ -79,7 +81,7 @@ This section explains how the registry merges, caches, and invalidates provider
79
81
 
80
82
  The package is built on one separation: the registry owns merging, winning resolution, and validation, while providers own where skills come from. A provider is a borrowed same-process object with a `list()` that returns candidates and a `get()` that loads a body; the registry never inspects skill content beyond validating its semantic fields.
81
83
 
82
- The registry is host+per-scope layered, the shape the tools registry established: a registration files into the layer of its calling context's scope — host rows and repository plugins land in the global layer, a plugin mounted by an agent preset's standing composition lands in that preset's layer. A read merges the global layer with the viewing scope's chain; the nearest layer wins a duplicate name outright, and within one layer duplicates resolve by rank, provider registration order, then provider-local order.
84
+ The registry is host+per-scope layered, the shape the tools registry established: a registration is filed into the layer of its calling context's scope — host rows and repository plugins land in the global layer, a plugin mounted by an agent preset's standing composition lands in that preset's layer. A read merges the global layer with the viewing scope's chain; the nearest layer wins a duplicate name outright, and within one layer duplicates resolve by rank, provider registration order, then provider-local order.
83
85
 
84
86
  ### Source map
85
87
 
package/README.zh.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "skill 提供方注册表,供选择、配置或排查来自任意来源的 skill 如何被合并、解析与加载的用户与维护者阅读。"
2
+ description: "skill(技能)提供方注册表,供选择、配置或排查来自任意来源的 skill 如何被合并、解析与加载的用户与维护者阅读。"
3
3
  kind: "package-reference"
4
4
  ---
5
5
 
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- 使用本包可让 agent(智能体)和用户通过一个目录访问从本地目录、嵌入式插件数据或远程服务收集的可复用任务专项指令。它会以可预测的方式裁决重名项、验证条目、在来源不可用时保留可用结果,并按需加载所选 skill(技能)的完整指令。当组合需要多个来源或非文件系统来源的 skill 时,请挂载本包;本包自身不含 skill 内容,因此本地发现需搭配 `dsh-skill-filesystem`,模型访问需搭配 `dsh-tool-skill`。
12
+ 使用本包可让 agent(智能体)和用户通过一个目录访问从本地目录、嵌入式插件数据或远程服务收集的可复用任务专项指令。它会以可预测的方式裁决重名项、验证条目、在来源不可用时保留可用结果,并按需加载所选 skill 的完整指令。当组合需要多个来源或非文件系统来源的 skill 时,请挂载本包;本包自身不含 skill 内容,因此本地发现需搭配 `dsh-skill-filesystem`,模型访问需搭配 `dsh-tool-skill`。
13
13
 
14
14
  ## 目录
15
15
 
@@ -65,6 +65,8 @@ kind: "package-reference"
65
65
 
66
66
  任意提供方报告的 skill 都会出现在合并目录中,按其精确 kebab-case 名称加载即可返回正文;无效名称返回无结果而非抛错。发现失败的提供方会被记录并跳过,观测被标记为不完整,因此消费方保留其最后一份可用目录;显式的不完整观测仍会贡献其候选项。格式错误的候选项会快速失败——注册表在缓存或返回任何内容之前,会先验证名称、描述、调用布尔值与提供方归属。
67
67
 
68
+ Skill 摘要保留胜出提供方可选的指令文件 `path`,供提供文件预览的发现消费者使用。列举仍不读取 skill 正文;面向模型的目录继续仅选择其负责的路由字段。
69
+
68
70
  -----
69
71
 
70
72
  <a id="understand-the-implementation"></a>
@@ -86,11 +88,11 @@ kind: "package-reference"
86
88
  | 文件 | 职责 |
87
89
  |---|---|
88
90
  | [`src/index.ts`](src/index.ts) | 插件入口、`SkillRegistry` 服务、候选项与定义验证、共享的面向模型渲染 |
89
- | — | 不发布运行时不变式伴生入口;provider/runtime map 与带 revision 的 cache registry 内原子变更,且没有独立 change event 或 snapshot 可供交叉核对。 |
91
+ | — | 不发布运行时不变式伴生入口;提供方/运行时 map 与带 revision 的 cache 在注册表内原子变更,且没有独立变更事件或快照可供交叉核对。 |
90
92
 
91
93
  ### 目录收集
92
94
 
93
- 读取(`list`/`snapshot`)会收集每一层的候选项:先是运行时 skill,再是各提供方的 `list()` 结果,提供方依次等待、失败被包含。候选项经验证后在层内去重,跨层合并;摘要按名称排序。完成的收集按 cwd、scope 链与 revision 缓存,上限为 `collectCacheMaxEntries`;读取中途提供方或运行时变更使 revision 递增时,进行中的收集会重试一次,第二次变更则返回最新候选项并标记为不完整、不予缓存。
95
+ 读取(`list`/`snapshot`)会收集每一层的候选项:先是运行时 skill,再是各提供方的 `list()` 结果,注册表会依次等待各提供方,并隔离失败。候选项经验证后在层内去重,跨层合并;摘要按名称排序。完成的收集按 cwd、scope 链与 revision 缓存,上限为 `collectCacheMaxEntries`;读取中途提供方或运行时变更使 revision 递增时,进行中的收集会重试一次,第二次变更则返回最新候选项并标记为不完整、不予缓存。
94
96
 
95
97
  ### 加载与陈旧
96
98
 
package/lib/index.js CHANGED
@@ -492,6 +492,7 @@ function toSummary(skill) {
492
492
  const { name, description, whenToUse, invocation, source, provider, resourceBase } = skill;
493
493
  return {
494
494
  name,
495
+ ...skill.path === void 0 ? {} : { path: skill.path },
495
496
  description,
496
497
  ...whenToUse !== void 0 ? { whenToUse } : {},
497
498
  invocation,
@@ -42,6 +42,8 @@ export interface SkillInvocationPolicy {
42
42
  }
43
43
  /** Invocation-neutral skill metadata returned by `ctx.skills.list()`. */
44
44
  export interface SkillSummary {
45
+ /** Absolute instruction file path when supplied by the provider; absent for virtual skills. */
46
+ readonly path?: string;
45
47
  /** Kebab-case identifier used to address the skill. */
46
48
  readonly name: string;
47
49
  /** Short routing description shown by discovery consumers. */
@@ -63,8 +65,6 @@ export interface SkillCandidate extends SkillSummary {
63
65
  readonly rank: number;
64
66
  /** Opaque provider-owned handle passed back to `provider.get()`. */
65
67
  readonly locator: unknown;
66
- /** Absolute file path when the provider has one. */
67
- readonly path?: string;
68
68
  /** Parsed optional metadata object from provider-specific skill frontmatter. */
69
69
  readonly metadata?: Readonly<Record<string, unknown>>;
70
70
  }
@@ -72,8 +72,6 @@ export interface SkillCandidate extends SkillSummary {
72
72
  export interface SkillDefinition extends SkillSummary {
73
73
  /** Markdown instruction body after any provider-specific metadata removal. */
74
74
  readonly content: string;
75
- /** Absolute file path when the skill came from disk. */
76
- readonly path?: string;
77
75
  /** Parsed optional metadata object from frontmatter. */
78
76
  readonly metadata?: Readonly<Record<string, unknown>>;
79
77
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-skill",
3
3
  "description": "Agent skill provider registry for the DeepSeek Harness",
4
- "version": "0.1.5-rc.1",
4
+ "version": "0.1.6-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -28,16 +28,16 @@
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
30
  "@deepseek-ai/cordis": "^4.0.2",
31
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
32
- "@deepseek-ai/dsh-scope": "^0.1.5-rc.1"
31
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
32
+ "@deepseek-ai/dsh-scope": "^0.1.6-alpha.1"
33
33
  },
34
34
  "dependencies": {
35
- "@deepseek-ai/dsh-util-values": "^0.1.5-rc.1",
36
- "@deepseek-ai/schemastery": "^3.18.2"
35
+ "@deepseek-ai/schemastery": "^3.18.2",
36
+ "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.2",
40
- "@deepseek-ai/dsh-scope": "^0.1.5-rc.1",
41
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1"
40
+ "@deepseek-ai/dsh-scope": "^0.1.6-alpha.1",
41
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.1"
42
42
  }
43
43
  }