opcode-pg-memory 2.2.4 → 2.2.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 CHANGED
@@ -117,6 +117,7 @@ mcp-server.ts # MCP 服务入口
117
117
  |------|------|
118
118
  | [USAGE_GUIDE.md](./USAGE_GUIDE.md) | 完整使用指南 — 配置 · 工具 · 运维 |
119
119
  | [PLUGIN_DOCUMENTATION.md](./PLUGIN_DOCUMENTATION.md) | 架构详解 — 钩子系统 · 数据库设计 |
120
+ | [AGENTS.template.md](./AGENTS.template.md) | AGENTS.md 模板 — OmO directory-agents-injector 自动通知子代理 |
120
121
 
121
122
  ## License
122
123
 
package/dist/cli.js CHANGED
@@ -5127,6 +5127,30 @@ function createSkill() {
5127
5127
  console.log("Created pg-memory skill");
5128
5128
  return true;
5129
5129
  }
5130
+ var PG_MEMORY_AGENTS_TEMPLATE = `# PG Memory — Long-term Memory System
5131
+
5132
+ 本项目已安装 pg-memory 插件。你有以下记忆工具可用:
5133
+
5134
+ ## 自动功能(无需你调用)
5135
+ - 工具执行记录 — 每次工具调用自动保存为观察
5136
+ - 实体提取 — 从代码中自动提取函数、类、文件等实体
5137
+ - 话题段隔离 — 话题切换时自动分段
5138
+ - 首条消息注入 — 新会话自动注入历史相关记忆
5139
+
5140
+ ## 手动工具
5141
+ - recall_memory({ query: "你的任务目标" }) — 处理新任务前检索历史经验
5142
+ - /pg-memory-reflect — 完成重要工作后总结模式
5143
+
5144
+ ## OmO 子代理策略
5145
+ OmO 子代理无 MCP 直接访问。主代理应先调用 recall_memory 再将结果传给子代理。
5146
+ `;
5147
+ function createAgentsTemplate() {
5148
+ mkdirSync(OPENCODE_SKILLS_DIR, { recursive: true });
5149
+ const agentsPath = join(OPENCODE_SKILLS_DIR, "pg-memory-agents.template.md");
5150
+ writeFileSync(agentsPath, PG_MEMORY_AGENTS_TEMPLATE);
5151
+ console.log("Created AGENTS.md template (copy to project root)");
5152
+ return true;
5153
+ }
5130
5154
  function printHelp() {
5131
5155
  console.log(`
5132
5156
  pg-memory - PostgreSQL-backed long-term memory for OpenCode
@@ -5173,6 +5197,7 @@ OpenCode PG Memory installer
5173
5197
  createSyncCommand();
5174
5198
  createReflectCommand();
5175
5199
  createSkill();
5200
+ createAgentsTemplate();
5176
5201
  console.log(`
5177
5202
  Setup complete!`);
5178
5203
  console.log(`