mrmainspring 0.2.6 → 0.2.8

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/dist/cli.js CHANGED
@@ -67,7 +67,8 @@ export async function runCliCommand(args) {
67
67
  return true;
68
68
  }
69
69
  if (command === "setup") {
70
- if (process.stdin.isTTY ?? process.stdout.isTTY) {
70
+ const forceInteractive = args.includes("--interactive") || args.includes("-i");
71
+ if (forceInteractive || (process.stdin.isTTY ?? process.stdout.isTTY)) {
71
72
  await runInteractiveSetup();
72
73
  }
73
74
  else {
@@ -117,20 +118,19 @@ export async function runCliCommand(args) {
117
118
  return true;
118
119
  }
119
120
  const CLOCK_ART = [
120
- "",
121
- " ╭────┴────╮ ",
122
- " ╭╯ 12 ╰╮ ",
123
- " 11 │ 1 │ ",
124
- " │ │ ",
125
- " 9 ─┤ ──◎ ├─ 3 ",
126
- " │ │ ",
127
- " │ 8 4 │ ",
128
- " ╰╮ 7 5 ╭╯ ",
129
- " ╰╮ 6 ╭╯ ",
130
- " ╰────────╯ ",
131
- " ",
132
- " Mr Mainspring ",
133
- " Memory · Anchor · Pay ",
121
+ " .-.-. ",
122
+ " (( (__I__) )) ",
123
+ " .'_....._'. ",
124
+ " / / .12 . \\ \\ ",
125
+ " | | ' | ' | | ",
126
+ " | | 9 / 3 | | ",
127
+ " \\ \\ '.6.' / / ",
128
+ " '.`-...-'.' ",
129
+ " /'-- --'\\ ",
130
+ " `\"\"\"\"\"\"\"\"\"` ",
131
+ " ",
132
+ " Mr Mainspring ",
133
+ " Memory · Anchor · Pay ",
134
134
  ].join("\n");
135
135
  async function runInteractiveSetup() {
136
136
  process.stdout.write(`\n${CLOCK_ART}\n\n`);
@@ -26,6 +26,11 @@ export function registerGrimoireTools(server, grimoireService) {
26
26
  }
27
27
  }, async (input) => {
28
28
  const secret = await grimoireService.putSecret(input);
29
+ server.sendLoggingMessage({
30
+ level: "info",
31
+ logger: "mainspring",
32
+ data: `Secret stored [${input.type}] ${input.name} (agent=${input.agent_id})`
33
+ }).catch(() => { });
29
34
  return jsonResult({
30
35
  status: "stored",
31
36
  secret
@@ -62,6 +67,11 @@ export function registerGrimoireTools(server, grimoireService) {
62
67
  }
63
68
  }, async (input) => {
64
69
  const policy = await grimoireService.setPolicy(input);
70
+ server.sendLoggingMessage({
71
+ level: "info",
72
+ logger: "mainspring",
73
+ data: `Policy set [${input.policy_id}] max=${input.max_amount_per_call} per call (agent=${input.agent_id})`
74
+ }).catch(() => { });
65
75
  return jsonResult({
66
76
  status: "stored",
67
77
  policy
@@ -18,6 +18,14 @@ export function registerMemoryTools(server, memoryService) {
18
18
  }
19
19
  }, async (input) => {
20
20
  const memory = await memoryService.write(input);
21
+ const anchorNote = memory.anchor_status === "anchored" && memory.casper_transaction_hash
22
+ ? ` · anchored tx=${memory.casper_transaction_hash.slice(0, 12)}…`
23
+ : memory.anchor_status === "pending" ? " · anchor pending" : "";
24
+ server.sendLoggingMessage({
25
+ level: "info",
26
+ logger: "mainspring",
27
+ data: `Memory saved [${input.type}] ${memory.memory_id}${anchorNote}`
28
+ }).catch(() => { });
21
29
  return jsonResult({
22
30
  memory_id: memory.memory_id,
23
31
  content_hash: memory.content_hash,
@@ -21,6 +21,14 @@ export function registerPaymentTools(server, paymentService) {
21
21
  }
22
22
  }, async (input) => {
23
23
  const result = await paymentService.fetch(input);
24
+ const status = result.status ?? "unknown";
25
+ const level = status === "settlement_unavailable" || status === "policy_blocked"
26
+ ? "warning" : "info";
27
+ server.sendLoggingMessage({
28
+ level,
29
+ logger: "mainspring",
30
+ data: `Payment [${status}] ${input.method} ${input.url} (policy=${input.policy_id})`
31
+ }).catch(() => { });
24
32
  return jsonResult(result);
25
33
  });
26
34
  server.registerTool("payment.receipt", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mrmainspring",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Mr Mainspring MCP backend with memory, Grimoire policies, audit, Casper anchoring, and x402 settlement boundaries.",
5
5
  "license": "MIT",
6
6
  "type": "module",