memorix 1.0.0 → 1.0.2

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 CHANGED
@@ -2,6 +2,93 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.2] — 2026-03-14
6
+
7
+ ### Fixed
8
+ - **MCP Server version mismatch** — Server now reports the correct version from `package.json` (was hardcoded `0.1.0`). Injected at build time via tsup `define`.
9
+ - **CI Node.js matrix** — Removed Node 18 from CI matrix to match `engines: >=20` in `package.json`.
10
+ - **Orama reindex idempotency** — `reindexObservations()` now resets the Orama DB before rebuilding, eliminating "document already exists" errors in multi-session scenarios.
11
+ - **E2E tests no longer touch real user data** — Mini-skills E2E tests now use a temporary directory with synthetic observations instead of reading/writing `~/.memorix/data/`.
12
+
13
+ ---
14
+
15
+ ## [1.0.1] — 2026-03-14
16
+
17
+ ### Fixed
18
+ - **OpenCode stdout pollution** — Removed all `console.log` / `console.error` from the generated OpenCode plugin template. Hooks now run fully silent. (fixes #15)
19
+ - **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)
20
+ - **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.
21
+
22
+ ### Added
23
+ - **`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.
24
+
25
+ ---
26
+
27
+ ## [1.0.0] — 2026-03-09
28
+
29
+ ### 🎉 First Stable Release
30
+
31
+ Memorix reaches v1.0.0 — all major features complete. Future versions will iterate based on AI/agent ecosystem evolution.
32
+
33
+ ### Added
34
+ - **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.
35
+ - **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.
36
+ - **`memorix_transfer` tool** — Merged `memorix_export` + `memorix_import` into a single tool with `action: "export" | "import"`.
37
+ - **TEAM.md** — Multi-agent coordination protocol documentation.
38
+
39
+ ### Changed
40
+ - **Tool consolidation: 41 → 22 default tools (-46%)**
41
+ - Team tools: 13 individual → 4 merged (action parameter pattern)
42
+ - Knowledge Graph tools: 9 → conditional via `~/.memorix/settings.json` (`{ "knowledgeGraph": true }`)
43
+ - Export+Import: 2 → 1 (`memorix_transfer`)
44
+ - **Dashboard Team Panel** — Redesigned with Iconify icons, Material Design 3 style. Agent cards, task lists, message panel, file lock panel.
45
+ - **README updated** for v1.0.0 stable (EN + 中文).
46
+
47
+ ### Fixed
48
+ - **Windows EPERM file lock race condition** — Treat EPERM same as EEXIST in file-lock.ts.
49
+ - **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.
50
+
51
+ ### Production Hardening
52
+ - Cross-session shared team state
53
+ - Inbox capped at 200 messages with auto-eviction
54
+ - Session timeout GC (30min idle → auto-close)
55
+ - Send to inactive agent rejected
56
+ - Agent leave releases file locks + clears inbox
57
+ - Orphaned task rescue when assignee inactive
58
+ - Input validation: agent name max 100, message max 10KB
59
+
60
+ ### Stats
61
+ - **Default MCP Tools:** 22 (+9 optional KG)
62
+ - **Tests:** 753/753 passing across 56 files
63
+ - **IDE Support:** 10 agents (Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro, Antigravity, OpenCode, Trae, Gemini CLI)
64
+
65
+ ## [0.12.0] — 2026-03-08
66
+
67
+ ### Added
68
+ - **Intent-Aware Recall** — Search understands query intent ("why X?" prioritizes decisions/trade-offs, "how to X?" prioritizes how-it-works).
69
+ - **MCP Deadlock Fix** — Resolved stdio transport deadlock under high concurrency.
70
+ - **Dashboard Dark Theme Fix** — Proper dark mode support across all panels.
71
+ - **Build Race Condition Fix** — Fixed tsup parallel build race condition.
72
+
73
+ ## [0.11.0] — 2026-03-07
74
+
75
+ ### Added
76
+ - **Mini-Skills** (`memorix_promote`) — Promote observations to permanent skills that auto-inject at session start. Never decay, project-scoped.
77
+ - **LLM Quality Engine** — Compact-on-write (duplicate detection at write time), narrative compression (~27% token reduction), search reranking (60% queries improved).
78
+ - **`memorix_deduplicate` tool** — LLM-powered semantic deduplication with dry-run support.
79
+ - **`memorix_resolve` tool** — Mark completed tasks and fixed bugs as resolved to prevent context pollution.
80
+
81
+ ### Fixed
82
+ - **Retention decay fix** — Reclassified `what-changed`/`discovery` to low retention (30d instead of 90d).
83
+
84
+ ### Stats
85
+ - **Tests:** 641 → 674 passing
86
+
87
+ ## [0.10.6] — 2026-03-06
88
+
89
+ ### Fixed
90
+ - Minor stability improvements.
91
+
5
92
  ## [0.10.5] — 2026-03-05
6
93
 
7
94
  ### 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
- | `memorix_retention` | Check memory health | `action: "summary"` |
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
- Cursor │ │ Claude │ │ Windsurf │ │ Codex │ │ +6 more
306
- │ │ │ Code │ │ │ │ │ │ │
307
- └────┬────┘ └─────┬─────┘ └─────┬──────┘ └───┬───┘ └────┬─────┘
308
- │ │ │ │ │
309
- └─────────────┴──────┬───────┴──────────────┴───────────┘
310
- MCP (stdio)
311
- ┌──────┴──────┐
312
- │ Memorix │
313
- │ MCP Server
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-674%20passed-brightgreen?style=flat-square" alt="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>LLM 压缩降低 27% token 消耗 | 重排序提升 60% 检索精度 | 支持 10 Agent</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
- ### 28 个 MCP 工具
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` · `memorix_export` · `memorix_import` |
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
- Cursor │ │ Claude │ │ Windsurf │ │ Codex │ │ +6 more │
285
- │ │ │ Code │ │ │ │ │ │ │
286
- └────┬────┘ └─────┬─────┘ └─────┬──────┘ └───┬───┘ └────┬─────┘
287
- │ │ │ │ │
288
- └─────────────┴──────┬───────┴──────────────┴───────────┘
289
- MCP (stdio)
290
- ┌──────┴──────┐
291
- │ Memorix │
292
- │ MCP Server
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 # 674 个测试
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
- console.log('[memorix] plugin loaded, directory:', directory);
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
- console.log('[memorix] hook fired:', payload.hook_event_name);
3392
- } catch (err) {
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
 
@@ -13867,8 +13868,8 @@ async function upsertObservation(existing, input, now) {
13867
13868
  status: "active"
13868
13869
  };
13869
13870
  try {
13870
- const { removeObservation: removeObservation2 } = await Promise.resolve().then(() => (init_orama_store(), orama_store_exports));
13871
- await removeObservation2(`obs-${existing.id}`);
13871
+ const { removeObservation: removeObservation3 } = await Promise.resolve().then(() => (init_orama_store(), orama_store_exports));
13872
+ await removeObservation3(`obs-${existing.id}`);
13872
13873
  } catch {
13873
13874
  }
13874
13875
  await insertObservation(doc);
@@ -14007,6 +14008,7 @@ function suggestTopicKey(type, title) {
14007
14008
  }
14008
14009
  async function reindexObservations() {
14009
14010
  if (observations.length === 0) return 0;
14011
+ await resetDb();
14010
14012
  let embeddings = [];
14011
14013
  if (isEmbeddingEnabled()) {
14012
14014
  try {
@@ -14022,8 +14024,9 @@ async function reindexObservations() {
14022
14024
  const obs = observations[i2];
14023
14025
  try {
14024
14026
  const embedding = embeddings[i2] ?? null;
14027
+ const docId = `obs-${obs.id}`;
14025
14028
  const doc = {
14026
- id: `obs-${obs.id}`,
14029
+ id: docId,
14027
14030
  observationId: obs.id,
14028
14031
  entityName: obs.entityName,
14029
14032
  type: obs.type,
@@ -14076,7 +14079,7 @@ __export(orama_store_exports, {
14076
14079
  getTimeline: () => getTimeline,
14077
14080
  insertObservation: () => insertObservation,
14078
14081
  isEmbeddingEnabled: () => isEmbeddingEnabled,
14079
- removeObservation: () => removeObservation,
14082
+ removeObservation: () => removeObservation2,
14080
14083
  resetDb: () => resetDb,
14081
14084
  searchObservations: () => searchObservations
14082
14085
  });
@@ -14132,7 +14135,7 @@ async function insertObservation(doc) {
14132
14135
  const database = await getDb();
14133
14136
  await insert3(database, doc);
14134
14137
  }
14135
- async function removeObservation(oramaId) {
14138
+ async function removeObservation2(oramaId) {
14136
14139
  const database = await getDb();
14137
14140
  await remove4(database, oramaId);
14138
14141
  }
@@ -45659,7 +45662,7 @@ async function createMemorixServer(cwd, existingServer, sharedTeam) {
45659
45662
  let syncAdvisory = null;
45660
45663
  const server = existingServer ?? new McpServer({
45661
45664
  name: "memorix",
45662
- version: "0.1.0"
45665
+ version: true ? "1.0.2" : "1.0.1"
45663
45666
  });
45664
45667
  server.registerTool(
45665
45668
  "memorix_store",
@@ -47306,12 +47309,32 @@ ${lines.join("\n")}` }] };
47306
47309
  }
47307
47310
  if (autoInstall) {
47308
47311
  const { getHookStatus: getHookStatus2, installHooks: installHooks2, detectInstalledAgents: detectInstalledAgents2 } = await Promise.resolve().then(() => (init_installers(), installers_exports));
47312
+ const { join: join18 } = await import("path");
47313
+ const { access: access2 } = await import("fs/promises");
47309
47314
  const workDir = cwd ?? process.cwd();
47310
47315
  const statuses = await getHookStatus2(workDir);
47311
47316
  const installedAgents = new Set(statuses.filter((s2) => s2.installed).map((s2) => s2.agent));
47312
47317
  const detectedAgents = await detectInstalledAgents2();
47318
+ const AGENT_MARKER_DIR = {
47319
+ claude: ".claude",
47320
+ windsurf: ".windsurf",
47321
+ cursor: ".cursor",
47322
+ copilot: ".vscode",
47323
+ opencode: ".opencode",
47324
+ kiro: ".kiro",
47325
+ antigravity: ".gemini",
47326
+ trae: ".trae"
47327
+ };
47313
47328
  for (const agent of detectedAgents) {
47314
47329
  if (installedAgents.has(agent)) continue;
47330
+ const markerDir = AGENT_MARKER_DIR[agent];
47331
+ if (markerDir) {
47332
+ try {
47333
+ await access2(join18(workDir, markerDir));
47334
+ } catch {
47335
+ continue;
47336
+ }
47337
+ }
47315
47338
  try {
47316
47339
  const config2 = await installHooks2(agent, workDir);
47317
47340
  console.error(`[memorix] Auto-installed hooks for ${agent} \u2192 ${config2.configPath}`);
@@ -47391,7 +47414,7 @@ ${lines.join("\n")}` }] };
47391
47414
  try {
47392
47415
  const older = group[i2], newer = group[i2 + 1];
47393
47416
  const decision = await deduplicateMemory2(
47394
- { id: newer.id, title: newer.title, narrative: newer.narrative, facts: newer.facts.join("\n") },
47417
+ { title: newer.title, narrative: newer.narrative, facts: newer.facts },
47395
47418
  [{ id: older.id, title: older.title, narrative: older.narrative, facts: older.facts.join("\n") }]
47396
47419
  );
47397
47420
  if (decision && (decision.action === "UPDATE" || decision.action === "NONE")) {
@@ -47675,7 +47698,7 @@ var init_serve = __esm({
47675
47698
  });
47676
47699
  } else {
47677
47700
  console.error(`[memorix] cwd may not be a valid project, trying MCP roots protocol...`);
47678
- const mcpServer = new McpServer2({ name: "memorix", version: "0.1.0" });
47701
+ const mcpServer = new McpServer2({ name: "memorix", version: true ? "1.0.2" : "1.0.1" });
47679
47702
  mcpServer.registerTool("_memorix_loading", {
47680
47703
  description: "Memorix is initializing, detecting project root...",
47681
47704
  inputSchema: {}
@@ -49577,7 +49600,7 @@ function normalizeGemini(payload, event) {
49577
49600
  }
49578
49601
  function normalizeOpenCode(payload, event) {
49579
49602
  const result = {
49580
- sessionId: "",
49603
+ sessionId: payload.session_id ?? payload.sessionId ?? "",
49581
49604
  cwd: payload.cwd ?? ""
49582
49605
  };
49583
49606
  const toolName = payload.tool_name ?? "";