indelible-mcp 4.5.0 → 4.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +50 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indelible-mcp",
3
- "version": "4.5.0",
3
+ "version": "4.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
@@ -838,7 +838,8 @@ async function commitSession(session, wif) {
838
838
  if (utxos && utxos.length > 0) {
839
839
  const payload = {
840
840
  protocol: "indelible.claude-code",
841
- encrypted: session.encrypted
841
+ encrypted: session.encrypted,
842
+ wrap_owner: session.wrap_owner || null
842
843
  };
843
844
  const { txHex, txId, changeUtxos, fee, txSize } = await buildOpReturnTxWithChange(wif, utxos, JSON.stringify(payload));
844
845
  const writeReceipt = await broadcastTx(txHex);
@@ -849,17 +850,22 @@ async function commitSession(session, wif) {
849
850
  } catch {
850
851
  }
851
852
  }
852
- await indexSession({
853
- txId,
854
- address: session.address,
855
- encrypted: session.encrypted,
856
- session_id: session.session_id,
857
- prev_session_id: session.prev_session_id,
858
- summary_enc: summaryEnc,
859
- message_count: session.message_count,
860
- save_type: session.type || "full",
861
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
862
- }, config, wif);
853
+ try {
854
+ await indexSession({
855
+ txId,
856
+ address: session.address,
857
+ encrypted: session.encrypted,
858
+ session_id: session.session_id,
859
+ prev_session_id: session.prev_session_id,
860
+ summary_enc: summaryEnc,
861
+ message_count: session.message_count,
862
+ save_type: session.type || "full",
863
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
864
+ }, config, wif);
865
+ } catch (idxErr) {
866
+ process.stderr.write(`[MCP] WARNING \u2014 indexSession failed (non-fatal, tx is on chain): ${idxErr.message}
867
+ `);
868
+ }
863
869
  const receipt = buildReceipt(writeReceipt, { txId, fee, txSize });
864
870
  return { success: true, txId, changeUtxos, receipt };
865
871
  }
@@ -2922,7 +2928,9 @@ async function _saveSessionInner(transcriptPath, summary, mode) {
2922
2928
  timestamp: session.created_at
2923
2929
  };
2924
2930
  await appendFile(indexPath2, JSON.stringify(entry) + "\n");
2925
- } catch {
2931
+ } catch (e) {
2932
+ process.stderr.write(`[save_session] WARNING \u2014 session-index append failed; wrap NOT cached locally (on-chain copy is primary): ${e?.message || e}
2933
+ `);
2926
2934
  }
2927
2935
  let memoryTxId = config.memory_file_txid || null;
2928
2936
  let historyTxId = config.session_history_txid || null;
@@ -3194,20 +3202,25 @@ async function saveStyle(rulesText, styleName, description) {
3194
3202
  return { success: false, error: "No UTXOs available. Fund your wallet first." };
3195
3203
  }
3196
3204
  const { txHex, txId } = await buildOpReturnTx(wif, utxos, JSON.stringify(payload));
3197
- await broadcastTx(txHex);
3205
+ const writeReceipt = await broadcastTx(txHex);
3198
3206
  await saveConfig({
3199
3207
  ...config,
3200
3208
  style_txid: txId,
3201
3209
  style_name: styleName,
3202
3210
  style_id: styleId
3203
3211
  });
3212
+ const receipt = buildReceipt(writeReceipt, { txId, fee: null, txSize: txHex.length / 2 });
3213
+ appendReceipt(receipt, { trigger: "interactive", saveType: "style" });
3204
3214
  return {
3205
3215
  success: true,
3206
3216
  txId,
3207
3217
  styleId,
3208
3218
  styleName,
3209
3219
  rulesLength: rulesText.length,
3210
- message: `Style "${styleName}" saved to blockchain. txId: ${txId}`
3220
+ receipt,
3221
+ message: `Style "${styleName}" saved to blockchain.
3222
+
3223
+ ${formatSaveReceipt(receipt)}`
3211
3224
  };
3212
3225
  } catch (error) {
3213
3226
  return { success: false, error: `Failed to broadcast style: ${error.message}` };
@@ -5073,12 +5086,17 @@ async function updateVaultIndex() {
5073
5086
  const result = await broadcastTx(txHex);
5074
5087
  const indexTxId = result.txid || txId;
5075
5088
  await saveConfig({ ...config, vault_index_txid: indexTxId });
5089
+ const receipt = buildReceipt(result, { txId: indexTxId, fee: null, txSize: txHex.length / 2 });
5090
+ appendReceipt(receipt, { trigger: "interactive", saveType: "vault-index" });
5076
5091
  return {
5077
5092
  success: true,
5078
5093
  txId: indexTxId,
5079
5094
  files: files.length,
5080
5095
  projects: projects.length,
5081
- message: `Vault index updated: ${files.length} files, ${projects.length} projects. txId: ${indexTxId}`
5096
+ receipt,
5097
+ message: `Vault index updated: ${files.length} files, ${projects.length} projects.
5098
+
5099
+ ${formatSaveReceipt(receipt)}`
5082
5100
  };
5083
5101
  } catch (error) {
5084
5102
  return { success: false, error: `Failed to update vault index: ${error.message}` };
@@ -5523,6 +5541,13 @@ async function saveGoalsToChain() {
5523
5541
  content: [{ type: "text", text: `Failed to parse ${GOALS_PATH2}: ${err.message}` }]
5524
5542
  };
5525
5543
  }
5544
+ const contentHash = crypto.createHash("sha256").update(JSON.stringify(goalsData)).digest("hex");
5545
+ const config = await loadConfig();
5546
+ if (config.goals_snapshot_hash === contentHash) {
5547
+ return {
5548
+ content: [{ type: "text", text: `Goals unchanged since the last snapshot${config.goals_snapshot_txid ? ` (txid ${config.goals_snapshot_txid})` : ""} \u2014 skipped broadcast, no cost.` }]
5549
+ };
5550
+ }
5526
5551
  const wif = await getWif();
5527
5552
  if (!wif) {
5528
5553
  return {
@@ -5559,19 +5584,21 @@ async function saveGoalsToChain() {
5559
5584
  utxos,
5560
5585
  JSON.stringify(payload)
5561
5586
  );
5562
- await broadcastTx(txHex);
5587
+ const writeReceipt = await broadcastTx(txHex);
5588
+ const receipt = buildReceipt(writeReceipt, { txId, fee, txSize });
5589
+ appendReceipt(receipt, { trigger: "interactive", saveType: "goals" });
5590
+ await saveConfig({ ...config, goals_snapshot_hash: contentHash, goals_snapshot_txid: txId });
5563
5591
  return {
5564
5592
  content: [{
5565
5593
  type: "text",
5566
5594
  text: `\u2713 Goals snapshot broadcast.
5567
5595
 
5568
- txid: ${txId}
5569
5596
  address: ${address}
5570
5597
  goals: ${goals.length} active, ${completed.length} completed
5571
- fee: ${fee} sats (${txSize} bytes)
5572
5598
 
5573
- Web Goals tab should now reflect these on next refresh (chain scan).
5574
- https://whatsonchain.com/tx/${txId}`
5599
+ ${formatSaveReceipt(receipt)}
5600
+
5601
+ Web Goals tab should reflect these on next refresh (chain scan).`
5575
5602
  }]
5576
5603
  };
5577
5604
  }
@@ -6298,7 +6325,7 @@ Commands:
6298
6325
  }
6299
6326
  function printHelp() {
6300
6327
  console.log(`
6301
- Indelible MCP \u2014 Blockchain memory for Claude Code (v4.5.0)
6328
+ Indelible MCP \u2014 Blockchain memory for Claude Code (v4.5.1)
6302
6329
 
6303
6330
  Setup:
6304
6331
  indelible-mcp setup --wif=KEY --pin=PIN Import and encrypt your private key
@@ -6516,7 +6543,7 @@ function readStdin() {
6516
6543
  }
6517
6544
  var SERVER_INFO = {
6518
6545
  name: "indelible",
6519
- version: "4.5.0",
6546
+ version: "4.5.1",
6520
6547
  description: "Blockchain-backed memory and code storage for Claude Code"
6521
6548
  };
6522
6549
  var TOOLS = [