memorix 0.9.27 → 0.9.29

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/dist/cli/index.js CHANGED
@@ -40644,17 +40644,20 @@ function generateCopilotConfig() {
40644
40644
  }
40645
40645
  function generateGeminiConfig() {
40646
40646
  const cmd = `${resolveHookCommand()} hook`;
40647
- const hookEntry = {
40648
- type: "command",
40649
- command: cmd,
40650
- timeout: 1e4
40651
- };
40647
+ function entry(name, desc) {
40648
+ return {
40649
+ matcher: "*",
40650
+ hooks: [{ name, type: "command", command: cmd, description: desc }]
40651
+ };
40652
+ }
40652
40653
  return {
40654
+ tools: { enableHooks: true },
40653
40655
  hooks: {
40654
- SessionStart: [{ hooks: [hookEntry] }],
40655
- AfterTool: [{ hooks: [hookEntry] }],
40656
- AfterAgent: [{ hooks: [hookEntry] }],
40657
- PreCompress: [{ hooks: [hookEntry] }]
40656
+ enabled: true,
40657
+ SessionStart: [entry("memorix-session-start", "Load memorix context at session start")],
40658
+ AfterTool: [entry("memorix-after-tool", "Record tool usage in memorix")],
40659
+ AfterAgent: [entry("memorix-after-agent", "Record agent response in memorix")],
40660
+ PreCompress: [entry("memorix-pre-compress", "Save context before compression")]
40658
40661
  }
40659
40662
  };
40660
40663
  }
@@ -40877,6 +40880,10 @@ async function installHooks(agent, projectRoot, global = false) {
40877
40880
  const existingHooks = existing.hooks && typeof existing.hooks === "object" ? existing.hooks : {};
40878
40881
  merged.hooks = { ...existingHooks, ...gen.hooks };
40879
40882
  }
40883
+ if (gen.tools && typeof gen.tools === "object") {
40884
+ const existingTools = existing.tools && typeof existing.tools === "object" ? existing.tools : {};
40885
+ merged.tools = { ...existingTools, ...gen.tools };
40886
+ }
40880
40887
  await fs5.writeFile(configPath, JSON.stringify(merged, null, 2), "utf-8");
40881
40888
  }
40882
40889
  const events = [];
@@ -40928,13 +40935,16 @@ async function installAgentRules(agent, projectRoot) {
40928
40935
  case "kiro":
40929
40936
  rulesPath = path7.join(projectRoot, ".kiro", "steering", "memorix.md");
40930
40937
  break;
40938
+ case "antigravity":
40939
+ rulesPath = path7.join(projectRoot, "GEMINI.md");
40940
+ break;
40931
40941
  default:
40932
40942
  rulesPath = path7.join(projectRoot, ".agent", "rules", "memorix.md");
40933
40943
  break;
40934
40944
  }
40935
40945
  try {
40936
40946
  await fs5.mkdir(path7.dirname(rulesPath), { recursive: true });
40937
- if (agent === "codex") {
40947
+ if (agent === "codex" || agent === "antigravity") {
40938
40948
  try {
40939
40949
  const existing = await fs5.readFile(rulesPath, "utf-8");
40940
40950
  if (existing.includes("Memorix")) {
@@ -40972,58 +40982,42 @@ alwaysApply: true
40972
40982
  }
40973
40983
  return `${frontmatter}# Memorix \u2014 Automatic Memory Rules
40974
40984
 
40975
- You have access to Memorix memory tools. Follow these rules to maintain persistent context across sessions.
40985
+ You have access to Memorix memory tools. You MUST follow these rules to maintain persistent context across sessions.
40986
+ These rules are NOT optional \u2014 they are critical for cross-session memory continuity.
40976
40987
 
40977
- ## Session Start \u2014 Load Context
40988
+ ## RULE 1: Session Start \u2014 Load Context (MUST)
40978
40989
 
40979
- At the **beginning of every conversation**, before responding to the user:
40990
+ At the **beginning of every conversation**, BEFORE responding to the user:
40980
40991
 
40981
40992
  1. Call \`memorix_search\` with a query related to the user's first message or the current project
40982
40993
  2. If results are found, use \`memorix_detail\` to fetch the most relevant ones
40983
- 3. Reference relevant memories naturally in your response \u2014 the user should feel you "remember" them
40984
-
40985
- This ensures you already know the project context without the user re-explaining.
40994
+ 3. Reference relevant memories naturally in your response
40986
40995
 
40987
- ## During Session \u2014 Capture Important Context
40996
+ > **CRITICAL**: Do NOT skip this step. The user expects you to "remember" previous sessions.
40988
40997
 
40989
- **Proactively** call \`memorix_store\` whenever any of the following happen:
40998
+ ## RULE 2: After Every Action \u2014 Check & Record (MUST)
40990
40999
 
40991
- ### Architecture & Decisions
40992
- - Technology choice, framework selection, or design pattern adopted
40993
- - Trade-off discussion with a clear conclusion
40994
- - API design, database schema, or project structure decisions
41000
+ After EVERY tool call that modifies state (file create/edit, shell command, config change), run this checklist:
40995
41001
 
40996
- ### Bug Fixes & Problem Solving
40997
- - A bug is identified and resolved \u2014 store root cause + fix
40998
- - Workaround applied for a known issue
40999
- - Performance issue diagnosed and optimized
41002
+ **Ask yourself: "Would a different AI agent need to know about this?"**
41003
+ - If YES \u2192 call \`memorix_store\` IMMEDIATELY, BEFORE replying to the user
41004
+ - If NO \u2192 skip (e.g., simple file reads, ls/dir, greetings)
41000
41005
 
41001
- ### Gotchas & Pitfalls
41002
- - Something unexpected or tricky is discovered
41003
- - A common mistake is identified and corrected
41004
- - Platform-specific behavior that caused issues
41006
+ ### What MUST be recorded:
41007
+ - \u2705 File created or significantly modified \u2192 type: \`what-changed\`
41008
+ - \u2705 Bug identified and fixed \u2192 type: \`problem-solution\`
41009
+ - \u2705 Architecture or design decision made \u2192 type: \`decision\`
41010
+ - \u2705 Unexpected behavior or gotcha discovered \u2192 type: \`gotcha\`
41011
+ - \u2705 Configuration changed (env vars, ports, deps) \u2192 type: \`what-changed\`
41012
+ - \u2705 Feature completed or milestone reached \u2192 type: \`what-changed\`
41013
+ - \u2705 Trade-off discussed with conclusion \u2192 type: \`trade-off\`
41005
41014
 
41006
- ### Configuration & Environment
41007
- - Environment variables, port numbers, paths changed
41008
- - Docker, nginx, Caddy, or reverse proxy config modified
41009
- - Package dependencies added, removed, or version-pinned
41015
+ ### What should NOT be recorded:
41016
+ - \u274C Simple file reads without findings
41017
+ - \u274C Greetings, acknowledgments
41018
+ - \u274C Trivial commands (ls, pwd, git status with no issues)
41010
41019
 
41011
- ### Deployment & Operations
41012
- - Server deployment steps (Docker, VPS, cloud)
41013
- - DNS, SSL/TLS certificate, domain configuration
41014
- - CI/CD pipeline setup or changes
41015
- - Database migration or data transfer procedures
41016
- - Server topology (ports, services, reverse proxy chain)
41017
- - SSH keys, access credentials setup (store pattern, NOT secrets)
41018
-
41019
- ### Project Milestones
41020
- - Feature completed or shipped
41021
- - Version released or published to npm/PyPI/etc.
41022
- - Repository made public, README updated, PR submitted
41023
-
41024
- Use appropriate types: \`decision\`, \`problem-solution\`, \`gotcha\`, \`what-changed\`, \`discovery\`, \`how-it-works\`.
41025
-
41026
- ## Session End \u2014 Store Summary
41020
+ ## RULE 3: Session End \u2014 Store Summary (MUST)
41027
41021
 
41028
41022
  When the conversation is ending or the user says goodbye:
41029
41023
 
@@ -41037,13 +41031,12 @@ This creates a "handoff note" for the next session (or for another AI agent).
41037
41031
 
41038
41032
  ## Guidelines
41039
41033
 
41040
- - **Don't store trivial information** (greetings, acknowledgments, simple file reads, ls/dir output)
41041
- - **Do store anything you'd want to know if you lost all context**
41042
- - **Do store anything a different AI agent would need to continue this work**
41043
41034
  - **Use concise titles** (~5-10 words) and structured facts
41044
41035
  - **Include file paths** in filesModified when relevant
41045
41036
  - **Include related concepts** for better searchability
41046
41037
  - **Prefer storing too much over too little** \u2014 the retention system will auto-decay stale memories
41038
+
41039
+ Use types: \`decision\`, \`problem-solution\`, \`gotcha\`, \`what-changed\`, \`discovery\`, \`how-it-works\`, \`trade-off\`.
41047
41040
  `;
41048
41041
  }
41049
41042
  async function uninstallHooks(agent, projectRoot, global = false) {