pi-skill-evolve 0.1.0 → 0.1.2

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.
@@ -16,10 +16,17 @@ import * as path from "node:path";
16
16
 
17
17
  import { compileRules, listSkillDirs, loadHardRules, scanSkillsDir, scanText } from "../lib/hard-rules.ts";
18
18
 
19
- const REPO = "/home/suveng/doger/ev/vkk_client_flutter";
20
- const RULES_FILE = path.join(REPO, ".pi/evolution/rules/hard-rules.json");
19
+ // 规则文件属于「工作区数据」而不是包里的一部分:源码仓在 .pi/evolution/rules/ 下有一份,
20
+ // npm 包里没有。所以路径从当前文件往上推三层(.../extensions/skill-evolve/test → 仓库根),
21
+ // 找不到就跳过 —— 不要写死某台机器的绝对路径(本地过、CI 挂就是死在这上面)。
22
+ const REPO = path.resolve(path.dirname(new URL(import.meta.url).pathname), "../../..");
23
+ const RULES_FILE = process.env.SKILL_EVOLVE_RULES ?? path.join(REPO, ".pi/evolution/rules/hard-rules.json");
21
24
 
22
- test("仓库自带的 hard-rules.json 能编译:6 条 P0、无坏规则、字段齐全", () => {
25
+ test("仓库自带的 hard-rules.json 能编译:6 条 P0、无坏规则、字段齐全", (t) => {
26
+ if (!fs.existsSync(RULES_FILE)) {
27
+ t.skip(`本机没有 ${RULES_FILE}(工作区数据,npm 包不附带)`);
28
+ return;
29
+ }
23
30
  const loaded = loadHardRules(RULES_FILE);
24
31
  assert.deepEqual(loaded.invalid, []);
25
32
  assert.equal(loaded.compiled.length, 6);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-skill-evolve",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "技能进化:采集会话中的技能曝光/加载,异步复盘、生成改进提案并独立评审,附本机 Web 管理面板",
5
5
  "keywords": [
6
6
  "pi-package",