memorix 0.6.2 → 0.6.3

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
@@ -7,7 +7,7 @@
7
7
  <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=flat-square&color=blue" alt="npm downloads"></a>
8
8
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat-square" alt="License"></a>
9
9
  <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=flat-square&color=yellow" alt="GitHub stars"></a>
10
- <img src="https://img.shields.io/badge/tests-274%20passed-brightgreen?style=flat-square" alt="Tests">
10
+ <img src="https://img.shields.io/badge/tests-405%20passed-brightgreen?style=flat-square" alt="Tests">
11
11
  </p>
12
12
  <p align="center">
13
13
  <a href="#-quick-start">Quick Start</a> •
@@ -20,9 +20,9 @@
20
20
 
21
21
  ---
22
22
 
23
- > **One project, six agents, zero context loss.**
23
+ > **One project, seven agents, zero context loss.**
24
24
  >
25
- > Memorix is a **cross-agent memory bridge** — it lets Cursor, Windsurf, Claude Code, Codex, Copilot, and Antigravity **share the same project knowledge** in real-time. Architecture decisions made in one IDE are instantly available in another. Switch tools, open new windows, start fresh sessions — your context follows you everywhere via [MCP](https://modelcontextprotocol.io/). It also **syncs MCP configs, rules, skills, and workflows** across all your agents automatically.
25
+ > Memorix is a **cross-agent memory bridge** — it lets Cursor, Windsurf, Claude Code, Codex, Copilot, Antigravity, and **Kiro** **share the same project knowledge** in real-time. Architecture decisions made in one IDE are instantly available in another. Switch tools, open new windows, start fresh sessions — your context follows you everywhere via [MCP](https://modelcontextprotocol.io/). It also **syncs MCP configs, rules, skills, and workflows** across all your agents automatically.
26
26
 
27
27
  ---
28
28
 
@@ -46,7 +46,7 @@ Add Memorix to your agent's MCP config — **that's it**. No global install need
46
46
 
47
47
  Restart your agent and Memorix is running! 🎉
48
48
 
49
- > 💡 More agent configs: [Cursor](#cursor) • [Claude Code](#claude-code) • [Codex](#codex) • [VS Code Copilot](#vs-code-copilot) • [Antigravity](#antigravity)
49
+ > 💡 More agent configs: [Cursor](#cursor) • [Claude Code](#claude-code) • [Codex](#codex) • [VS Code Copilot](#vs-code-copilot) • [Antigravity](#antigravity) • [Kiro](#kiro)
50
50
 
51
51
  ### Or Install Globally
52
52
 
@@ -93,7 +93,7 @@ Then use `"command": "memorix"` instead of `"command": "npx"` in your config.
93
93
 
94
94
  ### 🔄 Cross-Agent Workspace Sync
95
95
 
96
- - **6 Agent Adapters** — Windsurf, Cursor, Claude Code, Codex, VS Code Copilot, Antigravity
96
+ - **7 Agent Adapters** — Windsurf, Cursor, Claude Code, Codex, VS Code Copilot, Antigravity, **Kiro**
97
97
  - **MCP Config Migration** — Detect and migrate MCP server configs (merges — never overwrites)
98
98
  - **Rules Sync** — Scan → Deduplicate → Conflict detection → Cross-format generation
99
99
  - **Skills & Workflows** — Copy skill folders and workflow files across agents
@@ -113,11 +113,13 @@ Then use `"command": "memorix"` instead of `"command": "npx"` in your config.
113
113
  - **Project Switcher** — Dropdown to view any project's data without switching IDEs
114
114
  - **Knowledge Graph** — Interactive visualization of entities and relations
115
115
  - **Retention Scores** — Exponential decay scoring with immunity status
116
+ - **Observation Management** — Expand/collapse details, search, delete with confirmation, data export
116
117
  - **Light/Dark Theme** — Premium glassmorphism design, bilingual (EN/中文)
117
118
 
118
119
  ### 🪝 Auto-Memory Hooks
119
120
 
120
121
  - **Implicit Memory** — Auto-captures decisions, errors, gotchas from agent activity
122
+ - **Session Start Injection** — Intelligently loads recent high-value memories (gotchas, decisions, problem-solutions) and injects a concise summary into the agent's system prompt at session start
121
123
  - **Multi-Language Pattern Detection** — English + Chinese keyword matching
122
124
  - **Cooldown & Noise Filtering** — 30s cooldown, skips trivial commands (ls, cat, pwd)
123
125
  - **One-Command Install** — `memorix hooks install` sets up hooks + rules for your agent
@@ -204,6 +206,20 @@ args = ["-y", "memorix@latest", "serve"]
204
206
  }
205
207
  ```
206
208
 
209
+ ### Kiro
210
+
211
+ `.kiro/settings/mcp.json`:
212
+ ```json
213
+ {
214
+ "mcpServers": {
215
+ "memorix": {
216
+ "command": "npx",
217
+ "args": ["-y", "memorix@latest", "serve"]
218
+ }
219
+ }
220
+ }
221
+ ```
222
+
207
223
  ---
208
224
 
209
225
  ## 🛠 Available MCP Tools
@@ -278,33 +294,33 @@ Files: ["src/auth/jwt.ts", "src/config.ts"]
278
294
  ### Architecture
279
295
 
280
296
  ```
281
- ┌──────────────────────────────────────────────────────────────┐
282
- AI Coding Agents
283
- │ Windsurf │ Cursor │ Claude Code │ Codex │ Copilot │ Antigravity
284
- └────────────────────────┬─────────────────────────────────────┘
285
- │ MCP Protocol (stdio)
286
- ┌────────────────────────▼─────────────────────────────────────┐
287
- Memorix MCP Server (17 tools)
288
-
289
- │ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐
290
- │ │ Memory │ │ Compact │ │ Workspace Sync │
291
- │ │ Layer │ │ Engine │ │ (6 adapters) │
292
- │ │ │ │ (3-layer) │ │ │
293
- │ │ • Graph │ │ │ │ • MCP Configs │
294
- │ │ • Retention │ │ │ │ • Rules │
295
- │ │ • Entities │ │ │ │ • Skills │
296
- │ │ • Relations │ │ │ │ • Workflows │
297
- │ └──────┬──────┘ └──────┬───────┘ └──────────────────┘
298
- │ │ │
299
- │ ┌──────▼────────────────▼───────────────────────────────┐
300
- │ │ Orama Store (BM25 + Vector) │ Persistence (JSONL) │
301
- │ └───────────────────────────────────────────────────────┘
302
-
303
- │ ┌───────────────────────────────────────────────────────┐
304
- │ │ Hooks System: Normalizer → Pattern Detector → Store │
305
- │ │ (Auto-captures decisions, bugs, gotchas from agents) │
306
- │ └───────────────────────────────────────────────────────┘
307
- └──────────────────────────────────────────────────────────────┘
297
+ ┌───────────────────────────────────────────────────────────────────┐
298
+ AI Coding Agents
299
+ │ Windsurf │ Cursor │ Claude Code │ Codex │ Copilot │ Antigravity │ Kiro
300
+ └───────────────────────────┬───────────────────────────────────────┘
301
+ │ MCP Protocol (stdio)
302
+ ┌───────────────────────────▼───────────────────────────────────────┐
303
+ Memorix MCP Server (17 tools)
304
+
305
+ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐
306
+ │ │ Memory │ │ Compact │ │ Workspace Sync │
307
+ │ │ Layer │ │ Engine │ │ (7 adapters) │
308
+ │ │ │ │ (3-layer) │ │ │
309
+ │ │ • Graph │ │ │ │ • MCP Configs │
310
+ │ │ • Retention │ │ │ │ • Rules │
311
+ │ │ • Entities │ │ │ │ • Skills │
312
+ │ │ • Relations │ │ │ │ • Workflows │
313
+ │ └──────┬──────┘ └──────┬───────┘ └──────────────────┘
314
+ │ │ │
315
+ │ ┌──────▼────────────────▼───────────────────────────────┐
316
+ │ │ Orama Store (BM25 + Vector) │ Persistence (JSONL) │
317
+ │ └───────────────────────────────────────────────────────┘
318
+
319
+ │ ┌───────────────────────────────────────────────────────┐
320
+ │ │ Hooks System: Normalizer → Pattern Detector → Store │
321
+ │ │ (Auto-captures decisions, bugs, gotchas from agents) │
322
+ │ └───────────────────────────────────────────────────────┘
323
+ └───────────────────────────────────────────────────────────────────┘
308
324
  ```
309
325
 
310
326
  ---
@@ -349,7 +365,7 @@ cd memorix
349
365
  npm install
350
366
 
351
367
  npm run dev # tsup watch mode
352
- npm test # vitest (274 tests)
368
+ npm test # vitest (405 tests)
353
369
  npm run lint # TypeScript type check
354
370
  npm run build # Production build
355
371
  ```
@@ -366,7 +382,7 @@ src/
366
382
  ├── embedding/ # Optional fastembed vector provider
367
383
  ├── hooks/ # Auto-memory hooks (normalizer + pattern detector)
368
384
  ├── workspace/ # Cross-agent MCP/workflow/skills sync
369
- ├── rules/ # Cross-agent rules sync (6 adapters)
385
+ ├── rules/ # Cross-agent rules sync (7 adapters)
370
386
  ├── dashboard/ # Visual web dashboard (knowledge graph, stats)
371
387
  ├── project/ # Git-based project detection
372
388
  └── cli/ # CLI commands (serve, hook, sync, dashboard)
package/dist/cli/index.js CHANGED
@@ -3409,7 +3409,7 @@ async function installAgentRules(agent, projectRoot) {
3409
3409
  rulesPath = path5.join(projectRoot, "AGENTS.md");
3410
3410
  break;
3411
3411
  case "kiro":
3412
- rulesPath = path5.join(projectRoot, ".kiro", "rules", "memorix.md");
3412
+ rulesPath = path5.join(projectRoot, ".kiro", "steering", "memorix.md");
3413
3413
  break;
3414
3414
  default:
3415
3415
  rulesPath = path5.join(projectRoot, ".agent", "rules", "memorix.md");
@@ -4820,7 +4820,8 @@ var init_sync = __esm({
4820
4820
  "claude-code": "Claude Code (CLAUDE.md, .claude/rules/*.md)",
4821
4821
  codex: "Codex (SKILL.md, AGENTS.md)",
4822
4822
  windsurf: "Windsurf (.windsurfrules, .windsurf/rules/*.md)",
4823
- antigravity: "Antigravity (.agent/rules/*.md, GEMINI.md)"
4823
+ antigravity: "Antigravity (.agent/rules/*.md, GEMINI.md)",
4824
+ kiro: "Kiro (.kiro/steering/*.md, AGENTS.md)"
4824
4825
  };
4825
4826
  sync_default = defineCommand3({
4826
4827
  meta: {
@@ -4830,7 +4831,7 @@ var init_sync = __esm({
4830
4831
  args: {
4831
4832
  target: {
4832
4833
  type: "string",
4833
- description: "Target agent format (cursor, claude-code, codex, windsurf, antigravity)",
4834
+ description: "Target agent format (cursor, claude-code, codex, windsurf, antigravity, kiro)",
4834
4835
  required: false
4835
4836
  },
4836
4837
  dry: {
@@ -4873,11 +4874,11 @@ var init_sync = __esm({
4873
4874
  }
4874
4875
  let target = args.target;
4875
4876
  if (!target) {
4876
- const available = ["cursor", "claude-code", "codex", "windsurf", "antigravity"].filter(
4877
+ const available = ["cursor", "claude-code", "codex", "windsurf", "antigravity", "kiro"].filter(
4877
4878
  (t) => !sources.includes(t)
4878
4879
  );
4879
4880
  if (available.length === 0) {
4880
- available.push("cursor", "claude-code", "codex", "windsurf", "antigravity");
4881
+ available.push("cursor", "claude-code", "codex", "windsurf", "antigravity", "kiro");
4881
4882
  }
4882
4883
  const selected = await p2.select({
4883
4884
  message: "Generate rules for which agent?",
@@ -5306,14 +5307,65 @@ async function handleHookEvent(input) {
5306
5307
  return { observation: null, output: defaultOutput };
5307
5308
  }
5308
5309
  switch (input.event) {
5309
- case "session_start":
5310
+ case "session_start": {
5311
+ let contextSummary = "";
5312
+ try {
5313
+ const { detectProject: detectProject2 } = await Promise.resolve().then(() => (init_detector(), detector_exports));
5314
+ const { getProjectDataDir: getProjectDataDir2, loadObservationsJson: loadObservationsJson2 } = await Promise.resolve().then(() => (init_persistence(), persistence_exports));
5315
+ const project = await detectProject2(input.cwd || process.cwd());
5316
+ const dataDir = await getProjectDataDir2(project.id);
5317
+ const allObs = await loadObservationsJson2(dataDir);
5318
+ if (allObs.length > 0) {
5319
+ const PRIORITY_ORDER = {
5320
+ "gotcha": 6,
5321
+ "decision": 5,
5322
+ "problem-solution": 4,
5323
+ "trade-off": 3,
5324
+ "discovery": 2,
5325
+ "how-it-works": 1
5326
+ };
5327
+ const scored = allObs.map((obs, i) => ({
5328
+ obs,
5329
+ priority: PRIORITY_ORDER[obs.type ?? ""] ?? 0,
5330
+ recency: i
5331
+ // higher index = more recent
5332
+ })).sort((a, b) => {
5333
+ if (b.priority !== a.priority) return b.priority - a.priority;
5334
+ return b.recency - a.recency;
5335
+ });
5336
+ const top = scored.slice(0, 5);
5337
+ const TYPE_EMOJI = {
5338
+ "gotcha": "\u{1F534}",
5339
+ "decision": "\u{1F7E4}",
5340
+ "problem-solution": "\u{1F7E1}",
5341
+ "trade-off": "\u2696\uFE0F",
5342
+ "discovery": "\u{1F7E3}",
5343
+ "how-it-works": "\u{1F535}",
5344
+ "what-changed": "\u{1F7E2}",
5345
+ "why-it-exists": "\u{1F7E0}",
5346
+ "session-request": "\u{1F3AF}"
5347
+ };
5348
+ const lines = top.map(({ obs }) => {
5349
+ const emoji = TYPE_EMOJI[obs.type ?? ""] ?? "\u{1F4CC}";
5350
+ const title = obs.title ?? "(untitled)";
5351
+ const fact = obs.facts?.[0] ? ` \u2014 ${obs.facts[0]}` : "";
5352
+ return `${emoji} ${title}${fact}`;
5353
+ });
5354
+ contextSummary = `
5355
+
5356
+ Recent project memories (${project.name}):
5357
+ ${lines.join("\n")}`;
5358
+ }
5359
+ } catch {
5360
+ }
5310
5361
  return {
5311
5362
  observation: null,
5312
5363
  output: {
5313
5364
  continue: true,
5314
- systemMessage: "Memorix is active. Your memories from previous sessions are available via memorix_search."
5365
+ systemMessage: `Memorix is active. Your memories from previous sessions are available via memorix_search.${contextSummary}`
5315
5366
  }
5316
5367
  };
5368
+ }
5317
5369
  case "pre_compact":
5318
5370
  return {
5319
5371
  observation: buildObservation(input, extractContent(input)),