indelible-mcp 2.5.0 → 2.5.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indelible-mcp",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Blockchain-backed memory and code storage for Claude Code. Save AI conversations and source code permanently on BSV.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -220,7 +220,7 @@ Commands:
220
220
 
221
221
  function printHelp() {
222
222
  console.log(`
223
- Indelible MCP — Blockchain memory for Claude Code (v2.5.0)
223
+ Indelible MCP — Blockchain memory for Claude Code (v2.5.1)
224
224
 
225
225
  Setup:
226
226
  indelible-mcp setup --wif=KEY --pin=PIN Import and encrypt your private key
@@ -316,7 +316,7 @@ function readStdin() {
316
316
 
317
317
  const SERVER_INFO = {
318
318
  name: 'indelible',
319
- version: '2.5.0',
319
+ version: '2.5.1',
320
320
  description: 'Blockchain-backed memory and code storage for Claude Code'
321
321
  }
322
322
 
@@ -34,7 +34,7 @@ export async function saveFile(filePath, options = {}) {
34
34
  const filenameEnc = encrypt(filename, wif)
35
35
  const pathEnc = encrypt(relativePath, wif)
36
36
 
37
- let utxos = await spv.getUtxos(config.address)
37
+ let utxos = options.utxos || await spv.getUtxos(config.address)
38
38
  if (!utxos || utxos.length === 0) {
39
39
  return { success: false, error: 'No UTXOs available. Fund your wallet first.' }
40
40
  }
@@ -43,6 +43,7 @@ export async function saveFile(filePath, options = {}) {
43
43
 
44
44
  try {
45
45
  let masterTxId
46
+ let finalChangeUtxos = null
46
47
 
47
48
  if (encrypted.length <= MAX_CHUNK_SIZE) {
48
49
  const payload = {
@@ -57,11 +58,12 @@ export async function saveFile(filePath, options = {}) {
57
58
  timestamp
58
59
  }
59
60
 
60
- const { txHex, txId } = await spv.buildOpReturnTxWithChange(
61
+ const { txHex, txId, changeUtxos } = await spv.buildOpReturnTxWithChange(
61
62
  wif, utxos, JSON.stringify(payload)
62
63
  )
63
64
  const result = await spv.broadcastTx(txHex)
64
65
  masterTxId = result.txid || txId
66
+ finalChangeUtxos = changeUtxos
65
67
  } else {
66
68
  // Chunked upload
67
69
  const chunks = []
@@ -118,11 +120,12 @@ export async function saveFile(filePath, options = {}) {
118
120
  await new Promise(r => setTimeout(r, 500))
119
121
  utxos = await spv.getUtxos(config.address)
120
122
  }
121
- const { txHex, txId } = await spv.buildOpReturnTxWithChange(
123
+ const { txHex, txId, changeUtxos: masterChangeUtxos } = await spv.buildOpReturnTxWithChange(
122
124
  wif, utxos, JSON.stringify(masterPayload)
123
125
  )
124
126
  const result = await spv.broadcastTx(txHex)
125
127
  masterTxId = result.txid || txId
128
+ finalChangeUtxos = masterChangeUtxos
126
129
  }
127
130
 
128
131
  // Track in config
@@ -147,6 +150,7 @@ export async function saveFile(filePath, options = {}) {
147
150
  size: fileSize,
148
151
  contentHash: `sha256:${contentHash}`,
149
152
  chunks: chunkCount,
153
+ changeUtxos: finalChangeUtxos,
150
154
  message: `File "${filename}" saved to blockchain. txId: ${masterTxId}${chunkCount > 1 ? ` (${chunkCount} chunks)` : ''}`
151
155
  }
152
156
  } catch (error) {
@@ -97,11 +97,19 @@ export async function saveProject(dirPath, options = {}) {
97
97
  let totalSize = 0
98
98
 
99
99
  try {
100
+ let lastChangeUtxos = null
101
+
100
102
  for (let i = 0; i < allFiles.length; i++) {
101
103
  const file = allFiles[i]
102
- const result = await saveFile(file.absolutePath, {
104
+ const fileOpts = {
103
105
  relativePath: `${projectName}/${file.relativePath}`
104
- })
106
+ }
107
+ // Chain: pass previous file's change UTXOs so we don't fight over the same UTXO
108
+ if (lastChangeUtxos && lastChangeUtxos.length > 0) {
109
+ fileOpts.utxos = lastChangeUtxos
110
+ }
111
+
112
+ const result = await saveFile(file.absolutePath, fileOpts)
105
113
 
106
114
  if (!result.success) {
107
115
  return {
@@ -112,6 +120,9 @@ export async function saveProject(dirPath, options = {}) {
112
120
  }
113
121
  }
114
122
 
123
+ // Capture change UTXOs for next file
124
+ lastChangeUtxos = result.changeUtxos
125
+
115
126
  savedFiles.push({
116
127
  path: file.relativePath,
117
128
  txid: result.txId,
@@ -142,7 +153,10 @@ export async function saveProject(dirPath, options = {}) {
142
153
  timestamp
143
154
  }
144
155
 
145
- let utxos = await spv.getUtxos(config.address)
156
+ // Use last file's change UTXOs for manifest (chain continues)
157
+ let utxos = (lastChangeUtxos && lastChangeUtxos.length > 0)
158
+ ? lastChangeUtxos
159
+ : await spv.getUtxos(config.address)
146
160
  if (!utxos || utxos.length === 0) {
147
161
  return {
148
162
  success: false,
@@ -151,7 +165,7 @@ export async function saveProject(dirPath, options = {}) {
151
165
  }
152
166
  }
153
167
 
154
- const { txHex, txId } = await spv.buildOpReturnTx(
168
+ const { txHex, txId } = await spv.buildOpReturnTxWithChange(
155
169
  wif, utxos, JSON.stringify(manifest)
156
170
  )
157
171
  const result = await spv.broadcastTx(txHex)