@dsh-plus/agent-preset-rea 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/skill.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  /**
2
- * 预设作用域内的 skill 根解析:随包 REA 官方 skill + 配置追加目录。
2
+ * 预设作用域内的 skill 根解析:随包 REA 官方 skill(或手动更新副本)+ 配置追加目录。
3
3
  *
4
- * 两者都只加在本预设 `skill-filesystem` 行的 `customSkillDirs`(rank 300 的
5
- * **追加**根)上,因此不会进入项目根 / 用户根 / `$DSH_BUNDLED_SKILL_DIR`,
6
- * 其他预设的 skill 目录不受影响。
4
+ * 全部只加在本预设 `skill-filesystem` 行的 `customSkillDirs`(rank 300 的**追加**根)
5
+ * 上,因此不进入项目根 / 用户根 / `$DSH_BUNDLED_SKILL_DIR`,其他预设不受影响。
6
+ *
7
+ * 手动更新副本存在时**替代**随包根而不是并排:两者同名(`reverse-engineer-anything`),
8
+ * 并排只会得到「哪个生效」的歧义。
7
9
  * @module @dsh-plus/agent-preset-rea/skill
8
10
  */
9
11
  import { fileURLToPath } from 'node:url'
@@ -18,7 +20,15 @@ import type { AgentPresetReaConfig } from './config.ts'
18
20
  */
19
21
  export const BUNDLED_SKILL_ROOT = fileURLToPath(new URL('../skills', import.meta.url))
20
22
 
21
- /** skill-filesystem 的追加根清单:随包 REA skill 在前,配置追加目录随后。 */
22
- export function reaSkillDirs(config: AgentPresetReaConfig): string[] {
23
- return [BUNDLED_SKILL_ROOT, ...config.extraSkillDirs]
23
+ /**
24
+ * skill-filesystem 的追加根清单。
25
+ * @param config - 插件配置。
26
+ * @param updatedRoot - 手动更新副本根(存在即替代随包根;来自 manager 现探)。
27
+ */
28
+ export function reaSkillDirs(
29
+ config: AgentPresetReaConfig,
30
+ updatedRoot: string | null = null,
31
+ ): string[] {
32
+ const base = updatedRoot === null ? [BUNDLED_SKILL_ROOT] : [updatedRoot]
33
+ return [...base, ...config.extraSkillDirs]
24
34
  }