@synth-coder/memhub 0.2.2 → 0.2.4
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/.factory/commands/opsx-apply.md +150 -0
- package/.factory/commands/opsx-archive.md +155 -0
- package/.factory/commands/opsx-explore.md +171 -0
- package/.factory/commands/opsx-propose.md +104 -0
- package/.factory/skills/openspec-apply-change/SKILL.md +156 -0
- package/.factory/skills/openspec-archive-change/SKILL.md +114 -0
- package/.factory/skills/openspec-explore/SKILL.md +288 -0
- package/.factory/skills/openspec-propose/SKILL.md +110 -0
- package/.github/workflows/ci.yml +48 -12
- package/.github/workflows/release.yml +67 -0
- package/AGENTS.md +158 -17
- package/README.md +147 -66
- package/README.zh-CN.md +75 -23
- package/dist/src/cli/agents/claude-code.d.ts +5 -0
- package/dist/src/cli/agents/claude-code.d.ts.map +1 -0
- package/dist/src/cli/agents/claude-code.js +14 -0
- package/dist/src/cli/agents/claude-code.js.map +1 -0
- package/dist/src/cli/agents/cline.d.ts +5 -0
- package/dist/src/cli/agents/cline.d.ts.map +1 -0
- package/dist/src/cli/agents/cline.js +14 -0
- package/dist/src/cli/agents/cline.js.map +1 -0
- package/dist/src/cli/agents/codex.d.ts +5 -0
- package/dist/src/cli/agents/codex.d.ts.map +1 -0
- package/dist/src/cli/agents/codex.js +14 -0
- package/dist/src/cli/agents/codex.js.map +1 -0
- package/dist/src/cli/agents/cursor.d.ts +5 -0
- package/dist/src/cli/agents/cursor.d.ts.map +1 -0
- package/dist/src/cli/agents/cursor.js +14 -0
- package/dist/src/cli/agents/cursor.js.map +1 -0
- package/dist/src/cli/agents/factory-droid.d.ts +5 -0
- package/dist/src/cli/agents/factory-droid.d.ts.map +1 -0
- package/dist/src/cli/agents/factory-droid.js +14 -0
- package/dist/src/cli/agents/factory-droid.js.map +1 -0
- package/dist/src/cli/agents/gemini-cli.d.ts +5 -0
- package/dist/src/cli/agents/gemini-cli.d.ts.map +1 -0
- package/dist/src/cli/agents/gemini-cli.js +14 -0
- package/dist/src/cli/agents/gemini-cli.js.map +1 -0
- package/dist/src/cli/agents/index.d.ts +14 -0
- package/dist/src/cli/agents/index.d.ts.map +1 -0
- package/dist/src/cli/agents/index.js +30 -0
- package/dist/src/cli/agents/index.js.map +1 -0
- package/dist/src/cli/agents/windsurf.d.ts +5 -0
- package/dist/src/cli/agents/windsurf.d.ts.map +1 -0
- package/dist/src/cli/agents/windsurf.js +14 -0
- package/dist/src/cli/agents/windsurf.js.map +1 -0
- package/dist/src/cli/index.d.ts +8 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +168 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/init.d.ts +34 -0
- package/dist/src/cli/init.d.ts.map +1 -0
- package/dist/src/cli/init.js +160 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/instructions.d.ts +29 -0
- package/dist/src/cli/instructions.d.ts.map +1 -0
- package/dist/src/cli/instructions.js +141 -0
- package/dist/src/cli/instructions.js.map +1 -0
- package/dist/src/cli/types.d.ts +22 -0
- package/dist/src/cli/types.d.ts.map +1 -0
- package/dist/src/cli/types.js +86 -0
- package/dist/src/cli/types.js.map +1 -0
- package/dist/src/contracts/schemas.js.map +1 -1
- package/dist/src/server/mcp-server.d.ts +8 -0
- package/dist/src/server/mcp-server.d.ts.map +1 -1
- package/dist/src/server/mcp-server.js +30 -16
- package/dist/src/server/mcp-server.js.map +1 -1
- package/dist/src/services/embedding-service.d.ts.map +1 -1
- package/dist/src/services/embedding-service.js +1 -1
- package/dist/src/services/embedding-service.js.map +1 -1
- package/dist/src/services/memory-service.d.ts +1 -0
- package/dist/src/services/memory-service.d.ts.map +1 -1
- package/dist/src/services/memory-service.js +125 -82
- package/dist/src/services/memory-service.js.map +1 -1
- package/dist/src/storage/markdown-storage.d.ts.map +1 -1
- package/dist/src/storage/markdown-storage.js +1 -1
- package/dist/src/storage/markdown-storage.js.map +1 -1
- package/dist/src/storage/vector-index.d.ts.map +1 -1
- package/dist/src/storage/vector-index.js +4 -5
- package/dist/src/storage/vector-index.js.map +1 -1
- package/docs/README.md +21 -0
- package/docs/mcp-tools.md +136 -0
- package/docs/user-guide.md +182 -0
- package/package.json +22 -19
- package/src/cli/agents/claude-code.ts +14 -0
- package/src/cli/agents/cline.ts +14 -0
- package/src/cli/agents/codex.ts +14 -0
- package/src/cli/agents/cursor.ts +14 -0
- package/src/cli/agents/factory-droid.ts +14 -0
- package/src/cli/agents/gemini-cli.ts +14 -0
- package/src/cli/agents/index.ts +36 -0
- package/src/cli/agents/windsurf.ts +14 -0
- package/src/cli/index.ts +192 -0
- package/src/cli/init.ts +218 -0
- package/src/cli/instructions.ts +156 -0
- package/src/cli/types.ts +112 -0
- package/src/contracts/mcp.ts +1 -1
- package/src/contracts/schemas.ts +4 -4
- package/src/contracts/types.ts +4 -4
- package/src/server/mcp-server.ts +36 -29
- package/src/services/embedding-service.ts +80 -80
- package/src/services/memory-service.ts +142 -107
- package/src/storage/markdown-storage.ts +1 -9
- package/src/storage/vector-index.ts +117 -118
- package/test/cli/init.test.ts +380 -0
- package/test/server/mcp-server.test.ts +45 -3
- package/test/services/memory-service.test.ts +16 -4
- package/test/storage/frontmatter-parser.test.ts +1 -1
- package/test/storage/markdown-storage.test.ts +19 -10
- package/test/storage/vector-index.test.ts +129 -133
- package/test/utils/slugify.test.ts +5 -1
- package/docs/architecture.md +0 -349
- package/docs/contracts.md +0 -119
- package/docs/prompt-template.md +0 -79
- package/docs/proposals/mcp-typescript-sdk-refactor.md +0 -568
- package/docs/proposals/proposal-close-gates.md +0 -58
- package/docs/tool-calling-policy.md +0 -107
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# MCP Tools Reference
|
|
2
|
+
|
|
3
|
+
MemHub exposes two MCP tools for AI agents to manage persistent memory.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## memory_load
|
|
8
|
+
|
|
9
|
+
Load relevant memories to get context for the current task.
|
|
10
|
+
|
|
11
|
+
### Parameters
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Required | Description |
|
|
14
|
+
| ----------- | -------- | -------- | ----------------------------------------------------------- |
|
|
15
|
+
| `query` | string | No | Search query to filter memories |
|
|
16
|
+
| `tags` | string[] | No | Filter by tags |
|
|
17
|
+
| `limit` | number | No | Max memories to return (default: 10) |
|
|
18
|
+
| `entryType` | string | No | Filter by type: `preference`, `decision`, `context`, `fact` |
|
|
19
|
+
|
|
20
|
+
### Returns
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"memories": [
|
|
25
|
+
{
|
|
26
|
+
"id": "uuid",
|
|
27
|
+
"title": "Memory title",
|
|
28
|
+
"content": "Memory content...",
|
|
29
|
+
"tags": ["tag1", "tag2"],
|
|
30
|
+
"category": "engineering",
|
|
31
|
+
"importance": 4,
|
|
32
|
+
"createdAt": "2026-03-04T10:00:00.000Z",
|
|
33
|
+
"updatedAt": "2026-03-04T10:00:00.000Z"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"count": 1
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### When to Call
|
|
41
|
+
|
|
42
|
+
- Starting a new conversation or task
|
|
43
|
+
- User mentions "before", "remember", "last time"
|
|
44
|
+
- Uncertain about user preferences or constraints
|
|
45
|
+
- Need project context (tech stack, conventions)
|
|
46
|
+
|
|
47
|
+
### Example
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"query": "testing framework",
|
|
52
|
+
"tags": ["preference"],
|
|
53
|
+
"limit": 5
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## memory_update
|
|
60
|
+
|
|
61
|
+
Store new memories or update existing ones.
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Required | Description |
|
|
66
|
+
| ------------ | -------- | -------- | ------------------------------------------ |
|
|
67
|
+
| `title` | string | Yes | Short, descriptive title |
|
|
68
|
+
| `content` | string | Yes | Detailed memory content |
|
|
69
|
+
| `tags` | string[] | No | Tags for categorization |
|
|
70
|
+
| `entryType` | string | No | Memory type (default: `fact`) |
|
|
71
|
+
| `category` | string | No | Category (e.g., `engineering`, `business`) |
|
|
72
|
+
| `importance` | number | No | Importance 1-5 (default: 3) |
|
|
73
|
+
| `id` | string | No | Existing memory ID to update |
|
|
74
|
+
|
|
75
|
+
### Entry Types
|
|
76
|
+
|
|
77
|
+
| Type | Purpose |
|
|
78
|
+
| ------------ | -------------------------------------------------- |
|
|
79
|
+
| `preference` | User preferences (coding style, framework choices) |
|
|
80
|
+
| `decision` | Architecture decisions, technology choices |
|
|
81
|
+
| `context` | Project context (team, processes, constraints) |
|
|
82
|
+
| `fact` | Learned facts, important notes |
|
|
83
|
+
|
|
84
|
+
### Returns
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"id": "uuid",
|
|
89
|
+
"title": "Memory title",
|
|
90
|
+
"createdAt": "2026-03-04T10:00:00.000Z"
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### When to Call
|
|
95
|
+
|
|
96
|
+
- User explicitly expresses a preference
|
|
97
|
+
- Made a significant decision with reasoning
|
|
98
|
+
- Discovered important project context
|
|
99
|
+
- User corrected an assumption
|
|
100
|
+
|
|
101
|
+
### Example
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"title": "Use Vitest for Testing",
|
|
106
|
+
"content": "User prefers Vitest over Jest for all new projects. Reason: faster test execution and better ESM support.",
|
|
107
|
+
"tags": ["testing", "preference"],
|
|
108
|
+
"entryType": "preference",
|
|
109
|
+
"importance": 4
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Best Practices
|
|
116
|
+
|
|
117
|
+
### What to Store
|
|
118
|
+
|
|
119
|
+
**Good candidates:**
|
|
120
|
+
|
|
121
|
+
- User preferences (coding style, frameworks)
|
|
122
|
+
- Technical decisions and their reasoning
|
|
123
|
+
- Project constraints and conventions
|
|
124
|
+
- Lessons learned from mistakes
|
|
125
|
+
|
|
126
|
+
**Avoid storing:**
|
|
127
|
+
|
|
128
|
+
- Temporary information
|
|
129
|
+
- One-time tasks
|
|
130
|
+
- Sensitive data (API keys, passwords)
|
|
131
|
+
|
|
132
|
+
### Memory Principles
|
|
133
|
+
|
|
134
|
+
1. **Natural trigger** - Memory calls should be context-driven
|
|
135
|
+
2. **Value first** - Only store what future conversations benefit from
|
|
136
|
+
3. **Preferences matter** - User preferences are the most valuable memories
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# MemHub User Guide
|
|
2
|
+
|
|
3
|
+
MemHub is a Git-friendly memory system for AI coding agents. It helps your AI remember preferences, decisions, and project context across conversations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Quick Setup (Recommended)
|
|
8
|
+
|
|
9
|
+
Configure MemHub for your AI agent with one command:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx -y @synth-coder/memhub init
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This will:
|
|
16
|
+
|
|
17
|
+
1. Add MCP server config to your agent's configuration file
|
|
18
|
+
2. Add MemHub usage instructions to your agent's rules file
|
|
19
|
+
|
|
20
|
+
### Supported Agents
|
|
21
|
+
|
|
22
|
+
| Agent | Global Config | Local Config |
|
|
23
|
+
| ------------- | ------------------------------------- | ----------------------------------- |
|
|
24
|
+
| Claude Code | `~/.claude/settings.json` | `.mcp.json` |
|
|
25
|
+
| Cursor | `~/.cursor/mcp.json` | `.cursor/mcp.json` |
|
|
26
|
+
| Cline | `~/.cline/mcp.json` | `.cline/mcp.json` |
|
|
27
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | `.codeium/windsurf/mcp_config.json` |
|
|
28
|
+
| Factory Droid | `~/.factory/mcp.json` | `.factory/mcp.json` |
|
|
29
|
+
| Gemini CLI | `~/.gemini/settings.json` | `.gemini/settings.json` |
|
|
30
|
+
| Codex | `~/.codex/config.toml` | `.codex/config.toml` |
|
|
31
|
+
|
|
32
|
+
### CLI Options
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Interactive selection (global - default)
|
|
36
|
+
npx -y @synth-coder/memhub init
|
|
37
|
+
|
|
38
|
+
# Specify agent
|
|
39
|
+
npx -y @synth-coder/memhub init -a claude-code
|
|
40
|
+
|
|
41
|
+
# Configure for current project only (local)
|
|
42
|
+
npx -y @synth-coder/memhub init -a cursor -l
|
|
43
|
+
|
|
44
|
+
# Update existing configuration
|
|
45
|
+
npx -y @synth-coder/memhub init -a claude-code --force
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
| Option | Description |
|
|
49
|
+
| -------------------- | ----------------------------------------------- |
|
|
50
|
+
| `-a, --agent <name>` | Agent type (skip interactive) |
|
|
51
|
+
| `-l, --local` | Configure for current project (default: global) |
|
|
52
|
+
| `-f, --force` | Update existing configuration |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## How It Works
|
|
57
|
+
|
|
58
|
+
### Memory Tools
|
|
59
|
+
|
|
60
|
+
MemHub provides two MCP tools for your AI agent:
|
|
61
|
+
|
|
62
|
+
#### `memory_load` - Recall Context
|
|
63
|
+
|
|
64
|
+
Your AI calls this when it needs to remember something:
|
|
65
|
+
|
|
66
|
+
- User mentions "before", "remember", "last time"
|
|
67
|
+
- Uncertain about user preferences
|
|
68
|
+
- Need historical context for a decision
|
|
69
|
+
|
|
70
|
+
#### `memory_update` - Store Knowledge
|
|
71
|
+
|
|
72
|
+
Your AI calls this when it learns something worth remembering:
|
|
73
|
+
|
|
74
|
+
- User expresses a preference ("I prefer functional components")
|
|
75
|
+
- Made a significant decision with reasoning
|
|
76
|
+
- Discovered important project context
|
|
77
|
+
- User corrected an assumption
|
|
78
|
+
|
|
79
|
+
### Memory Types
|
|
80
|
+
|
|
81
|
+
| Type | Purpose | Example |
|
|
82
|
+
| ------------ | ------------------- | ------------------------------------ |
|
|
83
|
+
| `preference` | User preferences | "Prefers TypeScript over JavaScript" |
|
|
84
|
+
| `decision` | Technical decisions | "Using PostgreSQL for scalability" |
|
|
85
|
+
| `context` | Project context | "Team uses conventional commits" |
|
|
86
|
+
| `fact` | Learned facts | "API rate limit is 1000 req/min" |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Storage
|
|
91
|
+
|
|
92
|
+
### Where Memories Are Stored
|
|
93
|
+
|
|
94
|
+
By default, memories are stored in `~/.memhub/` (global) or `./memories/` (local).
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Custom storage location
|
|
98
|
+
MEMHUB_STORAGE_PATH=/path/to/memories npx -y @synth-coder/memhub
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### File Format
|
|
102
|
+
|
|
103
|
+
Memories are plain Markdown files with YAML front matter:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
---
|
|
107
|
+
id: '550e8400-e29b-41d4-a716-446655440000'
|
|
108
|
+
created_at: '2026-03-04T10:00:00.000Z'
|
|
109
|
+
tags:
|
|
110
|
+
- architecture
|
|
111
|
+
- tdd
|
|
112
|
+
category: 'engineering'
|
|
113
|
+
importance: 4
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
# Use Contract-First Design
|
|
117
|
+
|
|
118
|
+
Define tool contracts and schemas before implementation.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Git Integration
|
|
122
|
+
|
|
123
|
+
Since memories are plain text files, you can:
|
|
124
|
+
|
|
125
|
+
- Commit them to your repository
|
|
126
|
+
- Review changes in pull requests
|
|
127
|
+
- Revert if needed
|
|
128
|
+
- Share with your team
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Environment Variables
|
|
133
|
+
|
|
134
|
+
| Variable | Default | Description |
|
|
135
|
+
| --------------------- | ----------- | ------------------------------------------- |
|
|
136
|
+
| `MEMHUB_STORAGE_PATH` | `~/.memhub` | Memory storage directory |
|
|
137
|
+
| `MEMHUB_LOG_LEVEL` | `info` | Log level: `debug`, `info`, `warn`, `error` |
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Tips
|
|
142
|
+
|
|
143
|
+
### What to Remember
|
|
144
|
+
|
|
145
|
+
**Good candidates:**
|
|
146
|
+
|
|
147
|
+
- User preferences (coding style, frameworks)
|
|
148
|
+
- Technical decisions and their reasoning
|
|
149
|
+
- Project constraints and conventions
|
|
150
|
+
- Lessons learned from mistakes
|
|
151
|
+
|
|
152
|
+
**Avoid storing:**
|
|
153
|
+
|
|
154
|
+
- Temporary information
|
|
155
|
+
- One-time tasks
|
|
156
|
+
- Sensitive data (API keys, passwords)
|
|
157
|
+
|
|
158
|
+
### Memory Principles
|
|
159
|
+
|
|
160
|
+
1. **Natural trigger** - Memory calls should be context-driven, not scheduled
|
|
161
|
+
2. **Value first** - Only store what future conversations will benefit from
|
|
162
|
+
3. **Preferences matter** - User preferences are the most valuable memories
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Troubleshooting
|
|
167
|
+
|
|
168
|
+
### Configuration not working?
|
|
169
|
+
|
|
170
|
+
1. Restart your AI agent after running `init`
|
|
171
|
+
2. Check the config file exists and contains `memhub` server
|
|
172
|
+
3. Try with `--force` to update existing configuration
|
|
173
|
+
|
|
174
|
+
### Memories not loading?
|
|
175
|
+
|
|
176
|
+
1. Check `MEMHUB_STORAGE_PATH` is correct
|
|
177
|
+
2. Verify the directory contains `.md` files
|
|
178
|
+
3. Check file permissions
|
|
179
|
+
|
|
180
|
+
### Need help?
|
|
181
|
+
|
|
182
|
+
- GitHub Issues: https://github.com/synth-coder/memhub/issues
|
package/package.json
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synth-coder/memhub",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "A Git-friendly memory hub using Markdown-based storage with YAML Front Matter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"memhub": "dist/src/
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"prepublishOnly": "npm run build && node -e \"require('fs').chmodSync('dist/src/server/mcp-server.js', 0o755)\"",
|
|
13
|
-
"build": "tsc",
|
|
14
|
-
"dev": "tsc --watch",
|
|
15
|
-
"test": "vitest run",
|
|
16
|
-
"test:watch": "vitest",
|
|
17
|
-
"test:coverage": "vitest run --coverage",
|
|
18
|
-
"lint": "eslint src test --ext .ts",
|
|
19
|
-
"lint:fix": "eslint src test --ext .ts --fix",
|
|
20
|
-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"docs/**/*.md\"",
|
|
21
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\" \"docs/**/*.md\"",
|
|
22
|
-
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
23
|
-
"quality": "npm run lint && npm run typecheck && npm run test:coverage",
|
|
24
|
-
"ci": "npm run quality"
|
|
9
|
+
"memhub": "dist/src/cli/index.js"
|
|
25
10
|
},
|
|
26
11
|
"keywords": [
|
|
27
12
|
"mcp",
|
|
@@ -33,15 +18,19 @@
|
|
|
33
18
|
"author": "",
|
|
34
19
|
"license": "MIT",
|
|
35
20
|
"dependencies": {
|
|
21
|
+
"@clack/prompts": "^1.1.0",
|
|
36
22
|
"@lancedb/lancedb": "^0.26.2",
|
|
37
23
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
38
24
|
"@xenova/transformers": "^2.17.2",
|
|
25
|
+
"proper-lockfile": "^4.1.2",
|
|
39
26
|
"sharp": "^0.34.5",
|
|
27
|
+
"smol-toml": "^1.6.0",
|
|
40
28
|
"yaml": "^2.8.2",
|
|
41
29
|
"zod": "^3.25.76"
|
|
42
30
|
},
|
|
43
31
|
"devDependencies": {
|
|
44
32
|
"@types/node": "^20.19.35",
|
|
33
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
45
34
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
46
35
|
"@typescript-eslint/parser": "^6.21.0",
|
|
47
36
|
"@vitest/coverage-v8": "^1.6.1",
|
|
@@ -53,6 +42,20 @@
|
|
|
53
42
|
"vitest": "^1.6.1"
|
|
54
43
|
},
|
|
55
44
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
45
|
+
"node": ">=20.0.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc",
|
|
49
|
+
"dev": "tsc --watch",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"test:coverage": "vitest run --coverage",
|
|
53
|
+
"lint": "eslint src test --ext .ts",
|
|
54
|
+
"lint:fix": "eslint src test --ext .ts --fix",
|
|
55
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"docs/**/*.md\"",
|
|
56
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\" \"docs/**/*.md\"",
|
|
57
|
+
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
58
|
+
"quality": "npm run lint && npm run typecheck && npm run test:coverage",
|
|
59
|
+
"ci": "npm run quality"
|
|
57
60
|
}
|
|
58
|
-
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateClaudeCodeConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cline MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateClineConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateCodexConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateCursorConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory Droid MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateFactoryDroidConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini CLI MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateGeminiCliConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent configuration generators index
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { generateCursorConfig } from './cursor.js';
|
|
6
|
+
export { generateClaudeCodeConfig } from './claude-code.js';
|
|
7
|
+
export { generateClineConfig } from './cline.js';
|
|
8
|
+
export { generateWindsurfConfig } from './windsurf.js';
|
|
9
|
+
export { generateFactoryDroidConfig } from './factory-droid.js';
|
|
10
|
+
export { generateGeminiCliConfig } from './gemini-cli.js';
|
|
11
|
+
export { generateCodexConfig } from './codex.js';
|
|
12
|
+
|
|
13
|
+
import type { AgentType } from '../types.js';
|
|
14
|
+
import { generateCursorConfig } from './cursor.js';
|
|
15
|
+
import { generateClaudeCodeConfig } from './claude-code.js';
|
|
16
|
+
import { generateClineConfig } from './cline.js';
|
|
17
|
+
import { generateWindsurfConfig } from './windsurf.js';
|
|
18
|
+
import { generateFactoryDroidConfig } from './factory-droid.js';
|
|
19
|
+
import { generateGeminiCliConfig } from './gemini-cli.js';
|
|
20
|
+
import { generateCodexConfig } from './codex.js';
|
|
21
|
+
|
|
22
|
+
export type ConfigGenerator = (memhubPath: string) => Record<string, unknown>;
|
|
23
|
+
|
|
24
|
+
const generators: Record<AgentType, ConfigGenerator> = {
|
|
25
|
+
cursor: generateCursorConfig,
|
|
26
|
+
'claude-code': generateClaudeCodeConfig,
|
|
27
|
+
cline: generateClineConfig,
|
|
28
|
+
windsurf: generateWindsurfConfig,
|
|
29
|
+
'factory-droid': generateFactoryDroidConfig,
|
|
30
|
+
'gemini-cli': generateGeminiCliConfig,
|
|
31
|
+
codex: generateCodexConfig,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function getConfigGenerator(agentId: AgentType): ConfigGenerator {
|
|
35
|
+
return generators[agentId];
|
|
36
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windsurf MCP configuration generator
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function generateWindsurfConfig(_memhubPath: string): Record<string, unknown> {
|
|
6
|
+
return {
|
|
7
|
+
mcpServers: {
|
|
8
|
+
memhub: {
|
|
9
|
+
command: 'npx',
|
|
10
|
+
args: ['-y', '@synth-coder/memhub'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|