@memnexus-ai/cli 1.7.43 → 1.7.44
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,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Steering file content templates — core rules shared across all
|
|
3
|
-
*
|
|
2
|
+
* Steering file content templates — MCP-first core rules shared across all
|
|
3
|
+
* agents, with an optional CLI appendix for agents that have terminal access.
|
|
4
4
|
*/
|
|
5
5
|
import type { SteeringContentFocus } from './types.js';
|
|
6
6
|
declare const BEGIN_MARKER = "<!-- BEGIN MEMNEXUS RULES (managed by mx setup \u2014 do not edit this section) -->";
|
|
@@ -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;AAsKpC;;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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Steering file content templates — core rules shared across all
|
|
4
|
-
*
|
|
3
|
+
* Steering file content templates — MCP-first core rules shared across all
|
|
4
|
+
* agents, with an optional CLI appendix for agents that have terminal access.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.END_MARKER = exports.BEGIN_MARKER = void 0;
|
|
@@ -11,11 +11,11 @@ const BEGIN_MARKER = '<!-- BEGIN MEMNEXUS RULES (managed by mx setup — do not
|
|
|
11
11
|
exports.BEGIN_MARKER = BEGIN_MARKER;
|
|
12
12
|
const END_MARKER = '<!-- END MEMNEXUS RULES -->';
|
|
13
13
|
exports.END_MARKER = END_MARKER;
|
|
14
|
-
// ── Core Rules (shared
|
|
15
|
-
function
|
|
14
|
+
// ── MCP Core Rules (shared by ALL agents) ────────────────────────
|
|
15
|
+
function getMcpCoreRules() {
|
|
16
16
|
return `# MemNexus Memory Management
|
|
17
17
|
|
|
18
|
-
MemNexus gives you persistent memory across sessions. Save important context, search past work, and build on previous decisions.
|
|
18
|
+
MemNexus gives you persistent memory across sessions via MCP tools. Save important context, search past work, and build on previous decisions.
|
|
19
19
|
|
|
20
20
|
## When to Save Memories
|
|
21
21
|
|
|
@@ -26,132 +26,141 @@ Save a memory after:
|
|
|
26
26
|
- Discovering patterns or gotchas (reusable knowledge)
|
|
27
27
|
- Before switching tasks (current progress, next steps, blockers)
|
|
28
28
|
|
|
29
|
-
## Quick Reference
|
|
29
|
+
## MCP Tools Quick Reference
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
### Save & Update
|
|
32
|
+
| Tool | Purpose |
|
|
32
33
|
|------|---------|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
| Recent work recap | \`mx memories recap --recent 24h\` |
|
|
36
|
-
| AI digest of topic | \`mx memories digest --query "..." --digest-format structured\` |
|
|
37
|
-
| Get memory details | \`mx memories get <id>\` |
|
|
38
|
-
| Timeline view | \`mx memories search --query "..." --timeline\` |
|
|
39
|
-
| Check account/quota | \`mx auth status\` |
|
|
40
|
-
|
|
41
|
-
## Conversation Tracking
|
|
42
|
-
|
|
43
|
-
Group related memories into conversations:
|
|
34
|
+
| \`create_memory\` | Save a new memory with content, optional topics, and conversationId |
|
|
35
|
+
| \`manage_memory\` | Update content/topics of an existing memory, or delete by ID |
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
### Search & Retrieve
|
|
38
|
+
| Tool | Purpose |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| \`search_memories\` | Search by query (semantic), filter by topics/time, or list recent memories |
|
|
41
|
+
| \`get_memory\` | Retrieve full memory by ID or by named key (includes relationships/context) |
|
|
42
|
+
| \`recall\` | AI-synthesized digest of a topic — structured, narrative, timeline, or status-report |
|
|
43
|
+
| \`conversations\` | List conversations, or get a summary/timeline for a specific conversation |
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
### Explore & Analyze
|
|
46
|
+
| Tool | Purpose |
|
|
47
|
+
|------|---------|
|
|
48
|
+
| \`knowledge_graph\` | Explore extracted facts (\`type: "facts"\`), browse/search topics (\`type: "topics"\`), or discover related topics (\`type: "related_topics"\`) |
|
|
49
|
+
| \`patterns\` | Detect behavioral patterns (\`action: "detect"\`), analyze trends (\`action: "analyze"\`), or list stored patterns (\`action: "list"\`) |
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- **\`mx memories search --group-by conversation\`** — results organized by work session.
|
|
51
|
+
### Account
|
|
52
|
+
| Tool | Purpose |
|
|
53
|
+
|------|---------|
|
|
54
|
+
| \`get_user_profile\` | Check plan, quota, usage stats — the ONLY way to get account info |
|
|
57
55
|
|
|
58
|
-
##
|
|
56
|
+
## Conversation Tracking (Critical)
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
- **Status**: \`completed\`, \`in-progress\`, \`blocked\`
|
|
62
|
-
- **Component**: \`mx-cli\`, \`mx-core-api\`, etc.
|
|
58
|
+
Group related memories into conversations to maintain context:
|
|
63
59
|
|
|
64
|
-
|
|
60
|
+
1. **First memory of a new task** — set \`conversationId\` to \`"NEW"\`
|
|
61
|
+
2. **Parse the response** — it returns the new conversation ID (e.g., \`conv_abc123\`)
|
|
62
|
+
3. **Store that ID** — use it for all subsequent memories in this task
|
|
63
|
+
4. **Subsequent memories** — set \`conversationId\` to \`"conv_abc123"\`
|
|
64
|
+
5. **New topic/task** — use \`"NEW"\` again to start a fresh conversation
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Example flow:
|
|
67
|
+
\`\`\`
|
|
68
|
+
create_memory({ conversationId: "NEW", content: "Starting work on auth refactor..." })
|
|
69
|
+
→ response includes conversationId: "conv_abc123"
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
- **Use \`--content\` flag** — always use non-interactive mode for automation compatibility
|
|
70
|
-
- **Never run mx in background** — all commands complete in <1 second
|
|
71
|
-
- **Include references** — mention issue numbers, commit hashes, file paths in content
|
|
72
|
-
- **Write for others** — assume future readers are unfamiliar with the work
|
|
73
|
-
- **Use \`mx auth status\` for account info** — do NOT search memories for plan/quota details`;
|
|
74
|
-
}
|
|
75
|
-
// ── MCP-Only Rules (for agents without CLI access) ───────────────
|
|
76
|
-
function getMcpOnlyRules() {
|
|
77
|
-
return `# MemNexus Memory Management
|
|
71
|
+
create_memory({ conversationId: "conv_abc123", content: "Switched to JWT tokens..." })
|
|
78
72
|
|
|
79
|
-
|
|
73
|
+
create_memory({ conversationId: "conv_abc123", content: "Auth refactor complete..." })
|
|
74
|
+
\`\`\`
|
|
80
75
|
|
|
81
|
-
##
|
|
76
|
+
## Search & Retrieval Strategies
|
|
82
77
|
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
78
|
+
- **\`search_memories\`** — primary search tool. Supports \`query\` for semantic search, \`topics\`/\`excludeTopics\` for filtering, \`recent\` for time-limiting (e.g. \`"24h"\`, \`"7d"\`). Omit \`query\` to list recent memories.
|
|
79
|
+
- **\`recall\`** — AI-synthesized digest. 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"\`.
|
|
80
|
+
- **\`conversations\`** — list work sessions with \`recent\` filter, or get a \`"summary"\`/\`"timeline"\` view for a specific conversation.
|
|
81
|
+
- **\`knowledge_graph\`** — explore extracted knowledge:
|
|
82
|
+
- \`type: "facts"\` + \`query\` — search structured facts extracted from memories
|
|
83
|
+
- \`type: "topics"\` — list all topics, or search with \`query\`
|
|
84
|
+
- \`type: "related_topics"\` + \`topicId\` — discover connected topics
|
|
85
|
+
- **\`patterns\`** — behavioral analysis:
|
|
86
|
+
- \`action: "detect"\` — find new patterns in your memories
|
|
87
|
+
- \`action: "analyze"\` — AI-generated insights and recommendations
|
|
88
|
+
- \`action: "list"\` — view stored patterns
|
|
88
89
|
|
|
89
|
-
##
|
|
90
|
+
## Topic Conventions
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
| \`search_memories\` | Search by query, filter by topics or time |
|
|
95
|
-
| \`recall\` | Get an AI-synthesized digest of a topic |
|
|
96
|
-
| \`get_memory\` | Retrieve a specific memory by ID |
|
|
97
|
-
| \`manage_memory\` | Update or delete a memory |
|
|
98
|
-
| \`conversations\` | List or summarize conversations |
|
|
99
|
-
| \`knowledge_graph\` | Explore extracted facts and topics |
|
|
100
|
-
| \`get_user_profile\` | Check account, plan, and quota |
|
|
101
|
-
|
|
102
|
-
## Conversation Tracking
|
|
103
|
-
|
|
104
|
-
Group related memories into conversations:
|
|
105
|
-
- First memory: set \`conversationId\` to \`"NEW"\`
|
|
106
|
-
- Follow-ups: reuse the returned conversation ID
|
|
107
|
-
- New topic: use \`"NEW"\` again
|
|
92
|
+
Topics are auto-extracted from content. Only add manual \`topics\` for:
|
|
93
|
+
- **Status**: \`completed\`, \`in-progress\`, \`blocked\`, \`needs-review\`
|
|
94
|
+
- **Component**: project-specific component names (e.g. \`mx-cli\`, \`mx-core-api\`)
|
|
108
95
|
|
|
109
|
-
|
|
96
|
+
Example: \`topics: ["mx-core-api", "completed"]\`
|
|
110
97
|
|
|
111
|
-
|
|
112
|
-
- **Status**: \`completed\`, \`in-progress\`, \`blocked\`
|
|
113
|
-
- **Component**: project-specific component names
|
|
98
|
+
Do NOT manually tag things like \`debugging\`, \`authentication\`, \`api-development\` — the extraction pipeline handles these automatically from well-written content.
|
|
114
99
|
|
|
115
100
|
## Best Practices
|
|
116
101
|
|
|
117
|
-
- **Search before asking** — use \`search_memories\` to check for existing context
|
|
118
|
-
- **
|
|
119
|
-
- **Use \`
|
|
102
|
+
- **Search before asking** — use \`search_memories\` to check for existing context before starting new work
|
|
103
|
+
- **Use \`get_user_profile\` for account info** — never search memories for plan/quota details
|
|
104
|
+
- **Use \`recall\` for overviews, \`search_memories\` for specific results** — recall synthesizes, search returns raw matches
|
|
105
|
+
- **Use named memories for living documents** — pass \`name\` param (e.g. \`"project-status"\`) for memories you update regularly
|
|
106
|
+
- **Include references** — mention issue numbers, commit hashes, file paths in content
|
|
120
107
|
- **Write for others** — assume future readers are unfamiliar with the work`;
|
|
121
108
|
}
|
|
109
|
+
// ── CLI Appendix (only for agents with terminal access) ──────────
|
|
110
|
+
function getCliSection() {
|
|
111
|
+
return `
|
|
112
|
+
|
|
113
|
+
## CLI Workflows (Terminal)
|
|
114
|
+
|
|
115
|
+
The \`mx\` CLI provides additional workflows beyond MCP tools:
|
|
116
|
+
|
|
117
|
+
| Workflow | Command |
|
|
118
|
+
|----------|---------|
|
|
119
|
+
| Recent work recap | \`mx memories recap --recent 24h\` |
|
|
120
|
+
| AI digest of topic | \`mx memories digest --query "..." --digest-format structured\` |
|
|
121
|
+
| Timeline search | \`mx memories search --query "..." --timeline\` |
|
|
122
|
+
| Grouped by session | \`mx memories search --query "..." --group-by conversation\` |
|
|
123
|
+
| Full CLI help | \`mx agent-help\` |
|
|
124
|
+
|
|
125
|
+
Run \`mx agent-help\` for full AI-optimized documentation of all commands.`;
|
|
126
|
+
}
|
|
122
127
|
// ── Agent-Specific Additions ─────────────────────────────────────
|
|
123
128
|
const AGENT_RULES = {
|
|
124
129
|
'claude-code': `
|
|
130
|
+
|
|
125
131
|
## Claude Code Tips
|
|
126
132
|
|
|
127
|
-
-
|
|
128
|
-
- Use
|
|
129
|
-
- Run \`mx agent-help\` for full
|
|
130
|
-
- Run \`mx agent-help memories\` for memory-specific workflows`,
|
|
133
|
+
- MCP tools are your primary interface — use them directly for all memory operations
|
|
134
|
+
- Use the terminal to run \`mx\` CLI commands for additional workflows (recaps, digests, timelines)
|
|
135
|
+
- Run \`mx agent-help\` in the terminal for full CLI documentation`,
|
|
131
136
|
cursor: `
|
|
137
|
+
|
|
132
138
|
## Cursor Tips
|
|
133
139
|
|
|
134
|
-
- MCP tools are available in Composer —
|
|
135
|
-
- Use the terminal
|
|
140
|
+
- MCP tools are available in Composer — use them for all memory operations
|
|
141
|
+
- Use the terminal to run \`mx\` CLI commands for additional workflows (recaps, digests, timelines)
|
|
136
142
|
- Run \`mx agent-help\` in the terminal for full CLI documentation`,
|
|
137
143
|
copilot: `
|
|
144
|
+
|
|
138
145
|
## Copilot Tips
|
|
139
146
|
|
|
140
|
-
- MCP tools are available in Copilot Chat for
|
|
141
|
-
- Use the terminal to run \`mx\` CLI commands for
|
|
147
|
+
- MCP tools are available in Copilot Chat for all memory operations
|
|
148
|
+
- Use the terminal to run \`mx\` CLI commands for additional workflows (recaps, digests, timelines)
|
|
142
149
|
- Run \`mx agent-help\` in the terminal for full CLI documentation`,
|
|
143
150
|
codex: `
|
|
151
|
+
|
|
144
152
|
## Codex CLI Tips
|
|
145
153
|
|
|
146
|
-
-
|
|
147
|
-
- Use
|
|
154
|
+
- MCP tools are your primary interface — use them for all memory operations
|
|
155
|
+
- Use shell execution for \`mx\` CLI workflows (recaps, digests, timelines)
|
|
148
156
|
- Run \`mx agent-help\` for full CLI documentation`,
|
|
149
157
|
'claude-desktop': `
|
|
158
|
+
|
|
150
159
|
## Claude Desktop Tips
|
|
151
160
|
|
|
152
161
|
- All memory operations use MCP tools — no CLI access needed
|
|
153
|
-
- Use \`create_memory\` to save
|
|
154
|
-
- Use \`
|
|
162
|
+
- Use \`create_memory\` to save and \`search_memories\` or \`recall\` to find past context
|
|
163
|
+
- Use \`knowledge_graph\` to explore extracted facts and topic relationships
|
|
155
164
|
- Use \`get_user_profile\` to check your account status and quota`,
|
|
156
165
|
};
|
|
157
166
|
// ── Composition ──────────────────────────────────────────────────
|
|
@@ -159,13 +168,15 @@ const AGENT_RULES = {
|
|
|
159
168
|
* Compose the full steering content for an agent, wrapped in section markers.
|
|
160
169
|
*/
|
|
161
170
|
function composeRules(agentId, version, contentFocus) {
|
|
162
|
-
const core =
|
|
171
|
+
const core = getMcpCoreRules();
|
|
172
|
+
const cli = contentFocus === 'full' ? getCliSection() : '';
|
|
163
173
|
const agentSpecific = AGENT_RULES[agentId] || '';
|
|
164
174
|
const lines = [
|
|
165
175
|
BEGIN_MARKER,
|
|
166
176
|
`<!-- version: ${version} | agent: ${agentId} -->`,
|
|
167
177
|
'',
|
|
168
178
|
core,
|
|
179
|
+
cli,
|
|
169
180
|
agentSpecific,
|
|
170
181
|
'',
|
|
171
182
|
END_MARKER,
|
|
@@ -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;;;AAiLH,oCAsBC;AAMD,oDAGC;AA5MD,MAAM,YAAY,GAChB,gFAAgF,CAAC;AAG1E,oCAAY;AAFrB,MAAM,UAAU,GAA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