@memnexus-ai/cli 1.7.176 → 1.7.177
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-templates.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAA,MAAM,YAAY,wFACgE,CAAC;AACnF,QAAA,MAAM,UAAU,gCAAgC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"rules-templates.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,QAAA,MAAM,YAAY,wFACgE,CAAC;AACnF,QAAA,MAAM,UAAU,gCAAgC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AA8IpC;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,MAAM,CA2C7D;AAID;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,oBAAoB,GACjC,MAAM,CAkBR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnE"}
|
|
@@ -16,191 +16,77 @@ exports.END_MARKER = END_MARKER;
|
|
|
16
16
|
function getMcpCoreRules() {
|
|
17
17
|
return `# MemNexus Memory Management
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
You have persistent memory across sessions. Use it proactively — save what matters, retrieve what you need.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Save Proactively
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
- Making
|
|
26
|
-
- Resolving complex
|
|
27
|
-
- Discovering
|
|
28
|
-
- Before switching tasks (
|
|
23
|
+
**You MUST save a memory after completing any of these — do not wait for the user to ask:**
|
|
24
|
+
- Finishing a feature, bug fix, or refactor
|
|
25
|
+
- Making a technical decision (what was chosen and why)
|
|
26
|
+
- Resolving a complex bug (root cause, fix, lessons learned)
|
|
27
|
+
- Discovering a pattern or gotcha (reusable knowledge)
|
|
28
|
+
- Before switching tasks (progress so far, next steps, blockers)
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Write for a future reader: include what you did, why, references (issue numbers, commits, file paths), and next steps.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
| Tool | Purpose |
|
|
34
|
-
|------|---------|
|
|
35
|
-
| \`build_context\` | Get a briefing before starting work — returns active work, key facts, gotchas, recent activity, and patterns. **Use this first when starting any task.** |
|
|
32
|
+
**Conversation tracking:** Use \`conversationId: "NEW"\` for the first memory of a task. Capture the returned \`conv_xxx\` ID and reuse it for follow-up memories in the same task. Use \`"NEW"\` again when switching to a different task.
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
| Tool | Purpose |
|
|
39
|
-
|------|---------|
|
|
40
|
-
| \`create_memory\` | Save a new memory with content, optional topics, and conversationId |
|
|
41
|
-
| \`manage_memory\` | Update content/topics, or delete by ID (requires \`confirmDeletion: true\` for deletes) |
|
|
34
|
+
**Topics** are auto-extracted from content. Only add manual \`topics\` for status tags (\`completed\`, \`in-progress\`) or component names.
|
|
42
35
|
|
|
43
|
-
|
|
44
|
-
| Tool | Purpose |
|
|
45
|
-
|------|---------|
|
|
46
|
-
| \`search_memories\` | Search by query with \`mode\` (\`"unified"\`, \`"content"\`, \`"facts"\`), filter by \`topics\`/\`excludeTopics\`/\`recent\`, sort with \`sortBy\`/\`order\` |
|
|
47
|
-
| \`get_memory\` | Retrieve by ID or named key. Set \`detail\` to \`"minimal"\`, \`"standard"\`, or \`"full"\` for relationship depth |
|
|
48
|
-
| \`recall\` | AI-synthesized digest with key facts, entities, and state breakdown — set \`format\` to \`"structured"\`, \`"narrative"\`, \`"timeline"\`, or \`"status-report"\` |
|
|
49
|
-
| \`conversations\` | List conversations, or get a \`"summary"\`/\`"timeline"\` view for a specific conversation |
|
|
50
|
-
|
|
51
|
-
### Explore & Analyze
|
|
52
|
-
| Tool | Purpose |
|
|
53
|
-
|------|---------|
|
|
54
|
-
| \`knowledge_graph\` | Explore entities (\`type: "entities"\`, optional \`entityType\`), facts (\`type: "facts"\`), topics (\`type: "topics"\`), related topics (\`type: "related_topics"\`), entity memories (\`type: "entity_memories"\` + \`entityId\`), or graph health (\`type: "health"\`) |
|
|
55
|
-
| \`patterns\` | Detect patterns (\`action: "detect"\`), analyze trends (\`action: "analyze"\`), compile from memories (\`action: "compile"\`), or list stored (\`action: "list"\`) |
|
|
56
|
-
|
|
57
|
-
### Account
|
|
58
|
-
| Tool | Purpose |
|
|
59
|
-
|------|---------|
|
|
60
|
-
| \`get_user_profile\` | Check plan, quota, usage stats — the ONLY way to get account info |
|
|
61
|
-
|
|
62
|
-
## Starting New Work
|
|
63
|
-
|
|
64
|
-
Before diving into any task, use \`build_context\` to get a briefing:
|
|
65
|
-
|
|
66
|
-
\`\`\`
|
|
67
|
-
build_context({ context: "refactor authentication middleware", files: ["src/middleware/auth.ts"] })
|
|
68
|
-
\`\`\`
|
|
36
|
+
**Code context:** When saving memories about code (architecture, implementations, bugs, decisions), include \`codeContext\` with at least \`product\` and \`service\` to scope the knowledge. Infer \`product\` from the repo name or \`package.json\`. Infer \`service\` from the package/directory you're working in. Omit \`codeContext\` for general notes, status updates, or non-code discussions.
|
|
69
37
|
|
|
70
|
-
|
|
71
|
-
- **Active work** — what you were last working on in this area
|
|
72
|
-
- **Key facts** — extracted knowledge relevant to the task
|
|
73
|
-
- **Gotchas** — recurring issues that appeared in multiple memories
|
|
74
|
-
- **Recent activity** — related memories from the last 24h (configurable via \`recent_hours\`)
|
|
75
|
-
- **Patterns** — behavioral patterns related to the work
|
|
38
|
+
## Find Context
|
|
76
39
|
|
|
77
|
-
Use the
|
|
40
|
+
Use the right tool for the situation:
|
|
78
41
|
|
|
79
|
-
|
|
42
|
+
| Situation | Tool | Why |
|
|
43
|
+
|-----------|------|-----|
|
|
44
|
+
| Starting a task | \`build_context\` | One-call briefing: active work, key facts, gotchas, patterns (~200ms) |
|
|
45
|
+
| Need an overview of a topic | \`recall\` | AI-synthesized digest across multiple memories (~3-5s) |
|
|
46
|
+
| Looking for specific memories | \`search_memories\` | Semantic search with filters (query, topics, recent, scope) |
|
|
47
|
+
| Know the ID or name | \`get_memory\` | Direct retrieval by ID or named key |
|
|
48
|
+
| Exploring the knowledge graph | \`knowledge_graph\` | Browse entities, facts, topics, and their connections |
|
|
80
49
|
|
|
81
|
-
|
|
50
|
+
**Do not** call \`get_memory\` in a loop to compile context — use \`recall\` instead.
|
|
51
|
+
**Do not** use \`search_memories\` for initial briefing — use \`build_context\`.
|
|
82
52
|
|
|
83
|
-
|
|
84
|
-
2. **Parse the response** — it returns the new conversation ID (e.g., \`conv_abc123\`)
|
|
85
|
-
3. **Store that ID** — use it for all subsequent memories in this task
|
|
86
|
-
4. **Subsequent memories** — set \`conversationId\` to \`"conv_abc123"\`
|
|
87
|
-
5. **New topic/task** — use \`"NEW"\` again to start a fresh conversation
|
|
53
|
+
## Tool Reference
|
|
88
54
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- **\`build_context\`** — use first when starting work. Combines 5 queries into one call to give you a complete briefing.
|
|
102
|
-
- **\`search_memories\`** — primary search tool. Key parameters:
|
|
103
|
-
- \`query\` — semantic search (omit to list recent)
|
|
104
|
-
- \`mode\` — \`"unified"\` (default, searches content + facts + entities), \`"content"\`, or \`"facts"\`
|
|
105
|
-
- \`topics\`/\`excludeTopics\` — filter by topic tags
|
|
106
|
-
- \`recent\` — time filter (e.g. \`"24h"\`, \`"7d"\`, \`"2w"\`)
|
|
107
|
-
- \`sortBy\` — \`"relevance"\`, \`"createdAt"\`, \`"updatedAt"\`, or \`"eventTime"\`
|
|
108
|
-
- **\`recall\`** — AI-synthesized digest with structured graph context. Returns key facts, entities, and effective state breakdown alongside the narrative. Use for "give me an overview of X" or "get me up to speed on Y". Set \`format\` to \`"structured"\`, \`"narrative"\`, \`"timeline"\`, or \`"status-report"\`.
|
|
109
|
-
- **\`conversations\`** — list work sessions with \`recent\` filter, or get a \`"summary"\`/\`"timeline"\` view for a specific conversation.
|
|
110
|
-
- **\`knowledge_graph\`** — explore graph structure:
|
|
111
|
-
- \`type: "entities"\` — list all entities, filter by \`entityType\` (PERSON, TECHNOLOGY, etc.)
|
|
112
|
-
- \`type: "entity_memories"\` + \`entityId\` — find memories connected to a specific entity
|
|
113
|
-
- \`type: "health"\` — check extraction coverage and graph statistics
|
|
114
|
-
- \`type: "facts"\` + \`query\` — search structured facts extracted from memories
|
|
115
|
-
- \`type: "topics"\` — list all topics, or search with \`query\`
|
|
116
|
-
- \`type: "related_topics"\` + \`topicId\` — discover connected topics
|
|
117
|
-
- **\`patterns\`** — behavioral analysis:
|
|
118
|
-
- \`action: "detect"\` — find new patterns in your memories
|
|
119
|
-
- \`action: "analyze"\` — AI-generated insights and recommendations
|
|
120
|
-
- \`action: "compile"\` — compile patterns from recent memories
|
|
121
|
-
- \`action: "list"\` — view stored patterns
|
|
122
|
-
|
|
123
|
-
## Topic Conventions
|
|
124
|
-
|
|
125
|
-
Topics are auto-extracted from content. Only add manual \`topics\` for:
|
|
126
|
-
- **Status**: \`completed\`, \`in-progress\`, \`blocked\`, \`needs-review\`
|
|
127
|
-
- **Component**: project-specific component names (e.g. \`mx-cli\`, \`mx-core-api\`)
|
|
128
|
-
|
|
129
|
-
Example: \`topics: ["mx-core-api", "completed"]\`
|
|
130
|
-
|
|
131
|
-
Do NOT manually tag things like \`debugging\`, \`authentication\`, \`api-development\` — the extraction pipeline handles these automatically from well-written content.
|
|
132
|
-
|
|
133
|
-
## Best Practices
|
|
134
|
-
|
|
135
|
-
- **Use \`build_context\` first** — before starting any task, get a briefing to avoid repeating mistakes
|
|
136
|
-
- **Search before asking** — use \`search_memories\` to check for existing context
|
|
137
|
-
- **Use \`get_user_profile\` for account info** — never search memories for plan/quota details
|
|
138
|
-
- **Start with \`recall\` for topic questions** — it synthesizes a narrative, returns key facts and entities, and filters superseded info. Use \`search_memories\` when you need specific raw results
|
|
139
|
-
- **Use named memories for living documents** — pass \`name\` param (e.g. \`"project-status"\`) for memories you update regularly
|
|
140
|
-
- **Include references** — mention issue numbers, commit hashes, file paths in content
|
|
141
|
-
- **Write for others** — assume future readers are unfamiliar with the work
|
|
142
|
-
|
|
143
|
-
## Code Context (Scoping Memories)
|
|
144
|
-
|
|
145
|
-
When creating memories, include \`codeContext\` to scope the knowledge to your environment. This enables scoped retrieval — finding only memories relevant to your product, service, or team.
|
|
55
|
+
| Tool | Purpose |
|
|
56
|
+
|------|---------|
|
|
57
|
+
| \`build_context\` | Session-start briefing — active work, facts, gotchas, patterns |
|
|
58
|
+
| \`create_memory\` | Save a new memory (with optional conversationId, topics, codeContext) |
|
|
59
|
+
| \`manage_memory\` | Update or delete an existing memory |
|
|
60
|
+
| \`search_memories\` | Search by meaning, filter by topics/recent/scope |
|
|
61
|
+
| \`get_memory\` | Retrieve by ID or named key (use \`detail\` for depth) |
|
|
62
|
+
| \`recall\` | AI-synthesized digest of a topic area |
|
|
63
|
+
| \`conversations\` | List or summarize work sessions |
|
|
64
|
+
| \`knowledge_graph\` | Explore entities, facts, topics, connections |
|
|
65
|
+
| \`patterns\` | Detect, analyze, or list behavioral patterns |
|
|
66
|
+
| \`get_user_profile\` | Check plan, quota, usage (the ONLY way to get account info) |
|
|
146
67
|
|
|
147
|
-
|
|
148
|
-
create_memory({
|
|
149
|
-
content: "Decided to use JWT for auth because...",
|
|
150
|
-
codeContext: {
|
|
151
|
-
product: "my-product", // product name
|
|
152
|
-
service: "auth-service", // service or package
|
|
153
|
-
team: "backend", // team that owns this knowledge
|
|
154
|
-
component: "authentication", // subsystem
|
|
155
|
-
role: "implementer" // your role (team-lead, implementer, reviewer)
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
\`\`\`
|
|
68
|
+
## Tips
|
|
159
69
|
|
|
160
|
-
**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
| \`product\` | Product name | \`"my-app"\`, \`"memnexus"\` |
|
|
164
|
-
| \`repo\` | Repository (if different from product) | \`"my-app-monorepo"\` |
|
|
165
|
-
| \`service\` | Service or package | \`"api"\`, \`"web"\`, \`"cli"\` |
|
|
166
|
-
| \`component\` | Subsystem | \`"billing"\`, \`"search"\` |
|
|
167
|
-
| \`team\` | Team name | \`"backend"\`, \`"platform"\` |
|
|
168
|
-
| \`role\` | Your role | \`"team-lead"\`, \`"implementer"\` |
|
|
169
|
-
|
|
170
|
-
**Scoped search** — filter memories by scope:
|
|
171
|
-
\`\`\`
|
|
172
|
-
search_memories({ query: "auth decisions", scope: { product: "my-product", service: "auth-service" } })
|
|
173
|
-
\`\`\``;
|
|
70
|
+
- **Use named memories** for documents you update regularly — pass \`name\` param (e.g. \`"project-status"\`)
|
|
71
|
+
- **Include references** in content — issue numbers, commit hashes, file paths get extracted as facts and entities
|
|
72
|
+
- **Write for others** — assume future readers have no context about your work`;
|
|
174
73
|
}
|
|
175
74
|
// ── CLI Appendix (only for agents with terminal access) ──────────
|
|
176
75
|
function getCliSection() {
|
|
177
76
|
return `
|
|
178
77
|
|
|
179
|
-
## CLI Workflows
|
|
78
|
+
## CLI-Only Workflows
|
|
180
79
|
|
|
181
|
-
The
|
|
80
|
+
Use MCP tools for all standard memory operations. The CLI adds workflows that MCP cannot do:
|
|
182
81
|
|
|
183
82
|
| Workflow | Command |
|
|
184
83
|
|----------|---------|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
| List conversations | \`mx conversations list --recent 7d\` |
|
|
192
|
-
| Conversation summary | \`mx conversations summary <conversation-id>\` |
|
|
193
|
-
| Search facts | \`mx facts search --query "..."\` |
|
|
194
|
-
| List entities | \`mx entities list --type TECHNOLOGY\` |
|
|
195
|
-
| Entity memories | \`mx entities memories <entity-id>\` |
|
|
196
|
-
| Graph health | \`mx entities health\` |
|
|
197
|
-
| Explore topics | \`mx topics discover-related --topic "..."\` |
|
|
198
|
-
| Detect patterns | \`mx patterns detect\` |
|
|
199
|
-
| List commit contexts | \`mx commit-context list --recent 7d\` |
|
|
200
|
-
| Show commit context | \`mx commit-context show <sha>\` |
|
|
201
|
-
| Full CLI help | \`mx agent-help\` |
|
|
202
|
-
|
|
203
|
-
Run \`mx agent-help\` for full AI-optimized documentation of all commands.`;
|
|
84
|
+
| Recent work recap (raw, fast) | \`mx memories recap --recent 24h\` |
|
|
85
|
+
| AI digest for handoffs/reports | \`mx memories digest --query "..." --digest-format structured\` |
|
|
86
|
+
| Timeline view (chronological) | \`mx memories search --query "..." --timeline\` |
|
|
87
|
+
| Group by conversation | \`mx memories search --query "..." --group-by conversation\` |
|
|
88
|
+
| Commit context history | \`mx commit-context list --recent 7d\` |
|
|
89
|
+
| Full CLI reference | \`mx agent-help\` |`;
|
|
204
90
|
}
|
|
205
91
|
// ── Agent-Specific Additions ─────────────────────────────────────
|
|
206
92
|
const AGENT_RULES = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-templates.js","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"rules-templates.js","sourceRoot":"","sources":["../../../src/lib/setup/rules-templates.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6JH,oFA2CC;AAOD,oCAsBC;AAMD,oD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