feat: 准备snapshot发布 - 简化角色系统,完善核心命令

This commit is contained in:
sean
2025-05-31 18:51:31 +08:00
parent 323c4e569c
commit dcd5f8ce1f
59 changed files with 1069 additions and 7117 deletions

View File

@ -37,7 +37,18 @@ class PromptProtocol extends ResourceProtocol {
* 设置注册表
*/
setRegistry(registry) {
this.registry = registry || {};
if (!registry) {
this.registry = new Map();
return;
}
// 如果传入的是普通对象转换为Map
if (registry instanceof Map) {
this.registry = registry;
} else {
// 从普通对象创建Map
this.registry = new Map(Object.entries(registry));
}
}
/**