engram-mcp-server 1.7.0 → 1.7.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 +283 -62
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +10 -2
- package/dist/database.js.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/installer/config-writer.d.ts +6 -2
- package/dist/installer/config-writer.d.ts.map +1 -1
- package/dist/installer/config-writer.js +17 -5
- package/dist/installer/config-writer.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +22 -16
- package/dist/installer/index.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +8 -0
- package/dist/migrations.js.map +1 -1
- package/dist/modes/universal.d.ts.map +1 -1
- package/dist/modes/universal.js +44 -8
- package/dist/modes/universal.js.map +1 -1
- package/dist/repositories/file-notes.repo.d.ts +4 -4
- package/dist/repositories/file-notes.repo.d.ts.map +1 -1
- package/dist/repositories/file-notes.repo.js +21 -2
- package/dist/repositories/file-notes.repo.js.map +1 -1
- package/dist/tools/dispatcher-admin.d.ts.map +1 -1
- package/dist/tools/dispatcher-admin.js +55 -0
- package/dist/tools/dispatcher-admin.js.map +1 -1
- package/dist/tools/dispatcher-memory.d.ts.map +1 -1
- package/dist/tools/dispatcher-memory.js +29 -16
- package/dist/tools/dispatcher-memory.js.map +1 -1
- package/dist/tools/find.d.ts.map +1 -1
- package/dist/tools/find.js +8 -5
- package/dist/tools/find.js.map +1 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +7 -3
- package/dist/tools/sessions.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
- [Overview](#overview)
|
|
22
22
|
- [Why Engram?](#why-engram)
|
|
23
23
|
- [Installation (Auto & Manual)](#installation)
|
|
24
|
-
- [✨ What's New in v1.7.
|
|
24
|
+
- [✨ What's New in v1.7.2](#-whats-new-in-v172)
|
|
25
|
+
- [What's New in v1.7.0](#-whats-new-in-v170)
|
|
25
26
|
- [What's New in v1.6.0](#-whats-new-in-v160)
|
|
26
27
|
- [Features](#features)
|
|
27
28
|
- [Architecture](#architecture)
|
|
@@ -55,6 +56,45 @@ Engram solves this by providing a **persistent brain** using a native SQLite (WA
|
|
|
55
56
|
|
|
56
57
|
---
|
|
57
58
|
|
|
59
|
+
## ✨ What's New in v1.7.2
|
|
60
|
+
|
|
61
|
+
**v1.7.2** is a hotfix release addressing 20 bugs found during a systematic functional audit of the v1.7.0 tool surface.
|
|
62
|
+
|
|
63
|
+
### 🔒 Enum Validation for Change, Task, and Scope Fields
|
|
64
|
+
|
|
65
|
+
`record_change`, `create_task`, and related actions now enforce enum validation on `change_type`, `impact_scope`, and `priority`. Previously, arbitrary strings were silently accepted, corrupting query results and task filtering.
|
|
66
|
+
|
|
67
|
+
- `change_type`: `created | modified | deleted | refactored | renamed | moved | config_changed`
|
|
68
|
+
- `impact_scope`: `local | module | cross_module | global`
|
|
69
|
+
- `priority`: `critical | high | medium | low`
|
|
70
|
+
|
|
71
|
+
### 📡 Directed Broadcasts — `target_agent` Now Works
|
|
72
|
+
|
|
73
|
+
`engram_memory(action:"broadcast", target_agent:"agent-name")` now correctly stores and filters directed messages. Previously the `target_agent` column was missing from the DB schema and the `agent_sync` query had no filter — all agents received all broadcasts regardless.
|
|
74
|
+
|
|
75
|
+
### ⏱️ `what_changed { since: "session_start" }` Fixed
|
|
76
|
+
|
|
77
|
+
The `"session_start"` sentinel value is now resolved to the current session's `started_at` timestamp before the SQL query. Previously it was passed literally, always returning zero results.
|
|
78
|
+
|
|
79
|
+
### 🔧 Universal Mode Array Coercion Fixed
|
|
80
|
+
|
|
81
|
+
`set_file_notes` with `dependencies` passed as a JSON string (e.g. `"[\"src/a.ts\"]"`) no longer crashes in Universal Mode. A `parseDepsField()` helper now handles both native arrays and JSON-encoded strings at the repository layer — compensating for the `HandlerCapturer` bypass of Zod preprocessing.
|
|
82
|
+
|
|
83
|
+
### ✅ API Correctness Fixes (ISS-001 – ISS-015)
|
|
84
|
+
|
|
85
|
+
- `generate_report` and `get_global_knowledge` return real data
|
|
86
|
+
- `backup` no longer returns ENOENT
|
|
87
|
+
- `get_tasks { status:"all" }` returns all tasks
|
|
88
|
+
- `acknowledge_event { approved:false }` snoozes the event
|
|
89
|
+
- `config { op:"get", key:X }` returns only that key's value
|
|
90
|
+
- `record_milestone` version prefix no longer doubled
|
|
91
|
+
- `dump` no longer creates a spurious change record
|
|
92
|
+
- `NoActiveSessionError` message uses correct v1.7 syntax
|
|
93
|
+
|
|
94
|
+
> Full changelog: [RELEASE_NOTES.md](RELEASE_NOTES.md)
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
58
98
|
## ✨ What's New in v1.7.0
|
|
59
99
|
|
|
60
100
|
**v1.7.0** is a precision token-efficiency release — six improvement tracks with zero breaking changes to the 4-dispatcher API surface.
|
|
@@ -211,10 +251,17 @@ Run this single command in your terminal. It will automatically detect your IDE
|
|
|
211
251
|
npx -y engram-mcp-server --install
|
|
212
252
|
```
|
|
213
253
|
|
|
254
|
+
**Universal mode** (~80 token single-tool schema — recommended for token-conscious setups):
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
npx -y engram-mcp-server --install --universal
|
|
258
|
+
```
|
|
259
|
+
|
|
214
260
|
**Non-interactive mode (CI/CD / Scripting):**
|
|
215
261
|
|
|
216
262
|
```bash
|
|
217
263
|
npx -y engram-mcp-server install --ide vscode --yes
|
|
264
|
+
npx -y engram-mcp-server install --ide vscode --universal --yes
|
|
218
265
|
```
|
|
219
266
|
|
|
220
267
|
**Clean removal:**
|
|
@@ -461,6 +508,22 @@ In the extension settings → MCP Servers:
|
|
|
461
508
|
|
|
462
509
|
</details>
|
|
463
510
|
|
|
511
|
+
### Verifying Your Installation
|
|
512
|
+
|
|
513
|
+
After installing, verify Engram is working by running:
|
|
514
|
+
|
|
515
|
+
```bash
|
|
516
|
+
npx -y engram-mcp-server --check
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Or use the MCP Inspector for a full interactive test:
|
|
520
|
+
|
|
521
|
+
```bash
|
|
522
|
+
npx @modelcontextprotocol/inspector npx -y engram-mcp-server
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
In your IDE, open the AI chat and ask the agent to call `engram_session(action:"start")`. If it returns a session ID and tool catalog, Engram is running correctly.
|
|
526
|
+
|
|
464
527
|
---
|
|
465
528
|
|
|
466
529
|
## Features
|
|
@@ -601,51 +664,75 @@ Engram v1.7.0 exposes **4 dispatcher tools** (or 1 tool in `--mode=universal`).
|
|
|
601
664
|
|
|
602
665
|
## Using with AI Agents
|
|
603
666
|
|
|
604
|
-
|
|
667
|
+
> **Copy-paste ready.** Copy everything between the `<!-- ENGRAM_INSTRUCTIONS_START -->` and `<!-- ENGRAM_INSTRUCTIONS_END -->` markers below directly into your agent's instruction file — `CLAUDE.md`, `.github/copilot-instructions.md`, Cursor Rules, or equivalent. No reformatting needed. Works as-is.
|
|
668
|
+
|
|
669
|
+
<!-- ENGRAM_INSTRUCTIONS_START -->
|
|
670
|
+
|
|
671
|
+
## Engram — Persistent Memory MCP (v1.7)
|
|
672
|
+
|
|
673
|
+
Engram is a persistent memory MCP server. It gives AI agents session continuity, change tracking, decision logging, and multi-agent coordination across sessions — all via a SQLite database. The API surface is **4 dispatcher tools** (or **1 tool** in universal mode) — each routed via an `action` parameter. Schema tokens: ~1,600 per call in standard mode, ~80 in universal mode.
|
|
605
674
|
|
|
606
|
-
|
|
675
|
+
Follow these rules **every session, every project**.
|
|
607
676
|
|
|
608
677
|
---
|
|
609
678
|
|
|
610
|
-
###
|
|
679
|
+
### Dispatcher Tools
|
|
611
680
|
|
|
612
|
-
|
|
681
|
+
| Tool | Responsibility |
|
|
682
|
+
| ---------------- | ------------------------------------------------- |
|
|
683
|
+
| `engram_session` | Session lifecycle (start, end, handoffs, history) |
|
|
684
|
+
| `engram_memory` | All memory operations (34+ actions) |
|
|
685
|
+
| `engram_admin` | Maintenance, git hooks, backup, config, stats |
|
|
686
|
+
| `engram_find` | Tool catalog search + convention linting |
|
|
687
|
+
|
|
688
|
+
> If running in **universal mode** (`--mode=universal`), all actions route through a single `engram` tool instead. Call `engram({ action: "start" })` etc.
|
|
689
|
+
|
|
690
|
+
> Use `engram_find({ query: "what I want to do" })` whenever you don't know the exact `action` name.
|
|
691
|
+
|
|
692
|
+
---
|
|
693
|
+
|
|
694
|
+
### 1. Session Start — Always First
|
|
695
|
+
|
|
696
|
+
**Before reading any file or taking any action**, call `engram_session(action:"start")`.
|
|
613
697
|
|
|
614
698
|
```js
|
|
615
699
|
engram_session({
|
|
616
700
|
action: "start",
|
|
617
701
|
agent_name: "claude",
|
|
618
702
|
verbosity: "summary",
|
|
619
|
-
focus: "
|
|
703
|
+
focus: "topic if known",
|
|
620
704
|
});
|
|
621
705
|
```
|
|
622
706
|
|
|
623
|
-
|
|
707
|
+
- **Verbosity** — Use `"summary"` by default. Use `"minimal"` for count-only context. Use `"nano"` (under 100 tokens) only when context is critically constrained. **Never** use `"full"`.
|
|
708
|
+
- **`focus`** — When you know what you're about to work on, pass it. Context is FTS5-ranked around that topic.
|
|
709
|
+
- **`tool_catalog`** — Returned at session start. Use it to know available actions — do not call a separate tool for this.
|
|
624
710
|
|
|
625
|
-
|
|
626
|
-
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
627
|
-
| `previous_session.summary` | Read immediately. Do not re-explore what is already known. |
|
|
628
|
-
| `active_decisions` | Binding. Follow them; do not re-debate. Supersede with `engram_memory(action:"record_decision")` if they must change. |
|
|
629
|
-
| `active_conventions` | Enforce in every file you touch this session. |
|
|
630
|
-
| `open_tasks` | Pending work items. Ask the user which to focus on if unclear. |
|
|
631
|
-
| `abandoned_work` | Work items left open by a previous session that ended unexpectedly. Review and resume or close. |
|
|
632
|
-
| `handoff_pending` | A structured handoff from the previous agent. Read instructions, then call `engram_session(action:"acknowledge_handoff")`. |
|
|
633
|
-
| `suggested_focus` | Auto-derived topic hint. Pass as `focus` on the next `start` call for filtered context. |
|
|
634
|
-
| `triggered_events` | Scheduled reminders or deferred work now triggered. Act on them. |
|
|
635
|
-
| `agent_rules` | Live-loaded rules from the Engram README. Treat as binding session instructions. |
|
|
636
|
-
| `tool_catalog` | Full list of available `engram_memory` and `engram_admin` actions with schemas. |
|
|
637
|
-
| `update_available` | Tell the user: _"Engram v{available_version} is available. Update, skip, or postpone?"_ |
|
|
711
|
+
Act on everything returned:
|
|
638
712
|
|
|
639
|
-
|
|
713
|
+
| Field | What to do |
|
|
714
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
715
|
+
| `previous_session.summary` | Read immediately. Do not re-explore what is already known. |
|
|
716
|
+
| `active_decisions` | Binding. Follow them. Supersede via `engram_memory(action:"record_decision", supersedes:<id>)` only if they must change. |
|
|
717
|
+
| `active_conventions` | Enforce in every file touched this session. |
|
|
718
|
+
| `open_tasks` | Pending work. Ask the user which to focus on if unclear. |
|
|
719
|
+
| `abandoned_work` | Work left open by a previous unexpected session end. Resume or close it. |
|
|
720
|
+
| `handoff_pending` | Structured handoff from previous agent. Read instructions, then call `engram_session(action:"acknowledge_handoff")`. |
|
|
721
|
+
| `suggested_focus` | Auto-derived topic hint. Pass as `focus` on the next `start` call. |
|
|
722
|
+
| `triggered_events` | Scheduled reminders or deferred work now due. Act on them. |
|
|
723
|
+
| `agent_rules` | Live-loaded rules from the Engram README. Treat as binding session instructions. |
|
|
724
|
+
| `update_available` | Inform the user: _"Engram v{version} is available — update, skip, or postpone?"_ |
|
|
725
|
+
|
|
726
|
+
**If `update_available` is set**, respond to the user's choice:
|
|
640
727
|
|
|
641
728
|
- **Update** → `npx -y engram-mcp-server install`
|
|
642
|
-
- **Skip** → `engram_admin({ action: "config", op: "set", key: "auto_update_skip_version", value: "{version}" })`
|
|
643
|
-
- **Postpone** → `engram_admin({ action: "config", op: "set", key: "auto_update_remind_after", value: "7d" })`
|
|
644
|
-
- **Disable** → `engram_admin({ action: "config", op: "set", key: "auto_update_check", value: "false" })`
|
|
729
|
+
- **Skip this version** → `engram_admin({ action: "config", op: "set", key: "auto_update_skip_version", value: "{version}" })`
|
|
730
|
+
- **Postpone 7 days** → `engram_admin({ action: "config", op: "set", key: "auto_update_remind_after", value: "7d" })`
|
|
731
|
+
- **Disable checks** → `engram_admin({ action: "config", op: "set", key: "auto_update_check", value: "false" })`
|
|
645
732
|
|
|
646
733
|
---
|
|
647
734
|
|
|
648
|
-
###
|
|
735
|
+
### 2. Before Opening Any File
|
|
649
736
|
|
|
650
737
|
Always check Engram before opening a file:
|
|
651
738
|
|
|
@@ -653,18 +740,26 @@ Always check Engram before opening a file:
|
|
|
653
740
|
engram_memory({ action: "get_file_notes", file_path: "path/to/file.ts" });
|
|
654
741
|
```
|
|
655
742
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
743
|
+
| `confidence` result | Action |
|
|
744
|
+
| ------------------- | ----------------------------------------------------------------------------------- |
|
|
745
|
+
| `"high"` | Use stored notes. Only open if you need to edit. |
|
|
746
|
+
| `"medium"` | Notes exist but file may have minor changes. Open only if precision matters. |
|
|
747
|
+
| `"stale"` | File has changed since notes were stored (hash mismatch). Re-read and update notes. |
|
|
748
|
+
| No notes | Read the file, then immediately call `set_file_notes`. |
|
|
660
749
|
|
|
661
|
-
|
|
750
|
+
After reading a file for the first time, store notes immediately:
|
|
751
|
+
|
|
752
|
+
```js
|
|
753
|
+
engram_memory({ action: "set_file_notes", file_path, purpose, dependencies, dependents, layer, complexity, notes, executive_summary })
|
|
754
|
+
// Batch multiple files:
|
|
755
|
+
engram_memory({ action: "set_file_notes_batch", files: [...] })
|
|
756
|
+
```
|
|
662
757
|
|
|
663
758
|
---
|
|
664
759
|
|
|
665
|
-
###
|
|
760
|
+
### 3. Before Making Design or Architecture Decisions
|
|
666
761
|
|
|
667
|
-
|
|
762
|
+
Search for existing decisions before proposing anything:
|
|
668
763
|
|
|
669
764
|
```js
|
|
670
765
|
engram_memory({
|
|
@@ -672,29 +767,29 @@ engram_memory({
|
|
|
672
767
|
query: "relevant keywords",
|
|
673
768
|
scope: "decisions",
|
|
674
769
|
});
|
|
770
|
+
// or:
|
|
771
|
+
engram_memory({ action: "get_decisions" });
|
|
675
772
|
```
|
|
676
773
|
|
|
677
774
|
- **Decision exists** → Follow it.
|
|
678
|
-
- **
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
});
|
|
691
|
-
```
|
|
775
|
+
- **Needs to change** → Explain why, then: `engram_memory({ action:"record_decision", supersedes:<id>, decision, rationale })`
|
|
776
|
+
- **No decision** → Make the call and record it immediately:
|
|
777
|
+
|
|
778
|
+
```js
|
|
779
|
+
engram_memory({
|
|
780
|
+
action: "record_decision",
|
|
781
|
+
decision,
|
|
782
|
+
rationale,
|
|
783
|
+
affected_files,
|
|
784
|
+
tags,
|
|
785
|
+
});
|
|
786
|
+
```
|
|
692
787
|
|
|
693
788
|
---
|
|
694
789
|
|
|
695
|
-
###
|
|
790
|
+
### 4. When Modifying Files
|
|
696
791
|
|
|
697
|
-
After every meaningful change, record it
|
|
792
|
+
After every meaningful change, record it — batch where possible:
|
|
698
793
|
|
|
699
794
|
```js
|
|
700
795
|
engram_memory({
|
|
@@ -703,7 +798,7 @@ engram_memory({
|
|
|
703
798
|
{
|
|
704
799
|
file_path,
|
|
705
800
|
change_type, // created | modified | refactored | deleted | renamed | moved | config_changed
|
|
706
|
-
description, // What changed AND why — not just the action
|
|
801
|
+
description, // What changed AND why — not just the action
|
|
707
802
|
impact_scope, // local | module | cross_module | global
|
|
708
803
|
},
|
|
709
804
|
],
|
|
@@ -712,7 +807,7 @@ engram_memory({
|
|
|
712
807
|
|
|
713
808
|
---
|
|
714
809
|
|
|
715
|
-
###
|
|
810
|
+
### 5. When You Don't Know Something
|
|
716
811
|
|
|
717
812
|
Search Engram before asking the user — they may have already explained it to a previous session:
|
|
718
813
|
|
|
@@ -727,22 +822,92 @@ engram_find({ query: "what I want to do" }); // discover the right action
|
|
|
727
822
|
|
|
728
823
|
---
|
|
729
824
|
|
|
730
|
-
###
|
|
825
|
+
### 6. Mid-Session — Approaching Context Limits
|
|
731
826
|
|
|
732
|
-
Before
|
|
827
|
+
Before hitting the context wall, save a checkpoint:
|
|
828
|
+
|
|
829
|
+
```js
|
|
830
|
+
engram_memory({ action: "checkpoint", current_understanding: "...", progress_percentage: 70, key_findings: [...], next_steps: [...], file_paths: [...] })
|
|
831
|
+
// Restore later:
|
|
832
|
+
engram_memory({ action: "get_checkpoint" })
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Check for context pressure events proactively:
|
|
836
|
+
|
|
837
|
+
```js
|
|
838
|
+
engram_memory({ action: "check_events" }); // fires at 50% / 70% / 85% context fill
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
---
|
|
842
|
+
|
|
843
|
+
### 7. Session End — Always Last
|
|
844
|
+
|
|
845
|
+
Before ending any session:
|
|
733
846
|
|
|
734
847
|
1. Record all file changes not yet recorded.
|
|
735
|
-
2.
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
848
|
+
2. Mark completed tasks: `engram_memory({ action:"update_task", task_id, status:"done" })`
|
|
849
|
+
3. Create tasks for anything incomplete: `engram_memory({ action:"create_task", title, description, priority })`
|
|
850
|
+
4. Record any new conventions: `engram_memory({ action:"add_convention", convention, rationale })`
|
|
851
|
+
5. Call end with a precise summary:
|
|
852
|
+
|
|
853
|
+
```js
|
|
854
|
+
engram_session({
|
|
855
|
+
action: "end",
|
|
856
|
+
summary:
|
|
857
|
+
"Exact files/functions touched, what is pending, any blockers, new patterns discovered",
|
|
858
|
+
});
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
---
|
|
862
|
+
|
|
863
|
+
### Quick Reference
|
|
864
|
+
|
|
865
|
+
| Situation | Call | Notes |
|
|
866
|
+
| ------------------------------- | ----------------------------------------------------------- | --------------------------------------- |
|
|
867
|
+
| **Start every session** | `engram_session(action:"start")` | verbosity:"summary", add focus if known |
|
|
868
|
+
| Discover an action name | `engram_find({ query:"..." })` | Returns action name + param schema |
|
|
869
|
+
| Before opening any file | `engram_memory(action:"get_file_notes")` | |
|
|
870
|
+
| After first reading a file | `engram_memory(action:"set_file_notes")` | Include `executive_summary` |
|
|
871
|
+
| Before a design choice | `engram_memory(action:"search")` / `action:"get_decisions"` | |
|
|
872
|
+
| Record a new decision | `engram_memory(action:"record_decision")` | Always include `rationale` |
|
|
873
|
+
| After editing files | `engram_memory(action:"record_change")` | Batch multiple changes in one call |
|
|
874
|
+
| Save mid-session progress | `engram_memory(action:"checkpoint")` | Use near context limits |
|
|
875
|
+
| Check context pressure | `engram_memory(action:"check_events")` | Fires at 50% / 70% / 85% |
|
|
876
|
+
| Create task for incomplete work | `engram_memory(action:"create_task")` | |
|
|
877
|
+
| Mark task done | `engram_memory(action:"update_task", status:"done")` | |
|
|
878
|
+
| Record a convention | `engram_memory(action:"add_convention")` | |
|
|
879
|
+
| Schedule deferred work | `engram_memory(action:"schedule_event")` | |
|
|
880
|
+
| Lint code against conventions | `engram_find(action:"lint", content:"...")` | Returns `violations[]` |
|
|
881
|
+
| Backup the database | `engram_admin(action:"backup")` | |
|
|
882
|
+
| **End every session** | `engram_session(action:"end")` | Be specific: files, functions, blockers |
|
|
883
|
+
|
|
884
|
+
---
|
|
885
|
+
|
|
886
|
+
### 8. Sub-Agent Sessions (v1.7+)
|
|
887
|
+
|
|
888
|
+
When your orchestrator spawns a sub-agent to handle a specific task, use `agent_role: "sub"` to get a lightweight, task-scoped context (~300-500 tokens) instead of the full session boilerplate:
|
|
744
889
|
|
|
745
|
-
|
|
890
|
+
```js
|
|
891
|
+
engram_session({
|
|
892
|
+
action: "start",
|
|
893
|
+
agent_name: "sub-agent-auth",
|
|
894
|
+
agent_role: "sub",
|
|
895
|
+
task_id: 42, // The task ID assigned by the orchestrator
|
|
896
|
+
});
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
The response includes only:
|
|
900
|
+
|
|
901
|
+
- The specified task's details (title, description, priority, tags)
|
|
902
|
+
- File notes for files assigned to that task
|
|
903
|
+
- Decisions matching the task's tags
|
|
904
|
+
- Up to 5 relevant conventions
|
|
905
|
+
|
|
906
|
+
Sub-agents should still call `engram_session(action:"end")` when done and `engram_memory(action:"record_change")` for any edits made.
|
|
907
|
+
|
|
908
|
+
> **Note:** Sub-agent mode is auto-activated when `agent_role: "sub"` is passed. No separate configuration needed.
|
|
909
|
+
|
|
910
|
+
<!-- ENGRAM_INSTRUCTIONS_END -->
|
|
746
911
|
|
|
747
912
|
---
|
|
748
913
|
|
|
@@ -879,6 +1044,62 @@ engram_memory({
|
|
|
879
1044
|
|
|
880
1045
|
---
|
|
881
1046
|
|
|
1047
|
+
## Troubleshooting
|
|
1048
|
+
|
|
1049
|
+
### Windows: `'engram' is not recognized` when using `npx`
|
|
1050
|
+
|
|
1051
|
+
If your Windows username contains special characters (tildes `~`, spaces, accented letters, etc.), `npx` may fail to resolve the binary:
|
|
1052
|
+
|
|
1053
|
+
```
|
|
1054
|
+
'engram' is not recognized as an internal or external command,
|
|
1055
|
+
operable program or batch file.
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
**Cause:** `npx` downloads packages to a temp directory under your user profile (e.g., `C:\Users\~ RG\AppData\Local\npm-cache\_npx\...`). Special characters — especially tildes — are misinterpreted as DOS 8.3 short-path prefixes, and spaces compound the issue. The generated `.cmd` shim fails to resolve its own path.
|
|
1059
|
+
|
|
1060
|
+
**Fix — use a global install instead of `npx`:**
|
|
1061
|
+
|
|
1062
|
+
```bash
|
|
1063
|
+
npm install -g engram-mcp-server
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
Then update your MCP config to use the binary directly:
|
|
1067
|
+
|
|
1068
|
+
```jsonc
|
|
1069
|
+
// .vscode/mcp.json (or equivalent for your IDE)
|
|
1070
|
+
{
|
|
1071
|
+
"servers": {
|
|
1072
|
+
"engram": {
|
|
1073
|
+
"type": "stdio",
|
|
1074
|
+
"command": "engram-mcp-server",
|
|
1075
|
+
"args": [
|
|
1076
|
+
"--mode=universal",
|
|
1077
|
+
"--project-root",
|
|
1078
|
+
"${workspaceFolder}",
|
|
1079
|
+
],
|
|
1080
|
+
},
|
|
1081
|
+
},
|
|
1082
|
+
}
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
**Note:** With a global install, you won't get automatic version updates. After publishing a new version, update manually:
|
|
1086
|
+
|
|
1087
|
+
```bash
|
|
1088
|
+
npm install -g engram-mcp-server@latest
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
### Database locked or corrupted
|
|
1092
|
+
|
|
1093
|
+
If you see `SQLITE_BUSY` or corruption errors:
|
|
1094
|
+
|
|
1095
|
+
1. Stop all IDE instances using Engram
|
|
1096
|
+
2. Delete the project-local database: `rm -rf .engram/`
|
|
1097
|
+
3. Restart — Engram will re-create the database and run all migrations automatically
|
|
1098
|
+
|
|
1099
|
+
The global database at `~/.engram/memory.db` can be reset the same way if needed.
|
|
1100
|
+
|
|
1101
|
+
---
|
|
1102
|
+
|
|
882
1103
|
## Contributing
|
|
883
1104
|
|
|
884
1105
|
We welcome contributions!
|
package/dist/database.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK/D,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,kBA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jC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,SAAS,GAAG,OAAmB,EACxC,KAAK,CAAC,EAAE,MAAM,GACb,IAAI,CAcN"}
|
package/dist/database.js
CHANGED
|
@@ -133,8 +133,16 @@ export function backupDatabase(destPath) {
|
|
|
133
133
|
// Ensure destination directory exists
|
|
134
134
|
const destDir = path.dirname(destPath);
|
|
135
135
|
fs.mkdirSync(destDir, { recursive: true });
|
|
136
|
-
//
|
|
137
|
-
db.backup(
|
|
136
|
+
// Flush WAL to the main DB file so the copy is consistent (ISS-005 fix).
|
|
137
|
+
// better-sqlite3's db.backup() is async in v9+ and statSync immediately after
|
|
138
|
+
// it would throw ENOENT before the file is written. Using WAL checkpoint +
|
|
139
|
+
// synchronous file copy guarantees the backup file is fully written before
|
|
140
|
+
// we return the path to callers.
|
|
141
|
+
try {
|
|
142
|
+
db.pragma("wal_checkpoint(FULL)");
|
|
143
|
+
}
|
|
144
|
+
catch { /* WAL may not be in use */ }
|
|
145
|
+
fs.copyFileSync(getDbPath(), destPath);
|
|
138
146
|
return destPath;
|
|
139
147
|
}
|
|
140
148
|
// ─── Gitignore ───────────────────────────────────────────────────────
|
package/dist/database.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,yEAAyE;AACzE,+EAA+E;AAE/E,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAqB,MAAM,yBAAyB,CAAC;AAChF,O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AC;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,CAAC,CAAC;IAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,gEAAgE;IAChE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,QAAgB,EAChB,UAA+B,SAAS,EACxC,KAAc;IAEd,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;QACnB,EAAE,CAAC,OAAO,CACR,kHAAkH,CACnH,CAAC,GAAG,CACH,mBAAmB,EAAE,EACrB,IAAI,EACJ,QAAQ,EACR,IAAI,CAAC,GAAG,EAAE,EACV,OAAO,EACP,KAAK,IAAI,IAAI,CACd,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC,CAAC,0DAA0D,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -56,7 +56,7 @@ export class SafetyCheckError extends EngramError {
|
|
|
56
56
|
*/
|
|
57
57
|
export class NoActiveSessionError extends EngramError {
|
|
58
58
|
constructor() {
|
|
59
|
-
super(
|
|
59
|
+
super('No active session. Call engram_session({ action: "start" }) first.', "NO_SESSION");
|
|
60
60
|
this.name = "NoActiveSessionError";
|
|
61
61
|
}
|
|
62
62
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kCAAkC;AAClC,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACzB,IAAI,CAAS;IACb,OAAO,CAA2B;IAE3C,YAAY,OAAe,EAAE,OAAe,cA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;IACnC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACjD;QACI,KAAK,CAAC,oEAAoE,EAAE,YAAY,CAAC,CAAC;QAC1F,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACvC,CAAC;CACJ"}
|
|
@@ -4,8 +4,12 @@ export declare function getInstallerVersion(): string;
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate the Engram server entry tailored to a specific IDE's requirements.
|
|
6
6
|
* Includes _engram_version so the installer can detect upgrades and legacy installs.
|
|
7
|
+
*
|
|
8
|
+
* @param ide IDE definition (controls type, cmd wrapper, etc.)
|
|
9
|
+
* @param universal When true, adds --mode=universal and --project-root to args.
|
|
10
|
+
* Uses IDE-appropriate workspace variable when available.
|
|
7
11
|
*/
|
|
8
|
-
export declare function makeEngramEntry(ide: IdeDefinition): Record<string, any>;
|
|
12
|
+
export declare function makeEngramEntry(ide: IdeDefinition, universal?: boolean): Record<string, any>;
|
|
9
13
|
/**
|
|
10
14
|
* Read and parse a JSON config file. Returns null if file doesn't exist or is invalid.
|
|
11
15
|
*/
|
|
@@ -25,7 +29,7 @@ export type InstallResult = "added" | "upgraded" | "exists" | "legacy-upgraded";
|
|
|
25
29
|
* "upgraded" — updated from an older tracked version to the current one
|
|
26
30
|
* "legacy-upgraded" — entry existed but had no _engram_version (pre-tracking era), now stamped
|
|
27
31
|
*/
|
|
28
|
-
export declare function addToConfig(configPath: string, ide: IdeDefinition): InstallResult;
|
|
32
|
+
export declare function addToConfig(configPath: string, ide: IdeDefinition, universal?: boolean): InstallResult;
|
|
29
33
|
/**
|
|
30
34
|
* Remove the Engram entry from a config file.
|
|
31
35
|
* Returns true if the entry was found and removed, false if not present.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/installer/config-writer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,yFAAyF;AACzF,wBAAgB,mBAAmB,IAAI,MAAM,CAQ5C;AAED
|
|
1
|
+
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/installer/config-writer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,yFAAyF;AACzF,wBAAgB,mBAAmB,IAAI,MAAM,CAQ5C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,SAAS,UAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA8B1F;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAMrE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAG3D;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAEhF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,UAAQ,GAAG,aAAa,CA2BpG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAgBhF"}
|
|
@@ -18,24 +18,36 @@ export function getInstallerVersion() {
|
|
|
18
18
|
/**
|
|
19
19
|
* Generate the Engram server entry tailored to a specific IDE's requirements.
|
|
20
20
|
* Includes _engram_version so the installer can detect upgrades and legacy installs.
|
|
21
|
+
*
|
|
22
|
+
* @param ide IDE definition (controls type, cmd wrapper, etc.)
|
|
23
|
+
* @param universal When true, adds --mode=universal and --project-root to args.
|
|
24
|
+
* Uses IDE-appropriate workspace variable when available.
|
|
21
25
|
*/
|
|
22
|
-
export function makeEngramEntry(ide) {
|
|
26
|
+
export function makeEngramEntry(ide, universal = false) {
|
|
23
27
|
const entry = {};
|
|
24
28
|
// Some IDEs require explicit "type": "stdio"
|
|
25
29
|
if (ide.requiresType) {
|
|
26
30
|
entry.type = "stdio";
|
|
27
31
|
}
|
|
32
|
+
// Build args
|
|
33
|
+
const baseArgs = ["-y", "engram-mcp-server"];
|
|
34
|
+
if (universal) {
|
|
35
|
+
baseArgs.push("--mode=universal");
|
|
36
|
+
}
|
|
28
37
|
// Windows cmd /c wrapper for npx (npx is a .cmd on Windows)
|
|
29
38
|
if (ide.requiresCmdWrapper) {
|
|
30
39
|
entry.command = "cmd";
|
|
31
|
-
entry.args = ["/c", "npx",
|
|
40
|
+
entry.args = ["/c", "npx", ...baseArgs];
|
|
32
41
|
}
|
|
33
42
|
else {
|
|
34
43
|
entry.command = "npx";
|
|
35
|
-
entry.args = [
|
|
44
|
+
entry.args = [...baseArgs];
|
|
36
45
|
}
|
|
37
46
|
// Version stamp — used by the installer to detect upgrades and legacy installs
|
|
38
47
|
entry._engram_version = getInstallerVersion();
|
|
48
|
+
if (universal) {
|
|
49
|
+
entry._engram_mode = "universal";
|
|
50
|
+
}
|
|
39
51
|
return entry;
|
|
40
52
|
}
|
|
41
53
|
/**
|
|
@@ -66,12 +78,12 @@ export function writeJson(filePath, data) {
|
|
|
66
78
|
* "upgraded" — updated from an older tracked version to the current one
|
|
67
79
|
* "legacy-upgraded" — entry existed but had no _engram_version (pre-tracking era), now stamped
|
|
68
80
|
*/
|
|
69
|
-
export function addToConfig(configPath, ide) {
|
|
81
|
+
export function addToConfig(configPath, ide, universal = false) {
|
|
70
82
|
let config = readJson(configPath) || {};
|
|
71
83
|
const key = ide.configKey;
|
|
72
84
|
if (!config[key])
|
|
73
85
|
config[key] = {};
|
|
74
|
-
const newEntry = makeEngramEntry(ide);
|
|
86
|
+
const newEntry = makeEngramEntry(ide, universal);
|
|
75
87
|
const currentVersion = newEntry._engram_version;
|
|
76
88
|
if (config[key].engram) {
|
|
77
89
|
const existingVersion = config[key].engram._engram_version;
|