memorix 1.0.0 → 1.0.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/CHANGELOG.md +77 -0
- package/CLAUDE.md +10 -1
- package/README.md +14 -28
- package/README.zh-CN.md +43 -32
- package/dist/cli/index.js +31 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +30 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,83 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.1] — 2026-03-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **OpenCode stdout pollution** — Removed all `console.log` / `console.error` from the generated OpenCode plugin template. Hooks now run fully silent. (fixes #15)
|
|
9
|
+
- **OpenCode session_id missing** — `normalizeOpenCode()` now reads `session_id` from the payload instead of hardcoding empty string. Plugin template generates and injects a stable session ID per plugin lifetime. (fixes #14)
|
|
10
|
+
- **Auto-install hooks scope** — Hooks are now only auto-installed for IDEs whose project-level config directory already exists (e.g., `.cursor/`, `.windsurf/`), preventing unwanted IDE directories from appearing in projects opened with a different IDE.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **`MEMORIX_DATA_DIR` environment variable** — Override the default data directory (`~/.memorix/data/`) by setting `MEMORIX_DATA_DIR`. Applied consistently across persistence, alias registry, and embedding cache.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## [1.0.0] — 2026-03-09
|
|
18
|
+
|
|
19
|
+
### 🎉 First Stable Release
|
|
20
|
+
|
|
21
|
+
Memorix reaches v1.0.0 — all major features complete. Future versions will iterate based on AI/agent ecosystem evolution.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **Multi-Agent Team Collaboration** — 4 team tools (`team_manage`, `team_file_lock`, `team_task`, `team_message`) for cross-IDE agent coordination. File-based persistence via `team-state.json`. Verified: Windsurf ↔ Antigravity bidirectional communication.
|
|
25
|
+
- **Auto-Cleanup on Startup** — Background retention archiving and intelligent deduplication run automatically in `deferredInit`. With LLM configured: semantic dedup via any OpenAI-compatible model. Without LLM: Jaccard similarity consolidation. Zero manual maintenance required.
|
|
26
|
+
- **`memorix_transfer` tool** — Merged `memorix_export` + `memorix_import` into a single tool with `action: "export" | "import"`.
|
|
27
|
+
- **TEAM.md** — Multi-agent coordination protocol documentation.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **Tool consolidation: 41 → 22 default tools (-46%)**
|
|
31
|
+
- Team tools: 13 individual → 4 merged (action parameter pattern)
|
|
32
|
+
- Knowledge Graph tools: 9 → conditional via `~/.memorix/settings.json` (`{ "knowledgeGraph": true }`)
|
|
33
|
+
- Export+Import: 2 → 1 (`memorix_transfer`)
|
|
34
|
+
- **Dashboard Team Panel** — Redesigned with Iconify icons, Material Design 3 style. Agent cards, task lists, message panel, file lock panel.
|
|
35
|
+
- **README updated** for v1.0.0 stable (EN + 中文).
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- **Windows EPERM file lock race condition** — Treat EPERM same as EEXIST in file-lock.ts.
|
|
39
|
+
- **PowerShell BOM in config.json** — `Set-Content -Encoding UTF8` adds BOM in PS 5.x, breaking `JSON.parse`. Always use Node.js for config file writes.
|
|
40
|
+
|
|
41
|
+
### Production Hardening
|
|
42
|
+
- Cross-session shared team state
|
|
43
|
+
- Inbox capped at 200 messages with auto-eviction
|
|
44
|
+
- Session timeout GC (30min idle → auto-close)
|
|
45
|
+
- Send to inactive agent rejected
|
|
46
|
+
- Agent leave releases file locks + clears inbox
|
|
47
|
+
- Orphaned task rescue when assignee inactive
|
|
48
|
+
- Input validation: agent name max 100, message max 10KB
|
|
49
|
+
|
|
50
|
+
### Stats
|
|
51
|
+
- **Default MCP Tools:** 22 (+9 optional KG)
|
|
52
|
+
- **Tests:** 753/753 passing across 56 files
|
|
53
|
+
- **IDE Support:** 10 agents (Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro, Antigravity, OpenCode, Trae, Gemini CLI)
|
|
54
|
+
|
|
55
|
+
## [0.12.0] — 2026-03-08
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- **Intent-Aware Recall** — Search understands query intent ("why X?" prioritizes decisions/trade-offs, "how to X?" prioritizes how-it-works).
|
|
59
|
+
- **MCP Deadlock Fix** — Resolved stdio transport deadlock under high concurrency.
|
|
60
|
+
- **Dashboard Dark Theme Fix** — Proper dark mode support across all panels.
|
|
61
|
+
- **Build Race Condition Fix** — Fixed tsup parallel build race condition.
|
|
62
|
+
|
|
63
|
+
## [0.11.0] — 2026-03-07
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
- **Mini-Skills** (`memorix_promote`) — Promote observations to permanent skills that auto-inject at session start. Never decay, project-scoped.
|
|
67
|
+
- **LLM Quality Engine** — Compact-on-write (duplicate detection at write time), narrative compression (~27% token reduction), search reranking (60% queries improved).
|
|
68
|
+
- **`memorix_deduplicate` tool** — LLM-powered semantic deduplication with dry-run support.
|
|
69
|
+
- **`memorix_resolve` tool** — Mark completed tasks and fixed bugs as resolved to prevent context pollution.
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
- **Retention decay fix** — Reclassified `what-changed`/`discovery` to low retention (30d instead of 90d).
|
|
73
|
+
|
|
74
|
+
### Stats
|
|
75
|
+
- **Tests:** 641 → 674 passing
|
|
76
|
+
|
|
77
|
+
## [0.10.6] — 2026-03-06
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
- Minor stability improvements.
|
|
81
|
+
|
|
5
82
|
## [0.10.5] — 2026-03-05
|
|
6
83
|
|
|
7
84
|
### Fixed
|
package/CLAUDE.md
CHANGED
|
@@ -42,6 +42,15 @@ You have access to Memorix, a cross-agent memory system. Use it to persist and r
|
|
|
42
42
|
| `memorix_store` | Save new knowledge | `type: "decision", title: "Use JWT for auth"` |
|
|
43
43
|
| `memorix_detail` | Get full observation | `ids: [42, 43]` |
|
|
44
44
|
| `memorix_timeline` | See what happened around an event | `anchorId: 42` |
|
|
45
|
-
| `
|
|
45
|
+
| `memorix_resolve` | Mark task done / bug fixed | `ids: [42]` |
|
|
46
|
+
| `memorix_session_start` | Load context at session start | (no params needed) |
|
|
47
|
+
| `memorix_session_end` | Save session summary | `summary: "## Goal\n..."` |
|
|
48
|
+
| `memorix_promote` | Make observation permanent | `action: "promote", observationIds: [42]` |
|
|
49
|
+
| `memorix_retention` | Check memory health | `action: "report"` |
|
|
50
|
+
| `memorix_transfer` | Export/import memories | `action: "export"` |
|
|
46
51
|
| `memorix_rules_sync` | Sync agent rules | `action: "status"` |
|
|
47
52
|
| `memorix_workspace_sync` | Migrate workspace configs | `action: "scan"` |
|
|
53
|
+
| `team_manage` | Register agent | `action: "join", name: "claude-backend"` |
|
|
54
|
+
| `team_file_lock` | Lock file before editing | `action: "lock", file: "src/auth.ts"` |
|
|
55
|
+
| `team_task` | Create/claim tasks | `action: "create", description: "Fix auth bug"` |
|
|
56
|
+
| `team_message` | Send message to other agent | `action: "send", to: "agent-id"` |
|
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="license"></a>
|
|
16
16
|
<a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="stars"></a>
|
|
17
17
|
<img src="https://img.shields.io/badge/tests-753%20passed-brightgreen?style=flat-square" alt="tests">
|
|
18
|
+
<a href="https://github.com/AVIDS2/memorix/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/AVIDS2/memorix/ci.yml?style=flat-square&label=CI" alt="CI"></a>
|
|
18
19
|
</p>
|
|
19
20
|
|
|
20
21
|
<p align="center">
|
|
@@ -300,34 +301,19 @@ memorix hooks install # Install auto-capture for IDEs
|
|
|
300
301
|
|
|
301
302
|
## Architecture
|
|
302
303
|
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
┌──────────┬─────────┼─────────┬──────────┐
|
|
317
|
-
│ │ │ │ │
|
|
318
|
-
┌────┴─────┐ ┌─┴───────┐ │ ┌──────┴──────┐ ┌─┴────────┐
|
|
319
|
-
│ Search │ │ Team │ │ │ Rules & │ │ Auto- │
|
|
320
|
-
│ Pipeline │ │ Collab │ │ │ Workspace │ │ Cleanup │
|
|
321
|
-
│ │ │ │ │ │ Sync │ │ │
|
|
322
|
-
│ BM25 │ │ Agents │ │ └─────────────┘ │ Retention│
|
|
323
|
-
│ +Vector │ │ Tasks │ │ │ +LLM │
|
|
324
|
-
│ +Rerank │ │ Locks │ │ │ Dedup │
|
|
325
|
-
└──────────┘ │ Msgs │ │ └──────────┘
|
|
326
|
-
│ └─────────┘ │
|
|
327
|
-
│ │ │
|
|
328
|
-
~/.memorix/data/ │ Knowledge
|
|
329
|
-
(local, per-project) │ Graph
|
|
330
|
-
team-state.json
|
|
304
|
+
```mermaid
|
|
305
|
+
graph TB
|
|
306
|
+
A["Cursor · Claude Code · Windsurf · Codex · +6 more"]
|
|
307
|
+
A -->|MCP stdio| Core
|
|
308
|
+
Core["Memorix MCP Server\n22 Default Tools · Auto-Hooks · Auto-Cleanup"]
|
|
309
|
+
Core --> Search["Search Pipeline\nBM25 + Vector + Rerank"]
|
|
310
|
+
Core --> Team["Team Collab\nAgents · Tasks · Locks · Msgs"]
|
|
311
|
+
Core --> Sync["Rules & Workspace Sync\n10 Adapters"]
|
|
312
|
+
Core --> Cleanup["Auto-Cleanup\nRetention + LLM Dedup"]
|
|
313
|
+
Core --> KG["Knowledge Graph\nEntities · Relations"]
|
|
314
|
+
Search --> Disk["~/.memorix/data/\nobservations · sessions · mini-skills · team-state · entities · relations"]
|
|
315
|
+
Team --> Disk
|
|
316
|
+
KG --> Disk
|
|
331
317
|
```
|
|
332
318
|
|
|
333
319
|
### Search Pipeline
|
package/README.zh-CN.md
CHANGED
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
<a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=flat-square&color=blue" alt="downloads"></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="license"></a>
|
|
16
16
|
<a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="stars"></a>
|
|
17
|
-
<img src="https://img.shields.io/badge/tests-
|
|
17
|
+
<img src="https://img.shields.io/badge/tests-753%20passed-brightgreen?style=flat-square" alt="tests">
|
|
18
|
+
<a href="https://github.com/AVIDS2/memorix/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/AVIDS2/memorix/ci.yml?style=flat-square&label=CI" alt="CI"></a>
|
|
18
19
|
</p>
|
|
19
20
|
|
|
20
21
|
<p align="center">
|
|
21
|
-
<strong>
|
|
22
|
+
<strong>v1.0 正式版 | 22 个 MCP 工具 | 自动清理 | 多 Agent 协作 | 10 IDE 支持</strong>
|
|
22
23
|
</p>
|
|
23
24
|
|
|
24
25
|
<p align="center">
|
|
@@ -58,6 +59,8 @@ AI 编码 Agent 在会话之间会丢失全部上下文。切换 IDE 后,之
|
|
|
58
59
|
### 核心能力
|
|
59
60
|
|
|
60
61
|
- **跨 Agent 记忆共享**:所有 Agent 共用同一记忆存储。在 Cursor 中存储,在 Claude Code 中检索。
|
|
62
|
+
- **多 Agent 协作**:Team 工具支持 Agent 间协调——注册/注销、文件锁、任务板、跨 IDE 消息传递,通过共享的 `team-state.json` 实现。
|
|
63
|
+
- **启动自动清理**:后台自动归档过期记忆 + 智能去重(配有 LLM 时用语义分析,否则用启发式),零人工维护。
|
|
61
64
|
- **双模式质量引擎**:免费启发式引擎处理基础去重;可选 LLM 模式提供智能压缩、重排序和冲突检测。
|
|
62
65
|
- **3 层渐进式展示**:搜索返回紧凑索引(每条约 50 tokens),时间线展示前后文,详情提供完整内容。相比全文检索节省约 10 倍 token。
|
|
63
66
|
- **Mini-Skills**:将高价值观察提升为永久技能,每次会话启动自动注入。关键知识永不衰减。
|
|
@@ -168,18 +171,26 @@ args = ["serve"]
|
|
|
168
171
|
|
|
169
172
|
## 功能
|
|
170
173
|
|
|
171
|
-
###
|
|
174
|
+
### 22 个 MCP 工具(默认)
|
|
172
175
|
|
|
173
176
|
| 分类 | 工具 |
|
|
174
177
|
|------|------|
|
|
175
178
|
| **记忆** | `memorix_store` · `memorix_search` · `memorix_detail` · `memorix_timeline` · `memorix_resolve` · `memorix_deduplicate` · `memorix_suggest_topic_key` |
|
|
176
179
|
| **会话** | `memorix_session_start` · `memorix_session_end` · `memorix_session_context` |
|
|
177
|
-
| **知识图谱** | `create_entities` · `create_relations` · `add_observations` · `delete_entities` · `delete_observations` · `delete_relations` · `search_nodes` · `open_nodes` · `read_graph` |
|
|
178
180
|
| **技能** | `memorix_skills` · `memorix_promote` |
|
|
179
181
|
| **工作区** | `memorix_workspace_sync` · `memorix_rules_sync` |
|
|
180
|
-
| **维护** | `memorix_retention` · `memorix_consolidate` · `
|
|
182
|
+
| **维护** | `memorix_retention` · `memorix_consolidate` · `memorix_transfer` |
|
|
183
|
+
| **团队** | `team_manage` · `team_file_lock` · `team_task` · `team_message` |
|
|
181
184
|
| **仪表盘** | `memorix_dashboard` |
|
|
182
185
|
|
|
186
|
+
<details>
|
|
187
|
+
<summary><strong>+9 可选:知识图谱工具</strong>(在 <code>~/.memorix/settings.json</code> 中启用)</summary>
|
|
188
|
+
|
|
189
|
+
`create_entities` · `create_relations` · `add_observations` · `delete_entities` · `delete_observations` · `delete_relations` · `search_nodes` · `open_nodes` · `read_graph`
|
|
190
|
+
|
|
191
|
+
启用方式:`{ "knowledgeGraph": true }` 写入 `~/.memorix/settings.json`
|
|
192
|
+
</details>
|
|
193
|
+
|
|
183
194
|
### 观察类型
|
|
184
195
|
|
|
185
196
|
九种结构化类型用于分类存储的知识:
|
|
@@ -257,6 +268,19 @@ Memorix 自动检测已有环境变量:
|
|
|
257
268
|
|
|
258
269
|
适用于必须永久保留的关键知识:部署流程、架构约束、反复出现的坑。
|
|
259
270
|
|
|
271
|
+
### 团队协作
|
|
272
|
+
|
|
273
|
+
多个 Agent 在同一工作区可通过 4 个团队工具协调:
|
|
274
|
+
|
|
275
|
+
| 工具 | 操作 | 用途 |
|
|
276
|
+
|------|------|------|
|
|
277
|
+
| `team_manage` | join, leave, status | Agent 注册——查看谁在线 |
|
|
278
|
+
| `team_file_lock` | lock, unlock, status | 协商式文件锁防止冲突 |
|
|
279
|
+
| `team_task` | create, claim, complete, list | 共享任务板+依赖管理 |
|
|
280
|
+
| `team_message` | send, broadcast, inbox | 直接消息和广播 |
|
|
281
|
+
|
|
282
|
+
状态持久化到 `team-state.json`,所有 IDE 进程共享。详见 [TEAM.md](TEAM.md)。
|
|
283
|
+
|
|
260
284
|
### 自动记忆 Hook
|
|
261
285
|
|
|
262
286
|
```bash
|
|
@@ -279,32 +303,19 @@ memorix hooks install # 为 IDE 安装自动记忆
|
|
|
279
303
|
|
|
280
304
|
## 架构
|
|
281
305
|
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
┌────────────────────┼────────────────────┐
|
|
296
|
-
│ │ │
|
|
297
|
-
┌────┴─────┐ ┌──────┴──────┐ ┌──────┴──────┐
|
|
298
|
-
│ Search │ │ Knowledge │ │ Rules & │
|
|
299
|
-
│ Pipeline │ │ Graph │ │ Workspace │
|
|
300
|
-
│ │ │ (Entities) │ │ Sync │
|
|
301
|
-
│ BM25 │ └─────────────┘ └─────────────┘
|
|
302
|
-
│ +Vector │
|
|
303
|
-
│ +Rerank │
|
|
304
|
-
└──────────┘
|
|
305
|
-
│
|
|
306
|
-
~/.memorix/data/
|
|
307
|
-
(100% 本地,按项目隔离)
|
|
306
|
+
```mermaid
|
|
307
|
+
graph TB
|
|
308
|
+
A["Cursor · Claude Code · Windsurf · Codex · +6 更多"]
|
|
309
|
+
A -->|MCP stdio| Core
|
|
310
|
+
Core["Memorix MCP Server\n22 个默认工具 · 自动Hook · 自动清理"]
|
|
311
|
+
Core --> Search["检索管线\nBM25 + 向量 + 重排序"]
|
|
312
|
+
Core --> Team["团队协作\n注册 · 任务 · 锁 · 消息"]
|
|
313
|
+
Core --> Sync["规则 & 工作区同步\n10 个适配器"]
|
|
314
|
+
Core --> Cleanup["自动清理\n保留衰减 + LLM 去重"]
|
|
315
|
+
Core --> KG["知识图谱\n实体 · 关系"]
|
|
316
|
+
Search --> Disk["~/.memorix/data/\nobservations · sessions · mini-skills · team-state · entities · relations"]
|
|
317
|
+
Team --> Disk
|
|
318
|
+
KG --> Disk
|
|
308
319
|
```
|
|
309
320
|
|
|
310
321
|
### 检索管线
|
|
@@ -339,7 +350,7 @@ git clone https://github.com/AVIDS2/memorix.git
|
|
|
339
350
|
cd memorix && npm install
|
|
340
351
|
|
|
341
352
|
npm run dev # 监听模式
|
|
342
|
-
npm test #
|
|
353
|
+
npm test # 753 个测试
|
|
343
354
|
npm run build # 生产构建
|
|
344
355
|
```
|
|
345
356
|
|
package/dist/cli/index.js
CHANGED
|
@@ -3377,10 +3377,12 @@ function generateOpenCodePlugin() {
|
|
|
3377
3377
|
* Docs: https://github.com/AVIDS2/memorix
|
|
3378
3378
|
*/
|
|
3379
3379
|
export const MemorixPlugin = async ({ project, client, $, directory, worktree }) => {
|
|
3380
|
-
|
|
3380
|
+
// Generate a stable session ID for this plugin lifetime
|
|
3381
|
+
const sessionId = \`opencode-\${Date.now().toString(36)}-\${Math.random().toString(36).slice(2, 8)}\`;
|
|
3381
3382
|
|
|
3382
3383
|
/** Pipe event JSON to memorix hook via temp file (Windows .cmd stdin workaround) */
|
|
3383
3384
|
async function runHook(payload) {
|
|
3385
|
+
payload.session_id = sessionId;
|
|
3384
3386
|
const tmpDir = Bun.env.TEMP || Bun.env.TMP || '/tmp';
|
|
3385
3387
|
const tmpPath = \`\${tmpDir}/memorix-hook-\${Date.now()}.json\`;
|
|
3386
3388
|
try {
|
|
@@ -3388,9 +3390,8 @@ export const MemorixPlugin = async ({ project, client, $, directory, worktree })
|
|
|
3388
3390
|
await Bun.write(tmpPath, data);
|
|
3389
3391
|
// cat | pipe works through .cmd wrappers; < redirect does NOT
|
|
3390
3392
|
await $\`cat \${tmpPath} | memorix hook\`.quiet().nothrow();
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
console.log('[memorix] hook error:', err?.message ?? err);
|
|
3393
|
+
} catch {
|
|
3394
|
+
// Silent \u2014 hooks must never break the agent
|
|
3394
3395
|
} finally {
|
|
3395
3396
|
try { const { unlinkSync } = await import('node:fs'); unlinkSync(tmpPath); } catch {}
|
|
3396
3397
|
}
|
|
@@ -9982,7 +9983,7 @@ var init_fastembed_provider = __esm({
|
|
|
9982
9983
|
"src/embedding/fastembed-provider.ts"() {
|
|
9983
9984
|
"use strict";
|
|
9984
9985
|
init_esm_shims();
|
|
9985
|
-
CACHE_DIR = join3(homedir3(), ".memorix", "data");
|
|
9986
|
+
CACHE_DIR = process.env.MEMORIX_DATA_DIR || join3(homedir3(), ".memorix", "data");
|
|
9986
9987
|
CACHE_FILE = join3(CACHE_DIR, ".embedding-cache.json");
|
|
9987
9988
|
cache = /* @__PURE__ */ new Map();
|
|
9988
9989
|
MAX_CACHE_SIZE = 5e3;
|
|
@@ -10239,7 +10240,7 @@ var init_api_provider = __esm({
|
|
|
10239
10240
|
"src/embedding/api-provider.ts"() {
|
|
10240
10241
|
"use strict";
|
|
10241
10242
|
init_esm_shims();
|
|
10242
|
-
CACHE_DIR2 = join4(homedir4(), ".memorix", "data");
|
|
10243
|
+
CACHE_DIR2 = process.env.MEMORIX_DATA_DIR || join4(homedir4(), ".memorix", "data");
|
|
10243
10244
|
CACHE_FILE2 = join4(CACHE_DIR2, ".embedding-api-cache.json");
|
|
10244
10245
|
cache3 = /* @__PURE__ */ new Map();
|
|
10245
10246
|
MAX_CACHE_SIZE3 = 1e4;
|
|
@@ -11027,7 +11028,7 @@ var init_aliases = __esm({
|
|
|
11027
11028
|
"src/project/aliases.ts"() {
|
|
11028
11029
|
"use strict";
|
|
11029
11030
|
init_esm_shims();
|
|
11030
|
-
DEFAULT_DATA_DIR = path3.join(os2.homedir(), ".memorix", "data");
|
|
11031
|
+
DEFAULT_DATA_DIR = process.env.MEMORIX_DATA_DIR || path3.join(os2.homedir(), ".memorix", "data");
|
|
11031
11032
|
ALIAS_FILE = ".project-aliases.json";
|
|
11032
11033
|
registryCache = null;
|
|
11033
11034
|
registryDir = null;
|
|
@@ -11715,7 +11716,7 @@ var init_persistence = __esm({
|
|
|
11715
11716
|
"use strict";
|
|
11716
11717
|
init_esm_shims();
|
|
11717
11718
|
init_file_lock();
|
|
11718
|
-
DEFAULT_DATA_DIR2 = path5.join(os3.homedir(), ".memorix", "data");
|
|
11719
|
+
DEFAULT_DATA_DIR2 = process.env.MEMORIX_DATA_DIR || path5.join(os3.homedir(), ".memorix", "data");
|
|
11719
11720
|
}
|
|
11720
11721
|
});
|
|
11721
11722
|
|
|
@@ -47306,12 +47307,32 @@ ${lines.join("\n")}` }] };
|
|
|
47306
47307
|
}
|
|
47307
47308
|
if (autoInstall) {
|
|
47308
47309
|
const { getHookStatus: getHookStatus2, installHooks: installHooks2, detectInstalledAgents: detectInstalledAgents2 } = await Promise.resolve().then(() => (init_installers(), installers_exports));
|
|
47310
|
+
const { join: join18 } = await import("path");
|
|
47311
|
+
const { access: access2 } = await import("fs/promises");
|
|
47309
47312
|
const workDir = cwd ?? process.cwd();
|
|
47310
47313
|
const statuses = await getHookStatus2(workDir);
|
|
47311
47314
|
const installedAgents = new Set(statuses.filter((s2) => s2.installed).map((s2) => s2.agent));
|
|
47312
47315
|
const detectedAgents = await detectInstalledAgents2();
|
|
47316
|
+
const AGENT_MARKER_DIR = {
|
|
47317
|
+
claude: ".claude",
|
|
47318
|
+
windsurf: ".windsurf",
|
|
47319
|
+
cursor: ".cursor",
|
|
47320
|
+
copilot: ".vscode",
|
|
47321
|
+
opencode: ".opencode",
|
|
47322
|
+
kiro: ".kiro",
|
|
47323
|
+
antigravity: ".gemini",
|
|
47324
|
+
trae: ".trae"
|
|
47325
|
+
};
|
|
47313
47326
|
for (const agent of detectedAgents) {
|
|
47314
47327
|
if (installedAgents.has(agent)) continue;
|
|
47328
|
+
const markerDir = AGENT_MARKER_DIR[agent];
|
|
47329
|
+
if (markerDir) {
|
|
47330
|
+
try {
|
|
47331
|
+
await access2(join18(workDir, markerDir));
|
|
47332
|
+
} catch {
|
|
47333
|
+
continue;
|
|
47334
|
+
}
|
|
47335
|
+
}
|
|
47315
47336
|
try {
|
|
47316
47337
|
const config2 = await installHooks2(agent, workDir);
|
|
47317
47338
|
console.error(`[memorix] Auto-installed hooks for ${agent} \u2192 ${config2.configPath}`);
|
|
@@ -47391,7 +47412,7 @@ ${lines.join("\n")}` }] };
|
|
|
47391
47412
|
try {
|
|
47392
47413
|
const older = group[i2], newer = group[i2 + 1];
|
|
47393
47414
|
const decision = await deduplicateMemory2(
|
|
47394
|
-
{
|
|
47415
|
+
{ title: newer.title, narrative: newer.narrative, facts: newer.facts },
|
|
47395
47416
|
[{ id: older.id, title: older.title, narrative: older.narrative, facts: older.facts.join("\n") }]
|
|
47396
47417
|
);
|
|
47397
47418
|
if (decision && (decision.action === "UPDATE" || decision.action === "NONE")) {
|
|
@@ -49577,7 +49598,7 @@ function normalizeGemini(payload, event) {
|
|
|
49577
49598
|
}
|
|
49578
49599
|
function normalizeOpenCode(payload, event) {
|
|
49579
49600
|
const result = {
|
|
49580
|
-
sessionId: "",
|
|
49601
|
+
sessionId: payload.session_id ?? payload.sessionId ?? "",
|
|
49581
49602
|
cwd: payload.cwd ?? ""
|
|
49582
49603
|
};
|
|
49583
49604
|
const toolName = payload.tool_name ?? "";
|