memory-bank-skill 7.4.0 → 7.4.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/README.md +2 -2
- package/dist/cli.js +1 -17
- package/dist/plugin.js +23 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -180,5 +180,5 @@ service=memory-bank Plugin initialized (unified) {"projectRoot":"..."}
|
|
|
180
180
|
|
|
181
181
|
## 版本
|
|
182
182
|
|
|
183
|
-
- **版本**: 7.4.
|
|
184
|
-
- **主要更新**:
|
|
183
|
+
- **版本**: 7.4.1
|
|
184
|
+
- **主要更新**: Writing guideline 改为 post-write advisory — 写入后建议参考规范检查,per-turn 去重
|
package/dist/cli.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: () => mod[key],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
3
|
var __require = import.meta.require;
|
|
20
4
|
|
|
21
5
|
// src/cli.ts
|
|
@@ -27,7 +11,7 @@ import { fileURLToPath } from "url";
|
|
|
27
11
|
// package.json
|
|
28
12
|
var package_default = {
|
|
29
13
|
name: "memory-bank-skill",
|
|
30
|
-
version: "7.4.
|
|
14
|
+
version: "7.4.1",
|
|
31
15
|
description: "Memory Bank - \u9879\u76EE\u8BB0\u5FC6\u7CFB\u7EDF\uFF0C\u8BA9 AI \u52A9\u624B\u5728\u6BCF\u6B21\u5BF9\u8BDD\u4E2D\u90FD\u80FD\u5FEB\u901F\u7406\u89E3\u9879\u76EE\u4E0A\u4E0B\u6587",
|
|
32
16
|
type: "module",
|
|
33
17
|
main: "dist/plugin.js",
|
package/dist/plugin.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
-
for (let key of __getOwnPropNames(mod))
|
|
11
|
-
if (!__hasOwnProp.call(to, key))
|
|
12
|
-
__defProp(to, key, {
|
|
13
|
-
get: () => mod[key],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
2
|
var __require = import.meta.require;
|
|
19
3
|
|
|
20
4
|
// plugin/memory-bank.ts
|
|
@@ -374,7 +358,7 @@ function getMessageGatingState(gatingKey, sessionId, projectRoot) {
|
|
|
374
358
|
meta.pendingDocFirstSatisfied = false;
|
|
375
359
|
}
|
|
376
360
|
}
|
|
377
|
-
state = { readFiles: new Set, contextSatisfied: false, warnedThisMessage: false, docFirstSatisfied: inheritDocFirst, docFirstWarned: false };
|
|
361
|
+
state = { readFiles: new Set, contextSatisfied: false, warnedThisMessage: false, docFirstSatisfied: inheritDocFirst, docFirstWarned: false, writingGuideInjected: false };
|
|
378
362
|
messageGatingStates.set(gatingKey, state);
|
|
379
363
|
if (messageGatingStates.size > 100) {
|
|
380
364
|
const first = messageGatingStates.keys().next().value;
|
|
@@ -1375,7 +1359,16 @@ Or call: proxy_task({ subagent_type: "memory-reader", ... })`);
|
|
|
1375
1359
|
}
|
|
1376
1360
|
}
|
|
1377
1361
|
}
|
|
1378
|
-
async function injectWritingGuideline(sid) {
|
|
1362
|
+
async function injectWritingGuideline(sid, writtenPaths) {
|
|
1363
|
+
const meta = getSessionMeta(sid, projectRoot);
|
|
1364
|
+
const messageKey = meta.lastUserMessageKey || "default";
|
|
1365
|
+
const gatingKey = `${sid}::${messageKey}`;
|
|
1366
|
+
const gatingState = getMessageGatingState(gatingKey, sid, projectRoot);
|
|
1367
|
+
if (gatingState.writingGuideInjected)
|
|
1368
|
+
return;
|
|
1369
|
+
gatingState.writingGuideInjected = true;
|
|
1370
|
+
const pathList = writtenPaths.map((p) => `- ${p}`).join(`
|
|
1371
|
+
`);
|
|
1379
1372
|
client.session.prompt({
|
|
1380
1373
|
path: { id: sid },
|
|
1381
1374
|
body: {
|
|
@@ -1385,8 +1378,13 @@ Or call: proxy_task({ subagent_type: "memory-reader", ... })`);
|
|
|
1385
1378
|
type: "text",
|
|
1386
1379
|
text: `## [Memory Bank Writing Guide]
|
|
1387
1380
|
|
|
1388
|
-
` + `\
|
|
1389
|
-
|
|
1381
|
+
` + `\u5DF2\u68C0\u6D4B\u5230 memory-bank/ \u5199\u5165\uFF1A
|
|
1382
|
+
${pathList}
|
|
1383
|
+
|
|
1384
|
+
` + `\u5EFA\u8BAE\u53C2\u8003\u5199\u5165\u89C4\u8303\u786E\u8BA4\u5185\u5BB9\u662F\u5426\u9700\u8981\u8C03\u6574\uFF1A
|
|
1385
|
+
` + `read({ filePath: "~/.config/opencode/skills/memory-bank/references/writer.md" })
|
|
1386
|
+
|
|
1387
|
+
` + `\u5982\u9700\u4FEE\u6B63\u8BF7\u76F4\u63A5\u4FEE\u6539\uFF0C\u7136\u540E\u7EE7\u7EED\u539F\u672C\u7684\u4EFB\u52A1\u3002`
|
|
1390
1388
|
}]
|
|
1391
1389
|
}
|
|
1392
1390
|
}).catch((err) => log.error("Failed to send writing guideline:", String(err)));
|
|
@@ -1439,6 +1437,7 @@ Or call: proxy_task({ subagent_type: "memory-reader", ... })`);
|
|
|
1439
1437
|
const targetPaths = extractPaths(toolLower, output.args || {});
|
|
1440
1438
|
if (targetPaths.length === 0)
|
|
1441
1439
|
return;
|
|
1440
|
+
const mbWrittenPaths = [];
|
|
1442
1441
|
for (const targetPath of targetPaths) {
|
|
1443
1442
|
if (!await isMemoryBankPath(targetPath))
|
|
1444
1443
|
continue;
|
|
@@ -1447,10 +1446,13 @@ Or call: proxy_task({ subagent_type: "memory-reader", ... })`);
|
|
|
1447
1446
|
throw new Error(`[Memory Bank Guard] memory-bank/ \u4E0B\u53EA\u5141\u8BB8\u5199\u5165 .md \u6587\u4EF6\u3002
|
|
1448
1447
|
` + `\u76EE\u6807\u6587\u4EF6: ${targetPath}`);
|
|
1449
1448
|
}
|
|
1450
|
-
|
|
1449
|
+
mbWrittenPaths.push(targetPath);
|
|
1451
1450
|
markDocFirstSatisfied(sessionID);
|
|
1452
1451
|
log.debug("Memory Bank write allowed", { sessionID, tool, targetPath });
|
|
1453
1452
|
}
|
|
1453
|
+
if (mbWrittenPaths.length > 0) {
|
|
1454
|
+
await injectWritingGuideline(sessionID, mbWrittenPaths);
|
|
1455
|
+
}
|
|
1454
1456
|
}
|
|
1455
1457
|
if (tool.toLowerCase() === "bash") {
|
|
1456
1458
|
const command = output.args?.command;
|