context-vault 3.7.0 → 3.9.0

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.
Files changed (73) hide show
  1. package/assets/agent-rules.md +28 -1
  2. package/assets/setup-prompt.md +16 -1
  3. package/bin/cli.js +1003 -7
  4. package/dist/auto-memory.d.ts +52 -0
  5. package/dist/auto-memory.d.ts.map +1 -0
  6. package/dist/auto-memory.js +142 -0
  7. package/dist/auto-memory.js.map +1 -0
  8. package/dist/register-tools.d.ts.map +1 -1
  9. package/dist/register-tools.js +2 -0
  10. package/dist/register-tools.js.map +1 -1
  11. package/dist/remote.d.ts +134 -0
  12. package/dist/remote.d.ts.map +1 -0
  13. package/dist/remote.js +242 -0
  14. package/dist/remote.js.map +1 -0
  15. package/dist/remote.test.d.ts +2 -0
  16. package/dist/remote.test.d.ts.map +1 -0
  17. package/dist/remote.test.js +107 -0
  18. package/dist/remote.test.js.map +1 -0
  19. package/dist/stats/recall.d.ts +33 -0
  20. package/dist/stats/recall.d.ts.map +1 -0
  21. package/dist/stats/recall.js +86 -0
  22. package/dist/stats/recall.js.map +1 -0
  23. package/dist/tools/context-status.d.ts.map +1 -1
  24. package/dist/tools/context-status.js +40 -0
  25. package/dist/tools/context-status.js.map +1 -1
  26. package/dist/tools/get-context.d.ts.map +1 -1
  27. package/dist/tools/get-context.js +44 -0
  28. package/dist/tools/get-context.js.map +1 -1
  29. package/dist/tools/publish-to-team.d.ts +11 -0
  30. package/dist/tools/publish-to-team.d.ts.map +1 -0
  31. package/dist/tools/publish-to-team.js +91 -0
  32. package/dist/tools/publish-to-team.js.map +1 -0
  33. package/dist/tools/publish-to-team.test.d.ts +2 -0
  34. package/dist/tools/publish-to-team.test.d.ts.map +1 -0
  35. package/dist/tools/publish-to-team.test.js +95 -0
  36. package/dist/tools/publish-to-team.test.js.map +1 -0
  37. package/dist/tools/recall.d.ts +1 -1
  38. package/dist/tools/recall.d.ts.map +1 -1
  39. package/dist/tools/recall.js +85 -1
  40. package/dist/tools/recall.js.map +1 -1
  41. package/dist/tools/save-context.d.ts +5 -1
  42. package/dist/tools/save-context.d.ts.map +1 -1
  43. package/dist/tools/save-context.js +163 -2
  44. package/dist/tools/save-context.js.map +1 -1
  45. package/dist/tools/session-start.d.ts.map +1 -1
  46. package/dist/tools/session-start.js +90 -86
  47. package/dist/tools/session-start.js.map +1 -1
  48. package/node_modules/@context-vault/core/dist/config.d.ts +3 -1
  49. package/node_modules/@context-vault/core/dist/config.d.ts.map +1 -1
  50. package/node_modules/@context-vault/core/dist/config.js +48 -2
  51. package/node_modules/@context-vault/core/dist/config.js.map +1 -1
  52. package/node_modules/@context-vault/core/dist/main.d.ts +1 -1
  53. package/node_modules/@context-vault/core/dist/main.d.ts.map +1 -1
  54. package/node_modules/@context-vault/core/dist/main.js.map +1 -1
  55. package/node_modules/@context-vault/core/dist/types.d.ts +7 -0
  56. package/node_modules/@context-vault/core/dist/types.d.ts.map +1 -1
  57. package/node_modules/@context-vault/core/package.json +1 -1
  58. package/node_modules/@context-vault/core/src/config.ts +50 -3
  59. package/node_modules/@context-vault/core/src/main.ts +1 -0
  60. package/node_modules/@context-vault/core/src/types.ts +8 -0
  61. package/package.json +2 -2
  62. package/src/auto-memory.ts +169 -0
  63. package/src/register-tools.ts +2 -0
  64. package/src/remote.test.ts +123 -0
  65. package/src/remote.ts +325 -0
  66. package/src/stats/recall.ts +139 -0
  67. package/src/tools/context-status.ts +40 -0
  68. package/src/tools/get-context.ts +44 -0
  69. package/src/tools/publish-to-team.test.ts +115 -0
  70. package/src/tools/publish-to-team.ts +112 -0
  71. package/src/tools/recall.ts +79 -1
  72. package/src/tools/save-context.ts +167 -1
  73. package/src/tools/session-start.ts +88 -100
@@ -1,4 +1,4 @@
1
- <!-- context-vault-rules v1.0 -->
1
+ <!-- context-vault-rules v1.1 -->
2
2
  # Context Vault — Agent Rules
3
3
 
4
4
  You have access to a persistent knowledge vault via MCP tools (`get_context`, `save_context`, `list_context`, `delete_context`). Use it to build lasting memory across sessions.
@@ -45,6 +45,33 @@ Every entry must have:
45
45
 
46
46
  Capture what was learned (the insight), why it matters (what problem it prevents), and when it applies (what context makes it relevant).
47
47
 
48
+ ## Team Sharing
49
+
50
+ If you have a team vault configured (`remote.teamId` is set), some entries you save locally may be useful to your teammates. After saving an entry, consider whether to suggest publishing it to the team vault.
51
+
52
+ **Suggest team sharing when ALL of these are true:**
53
+ - The user has a team vault configured
54
+ - The entry is kind: `insight`, `pattern`, or `reference`
55
+ - The content is generic enough to help teammates (not purely project-specific, unless the project is shared)
56
+ - The content does not contain sensitive data (no emails, API keys, passwords, tokens)
57
+
58
+ **Do NOT suggest team sharing when:**
59
+ - The entry is kind: `decision` (decisions are context-specific; the author should choose to share)
60
+ - The entry is kind: `event` (events are personal history)
61
+ - The entry is tagged with only personal or private buckets
62
+ - The content contains project-specific context that only makes sense to the author
63
+
64
+ **How to prompt:**
65
+
66
+ After saving a locally useful entry that matches the heuristics above:
67
+ ```
68
+ "This [insight/pattern/reference] about [topic] could be useful for your team. Publish to team vault?"
69
+ ```
70
+
71
+ If the user agrees, call `publish_to_team`. If the privacy scan flags matches, show them and offer to redact or force-publish.
72
+
73
+ **Restraint is key.** Do not prompt on every save. Only prompt when the entry is clearly team-relevant. When in doubt, skip the prompt. Over-prompting erodes trust faster than missed shares.
74
+
48
75
  ## Session Review
49
76
 
50
77
  At the end of significant work sessions, review what you learned. If the session produced novel knowledge (not every session does), save 1-3 consolidated entries. Prefer one solid entry over multiple fragments.
@@ -23,7 +23,21 @@ I just installed context-vault as an MCP server. Help me set it up properly for
23
23
 
24
24
  5. Scan my current workspace for projects (look for package.json, .git, Cargo.toml, pyproject.toml, etc.). For each project, propose a vault bucket name and create it if I approve.
25
25
 
26
- 6. Show me a summary of everything you configured.
26
+ 6. Check for Claude Code auto-memory integration:
27
+ - Look for auto-memory files at ~/.claude/projects/-<project-key>/memory/MEMORY.md
28
+ (project key = absolute cwd path with / replaced by -, leading - kept)
29
+ - If found, report stats: entry count, lines used out of 200 cap
30
+ - Offer to index existing memories into the vault as searchable copies
31
+ (kind: "reference", tags: ["auto-memory-indexed", "bucket:<project>"])
32
+ - This does NOT modify auto-memory files, only creates vault copies
33
+ - Mention the /vault overflow command for future overflow management
34
+
35
+ 7. Check for team vault configuration:
36
+ - Look for remote.teamId in the vault config (via context_status())
37
+ - If a team is configured, confirm the agent rules include team sharing heuristics
38
+ - If no team is configured, mention that teams can be set up later via the app at https://app.context-vault.com
39
+
40
+ 8. Show me a summary of everything you configured.
27
41
 
28
42
  Important:
29
43
  - Never modify my existing rules files. Only create a new dedicated context-vault rules file or append with clear delimiter markers.
@@ -41,6 +55,7 @@ After running this prompt, your AI agent will:
41
55
  - **Detect** your existing rules and avoid conflicts
42
56
  - **Install** a rules file that teaches the agent when to save knowledge automatically
43
57
  - **Configure** project-specific vault buckets for organized storage
58
+ - **Detect** Claude Code auto-memory and offer to index entries into the vault
44
59
 
45
60
  The rules file is a small (~50 lines) markdown file that guides your agent on:
46
61
  - When to save (after solving non-obvious bugs, finding undocumented behavior, etc.)