memory-bank-skill 5.7.4 → 5.7.6
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 +13 -5
- package/dist/cli.js +44 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,14 @@ bunx memory-bank-skill install
|
|
|
30
30
|
|
|
31
31
|
然后 **重启 OpenCode**,完成!
|
|
32
32
|
|
|
33
|
+
### 自定义模型
|
|
34
|
+
|
|
35
|
+
默认使用 `cliproxy/claude-opus-4-5-20251101`,可通过 `--model` 指定:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bunx memory-bank-skill install --model anthropic/claude-sonnet-4-5
|
|
39
|
+
```
|
|
40
|
+
|
|
33
41
|
### 验证安装
|
|
34
42
|
|
|
35
43
|
```bash
|
|
@@ -40,10 +48,10 @@ bunx memory-bank-skill doctor
|
|
|
40
48
|
|
|
41
49
|
| 操作 | 目标路径 |
|
|
42
50
|
|------|----------|
|
|
43
|
-
| 复制 Skill 文件 | `~/.config/opencode/skill/memory-bank/` |
|
|
44
|
-
| 配置 opencode.json | 添加 `permission.skill=allow
|
|
51
|
+
| 复制 Skill 文件 | `~/.config/opencode/skill/memory-bank/` 和 `memory-bank-writer/` |
|
|
52
|
+
| 配置 opencode.json | 添加 `permission.skill=allow`,注册插件和 agent |
|
|
53
|
+
| 注册 Agent | 添加 `memory-bank-writer` agent(用于写入守卫) |
|
|
45
54
|
| 写入 manifest | `~/.config/opencode/skill/memory-bank/.manifest.json` |
|
|
46
|
-
| 依赖安装 | 不自动执行;如需手动运行 `cd ~/.config/opencode && bun install` |
|
|
47
55
|
|
|
48
56
|
---
|
|
49
57
|
|
|
@@ -184,5 +192,5 @@ service=memory-bank Plugin initialized (unified) {"projectRoot":"..."}
|
|
|
184
192
|
|
|
185
193
|
## 版本
|
|
186
194
|
|
|
187
|
-
- **版本**: 5.
|
|
188
|
-
- **主要更新**:
|
|
195
|
+
- **版本**: 5.7.5
|
|
196
|
+
- **主要更新**: 写入守卫 + Writer Agent 自动注册
|
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import { fileURLToPath } from "url";
|
|
|
10
10
|
// package.json
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "memory-bank-skill",
|
|
13
|
-
version: "5.7.
|
|
13
|
+
version: "5.7.6",
|
|
14
14
|
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",
|
|
15
15
|
type: "module",
|
|
16
16
|
main: "dist/plugin.js",
|
|
@@ -203,7 +203,7 @@ async function installSkillFiles(packageRoot, undoStack, manifestFiles) {
|
|
|
203
203
|
details: baseDestDir
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
async function installPluginToConfig(undoStack) {
|
|
206
|
+
async function installPluginToConfig(undoStack, customModel) {
|
|
207
207
|
const configPath = join(homedir(), ".config", "opencode", "opencode.json");
|
|
208
208
|
const pluginPackageWithVersion = `memory-bank-skill@${VERSION}`;
|
|
209
209
|
const pluginPackagePrefix = "memory-bank-skill";
|
|
@@ -271,6 +271,25 @@ async function installPluginToConfig(undoStack) {
|
|
|
271
271
|
changes.push(`Added plugin: ${pluginPackageWithVersion}`);
|
|
272
272
|
modified = true;
|
|
273
273
|
}
|
|
274
|
+
if (!config.agent) {
|
|
275
|
+
config.agent = {};
|
|
276
|
+
}
|
|
277
|
+
const defaultModel = "cliproxy/claude-opus-4-5-20251101";
|
|
278
|
+
const writerAgent = {
|
|
279
|
+
description: "Memory Bank \u4E13\u7528\u5199\u5165\u4EE3\u7406",
|
|
280
|
+
model: customModel || defaultModel,
|
|
281
|
+
tools: {
|
|
282
|
+
write: true,
|
|
283
|
+
edit: true,
|
|
284
|
+
bash: false
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
const existingWriter = config.agent["memory-bank-writer"];
|
|
288
|
+
if (!existingWriter || JSON.stringify(existingWriter) !== JSON.stringify(writerAgent)) {
|
|
289
|
+
config.agent["memory-bank-writer"] = writerAgent;
|
|
290
|
+
changes.push(existingWriter ? "Updated agent: memory-bank-writer" : "Added agent: memory-bank-writer");
|
|
291
|
+
modified = true;
|
|
292
|
+
}
|
|
274
293
|
if (modified) {
|
|
275
294
|
const newContent = JSON.stringify(config, null, 2) + `
|
|
276
295
|
`;
|
|
@@ -346,7 +365,7 @@ async function checkAndCleanOpenCodeCache() {
|
|
|
346
365
|
}
|
|
347
366
|
return { cleaned: false };
|
|
348
367
|
}
|
|
349
|
-
async function install() {
|
|
368
|
+
async function install(customModel) {
|
|
350
369
|
log(`
|
|
351
370
|
${colors.bold}Memory Bank Skill Installer v${VERSION}${colors.reset}
|
|
352
371
|
`);
|
|
@@ -365,7 +384,7 @@ ${colors.bold}Memory Bank Skill Installer v${VERSION}${colors.reset}
|
|
|
365
384
|
logDetail(r1.details || "");
|
|
366
385
|
results.push(r1);
|
|
367
386
|
logStep(2, 2, "Configuring plugin...");
|
|
368
|
-
const r2 = await installPluginToConfig(undoStack);
|
|
387
|
+
const r2 = await installPluginToConfig(undoStack, customModel);
|
|
369
388
|
logDetail(r2.details || "");
|
|
370
389
|
results.push(r2);
|
|
371
390
|
await writeManifest(manifestFiles, undoStack);
|
|
@@ -473,21 +492,39 @@ function showHelp() {
|
|
|
473
492
|
${colors.bold}Memory Bank Skill v${VERSION}${colors.reset}
|
|
474
493
|
|
|
475
494
|
Usage:
|
|
476
|
-
bunx memory-bank-skill <command>
|
|
495
|
+
bunx memory-bank-skill <command> [options]
|
|
477
496
|
|
|
478
497
|
Commands:
|
|
479
498
|
install Install Memory Bank skill and plugin
|
|
480
499
|
doctor Check installation status
|
|
481
500
|
|
|
501
|
+
Options:
|
|
502
|
+
--model <model> Specify model for memory-bank-writer agent
|
|
503
|
+
Default: cliproxy/claude-opus-4-5-20251101
|
|
504
|
+
|
|
482
505
|
Examples:
|
|
483
506
|
bunx memory-bank-skill install
|
|
507
|
+
bunx memory-bank-skill install --model anthropic/claude-sonnet-4-5
|
|
484
508
|
bunx memory-bank-skill doctor
|
|
485
509
|
`);
|
|
486
510
|
}
|
|
487
|
-
|
|
511
|
+
function parseArgs() {
|
|
512
|
+
const args = process.argv.slice(2);
|
|
513
|
+
let command;
|
|
514
|
+
let model;
|
|
515
|
+
for (let i = 0;i < args.length; i++) {
|
|
516
|
+
if (args[i] === "--model" && args[i + 1]) {
|
|
517
|
+
model = args[++i];
|
|
518
|
+
} else if (!args[i].startsWith("-")) {
|
|
519
|
+
command = args[i];
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return { command, model };
|
|
523
|
+
}
|
|
524
|
+
var { command, model } = parseArgs();
|
|
488
525
|
switch (command) {
|
|
489
526
|
case "install":
|
|
490
|
-
install();
|
|
527
|
+
install(model);
|
|
491
528
|
break;
|
|
492
529
|
case "doctor":
|
|
493
530
|
doctor();
|