@pcircle/memesh 2.9.3 → 2.10.0
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/.claude-plugin/plugin.json +15 -0
- package/.mcp.json +12 -0
- package/README.de.md +4 -4
- package/README.es.md +4 -4
- package/README.fr.md +4 -4
- package/README.id.md +4 -4
- package/README.ja.md +4 -4
- package/README.ko.md +4 -4
- package/README.md +87 -13
- package/README.th.md +4 -4
- package/README.vi.md +4 -4
- package/README.zh-CN.md +4 -4
- package/README.zh-TW.md +84 -10
- package/dist/db/ConnectionPool.d.ts.map +1 -1
- package/dist/db/ConnectionPool.js +17 -1
- package/dist/db/ConnectionPool.js.map +1 -1
- package/dist/db/adapters/BetterSqlite3Adapter.d.ts.map +1 -1
- package/dist/db/adapters/BetterSqlite3Adapter.js +22 -0
- package/dist/db/adapters/BetterSqlite3Adapter.js.map +1 -1
- package/dist/embeddings/EmbeddingService.d.ts.map +1 -1
- package/dist/embeddings/EmbeddingService.js +2 -6
- package/dist/embeddings/EmbeddingService.js.map +1 -1
- package/dist/knowledge-graph/KGSearchEngine.d.ts +1 -0
- package/dist/knowledge-graph/KGSearchEngine.d.ts.map +1 -1
- package/dist/knowledge-graph/KGSearchEngine.js +4 -4
- package/dist/knowledge-graph/KGSearchEngine.js.map +1 -1
- package/dist/mcp/ToolDefinitions.d.ts.map +1 -1
- package/dist/mcp/ToolDefinitions.js +4 -3
- package/dist/mcp/ToolDefinitions.js.map +1 -1
- package/dist/mcp/handlers/MemoryToolHandler.d.ts.map +1 -1
- package/dist/mcp/handlers/MemoryToolHandler.js +3 -0
- package/dist/mcp/handlers/MemoryToolHandler.js.map +1 -1
- package/dist/mcp/tools/buddy-do.d.ts.map +1 -1
- package/dist/mcp/tools/buddy-do.js +17 -1
- package/dist/mcp/tools/buddy-do.js.map +1 -1
- package/dist/mcp/tools/buddy-remember.d.ts +1 -1
- package/dist/mcp/tools/buddy-remember.d.ts.map +1 -1
- package/dist/mcp/tools/buddy-remember.js +58 -16
- package/dist/mcp/tools/buddy-remember.js.map +1 -1
- package/dist/mcp/tools/create-entities.d.ts +1 -0
- package/dist/mcp/tools/create-entities.d.ts.map +1 -1
- package/dist/mcp/tools/create-entities.js +155 -0
- package/dist/mcp/tools/create-entities.js.map +1 -1
- package/dist/memory/UnifiedMemoryStore.d.ts.map +1 -1
- package/dist/memory/UnifiedMemoryStore.js +5 -1
- package/dist/memory/UnifiedMemoryStore.js.map +1 -1
- package/dist/ui/MetricsStore.d.ts.map +1 -1
- package/dist/ui/MetricsStore.js +21 -2
- package/dist/ui/MetricsStore.js.map +1 -1
- package/hooks/hooks.json +66 -0
- package/package.json +6 -4
- package/plugin.json +7 -3
- package/scripts/health-check.js +255 -0
- package/scripts/hooks/hook-utils.js +4 -4
- package/scripts/hooks/post-tool-use.js +4 -0
- package/scripts/hooks/pre-tool-use.js +30 -1
- package/scripts/hooks/session-start.js +45 -8
- package/scripts/postinstall-lib.js +15 -50
- package/scripts/postinstall-new.js +23 -130
- package/mcp.json +0 -10
- /package/{scripts/skills → skills}/comprehensive-code-review/SKILL.md +0 -0
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Post-install script for MeMesh
|
|
3
|
+
* Post-install script for MeMesh Plugin
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Following official Claude Code Plugin spec:
|
|
6
|
+
* - MCP servers: handled by plugin system via .mcp.json
|
|
7
|
+
* - Hooks: handled by plugin system via hooks/hooks.json
|
|
8
|
+
* - Skills: auto-discovered by plugin system from skills/
|
|
6
9
|
*
|
|
7
|
-
*
|
|
10
|
+
* This script only does:
|
|
8
11
|
* 1. Detect install mode (global/local)
|
|
9
12
|
* 2. Register marketplace
|
|
10
13
|
* 3. Create symlink
|
|
11
14
|
* 4. Enable plugin
|
|
12
|
-
* 5.
|
|
13
|
-
* 6. Fix legacy installations
|
|
15
|
+
* 5. Fix legacy installations
|
|
14
16
|
*/
|
|
15
17
|
|
|
16
18
|
import { fileURLToPath } from 'url';
|
|
17
19
|
import { dirname, join } from 'path';
|
|
18
20
|
import { homedir } from 'os';
|
|
19
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, statSync } from 'fs';
|
|
20
21
|
import chalk from 'chalk';
|
|
21
22
|
import boxen from 'boxen';
|
|
22
23
|
|
|
@@ -24,92 +25,16 @@ import boxen from 'boxen';
|
|
|
24
25
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
26
|
const __dirname = dirname(__filename);
|
|
26
27
|
|
|
27
|
-
// Import functions from postinstall-lib.js
|
|
28
|
+
// Import functions from postinstall-lib.js
|
|
28
29
|
import {
|
|
29
30
|
detectInstallMode,
|
|
30
31
|
getPluginInstallPath,
|
|
31
32
|
ensureMarketplaceRegistered,
|
|
32
33
|
ensureSymlinkExists,
|
|
33
34
|
ensurePluginEnabled,
|
|
34
|
-
ensureMCPConfigured,
|
|
35
35
|
detectAndFixLegacyInstall
|
|
36
36
|
} from './postinstall-lib.js';
|
|
37
37
|
|
|
38
|
-
// ============================================================================
|
|
39
|
-
// Bundled Skills Installation
|
|
40
|
-
// ============================================================================
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Install bundled skills to ~/.claude/skills/sa:<name>/
|
|
44
|
-
* Skills are shipped in scripts/skills/<name>/SKILL.md
|
|
45
|
-
* Only installs if skill doesn't exist or bundled version is newer.
|
|
46
|
-
*
|
|
47
|
-
* @param {string} claudeDir - Path to ~/.claude
|
|
48
|
-
* @returns {{ installed: string[], skipped: string[], errors: string[] }}
|
|
49
|
-
*/
|
|
50
|
-
function installBundledSkills(claudeDir) {
|
|
51
|
-
const result = { installed: [], skipped: [], errors: [] };
|
|
52
|
-
const bundledDir = join(__dirname, 'skills');
|
|
53
|
-
const skillsDir = join(claudeDir, 'skills');
|
|
54
|
-
|
|
55
|
-
if (!existsSync(bundledDir)) {
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Ensure skills directory exists
|
|
60
|
-
mkdirSync(skillsDir, { recursive: true });
|
|
61
|
-
|
|
62
|
-
// Read all bundled skills
|
|
63
|
-
let entries;
|
|
64
|
-
try {
|
|
65
|
-
entries = readdirSync(bundledDir, { withFileTypes: true });
|
|
66
|
-
} catch {
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
for (const entry of entries) {
|
|
71
|
-
if (!entry.isDirectory()) continue;
|
|
72
|
-
|
|
73
|
-
const skillName = entry.name;
|
|
74
|
-
const prefixedName = `sa:${skillName}`;
|
|
75
|
-
const sourceFile = join(bundledDir, skillName, 'SKILL.md');
|
|
76
|
-
const targetDir = join(skillsDir, prefixedName);
|
|
77
|
-
const targetFile = join(targetDir, 'SKILL.md');
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
// Read source first — if it doesn't exist, skip (no TOCTOU with existsSync)
|
|
81
|
-
let content;
|
|
82
|
-
let sourceStat;
|
|
83
|
-
try {
|
|
84
|
-
content = readFileSync(sourceFile, 'utf-8');
|
|
85
|
-
sourceStat = statSync(sourceFile);
|
|
86
|
-
} catch {
|
|
87
|
-
continue; // source doesn't exist, skip
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Skip if target exists and is newer than source
|
|
91
|
-
try {
|
|
92
|
-
const targetStat = statSync(targetFile);
|
|
93
|
-
if (targetStat.mtimeMs >= sourceStat.mtimeMs) {
|
|
94
|
-
result.skipped.push(skillName);
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
} catch {
|
|
98
|
-
// target doesn't exist yet, proceed to install
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Install: create dir + write SKILL.md
|
|
102
|
-
mkdirSync(targetDir, { recursive: true });
|
|
103
|
-
writeFileSync(targetFile, content, 'utf-8');
|
|
104
|
-
result.installed.push(skillName);
|
|
105
|
-
} catch (error) {
|
|
106
|
-
result.errors.push(`${skillName}: ${error.message}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
38
|
// ============================================================================
|
|
114
39
|
// Main Installation Flow
|
|
115
40
|
// ============================================================================
|
|
@@ -123,7 +48,6 @@ async function main() {
|
|
|
123
48
|
marketplace: false,
|
|
124
49
|
symlink: false,
|
|
125
50
|
pluginEnabled: false,
|
|
126
|
-
mcpConfigured: false,
|
|
127
51
|
legacyFixed: null,
|
|
128
52
|
errors: []
|
|
129
53
|
};
|
|
@@ -172,25 +96,7 @@ async function main() {
|
|
|
172
96
|
console.log(chalk.yellow(` ⚠️ Plugin enablement failed (non-fatal)`));
|
|
173
97
|
}
|
|
174
98
|
|
|
175
|
-
// Step 5:
|
|
176
|
-
// IMPORTANT: Skip MCP config for local dev to prevent path pollution
|
|
177
|
-
// (see v2.9.0 Issue 2: Local Development Path Pollution)
|
|
178
|
-
if (mode === 'local') {
|
|
179
|
-
console.log(chalk.yellow(' ⚠️ Skipping MCP configuration (local development mode)'));
|
|
180
|
-
console.log(chalk.gray(' This prevents writing local dev paths to ~/.claude/mcp_settings.json'));
|
|
181
|
-
results.mcpConfigured = false;
|
|
182
|
-
} else {
|
|
183
|
-
try {
|
|
184
|
-
await ensureMCPConfigured(installPath, mode, claudeDir);
|
|
185
|
-
results.mcpConfigured = true;
|
|
186
|
-
console.log(chalk.green(' ✅ MCP configured'));
|
|
187
|
-
} catch (error) {
|
|
188
|
-
results.errors.push(`MCP: ${error.message}`);
|
|
189
|
-
console.log(chalk.yellow(` ⚠️ MCP configuration failed (non-fatal)`));
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Step 6: Legacy Installation Fix
|
|
99
|
+
// Step 5: Legacy Installation Fix
|
|
194
100
|
try {
|
|
195
101
|
const legacyStatus = await detectAndFixLegacyInstall(installPath, claudeDir);
|
|
196
102
|
results.legacyFixed = legacyStatus;
|
|
@@ -204,25 +110,6 @@ async function main() {
|
|
|
204
110
|
console.log(chalk.dim(' ℹ️ Legacy check skipped'));
|
|
205
111
|
}
|
|
206
112
|
|
|
207
|
-
// Step 7: Install Bundled Skills
|
|
208
|
-
try {
|
|
209
|
-
const skillResult = installBundledSkills(claudeDir);
|
|
210
|
-
results.skillsInstalled = skillResult.installed;
|
|
211
|
-
results.skillsSkipped = skillResult.skipped;
|
|
212
|
-
|
|
213
|
-
if (skillResult.installed.length > 0) {
|
|
214
|
-
console.log(chalk.green(` ✅ Skills installed: ${skillResult.installed.join(', ')}`));
|
|
215
|
-
} else if (skillResult.skipped.length > 0) {
|
|
216
|
-
console.log(chalk.dim(` ℹ️ Skills up to date (${skillResult.skipped.length} already installed)`));
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (skillResult.errors.length > 0) {
|
|
220
|
-
results.errors.push(`Skills: ${skillResult.errors.join('; ')}`);
|
|
221
|
-
}
|
|
222
|
-
} catch (error) {
|
|
223
|
-
console.log(chalk.dim(' ℹ️ Skills installation skipped'));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
113
|
} catch (error) {
|
|
227
114
|
console.error(chalk.red('\n❌ Installation failed:'), error.message);
|
|
228
115
|
console.error(chalk.yellow('\n💡 You can configure manually (see instructions below)\n'));
|
|
@@ -232,8 +119,7 @@ async function main() {
|
|
|
232
119
|
// Display Installation Summary
|
|
233
120
|
// ============================================================================
|
|
234
121
|
|
|
235
|
-
const allSuccess = results.marketplace && results.symlink &&
|
|
236
|
-
results.pluginEnabled && results.mcpConfigured;
|
|
122
|
+
const allSuccess = results.marketplace && results.symlink && results.pluginEnabled;
|
|
237
123
|
|
|
238
124
|
const statusIcon = allSuccess ? '✅' : (results.errors.length > 0 ? '⚠️' : '✅');
|
|
239
125
|
const statusText = allSuccess
|
|
@@ -247,13 +133,13 @@ ${chalk.bold('Installation Summary:')}
|
|
|
247
133
|
${results.marketplace ? '✅' : '⚠️'} Marketplace: ${results.marketplace ? 'Registered' : 'Failed'}
|
|
248
134
|
${results.symlink ? '✅' : '⚠️'} Symlink: ${results.symlink ? 'Created' : 'Failed'}
|
|
249
135
|
${results.pluginEnabled ? '✅' : '⚠️'} Plugin: ${results.pluginEnabled ? 'Enabled' : 'Failed'}
|
|
250
|
-
${results.mcpConfigured ? '✅' : '⚠️'} MCP: ${results.mcpConfigured ? 'Configured' : 'Failed'}
|
|
251
136
|
|
|
252
|
-
${chalk.bold('
|
|
253
|
-
${chalk.cyan('•')} 8
|
|
137
|
+
${chalk.bold('Plugin Components (auto-managed by Claude Code):')}
|
|
138
|
+
${chalk.cyan('•')} MCP Server: 8 tools (persistent memory, semantic search, task routing)
|
|
139
|
+
${chalk.cyan('•')} Hooks: 6 auto-hooks (session recall, commit tracking, smart routing)
|
|
140
|
+
${chalk.cyan('•')} Skills: Comprehensive code review
|
|
254
141
|
${chalk.cyan('•')} Vector semantic search with ONNX embeddings (runs 100% locally)
|
|
255
|
-
${chalk.cyan('•')} Auto-
|
|
256
|
-
${chalk.cyan('•')} Local-first architecture (all data stored locally)
|
|
142
|
+
${chalk.cyan('•')} Auto-relation inference in knowledge graph
|
|
257
143
|
|
|
258
144
|
${chalk.bold('Next Steps:')}
|
|
259
145
|
${chalk.yellow('1.')} ${chalk.bold('Restart Claude Code')}
|
|
@@ -284,7 +170,14 @@ ${chalk.dim('Need help? Open an issue: https://github.com/PCIRCLE-AI/claude-code
|
|
|
284
170
|
);
|
|
285
171
|
|
|
286
172
|
// Exit with appropriate code
|
|
287
|
-
|
|
173
|
+
// Critical failures (plugin registration) → exit 1
|
|
174
|
+
// Non-critical failures (symlink already exists) → exit 0
|
|
175
|
+
const hasCriticalFailure = !results.marketplace && !results.symlink;
|
|
176
|
+
const hasPluginFailure = !results.pluginEnabled;
|
|
177
|
+
if (hasCriticalFailure || hasPluginFailure) {
|
|
178
|
+
process.exit(1);
|
|
179
|
+
}
|
|
180
|
+
process.exit(0);
|
|
288
181
|
}
|
|
289
182
|
|
|
290
183
|
// ============================================================================
|
package/mcp.json
DELETED
|
File without changes
|