@deepseek-ai/dsh-tool-skill 0.2.1-rc.5 → 0.2.2-alpha.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.
package/README.i18n.yaml CHANGED
@@ -9,8 +9,8 @@
9
9
  en: 223816f8da89cf76
10
10
  zh: 7c54534f299141eb
11
11
  /deepseek-ai-dsh-tool-skill/summary:
12
- en: 399399741476179c
13
- zh: 074ec6657481d320
12
+ en: b4180d01149b73ff
13
+ zh: 49da5065078a1407
14
14
  /deepseek-ai-dsh-tool-skill/table-of-contents:
15
15
  en: d152484eb41ac6b4
16
16
  zh: 09388d293f9be9cb
@@ -24,23 +24,23 @@
24
24
  en: 440b17442e431e27
25
25
  zh: f8e6d8ef9a954e86
26
26
  /deepseek-ai-dsh-tool-skill/use-this-package/what-the-model-gets:
27
- en: cf02796bd3f8877e
28
- zh: 81b93b1eb7f74690
27
+ en: 30977f5aac156d02
28
+ zh: 6641d32f1d6033ea
29
29
  /deepseek-ai-dsh-tool-skill/use-this-package/observable-success-and-failures:
30
- en: 813f1a7ab04d283e
31
- zh: 4adfcffcbb131d54
30
+ en: e84eb93d1b147fe1
31
+ zh: 6025da3f7d0009ad
32
32
  /deepseek-ai-dsh-tool-skill/understand-the-implementation:
33
33
  en: 1aa627255c35178f
34
34
  zh: 44d8633ea56765d3
35
35
  /deepseek-ai-dsh-tool-skill/understand-the-implementation/design-concept:
36
- en: ee4380c98437d699
37
- zh: 25f35ec8c8c47c00
36
+ en: c1faafc87c5bea50
37
+ zh: a0dc8d1f7365a139
38
38
  /deepseek-ai-dsh-tool-skill/understand-the-implementation/source-map:
39
39
  en: 509699e3a467df41
40
40
  zh: ff7fc30ec4998e5a
41
41
  /deepseek-ai-dsh-tool-skill/understand-the-implementation/catalog-lifecycle:
42
- en: 847745cf78860904
43
- zh: 55137ebef224ad48
42
+ en: c5a79c840eec02dc
43
+ zh: 724d52ed923b9285
44
44
  /deepseek-ai-dsh-tool-skill/understand-the-implementation/invocation-boundary:
45
45
  en: bb8543ea29cbc451
46
46
  zh: b1124fa489bf9ea4
@@ -54,14 +54,23 @@
54
54
  en: ed929c61dd301a56
55
55
  zh: 376c8d69b6fa7df6
56
56
  /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/what-the-model-sees:
57
- en: 9ad58d88958630db
58
- zh: 6ad1c30342e77fa4
57
+ en: 9bb1b510dc06df35
58
+ zh: 86992d045c4b62b3
59
+ /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/what-the-model-sees/incomplete-discovery-notice:
60
+ en: 30bbdd5d61a9e8c3
61
+ zh: 28f02400b5643331
62
+ /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/what-the-model-sees/initial-empty-incomplete-catalog:
63
+ en: bfed78cd16e0af12
64
+ zh: 7291a6e0bf95311f
65
+ /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/what-the-model-sees/empty-incomplete-replacement:
66
+ en: d71eb7aa26919abb
67
+ zh: 8f3e4db43aae3c6f
59
68
  /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/what-the-model-sees/skill-catalog-template:
60
69
  en: 8ca9241e26124ce3
61
70
  zh: d083f87eaae40e15
62
71
  /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/token-effect:
63
- en: c05d3d46e5139c4d
64
- zh: 8acfa475cddaeb18
72
+ en: 223a393b4d0d67d9
73
+ zh: d3dc5d22337abecb
65
74
  /deepseek-ai-dsh-tool-skill/model-experience/session-catalog/kv-cache-effect:
66
75
  en: e6e6758c96527e19
67
76
  zh: 8f95e36da658c95a
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- Agents can discover and load skills during a session. Before the first request, when model-invocable skills exist and the `skill` tool is visible, they receive a durable catalog of available skill names and capped descriptions, and can use the `skill` tool to load full instructions. Users can invoke a user-invocable skill with `/name`, which injects the same instructions into that step. Catalog changes append a complete replacement, including an empty catalog that retires old names; configure `catalogDescriptionMaxLength` to limit each description.
12
+ Agents can discover and load skills during a session. When the `skill` tool is visible, model-invocable skills or incomplete discovery produce a durable catalog before the first request. The tool loads full instructions; users can invoke user-invocable skills with `/name`. Entry, visibility, and completeness changes append a replacement catalog. Incomplete discovery publishes confirmed skills with a warning, including when none are confirmed. Configure `catalogDescriptionMaxLength` to cap descriptions.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -51,14 +51,14 @@ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-a
51
51
 
52
52
  ### What the model gets
53
53
 
54
- - **A session catalog.** When model-invocable skills exist and the `skill` tool is visible, the agent receives a durable user-role message before its first request, listing each skill's name and a capped description; the message tells the model to load a skill with the tool before acting on it, and never to infer instructions from the summary alone.
54
+ - **A session catalog.** When the `skill` tool is visible and either model-invocable skills exist or discovery is incomplete, the agent receives a durable user-role message before its first request, listing each confirmed skill's name and a capped description; a non-empty catalog tells the model to load a skill with the tool before acting on it, and never to infer instructions from the summary alone.
55
55
  - **A loader tool.** The model calls `skill` with the exact skill name and receives the full instruction body plus resource guidance in a canonical `<skill_content>` block; the result is retained as ordinary tool history.
56
56
  - **Explicit user invocation.** A `/name` token in direct user input that names a user-invocable skill injects that skill's instructions into the step, without the model having to load it.
57
- - **Live catalog updates.** Later membership, description, or visibility changes append a complete replacement catalog; removing every skill appends an empty catalog that retires older names.
57
+ - **Live catalog updates.** Later membership, description, visibility, or completeness changes append a replacement catalog; removing every skill appends an empty catalog that retires older names.
58
58
 
59
59
  ### Observable success and failures
60
60
 
61
- Loading a listed skill returns its full instructions; the model sees one canonical shape whether the load came from the tool or from a user's explicit invocation. An invalid name reports `Error: invalid skill name "<name>"`, an unknown name reports the skill is unknown or no longer available, and a skill disabled for model invocation reports it is not available for model invocation. The catalog is omitted entirely when no catalog was ever published and either no model-invocable skills exist or the `skill` tool is hidden or shadowed; after a catalog has been published, either visibility loss — the `skill` tool hidden or shadowed by a same-name scoped tool — or removal of every skill instead appends an empty catalog that retires older names.
61
+ Loading a listed skill returns its full instructions; the model sees one canonical shape whether the load came from the tool or from a user's explicit invocation. An invalid name reports `Error: invalid skill name "<name>"`, an unknown name reports the skill is unknown or no longer available, and a skill disabled for model invocation reports it is not available for model invocation. The catalog is omitted entirely when no catalog was ever published and either discovery is complete with no model-invocable skills or the `skill` tool is hidden or shadowed; after a catalog has been published, either visibility loss — the `skill` tool hidden or shadowed by a same-name scoped tool — or removal of every skill instead appends an empty catalog that retires older names.
62
62
 
63
63
  -----
64
64
 
@@ -72,7 +72,7 @@ This section explains how the catalog and the invocation boundary are built; the
72
72
 
73
73
  ### Design concept
74
74
 
75
- The package is built on two ideas. First, the catalog is a durable projection, diffed by a digest over the published entries rather than the rendered prose, so the `<system-reminder>` framing can never force a republish and consumers never re-parse the `<available_skills>` block. Second, one canonical rendering serves both load paths — the tool result and the user-explicit injection — through `renderSkillContent` shared from `dsh-skill`, so the model sees the same `<skill_content>` shape regardless of who initiated the load.
75
+ The package is built on two ideas. First, the catalog is a durable projection, diffed by a digest over the published entries and completeness rather than the rendered prose, so the `<system-reminder>` framing can never force a republish and consumers never re-parse the `<available_skills>` block. Second, one canonical rendering serves both load paths — the tool result and the user-explicit injection — through `renderSkillContent` shared from `dsh-skill`, so the model sees the same `<skill_content>` shape regardless of who initiated the load.
76
76
 
77
77
  ### Source map
78
78
 
@@ -82,7 +82,7 @@ The package is built on two ideas. First, the catalog is a durable projection, d
82
82
 
83
83
  ### Catalog lifecycle
84
84
 
85
- At each eligible `agent/pre-step`, the plugin snapshots the calling session's skill catalog, applies exact `skill` tool visibility, filters to model-invocable skills, and compares a digest of the entries against the newest visible `skill-catalog` message in the session log. When the digest changed, it hands the `enter` decision a durable user-role message containing the complete replacement catalog; an empty replacement explicitly retires earlier names. An incomplete provider snapshot emits nothing and preserves the last-good view for the next pre-step. The visibility check compares against the exact tool definition this plugin registered, so a scoped same-name shadow removes both the schema and its guidance; the plugin works mounted globally or inside one agent's composition.
85
+ At each eligible `agent/pre-step`, the plugin snapshots the calling session's skill catalog, applies exact `skill` tool visibility, filters to model-invocable skills, and compares a digest of the entries and completeness against the newest visible `skill-catalog` message in the session log. When the digest changed, it hands the `enter` decision a durable user-role message containing the replacement catalog; an empty replacement explicitly retires earlier names. An incomplete snapshot publishes its readable entries with a discovery warning and durable `incomplete: true` source metadata, including when no entries remain. Completeness participates in the digest, so recovery clears the warning even when the entries stay the same; incomplete observations are retried rather than cached. The visibility check compares against the exact tool definition this plugin registered, so a scoped same-name shadow removes both the schema and its guidance; the plugin works mounted globally or inside one agent's composition.
86
86
 
87
87
  ### Invocation boundary
88
88
 
@@ -111,7 +111,26 @@ Read these pages when the package-level contract is not enough. They move from t
111
111
 
112
112
  #### What the model sees
113
113
 
114
- If model-invocable skills exist and this exact `skill` tool is visible, the agent receives the catalog template below as a durable user-role message before the first request, with one data-dependent entry per sorted skill. Later membership, description, or visibility changes append a complete replacement using the same `<available_skills>` envelope; deleting every skill appends an empty envelope with an explicit instruction not to use older names. The template's closing sentence is the rule against double-loading: the user-explicit gesture boundary (the pre-step listener below) injects the same `renderSkillContent` output (shared from `@deepseek-ai/dsh-skill`) inline, and the catalog tells the model to follow that block instead of re-loading the skill through the tool; the replacement-catalog template carries the same anti-double-loading rule in both arms, including the emptied catalog.
114
+ If this exact `skill` tool is visible and either model-invocable skills exist or discovery is incomplete, the agent receives the catalog template below as a durable user-role message before the first request, with one data-dependent entry per sorted skill. Later membership, description, visibility, or completeness changes append a replacement using the same `<available_skills>` envelope; deleting every skill appends an empty envelope with an explicit instruction not to use older names. The template's closing sentence is the rule against double-loading: the user-explicit gesture boundary (the pre-step listener below) injects the same `renderSkillContent` output (shared from `@deepseek-ai/dsh-skill`) inline, and the catalog tells the model to follow that block instead of re-loading the skill through the tool; the replacement-catalog template carries the same anti-double-loading rule in both arms, including the emptied catalog.
115
+
116
+ ##### Incomplete discovery notice
117
+
118
+ ```markdown
119
+ Some skills could not be checked. Only confirmed skills are listed; a lower-priority definition of the same name may be selected when a preferred source is unavailable. Discovery will be retried on the next request.
120
+ ```
121
+
122
+ ##### Initial empty incomplete catalog
123
+
124
+ ```markdown
125
+ No skills could be confirmed in this discovery attempt.
126
+ Wait for an updated catalog before calling the `skill` tool. Do not infer skill instructions from an empty catalog.
127
+ ```
128
+
129
+ ##### Empty incomplete replacement
130
+
131
+ ```markdown
132
+ No skills could be confirmed in this discovery attempt. Do not use names from earlier skill catalogs.
133
+ ```
115
134
 
116
135
  ##### Skill catalog template
117
136
 
@@ -130,7 +149,7 @@ A user may also invoke a skill directly; its <skill_content> block then appears
130
149
 
131
150
  #### Token effect
132
151
 
133
- Repeated input cost scales with skill count and `catalogDescriptionMaxLength`; no initial catalog tokens are sent when the list is empty or the tool is hidden or shadowed. Each actual catalog change adds one retained complete replacement message.
152
+ Repeated input cost scales with skill count and `catalogDescriptionMaxLength`; no initial catalog tokens are sent when discovery is complete and empty or the tool is hidden or shadowed. Each entry or completeness change adds one retained replacement message; incomplete discovery adds a warning.
134
153
 
135
154
  #### KV Cache effect
136
155
 
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- agent 可以在会话期间发现并加载 skill。在首次请求前,如果存在模型可调用 skill 且 `skill` 工具可见,agent 会收到一份持久目录,列出可用 skill 的名称与有长度上限的描述,并可用 `skill` 工具加载完整指令。用户可以用 `/name` 调用某个用户可调用的 skill,把相同的指令注入该步骤。目录变更会追加一份完整替换,其中空目录会停用旧名称;可配置 `catalogDescriptionMaxLength` 来限制每条描述的长度。
12
+ agent 可以在会话期间发现并加载 skill。当 `skill` 工具可见时,只要存在模型可调用的 skill 或发现不完整,就会在首次请求前生成持久目录。工具加载完整指令;用户可以用 `/name` 调用用户可调用的 skill。条目、可见性和完整性变化会追加替换目录。发现不完整时会发布已确认的 skill 并附带警告,即使没有确认任何 skill。可配置 `catalogDescriptionMaxLength` 来限制描述长度。
13
13
 
14
14
  ## 目录
15
15
 
@@ -51,14 +51,14 @@ agent 可以在会话期间发现并加载 skill。在首次请求前,如果
51
51
 
52
52
  ### 模型得到什么
53
53
 
54
- - **会话目录。** 当存在模型可调用 skill 且 `skill` 工具可见时,agent 会在首次请求前收到一条持久的用户角色消息,列出每个 skill 的名称与有长度上限的描述;该消息告诉模型在着手任务前先用工具加载 skill,且绝不能仅凭摘要推断指令。
54
+ - **会话目录。** 当 `skill` 工具可见,且存在模型可调用 skill 或发现不完整时,agent 会在首次请求前收到一条持久的用户角色消息,列出每个已确认 skill 的名称与有长度上限的描述;非空目录告诉模型在着手任务前先用工具加载 skill,且绝不能仅凭摘要推断指令。
55
55
  - **加载工具。** 模型以精确的 skill 名称调用 `skill`,并收到完整指令正文以及规范的 `<skill_content>` 块中的资源指引;该结果作为普通工具历史保留。
56
56
  - **用户显式调用。** 直接用户输入中的 `/name` token 若指名某个用户可调用 skill,会把该 skill 的指令注入该步骤,而无需模型自行加载。
57
- - **实时目录更新。** 后续成员关系、描述或可见性变化会追加完整的替换目录;删除全部 skill 时会追加空目录,停用较早的名称。
57
+ - **实时目录更新。** 后续成员关系、描述、可见性或完整性变化会追加替换目录;删除全部 skill 时会追加空目录,停用较早的名称。
58
58
 
59
59
  ### 可观察的成功与失败
60
60
 
61
- 加载列出的 skill 会返回其完整指令;无论加载来自工具还是用户的显式调用,模型看到的都是同一种规范形态。无效名称会报告 `Error: invalid skill name "<name>"`,未知名称会报告该 skill 未知或已不可用,被禁用模型调用的 skill 会报告其不可用于模型调用。如果从未发布过目录,并且不存在模型可调用 skill,或 `skill` 工具被隐藏或遮蔽,则会整体省略目录;目录发布后,无论可见性丧失——`skill` 工具被隐藏或被同名作用域工具遮蔽——还是删除全部 skill,都会改为追加空目录来停用旧名称。
61
+ 加载列出的 skill 会返回其完整指令;无论加载来自工具还是用户的显式调用,模型看到的都是同一种规范形态。无效名称会报告 `Error: invalid skill name "<name>"`,未知名称会报告该 skill 未知或已不可用,被禁用模型调用的 skill 会报告其不可用于模型调用。如果从未发布过目录,并且发现完整且不存在模型可调用 skill,或 `skill` 工具被隐藏或遮蔽,则会整体省略目录;目录发布后,无论可见性丧失——`skill` 工具被隐藏或被同名作用域工具遮蔽——还是删除全部 skill,都会改为追加空目录来停用旧名称。
62
62
 
63
63
  -----
64
64
 
@@ -72,7 +72,7 @@ agent 可以在会话期间发现并加载 skill。在首次请求前,如果
72
72
 
73
73
  ### 设计理念
74
74
 
75
- 本包建立在两个想法之上。第一,目录是一种持久投影,按已发布条目的 digest 而非渲染后的正文做差异比较,因此 `<system-reminder>` 包装永远不会强制重新发布,消费方也不需要重新解析 `<available_skills>` 块。第二,一条规范渲染服务两条加载路径——工具结果与用户显式注入——经由共享自 `dsh-skill` 的 `renderSkillContent`,因此无论加载由谁发起,模型看到的都是同一种 `<skill_content>` 形态。
75
+ 本包建立在两个想法之上。第一,目录是一种持久投影,按已发布条目与完整性的 digest 而非渲染后的正文做差异比较,因此 `<system-reminder>` 包装永远不会强制重新发布,消费方也不需要重新解析 `<available_skills>` 块。第二,一条规范渲染服务两条加载路径——工具结果与用户显式注入——经由共享自 `dsh-skill` 的 `renderSkillContent`,因此无论加载由谁发起,模型看到的都是同一种 `<skill_content>` 形态。
76
76
 
77
77
  ### 源码地图
78
78
 
@@ -82,7 +82,7 @@ agent 可以在会话期间发现并加载 skill。在首次请求前,如果
82
82
 
83
83
  ### 目录生命周期
84
84
 
85
- 在每次符合条件的 `agent/pre-step`,插件都会快照调用会话的 skill 目录,应用 `skill` 工具的精确可见性,过滤出模型可调用的 skill,并把条目 digest 与会话日志中最新可见的 `skill-catalog` 消息做比较。digest 变化时,它把包含完整替换目录的持久用户角色消息交给 `enter` 决策;空替换会显式停用较早的名称。提供方快照不完整时不发送任何内容,并为下一次 pre-step 保留最后一份可用视图。可见性检查针对本插件所注册的精确工具定义,因此作用域内同名的遮蔽项会同时移除 schema 及其指引;该插件既可全局挂载,也可挂在单个 agent 的组合内。
85
+ 在每次符合条件的 `agent/pre-step`,插件都会快照调用会话的 skill 目录,应用 `skill` 工具的精确可见性,过滤出模型可调用的 skill,并把条目与完整性的 digest 同会话日志中最新可见的 `skill-catalog` 消息做比较。digest 变化时,它把包含替换目录的持久用户角色消息交给 `enter` 决策;空替换会显式停用较早的名称。快照不完整时仍会发布可读条目,并附带发现警告和持久化的 `incomplete: true` 来源元数据,即使已无可用条目。完整性也参与 digest,因此恢复后即使条目相同也会清除警告;不完整观测会重试而非缓存。可见性检查针对本插件所注册的精确工具定义,因此作用域内同名的遮蔽项会同时移除 schema 及其指引;该插件既可全局挂载,也可挂在单个 agent 的组合内。
86
86
 
87
87
  ### 调用边界
88
88
 
@@ -111,7 +111,26 @@ agent 可以在会话期间发现并加载 skill。在首次请求前,如果
111
111
 
112
112
  #### 模型看到什么
113
113
 
114
- 如果存在模型可调用 skill,且可见的正是这个 `skill` 工具,agent 会在第一个请求之前收到下方目录模板,其中包含每个已排序 skill 的一条随数据而定的条目。该目录是一条持久的用户角色消息。后续成员关系、描述或可见性的变化会使用同一个 `<available_skills>` 信封追加完整替换;删除所有 skill 时,会追加一个空信封,并明确指示不得使用旧名称。模板的结尾一句是防止双重加载的规则:用户显式的手势边界(下文的 pre-step 监听器)会把同一份 `renderSkillContent` 输出(共享自 `@deepseek-ai/dsh-skill`)内联注入,目录则告诉模型遵循该块,而不是再经工具重新加载该 skill;替换目录模板的两个分支——包括清空后的目录——都携带同一条防双重加载规则。
114
+ 如果可见的正是这个 `skill` 工具,且存在模型可调用 skill 或发现不完整,agent 会在第一个请求之前收到下方目录模板,其中包含每个已排序 skill 的一条随数据而定的条目。该目录是一条持久的用户角色消息。后续成员关系、描述、可见性或完整性的变化会使用同一个 `<available_skills>` 信封追加替换;删除所有 skill 时,会追加一个空信封,并明确指示不得使用旧名称。模板的结尾一句是防止双重加载的规则:用户显式的手势边界(下文的 pre-step 监听器)会把同一份 `renderSkillContent` 输出(共享自 `@deepseek-ai/dsh-skill`)内联注入,目录则告诉模型遵循该块,而不是再经工具重新加载该 skill;替换目录模板的两个分支——包括清空后的目录——都携带同一条防双重加载规则。
115
+
116
+ ##### 发现不完整提示
117
+
118
+ ```markdown
119
+ Some skills could not be checked. Only confirmed skills are listed; a lower-priority definition of the same name may be selected when a preferred source is unavailable. Discovery will be retried on the next request.
120
+ ```
121
+
122
+ ##### 不完整的初始空目录
123
+
124
+ ```markdown
125
+ No skills could be confirmed in this discovery attempt.
126
+ Wait for an updated catalog before calling the `skill` tool. Do not infer skill instructions from an empty catalog.
127
+ ```
128
+
129
+ ##### 不完整的空替换目录
130
+
131
+ ```markdown
132
+ No skills could be confirmed in this discovery attempt. Do not use names from earlier skill catalogs.
133
+ ```
115
134
 
116
135
  ##### Skill 目录模板
117
136
 
@@ -130,7 +149,7 @@ A user may also invoke a skill directly; its <skill_content> block then appears
130
149
 
131
150
  #### Token 影响
132
151
 
133
- 重复输入成本随 skill 数量和 `catalogDescriptionMaxLength` 增长;当列表为空或工具被隐藏或遮蔽时,不会发送初始目录 token。每次实际目录变更都会添加一条保留的完整替换消息。
152
+ 重复输入成本随 skill 数量和 `catalogDescriptionMaxLength` 增长;当发现完整且列表为空,或工具被隐藏或遮蔽时,不会发送初始目录 token。每次条目或完整性变化都会添加一条保留的替换消息;发现不完整时会附带警告。
134
153
 
135
154
  #### KV Cache 影响
136
155
 
package/lib/index.js CHANGED
@@ -941,41 +941,42 @@ function apply(ctx, config = {}) {
941
941
  complete: true
942
942
  };
943
943
  signal.throwIfAborted();
944
- if (!snapshot.complete) return decision;
945
944
  const skills = snapshot.skills.filter(isModelInvocable);
946
945
  const entries = catalogSourceEntries(skills, catalogDescriptionMaxLength);
947
- const digest = digestCatalogEntries(entries);
946
+ const incomplete = !snapshot.complete;
947
+ const digest = digestCatalogEntries(entries, incomplete);
948
948
  const history = catalogHistory(agent);
949
949
  const existing = catalogMessage(decision.messages);
950
950
  if (history.visibleDigest === digest) return existing === void 0 ? decision : {
951
951
  ...decision,
952
952
  messages: decision.messages.filter((message) => message.id !== existing.message.id)
953
953
  };
954
- if (existing !== void 0 && digestCatalogEntries(existing.entries) === digest) return decision;
955
- if (!history.published && skills.length === 0) return existing === void 0 ? decision : {
954
+ if (existing !== void 0 && digestCatalogEntries(existing.entries, existing.incomplete) === digest) return decision;
955
+ if (!history.published && skills.length === 0 && !incomplete) return existing === void 0 ? decision : {
956
956
  ...decision,
957
957
  messages: decision.messages.filter((message) => message.id !== existing.message.id)
958
958
  };
959
- const catalog = history.published ? renderCatalogUpdate(entries) : renderCatalogMessage(entries);
959
+ const catalog = history.published ? renderCatalogUpdate(entries, incomplete) : renderCatalogMessage(entries, incomplete);
960
960
  return {
961
961
  ...decision,
962
962
  messages: existing === void 0 ? [...decision.messages, catalog] : decision.messages.map((message) => message.id === existing.message.id ? catalog : message)
963
963
  };
964
964
  });
965
965
  }
966
- function renderCatalogMessage(entries) {
966
+ function renderCatalogMessage(entries, incomplete) {
967
967
  return createUserMessage({
968
968
  content: [{
969
969
  type: "text",
970
970
  text: [
971
971
  "<system-reminder>",
972
- "A skill is a reusable set of task-specific instructions. The following skills are available in this session:",
972
+ entries.length === 0 ? "No skills could be confirmed in this discovery attempt." : "A skill is a reusable set of task-specific instructions. The following skills are available in this session:",
973
973
  "",
974
974
  "<available_skills>",
975
975
  ...renderCatalogEntries(entries),
976
976
  "</available_skills>",
977
977
  "",
978
- "If the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.",
978
+ ...incomplete ? [incompleteCatalogNotice(), ""] : [],
979
+ entries.length === 0 ? "Wait for an updated catalog before calling the `skill` tool. Do not infer skill instructions from an empty catalog." : "If the user names a skill, or the task clearly matches a skill's description, call the `skill` tool with the exact skill name before taking task actions. Load all applicable skills, then follow their full instructions. This catalog contains summaries only; do not infer or follow a skill's instructions until it has been loaded.",
979
980
  "A user may also invoke a skill directly; its <skill_content> block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill.",
980
981
  "</system-reminder>"
981
982
  ].join("\n")
@@ -983,23 +984,25 @@ function renderCatalogMessage(entries) {
983
984
  source: {
984
985
  kind: "skill-catalog",
985
986
  form: "catalog",
986
- entries
987
+ entries,
988
+ ...incomplete ? { incomplete: true } : {}
987
989
  }
988
990
  });
989
991
  }
990
- function renderCatalogUpdate(entries) {
991
- const availability = entries.length === 0 ? ["No skills are currently available through the `skill` tool. Do not use names from earlier skill catalogs.", "A user may still invoke a skill directly; its <skill_content> block then appears in this conversation. Follow it, and do not call the `skill` tool for it."] : ["Use only names in this replacement catalog. If the user names a listed skill, or the task clearly matches its description, call the `skill` tool with the exact name before acting.", "A user may also invoke a skill directly; its <skill_content> block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill."];
992
+ function renderCatalogUpdate(entries, incomplete) {
993
+ const availability = entries.length === 0 ? [incomplete ? "No skills could be confirmed in this discovery attempt. Do not use names from earlier skill catalogs." : "No skills are currently available through the `skill` tool. Do not use names from earlier skill catalogs.", "A user may still invoke a skill directly; its <skill_content> block then appears in this conversation. Follow it, and do not call the `skill` tool for it."] : ["Use only names in this replacement catalog. If the user names a listed skill, or the task clearly matches its description, call the `skill` tool with the exact name before acting.", "A user may also invoke a skill directly; its <skill_content> block then appears in this conversation. Follow it, and do not call the `skill` tool again for that skill."];
992
994
  return createUserMessage({
993
995
  content: [{
994
996
  type: "text",
995
997
  text: [
996
998
  "<system-reminder>",
997
- "The available skill catalog changed. This complete catalog replaces every earlier available-skills list in this session:",
999
+ incomplete ? "Skill discovery is incomplete. This catalog of currently available skills replaces every earlier available-skills list in this session:" : "The available skill catalog changed. This complete catalog replaces every earlier available-skills list in this session:",
998
1000
  "",
999
1001
  "<available_skills>",
1000
1002
  ...renderCatalogEntries(entries),
1001
1003
  "</available_skills>",
1002
1004
  "",
1005
+ ...incomplete ? [incompleteCatalogNotice(), ""] : [],
1003
1006
  ...availability,
1004
1007
  "</system-reminder>"
1005
1008
  ].join("\n")
@@ -1008,10 +1011,14 @@ function renderCatalogUpdate(entries) {
1008
1011
  kind: "skill-catalog",
1009
1012
  form: "catalog",
1010
1013
  update: true,
1011
- entries
1014
+ entries,
1015
+ ...incomplete ? { incomplete: true } : {}
1012
1016
  }
1013
1017
  });
1014
1018
  }
1019
+ function incompleteCatalogNotice() {
1020
+ return "Some skills could not be checked. Only confirmed skills are listed; a lower-priority definition of the same name may be selected when a preferred source is unavailable. Discovery will be retried on the next request.";
1021
+ }
1015
1022
  /**
1016
1023
  * Model-facing catalog lines, projected from the same entries the source records.
1017
1024
  * The pseudo-XML escaping belongs to this frame, not to the published fact, so it
@@ -1022,13 +1029,12 @@ function renderCatalogEntries(entries) {
1022
1029
  return entries.map((entry) => `- \`${entry.name}\`: ${escapeText(entry.description)}`);
1023
1030
  }
1024
1031
  /**
1025
- * Catalog identity over the durable entry list rather than the rendered prose.
1026
- * The entries are what changes; the surrounding `<system-reminder>` framing is
1027
- * written for the model and must not decide whether a republish is needed.
1032
+ * Catalog identity includes durable entries and completeness so recovery clears
1033
+ * a discovery warning even when the entries are unchanged.
1028
1034
  */
1029
- function digestCatalogEntries(entries) {
1035
+ function digestCatalogEntries(entries, incomplete = false) {
1030
1036
  const canonical = entries.map((entry) => JSON.stringify([entry.name, entry.description])).join("\n");
1031
- return createHash("sha256").update(canonical).digest("hex");
1037
+ return createHash("sha256").update(incomplete ? "incomplete\n" : "").update(canonical).digest("hex");
1032
1038
  }
1033
1039
  /**
1034
1040
  * Entries of one durable catalog message, or undefined when the record is not a
@@ -1065,7 +1071,7 @@ function catalogHistory(agent) {
1065
1071
  if (event.type !== "user/message" || event.data.source.kind !== "skill-catalog") continue;
1066
1072
  const entries = readCatalogEntries(event.data.source);
1067
1073
  if (entries === void 0) continue;
1068
- const digest = digestCatalogEntries(entries);
1074
+ const digest = digestCatalogEntries(entries, event.data.source.incomplete === true);
1069
1075
  published = true;
1070
1076
  if (visible.has(event.seq)) return {
1071
1077
  visibleDigest: digest,
@@ -1080,7 +1086,8 @@ function catalogMessage(messages) {
1080
1086
  const entries = readCatalogEntries(message.source);
1081
1087
  if (entries !== void 0) return {
1082
1088
  message,
1083
- entries
1089
+ entries,
1090
+ incomplete: message.source.incomplete === true
1084
1091
  };
1085
1092
  }
1086
1093
  }
@@ -18,6 +18,8 @@ export interface SkillCatalogSource {
18
18
  readonly form: 'catalog';
19
19
  /** Marks a replacement catalog rather than this session's first publication. */
20
20
  readonly update?: true;
21
+ /** Some discovery failed; entries contain only skills found in this observation. Absence means complete. */
22
+ readonly incomplete?: true;
21
23
  /** Exactly the entries this message published, in catalog order. */
22
24
  readonly entries: readonly {
23
25
  readonly name: string;
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Tool zum Laden von Fertigkeiten",
4
+ "description": "Lassen Sie die KI bei Bedarf Fertigkeitsbeschreibungen laden."
5
+ }
6
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Herramienta de carga de habilidades",
4
+ "description": "Deje que la IA cargue descripciones de habilidades a pedido."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Outil de chargement de compétences",
4
+ "description": "Laissez l’IA charger les descriptions de compétences à la demande."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "スキル読み込みツール",
4
+ "description": "AI が必要に応じてスキルの説明を読み込めます。"
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Ferramenta de carregamento de habilidades",
4
+ "description": "Deixe a IA carregar descrições de habilidades sob demanda."
5
+ }
6
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Инструмент загрузки навыков",
4
+ "description": "Позвольте ИИ загружать описания навыков по требованию."
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-skill",
3
3
  "description": "Model-facing skill loading tool for the DeepSeek Harness",
4
- "version": "0.2.1-rc.5",
4
+ "version": "0.2.2-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,26 +29,28 @@
29
29
  ],
30
30
  "license": "MIT",
31
31
  "peerDependencies": {
32
- "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
33
- "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
34
- "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
35
- "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
36
- "@deepseek-ai/cordis": "~4.0.5",
37
- "@deepseek-ai/dsh-working-directory": "0.2.1-rc.5"
32
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.3",
33
+ "@deepseek-ai/dsh-llm": "0.2.2-alpha.3",
34
+ "@deepseek-ai/dsh-skill": "0.2.2-alpha.3",
35
+ "@deepseek-ai/dsh-tools": "0.2.2-alpha.3",
36
+ "@deepseek-ai/cordis": "~4.0.6-alpha.2",
37
+ "@deepseek-ai/dsh-working-directory": "0.2.2-alpha.3"
38
38
  },
39
39
  "dependencies": {
40
- "@deepseek-ai/schemastery": "~3.18.5"
40
+ "@deepseek-ai/schemastery": "~3.18.6-alpha.2"
41
41
  },
42
42
  "devDependencies": {
43
- "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
44
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-rc.5",
45
- "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
46
- "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
47
- "@deepseek-ai/dsh-session": "0.2.1-rc.5",
48
- "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
49
- "@deepseek-ai/dsh-skill-filesystem": "0.2.1-rc.5",
50
- "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
51
- "@deepseek-ai/cordis": "~4.0.5",
52
- "@deepseek-ai/dsh-working-directory": "0.2.1-rc.5"
43
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.3",
44
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-alpha.3",
45
+ "@deepseek-ai/dsh-llm": "0.2.2-alpha.3",
46
+ "@deepseek-ai/dsh-scope": "0.2.2-alpha.3",
47
+ "@deepseek-ai/dsh-session": "0.2.2-alpha.3",
48
+ "@deepseek-ai/dsh-skill": "0.2.2-alpha.3",
49
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.2-alpha.3",
50
+ "@deepseek-ai/dsh-tool-executor-native": "0.2.2-alpha.3",
51
+ "@deepseek-ai/dsh-tool-testkit": "0.2.2-alpha.3",
52
+ "@deepseek-ai/dsh-tools": "0.2.2-alpha.3",
53
+ "@deepseek-ai/cordis": "~4.0.6-alpha.2",
54
+ "@deepseek-ai/dsh-working-directory": "0.2.2-alpha.3"
53
55
  }
54
56
  }