create-ai-memory 0.15.1 → 0.15.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/README.md CHANGED
@@ -777,10 +777,10 @@ Six tools, read **and** write, so a GUI session is not a dead end:
777
777
  implementation, not a copy that drifts. A note written from Claude Desktop is
778
778
  committed and pushed exactly like one written in a terminal.
779
779
 
780
- MCP's `instructions` field carries a standing brief (read context first,
781
- search before solving, write back after) — without it a model has no reason
782
- to suspect a memory exists. Tool descriptions stay terse because schemas are
783
- re-sent every turn: six tools cost ~429 tokens/turn, the brief ~290 once.
780
+ The MCP initialization response carries the global profile and standards, plus
781
+ a standing brief (read context first, search before solving, write back after)
782
+ -- without it a model has no reason to suspect a memory exists. Tool
783
+ descriptions stay terse because schemas are re-sent every turn.
784
784
 
785
785
  **Do not register this for a terminal agent.** Claude Code, Codex, Gemini and
786
786
  opencode have a shell and should call `ai-mem-search` directly.
package/bin/ai-mem-mcp.js CHANGED
@@ -74,6 +74,24 @@ function zsh(snippet) {
74
74
  /** Shell-quote a value for safe interpolation into the zsh snippet. */
75
75
  const q = (s) => `'${String(s).replace(/'/g, `'\\''`)}'`;
76
76
 
77
+ /**
78
+ * Read one fixed vault note for the MCP instruction block.
79
+ *
80
+ * GUI models do not reliably call `get_context` before acting. The global
81
+ * profile and standards are therefore included in `initialize`, while
82
+ * project/session context stays in `get_context` because it needs a project.
83
+ *
84
+ * @param {string} rel vault-relative note path
85
+ * @returns {string}
86
+ */
87
+ function readVaultNote(rel) {
88
+ try {
89
+ return readFileSync(join(VAULT, rel), 'utf8').trim();
90
+ } catch {
91
+ return `[missing: ${rel}]`;
92
+ }
93
+ }
94
+
77
95
  /**
78
96
  * Resolve a note path and refuse anything outside the vault.
79
97
  *
@@ -113,6 +131,12 @@ function insideVault(p) {
113
131
  const INSTRUCTIONS = [
114
132
  "This is the user's persistent memory across every AI tool they use: past sessions, project decisions, and lessons learned the hard way.",
115
133
  '',
134
+ 'These global profile and standards are active instructions for this session:',
135
+ '--- _Global_Profile.md ---',
136
+ readVaultNote('_Global_Profile.md'),
137
+ '--- _Standards.md ---',
138
+ readVaultNote('_Standards.md'),
139
+ '',
116
140
  'Before answering anything about their work, call get_context. It returns their profile, standards, the current project note, and what the last session concluded.',
117
141
  'Before solving a problem, call search_memory -- they may have solved it already, and repeating a solved mistake is the failure this vault exists to prevent. Search broadly first; too specific a first query is the usual way to miss something.',
118
142
  'When you hit a blocker -- an error you do not understand, an unclear failure, or a second failed attempt at the same thing -- search again before guessing. Lessons rank above session logs, so a hit under _lessons/ is the recorded fix.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ai-memory",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Persistent, agent-agnostic session memory for AI coding CLIs (Claude Code, Codex, Gemini, Cursor, opencode). One Markdown vault, any agent.",
5
5
  "bin": {
6
6
  "create-ai-memory": "bin/create-ai-memory.js",