indelible-mcp 4.1.4 → 4.1.5
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/package.json +1 -1
- package/src/index.js +45 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -55,10 +55,14 @@ function installHooks() {
|
|
|
55
55
|
h.hooks?.some(hh => hh.command?.includes('indelible-mcp hook pre-compact')) ||
|
|
56
56
|
h.command?.includes('indelible-mcp hook pre-compact')
|
|
57
57
|
)
|
|
58
|
-
const
|
|
58
|
+
const hasPostCompact = settings.hooks.SessionStart?.some(h =>
|
|
59
59
|
h.hooks?.some(hh => hh.command?.includes('indelible-mcp hook post-compact')) ||
|
|
60
60
|
h.command?.includes('indelible-mcp hook post-compact')
|
|
61
61
|
)
|
|
62
|
+
const hasSessionStart = settings.hooks.SessionStart?.some(h =>
|
|
63
|
+
h.hooks?.some(hh => hh.command?.includes('indelible-mcp hook session-start')) ||
|
|
64
|
+
h.command?.includes('indelible-mcp hook session-start')
|
|
65
|
+
)
|
|
62
66
|
|
|
63
67
|
const installed = []
|
|
64
68
|
|
|
@@ -71,13 +75,22 @@ function installHooks() {
|
|
|
71
75
|
installed.push('PreCompact')
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
if (!
|
|
78
|
+
if (!hasPostCompact) {
|
|
75
79
|
if (!settings.hooks.SessionStart) settings.hooks.SessionStart = []
|
|
76
80
|
settings.hooks.SessionStart.push({
|
|
77
81
|
matcher: 'compact',
|
|
78
82
|
hooks: [{ type: 'command', command: 'indelible-mcp hook post-compact' }]
|
|
79
83
|
})
|
|
80
|
-
installed.push('SessionStart')
|
|
84
|
+
installed.push('SessionStart:compact')
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!hasSessionStart) {
|
|
88
|
+
if (!settings.hooks.SessionStart) settings.hooks.SessionStart = []
|
|
89
|
+
settings.hooks.SessionStart.push({
|
|
90
|
+
matcher: '',
|
|
91
|
+
hooks: [{ type: 'command', command: 'indelible-mcp hook session-start' }]
|
|
92
|
+
})
|
|
93
|
+
installed.push('SessionStart:style')
|
|
81
94
|
}
|
|
82
95
|
|
|
83
96
|
writeFileSync(settingsPath, JSON.stringify(settings, null, 2))
|
|
@@ -256,7 +269,7 @@ Commands:
|
|
|
256
269
|
|
|
257
270
|
function printHelp() {
|
|
258
271
|
console.log(`
|
|
259
|
-
Indelible MCP — Blockchain memory for Claude Code (v4.1.
|
|
272
|
+
Indelible MCP — Blockchain memory for Claude Code (v4.1.5)
|
|
260
273
|
|
|
261
274
|
Setup:
|
|
262
275
|
indelible-mcp setup --wif=KEY --pin=PIN Import and encrypt your private key
|
|
@@ -468,7 +481,7 @@ function readStdin() {
|
|
|
468
481
|
|
|
469
482
|
const SERVER_INFO = {
|
|
470
483
|
name: 'indelible',
|
|
471
|
-
version: '4.1.
|
|
484
|
+
version: '4.1.5',
|
|
472
485
|
description: 'Blockchain-backed memory and code storage for Claude Code'
|
|
473
486
|
}
|
|
474
487
|
|
|
@@ -737,6 +750,14 @@ async function runMcpServer() {
|
|
|
737
750
|
// ============ SETUP WIZARD ============
|
|
738
751
|
|
|
739
752
|
async function runWizard() {
|
|
753
|
+
// Detect sudo on Mac/Linux — MCP registration goes to wrong user
|
|
754
|
+
if (process.platform !== 'win32' && process.getuid?.() === 0) {
|
|
755
|
+
console.log('\n Don\'t run the wizard with sudo. Run it as your normal user:')
|
|
756
|
+
console.log(' indelible-mcp\n')
|
|
757
|
+
console.log(' (sudo is only needed for npm install -g)\n')
|
|
758
|
+
process.exit(1)
|
|
759
|
+
}
|
|
760
|
+
|
|
740
761
|
const rl = createInterface({ input: process.stdin, output: process.stdout })
|
|
741
762
|
const ask = (q) => new Promise(resolve => rl.question(q, resolve))
|
|
742
763
|
|
|
@@ -1014,6 +1035,25 @@ if (args[0] === 'hook') {
|
|
|
1014
1035
|
runPreCompactSave().catch(e => { process.stderr.write(`Indelible error: ${e.message}\n`); process.exit(0) })
|
|
1015
1036
|
} else if (args[1] === 'post-compact') {
|
|
1016
1037
|
runPostCompactRestore().catch(e => { process.stderr.write(`Indelible error: ${e.message}\n`); process.exit(0) })
|
|
1038
|
+
} else if (args[1] === 'session-start') {
|
|
1039
|
+
// Lightweight hook: load style only (runs on every new session)
|
|
1040
|
+
(async () => {
|
|
1041
|
+
const config = loadConfig()
|
|
1042
|
+
if (!config?.style_txid) { process.exit(0) }
|
|
1043
|
+
try {
|
|
1044
|
+
const style = await loadStyle(config.style_txid)
|
|
1045
|
+
if (style.success && style.rules) {
|
|
1046
|
+
process.stdout.write(`# AI Interaction Style: ${style.name}\n`)
|
|
1047
|
+
process.stdout.write(`Loaded from blockchain tx: ${config.style_txid}\n`)
|
|
1048
|
+
process.stdout.write(`Owner: ${style.owner} | Created: ${style.createdAt}\n\n`)
|
|
1049
|
+
process.stdout.write(style.rules + '\n')
|
|
1050
|
+
process.stderr.write(`Indelible: Style "${style.name}" loaded\n`)
|
|
1051
|
+
}
|
|
1052
|
+
} catch (err) {
|
|
1053
|
+
process.stderr.write(`Indelible: Style load failed: ${err.message}\n`)
|
|
1054
|
+
}
|
|
1055
|
+
process.exit(0)
|
|
1056
|
+
})()
|
|
1017
1057
|
} else {
|
|
1018
1058
|
console.error('Unknown hook:', args[1])
|
|
1019
1059
|
process.exit(1)
|