@goplausible/openclaw-algorand-plugin 1.8.1 → 1.8.3

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/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
  openclaw plugins install @goplausible/openclaw-algorand-plugin
27
27
  ```
28
28
 
29
- Or install from local path:
29
+ Or install from local path if you are running from source code:
30
30
 
31
31
  ```bash
32
32
  openclaw plugins install ./path/to/openclaw-algorand-plugin
@@ -37,21 +37,17 @@ openclaw plugins install ./path/to/openclaw-algorand-plugin
37
37
  After installing, run these commands:
38
38
 
39
39
  ```bash
40
- # 1. Initialize plugin (write memory file + configure mcporter)
41
- openclaw algorand-plugin init
42
-
43
- # 2. Run interactive setup (keyring persistence + x402 toggle)
40
+ # 1. Setup plugin (memory file + mcporter + interactive config)
44
41
  openclaw algorand-plugin setup
45
42
 
46
- # 3. Restart the gateway
43
+ # 2. Restart the gateway
47
44
  openclaw gateway restart
48
45
  ```
49
46
 
50
47
  ## Commands
51
48
 
52
49
  ```bash
53
- openclaw algorand-plugin init # Write plugin memory + configure mcporter
54
- openclaw algorand-plugin setup # Run interactive setup wizard
50
+ openclaw algorand-plugin setup # Initialize + configure plugin (memory, mcporter, options)
55
51
  openclaw algorand-plugin status # Show plugin status (binary, mcporter, config)
56
52
  openclaw algorand-plugin mcp-config # Show MCP config snippet for external coding agents
57
53
  ```
package/index.ts CHANGED
@@ -60,12 +60,19 @@ function getMcpBinaryPath(): string {
60
60
  function updatePluginConfig(newConfig: AlgorandPluginConfig): { success: boolean; error?: string } {
61
61
  try {
62
62
  const configPath = getConfigPath();
63
- if (!existsSync(configPath)) {
64
- return { success: false, error: `Config file not found: ${configPath}` };
63
+ const configDir = dirname(configPath);
64
+
65
+ // Create ~/.openclaw directory if it doesn't exist
66
+ if (!existsSync(configDir)) {
67
+ mkdirSync(configDir, { recursive: true });
65
68
  }
66
69
 
67
- const rawConfig = readFileSync(configPath, "utf-8");
68
- const config = JSON.parse(rawConfig);
70
+ // Create config file with empty object if it doesn't exist
71
+ let config: Record<string, any> = {};
72
+ if (existsSync(configPath)) {
73
+ const rawConfig = readFileSync(configPath, "utf-8");
74
+ config = JSON.parse(rawConfig);
75
+ }
69
76
 
70
77
  // Ensure plugins structure exists
71
78
  if (!config.plugins) config.plugins = {};
@@ -92,6 +99,42 @@ function updatePluginConfig(newConfig: AlgorandPluginConfig): { success: boolean
92
99
  }
93
100
  }
94
101
 
102
+ function stopExistingMcpProcesses(): { stopped: number; message: string } {
103
+ try {
104
+ // Find all running algorand-mcp processes
105
+ const psOutput = execSync("ps aux 2>/dev/null || tasklist 2>/dev/null || echo ''", { encoding: "utf-8" });
106
+ const lines = psOutput.split("\n").filter((line: string) => line.includes("algorand-mcp") && !line.includes("grep"));
107
+
108
+ if (lines.length === 0) {
109
+ return { stopped: 0, message: "No existing algorand-mcp processes found" };
110
+ }
111
+
112
+ // Extract PIDs and kill them
113
+ let stopped = 0;
114
+ for (const line of lines) {
115
+ const parts = line.trim().split(/\s+/);
116
+ const pid = parts[1]; // PID is second column in ps aux
117
+ if (pid && /^\d+$/.test(pid)) {
118
+ try {
119
+ execSync(`kill ${pid} 2>/dev/null`, { encoding: "utf-8" });
120
+ stopped++;
121
+ } catch {
122
+ // Process may have already exited
123
+ }
124
+ }
125
+ }
126
+
127
+ // Brief wait for processes to terminate
128
+ if (stopped > 0) {
129
+ execSync("sleep 1");
130
+ }
131
+
132
+ return { stopped, message: `Stopped ${stopped} existing algorand-mcp process${stopped !== 1 ? "es" : ""}` };
133
+ } catch {
134
+ return { stopped: 0, message: "Could not check for existing processes" };
135
+ }
136
+ }
137
+
95
138
  function configureMcporter(): { success: boolean; message: string } {
96
139
  const mcpCommand = getMcpBinaryPath();
97
140
 
@@ -221,12 +264,12 @@ export default function register(api: PluginApi) {
221
264
  .command("algorand-plugin")
222
265
  .description("Algorand blockchain integration (GoPlausible)");
223
266
 
224
- // Init command - writes plugin memory file AND configures mcporter
267
+ // Setup command - initializes (memory + mcporter) then runs interactive config
225
268
  algorand
226
- .command("init")
227
- .description("Initialize Algorand plugin (memory file + mcporter config)")
269
+ .command("setup")
270
+ .description("Initialize and configure Algorand plugin")
228
271
  .action(async () => {
229
- console.log("\nšŸ”· Initializing Algorand plugin...\n");
272
+ console.log("\nšŸ”· Setting up Algorand plugin...\n");
230
273
 
231
274
  const workspacePath = getWorkspacePath(api);
232
275
 
@@ -238,7 +281,15 @@ export default function register(api: PluginApi) {
238
281
  console.error(` āŒ ${memResult.message}`);
239
282
  }
240
283
 
241
- // Step 2: Configure mcporter
284
+ // Step 2: Stop any existing algorand-mcp processes
285
+ const stopResult = stopExistingMcpProcesses();
286
+ if (stopResult.stopped > 0) {
287
+ console.log(` āœ… ${stopResult.message}`);
288
+ } else {
289
+ console.log(` ā„¹ļø ${stopResult.message}`);
290
+ }
291
+
292
+ // Step 3: Configure mcporter
242
293
  console.log("");
243
294
  const mcpResult = configureMcporter();
244
295
  if (mcpResult.success) {
@@ -247,15 +298,8 @@ export default function register(api: PluginApi) {
247
298
  console.log(` āš ļø ${mcpResult.message}`);
248
299
  }
249
300
 
250
- console.log("\n Run `openclaw algorand-plugin setup` to configure options.");
251
- console.log(" Run `mcporter list algorand-mcp --schema` to verify MCP tools.\n");
252
- });
253
-
254
- // Setup wizard
255
- algorand
256
- .command("setup")
257
- .description("Run interactive Algorand plugin setup")
258
- .action(async () => {
301
+ // Step 4: Interactive config
302
+ console.log("");
259
303
  const newConfig = await runSetup(pluginConfig);
260
304
  if (newConfig) {
261
305
  const result = updatePluginConfig(newConfig);
@@ -269,6 +313,8 @@ export default function register(api: PluginApi) {
269
313
  console.log(` "plugins": { "allow": ["${PLUGIN_ID}"], "entries": { "${PLUGIN_ID}": { "config": ${JSON.stringify(newConfig)} } } }\n`);
270
314
  }
271
315
  }
316
+
317
+ console.log(" Run `mcporter list algorand-mcp --schema` to verify MCP tools.\n");
272
318
  });
273
319
 
274
320
  // Status command
@@ -296,7 +342,7 @@ export default function register(api: PluginApi) {
296
342
  console.log("");
297
343
  console.log(" MCP Server:");
298
344
  console.log(` Binary: ${mcp.available ? `āœ… ${mcp.path}` : "āš ļø Not found"}`);
299
- console.log(` mcporter: ${mcporterConfigured ? "āœ… Configured" : "āš ļø Not configured (run init)"}`);
345
+ console.log(` mcporter: ${mcporterConfigured ? "āœ… Configured" : "āš ļø Not configured (run setup)"}`);
300
346
  console.log("");
301
347
  console.log(" Config:");
302
348
  console.log(` x402: ${pluginConfig.enableX402 !== false ? "Enabled" : "Disabled"}`);
@@ -353,7 +399,7 @@ export default function register(api: PluginApi) {
353
399
  console.log(` }`);
354
400
  console.log(` }\n`);
355
401
  console.log(" Cursor (.cursor/mcp.json) — same format\n");
356
- console.log(" Note: OpenClaw uses mcporter. Run `openclaw algorand-plugin init` to configure.\n");
402
+ console.log(" Note: OpenClaw uses mcporter. Run `openclaw algorand-plugin setup` to configure.\n");
357
403
  });
358
404
  },
359
405
  { commands: ["algorand-plugin"] }
@@ -380,9 +426,8 @@ export default function register(api: PluginApi) {
380
426
  } catch { /* ignore on install */ }
381
427
 
382
428
  console.log(" Next steps:");
383
- console.log(" 1. Run `openclaw algorand-plugin init` — configure mcporter + add plugin memory");
384
- console.log(" 2. Run `openclaw algorand-plugin setup` — configure options & add to allow list");
385
- console.log(" 3. Restart OpenClaw gateway\n");
429
+ console.log(" 1. Run `openclaw algorand-plugin setup` — initialize + configure plugin");
430
+ console.log(" 2. Restart OpenClaw gateway\n");
386
431
  console.log(` Docs: ${GOPLAUSIBLE_SERVICES.website}\n`);
387
432
  },
388
433
  { name: "algorand.post-install", description: "Show setup instructions on install" }
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-algorand-plugin",
3
3
  "name": "Algorand Integration",
4
4
  "description": "Algorand blockchain integration with MCP and skills — by GoPlausible",
5
- "version": "1.8.1",
5
+ "version": "1.8.3",
6
6
  "skills": [
7
7
  "skills/algorand-development",
8
8
  "skills/algorand-typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplausible/openclaw-algorand-plugin",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },