Files
ZLH 766d3eb0b0 增加 DeepSeek Harness 市场源支持
- package.json 声明 dsh.bundle 与 dsh 引擎范围,供 DSH 作为 bundle 安装
- cordis.patch.yml 与 lib/index.js 注册只指向本包 skills 目录的技能提供方
- index.json 提供 format 1 市场索引,DSH 可通过索引地址发现并安装
- README 补充 DSH 安装方式与三处版本号的同步说明
2026-10-28 12:41:03 +08:00

38 lines
1.2 KiB
JavaScript

// DeepSeek Harness bundle 入口。
// 两种接线方式互斥:
// - 启动路径:cordis.patch.yml 直接插入技能提供方那一行,本模块不会被加载;
// - 热安装(profile 工具对本包调用 loader.create):本模块作为插件自行挂载同一个提供方,
// 无需重启即可让随包技能生效。
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
export const name = 'engineering-conventions';
const PROVIDER = '@deepseek-ai/dsh-skill-filesystem';
export function apply(ctx, config = {}) {
const skillRoot = config.bundledSkillDir
?? join(dirname(fileURLToPath(import.meta.url)), '..', 'skills');
ctx.effect(() => {
let entryId;
let disposed = false;
void ctx.loader.create({
name: PROVIDER,
config: {
providerName: 'engineering-conventions',
includeDefaultRoots: false,
bundledSkillDir: skillRoot,
},
}).then((id) => {
if (disposed) ctx.loader.remove(id);
else entryId = id;
}).catch((error) => {
console.error(`Failed to load ${PROVIDER} for ${name}.`, error);
});
return () => {
disposed = true;
if (entryId) ctx.loader.remove(entryId);
};
});
}