fix(skill): align with DSH skill service declarations - #93
Merged
Conversation
Signed-off-by: 黄子懿 <i@anclx.cc>
Contributor
Author
|
我也不知道为啥, 原版没有成功注入 skills, 改了下类型定义就可以了 |
Contributor
Author
|
有点神秘, 应该是其他问题导致的没有注入 skill |
Collaborator
|
这个 PR 的主要改动:
对于最初观察到的“先注入失败,调整类型定义后成功”,目前不能把原因直接归结为类型定义本身引起。 ctx.inject(['skills'], (skillCtx) => {
skillCtx.skills.registerProvider(...)
})所以更合理的推测是这次修改同时带来的其他变化有所影响,包括:
因此重新将这个 PR 定义为:**让 GenUI 的 bundled skill 注册方式正式对齐 DSH 官方的 skill service declaration。**至于最初遇到的 skill 缺失,不把类型定义作为根本原因。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动内容
@deepseek-ai/dsh-skill依赖;SkillProvider;Context.skills,去掉手工的Context & { skills: ... }类型断言;SkillRegistry集成测试。原因
#89 已经通过
ctx.skills.registerProvider(...)实现了 bundledgenuiskill 注册,但当时为了接入skillsservice,在 GenUI 内部自行补了一套类型定义。DSH 官方的
@deepseek-ai/dsh-skill已经提供了SkillProvider,并对 CordisContext声明了ctx.skills: SkillRegistry,因此这里应直接使用官方定义,避免维护一份平行 contract。最初曾观察到“调整类型定义后 skill 可以正常注入”,但目前不把类型修改本身视为已确认的运行时根因。
import type、module augmentation 和类型断言在编译后都会被擦除,实际现象也可能受到依赖解析、重新构建/加载或宿主启动状态等因素影响。测试
真实
SkillRegistry集成测试覆盖:SkillRegistry → GenUI启动顺序;GenUI → SkillRegistry晚绑定顺序;ctx.skills.list()能发现genui;ctx.skills.get('genui')能读取 bundledSKILL.md;