mnemospark 0.1.5 → 0.1.7

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
@@ -1,7 +1,5 @@
1
1
  # mnemospark
2
2
 
3
- ### 🚀 Stay tuned mnemospark will be released soon!
4
-
5
3
  mnemospark is an OpenClaw plugin that provides access to hyper-scaler cloud operations and proprietary data sets. Payments via x402 USDC on Base.
6
4
 
7
- Wallet & go 💙 *No forms. No email registration. Just Base.*
5
+ Stay tuned for a working release...
package/README.md.bak CHANGED
@@ -1,84 +1,22 @@
1
1
  # mnemospark
2
2
 
3
- mnemospark is an OpenClaw plugin for storage workflow operations with wallet-based x402 USDC payments.
4
-
5
- It focuses on:
6
-
7
- - `/mnemospark wallet` for wallet status and export
8
- - `/mnemospark cloud` for storage workflow commands (backup, price-storage, upload, ls, download, delete)
9
- - A local proxy that forwards `/mnemospark/*` storage endpoints to the mnemospark backend with wallet-proof signing
10
-
11
- ---
3
+ mnemospark is an OpenClaw plugin that provides access to hyper-scaler cloud operations and proprietary data sets. Payments via x402 USDC on Base.
12
4
 
13
5
  ## Quick start
14
6
 
15
- ```bash
16
- # Install plugin (from OpenClaw)
17
- openclaw plugins install mnemospark
18
-
19
- # (Optional) run standalone install to create or reuse a wallet
20
- npx mnemospark install --standard
21
-
22
- # (Optional) set wallet key explicitly; if omitted, mnemospark auto-generates one
23
- export MNEMOSPARK_WALLET_KEY=0x...
24
-
25
- # (Optional) point to a custom mnemospark backend API base URL
26
- export MNEMOSPARK_BACKEND_API_BASE_URL=https://your-backend.example.com
27
-
28
- # Start OpenClaw gateway (starts mnemospark proxy in gateway mode)
29
- openclaw gateway start
30
- ```
31
-
32
- In OpenClaw:
33
-
34
- - `/mnemospark wallet` to view wallet address and balance
35
- - `/mnemospark wallet export` to back up your private key
36
- - `/mnemospark cloud help` to view storage workflow commands
37
-
38
- ---
39
-
40
- ## Configuration
41
-
42
- - **Directory layout:**
43
- - Base directory: `~/.openclaw/mnemospark`
44
- - Logs and object log: `~/.openclaw/mnemospark/object.log`
45
- - Wallet directory: `~/.openclaw/mnemospark/wallet`
46
- - Wallet key: `~/.openclaw/mnemospark/wallet/wallet.key` (or `~/.openclaw/blockrun/wallet.key` when reusing a legacy Blockrun wallet)
47
- - Backup archives: `~/.openclaw/mnemospark/backup`
48
- - **Wallet key:** `MNEMOSPARK_WALLET_KEY` (optional). If not provided, mnemospark auto-generates a wallet and stores it under `~/.openclaw/mnemospark/wallet/wallet.key`.
49
- - **Backend base URL:** `MNEMOSPARK_BACKEND_API_BASE_URL` (optional if default is acceptable).
50
- - **No backend API key:** do not set `MNEMOSPARK_BACKEND_API_KEY` or `x-api-key`. Backend authentication uses wallet-proof signatures generated by the proxy.
51
-
52
- Install flows:
53
-
54
- - **Default install:** `npx mnemospark install --default` creates a new Base wallet for mnemospark under `~/.openclaw/mnemospark/wallet/wallet.key` (chmod 600).
55
- - **Standard install:** `npx mnemospark install --standard` checks for an existing `~/.openclaw/blockrun/wallet.key` and, if present, offers to reuse it for mnemospark; otherwise it behaves like the default install.
56
-
57
- ---
58
-
59
- ## Workflow and product references
60
-
61
- - [mnemospark full workflow](./.company/mnemospark_full_workflow.md)
62
- - [mnemospark PRD](./.company/mnemospark_PRD.md)
63
- - [mnemospark backend API spec](./.company/mnemospark_backend_api_spec.md)
64
-
65
- ---
66
-
67
- ## Python examples (uv)
7
+ 1. **Install the plugin in OpenClaw** (required):
68
8
 
69
- Python tooling and examples use [uv](https://docs.astral.sh/uv/) for dependency management. From the repo root:
9
+ ```bash
10
+ openclaw plugins install mnemospark
11
+ openclaw gateway start
12
+ ```
70
13
 
71
- ```bash
72
- # Install uv (macOS/Linux): curl -LsSf https://astral.sh/uv/install.sh | sh
73
- uv sync --extra bcm-pricing
74
- source .venv/bin/activate # or on Windows: .venv\Scripts\activate
75
- python examples/s3_storage_cost_estimate.py --gb 100
76
- python examples/data_transfer_cost_estimate.py --direction in --gb 100
77
- python examples/data_transfer_cost_estimate.py --direction out --gb 500
78
- ```
14
+ 2. **Optional — wallet setup** (creates or reuses a Base wallet; does not register the plugin):
79
15
 
80
- ---
16
+ ```bash
17
+ npx mnemospark install --standard
18
+ ```
81
19
 
82
- ## License
20
+ Plugin registration is handled only by `openclaw plugins install mnemospark`. The `npx mnemospark install` command sets up your wallet and helper scripts under `~/.openclaw/mnemospark/`; it does not write to `~/.openclaw/extensions/`.
83
21
 
84
- MIT
22
+ In OpenClaw: `/mnemospark wallet`, `/mnemospark cloud help`. See the [installation guide](https://github.com/pawlsclick/mnemospark#readme) and [OpenClaw plugins docs](https://docs.openclaw.ai/tools/plugin) if the plugin is not found.
package/dist/cli.js CHANGED
@@ -2912,9 +2912,10 @@ function createCloudCommand(options = {}) {
2912
2912
  }
2913
2913
 
2914
2914
  // src/cli.ts
2915
+ import { spawn as spawn2 } from "child_process";
2915
2916
  import { dirname as dirname4, join as join5 } from "path";
2916
2917
  import { fileURLToPath as fileURLToPath2 } from "url";
2917
- import { mkdir as mkdir4, readFile as readFile3, writeFile as writeFile4, cp } from "fs/promises";
2918
+ import { mkdir as mkdir4, readFile as readFile3, writeFile as writeFile4 } from "fs/promises";
2918
2919
  import { existsSync } from "fs";
2919
2920
  import { homedir as homedir3 } from "os";
2920
2921
  function isHexPrivateKey(value) {
@@ -3023,27 +3024,50 @@ function parseArgs(args) {
3023
3024
  var __filename2 = fileURLToPath2(import.meta.url);
3024
3025
  var __dirname2 = dirname4(__filename2);
3025
3026
  var PACKAGE_ROOT = dirname4(__dirname2);
3026
- var EXTENSIONS_DIR = join5(homedir3(), ".openclaw", "extensions", "mnemospark");
3027
3027
  async function ensureDir(path) {
3028
3028
  await mkdir4(path, { recursive: true });
3029
3029
  }
3030
3030
  async function deployExtensionFiles() {
3031
- await ensureDir(EXTENSIONS_DIR);
3032
3031
  const scriptsSource = join5(PACKAGE_ROOT, "scripts");
3033
- if (existsSync(scriptsSource)) {
3034
- await cp(scriptsSource, join5(EXTENSIONS_DIR, "scripts"), { recursive: true });
3035
- const mnemoScriptsDir = join5(homedir3(), ".openclaw", "mnemospark", "scripts");
3036
- await ensureDir(mnemoScriptsDir);
3037
- const uninstallSrc = join5(scriptsSource, "uninstall.sh");
3038
- if (existsSync(uninstallSrc)) {
3039
- const content = await readFile3(uninstallSrc);
3040
- await writeFile4(join5(mnemoScriptsDir, "uninstall.sh"), content, { mode: 493 });
3041
- }
3032
+ if (!existsSync(scriptsSource)) return;
3033
+ const mnemoScriptsDir = join5(homedir3(), ".openclaw", "mnemospark", "scripts");
3034
+ await ensureDir(mnemoScriptsDir);
3035
+ const uninstallSrc = join5(scriptsSource, "uninstall.sh");
3036
+ if (existsSync(uninstallSrc)) {
3037
+ const content = await readFile3(uninstallSrc);
3038
+ await writeFile4(join5(mnemoScriptsDir, "uninstall.sh"), content, { mode: 493 });
3042
3039
  }
3043
- const pluginJson = join5(PACKAGE_ROOT, "openclaw.plugin.json");
3044
- if (existsSync(pluginJson)) {
3045
- const content = await readFile3(pluginJson);
3046
- await writeFile4(join5(EXTENSIONS_DIR, "openclaw.plugin.json"), content);
3040
+ }
3041
+ function isOpenClawAvailable() {
3042
+ return new Promise((resolve3) => {
3043
+ const child = spawn2("openclaw", ["--version"], {
3044
+ stdio: "ignore",
3045
+ shell: true
3046
+ });
3047
+ child.on("error", () => resolve3(false));
3048
+ child.on("close", (code) => resolve3(code === 0));
3049
+ });
3050
+ }
3051
+ async function promptOrRunOpenClawPluginInstall() {
3052
+ const available = await isOpenClawAvailable();
3053
+ if (available) {
3054
+ console.log("\n[mnemospark] Registering plugin with OpenClaw...");
3055
+ const child = spawn2("openclaw", ["plugins", "install", "mnemospark"], {
3056
+ stdio: "inherit",
3057
+ shell: true
3058
+ });
3059
+ const exitCode = await new Promise((resolve3) => {
3060
+ child.on("close", resolve3);
3061
+ });
3062
+ if (exitCode !== 0) {
3063
+ console.log(
3064
+ "\n[mnemospark] OpenClaw plugin install did not succeed. Run manually: openclaw plugins install mnemospark"
3065
+ );
3066
+ }
3067
+ } else {
3068
+ console.log(
3069
+ "\n[mnemospark] To use mnemospark inside OpenClaw, install the plugin: openclaw plugins install mnemospark"
3070
+ );
3047
3071
  }
3048
3072
  }
3049
3073
  async function readLegacyWalletIfPresent() {
@@ -3159,6 +3183,7 @@ async function runInstall(mode) {
3159
3183
  console.log(
3160
3184
  "[mnemospark] Your wallet will be used for mnemospark storage payments on Base."
3161
3185
  );
3186
+ await promptOrRunOpenClawPluginInstall();
3162
3187
  return;
3163
3188
  }
3164
3189
  }
@@ -3180,6 +3205,7 @@ async function runInstall(mode) {
3180
3205
  console.log(
3181
3206
  "You can acquire USDC on Base from providers like Coinbase and Moonpay. Fund the wallet before running mnemospark."
3182
3207
  );
3208
+ await promptOrRunOpenClawPluginInstall();
3183
3209
  }
3184
3210
  async function runWallet() {
3185
3211
  const { address, source } = await resolveOrGenerateWalletKey();