refactor: 统一资源文件结构 - 移动package.registry.json到resource目录
将package.registry.json从src/目录移动到resource/目录,实现资源文件的统一管理: 文件变更: - 移动: src/package.registry.json → resource/package.registry.json - 更新: scripts/generate-package-registry.js - 修改输出路径 - 更新: src/lib/core/resource/discovery/PackageDiscovery.js - 更新4处路径引用 * _getRegistryPath() 方法(2处) * _loadPackageRegistry() 方法 * getRegistryData() 方法 架构优化: - 所有资源文件统一集中在resource/目录下 - 简化项目结构,提升语义清晰度 - 保持系统功能完全正常:角色发现、注册表生成、系统初始化 新的统一结构: 📁 resource/ ├── 📄 package.registry.json (新位置) ├── 📁 core/ (核心思维模式) ├── 📁 role/ (角色文件) ├── 📁 tool/ (工具文件) └── 📁 protocol/ (协议定义) 功能验证: ✅ 角色发现正常 (4个核心角色) ✅ 注册表生成正常 (23个资源) ✅ 系统初始化正常 ✅ 路径引用全部更新 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -100,10 +100,10 @@ class PackageDiscovery extends FilePatternDiscovery {
|
||||
avoidUserHome: true
|
||||
}
|
||||
const projectRoot = await this.directoryService.getProjectRoot(context)
|
||||
this.registryPath = path.join(projectRoot, 'src/package.registry.json')
|
||||
this.registryPath = path.join(projectRoot, 'resource/package.registry.json')
|
||||
} catch (error) {
|
||||
// 回退到默认路径
|
||||
this.registryPath = path.join(process.cwd(), 'src/package.registry.json')
|
||||
this.registryPath = path.join(process.cwd(), 'resource/package.registry.json')
|
||||
}
|
||||
}
|
||||
return this.registryPath
|
||||
@ -208,7 +208,7 @@ class PackageDiscovery extends FilePatternDiscovery {
|
||||
try {
|
||||
// 查找package.registry.json文件位置
|
||||
const packageRoot = await this._findPackageRoot()
|
||||
const registryPath = path.join(packageRoot, 'src', 'package.registry.json')
|
||||
const registryPath = path.join(packageRoot, 'resource', 'package.registry.json')
|
||||
|
||||
// 使用RegistryData统一管理
|
||||
const registryData = await RegistryData.fromFile('package', registryPath)
|
||||
@ -509,7 +509,7 @@ class PackageDiscovery extends FilePatternDiscovery {
|
||||
try {
|
||||
// 查找package.registry.json文件位置
|
||||
const packageRoot = await this._findPackageRoot()
|
||||
const registryPath = path.join(packageRoot, 'src', 'package.registry.json')
|
||||
const registryPath = path.join(packageRoot, 'resource', 'package.registry.json')
|
||||
|
||||
// 直接加载RegistryData
|
||||
const registryData = await RegistryData.fromFile('package', registryPath)
|
||||
|
||||
Reference in New Issue
Block a user