更新资源管理器和协议处理逻辑:优化角色资源的合并方式,支持直接处理thought和execution的路径字符串,同时增强对@project://前缀的处理,提升路径解析的灵活性和准确性。
This commit is contained in:
@ -50,6 +50,10 @@ class ExecutionProtocol extends ResourceProtocol {
|
||||
// 处理 @package:// 前缀
|
||||
if (resolvedPath.startsWith('@package://')) {
|
||||
resolvedPath = resolvedPath.replace('@package://', '')
|
||||
} else if (resolvedPath.startsWith('@project://')) {
|
||||
// 处理 @project:// 前缀,转换为绝对路径
|
||||
const relativePath = resolvedPath.replace('@project://', '')
|
||||
resolvedPath = path.join(process.cwd(), relativePath)
|
||||
}
|
||||
|
||||
return resolvedPath
|
||||
|
||||
@ -49,6 +49,10 @@ class ThoughtProtocol extends ResourceProtocol {
|
||||
// 处理 @package:// 前缀
|
||||
if (resolvedPath.startsWith('@package://')) {
|
||||
resolvedPath = resolvedPath.replace('@package://', '')
|
||||
} else if (resolvedPath.startsWith('@project://')) {
|
||||
// 处理 @project:// 前缀,转换为绝对路径
|
||||
const relativePath = resolvedPath.replace('@project://', '')
|
||||
resolvedPath = path.join(process.cwd(), relativePath)
|
||||
}
|
||||
|
||||
return resolvedPath
|
||||
|
||||
Reference in New Issue
Block a user