pi-patch-keeper 1.0.7 → 1.0.9
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/README.en.md +1 -1
- package/README.md +2 -2
- package/index.ts +3 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -32,7 +32,7 @@ Prevents "force-typed" extensions from silently swallowing every section written
|
|
|
32
32
|
| Notify | only on problems |
|
|
33
33
|
| Scope | `npm:` packages |
|
|
34
34
|
|
|
35
|
-
Optional config: `~/.pi/patch-keeper
|
|
35
|
+
Optional config: `~/.pi/patch-keeper.json`
|
|
36
36
|
|
|
37
37
|
## Limits
|
|
38
38
|
|
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ pi 的 system prompt 由各扩展写入的 section 拼装。若某扩展在 `bef
|
|
|
40
40
|
## 纪律
|
|
41
41
|
|
|
42
42
|
- **绝不** `return { systemPrompt }` —— 否则自己就是它要防的问题。
|
|
43
|
-
-
|
|
43
|
+
- 写操作两处:修 `settings.json` 的 `packages`(写前备份)与更新 `~/.pi/patch-keeper.json` 的指纹;失败都只提示。
|
|
44
44
|
- 任何异常只提示、不抛错;无问题不打扰。
|
|
45
45
|
|
|
46
46
|
## 安装
|
|
@@ -52,6 +52,6 @@ pi install ./pi-patch-keeper
|
|
|
52
52
|
|
|
53
53
|
## 限制
|
|
54
54
|
|
|
55
|
-
-
|
|
55
|
+
- 静态扫描从各入口的 `before_agent_start` 命中处起看 4000 字符(只看前 3 个入口文件),动态构造的 force 检测不到。
|
|
56
56
|
- user 扩展(不在 `packages` 数组里)不在扫描范围。
|
|
57
57
|
- 只处理顺序问题;不修改任何第三方扩展的源码。
|
package/index.ts
CHANGED
|
@@ -20,7 +20,8 @@ import * as path from "node:path";
|
|
|
20
20
|
|
|
21
21
|
const HOME = os.homedir();
|
|
22
22
|
const SETTINGS = path.join(HOME, ".pi", "agent", "settings.json");
|
|
23
|
-
|
|
23
|
+
// 配置与指纹同文件(与 README 一致;保留用户已有键)
|
|
24
|
+
const STATE = path.join(HOME, ".pi", "patch-keeper.json");
|
|
24
25
|
const NPM_ROOT = path.join(HOME, ".pi", "agent", "npm", "node_modules");
|
|
25
26
|
|
|
26
27
|
/** 已知无条件 force 型包。触发概率升序:越靠后越应排在 packages 末尾。 */
|
|
@@ -243,7 +244,7 @@ export default function patchKeeper(pi: ExtensionAPI): void {
|
|
|
243
244
|
const arg = (args || "").trim().toLowerCase();
|
|
244
245
|
if (arg === "fix") {
|
|
245
246
|
const r = fixForceOrder();
|
|
246
|
-
ctx.ui.notify(r ? `patch-keeper: ${r}` : "patch-keeper: force 顺序已正确,无需修复",
|
|
247
|
+
ctx.ui.notify(r ? `patch-keeper: ${r}` : "patch-keeper: force 顺序已正确,无需修复", "info");
|
|
247
248
|
return;
|
|
248
249
|
}
|
|
249
250
|
ctx.ui.notify(`扩展加载顺序\n${report().join("\n")}`, "info");
|
package/package.json
CHANGED