solana-traderclaw 1.0.23 → 1.0.25

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
@@ -554,8 +554,8 @@ I'll monitor this position and review after exit.
554
554
  - Run `traderclaw setup` to create or select a wallet
555
555
  - Verify the wallet ID: `traderclaw config show`
556
556
 
557
- **Wizard (`traderclaw install --wizard`) fails on `install_plugin_package` with `ENOENT` / `/root/solana-traderclaw/package.json` / `file:solana-traderclaw`:**
558
- - npm is picking up a **local folder** named `solana-traderclaw` in your shell cwd (often `/root`) instead of the registry. Remove or rename an empty/broken `~/solana-traderclaw` directory, then run `npm install -g solana-traderclaw@latest` and start the wizard again. Current installers use `solana-traderclaw@latest` for the registry fallback to avoid this ambiguity.
557
+ **Wizard (`traderclaw install --wizard`) fails on `install_plugin_package` with `ENOENT` / `…/solana-traderclaw/package.json` / `file:solana-traderclaw`:**
558
+ - Older installers used `spawn` with `shell: true`, which on Linux could drop npm’s argv so npm treated the package as a **local folder** under cwd (`/root` or `/tmp`). Current installers use **`shell: false`**, explicit **`--registry https://registry.npmjs.org/`** for registry installs, **`solana-traderclaw@latest`**, and a temp **`cwd`**. Upgrade `solana-traderclaw` and retry. If a stray directory `./solana-traderclaw` exists under that cwd, remove it: `rm -rf /tmp/solana-traderclaw` (and under `/root` if present).
559
559
 
560
560
  **Heartbeat not sending messages to Telegram:**
561
561
  - **Fresh `traderclaw setup`:** the installer runs `configureGatewayScheduling`, which sets a custom `heartbeat.prompt` on the `main` agent (no `HEARTBEAT_OK` escape). You only need the manual `openclaw config set` command below if you are on an older install or overwrote `agents.list`.
@@ -231,6 +231,27 @@ function isNpmGlobalBinConflict(err, cliName) {
231
231
  );
232
232
  }
233
233
 
234
+ /** True when spec is an on-disk package directory (global npm path or git checkout), not a registry name. */
235
+ function isNpmFilesystemPackageSpec(spec) {
236
+ if (typeof spec !== "string" || !spec.length) return false;
237
+ if (spec.startsWith("/")) return true;
238
+ return process.platform === "win32" && /^[A-Za-z]:[\\/]/.test(spec);
239
+ }
240
+
241
+ /**
242
+ * Args for `npm install -g …`. Use explicit registry for registry specs so npm never treats cwd/temp as `file:solana-traderclaw`.
243
+ * IMPORTANT: run with `{ shell: false }` — `spawn(..., { shell: true })` can drop argv on Unix and npm then mis-resolves the package name.
244
+ */
245
+ function npmGlobalInstallArgs(spec, { force = false } = {}) {
246
+ const args = ["install", "-g"];
247
+ if (force) args.push("--force");
248
+ if (!isNpmFilesystemPackageSpec(spec)) {
249
+ args.push("--registry", "https://registry.npmjs.org/");
250
+ }
251
+ args.push(spec);
252
+ return args;
253
+ }
254
+
234
255
  async function installPlugin(modeConfig, onEvent) {
235
256
  const spec = resolvePluginInstallSpec(modeConfig);
236
257
  const isLocalPluginRoot =
@@ -244,17 +265,17 @@ async function installPlugin(modeConfig, onEvent) {
244
265
  urls: [],
245
266
  });
246
267
  }
247
- // npm resolves bare package names against process cwd; a folder named solana-traderclaw under /root becomes file:solana-traderclaw and breaks global install.
248
268
  const npmCwd = tmpdir();
249
269
  if (typeof onEvent === "function") {
250
270
  onEvent({
251
271
  type: "stdout",
252
- text: `Running npm global install with cwd=${npmCwd} (avoids shadowing by ./solana-traderclaw in the wizard shell).\n`,
272
+ text: `Running npm global install with cwd=${npmCwd}, shell=false, args=${JSON.stringify(npmGlobalInstallArgs(spec))}\n`,
253
273
  urls: [],
254
274
  });
255
275
  }
276
+ const npmOpts = { onEvent, cwd: npmCwd, shell: false };
256
277
  try {
257
- await runCommandWithEvents("npm", ["install", "-g", spec], { onEvent, cwd: npmCwd });
278
+ await runCommandWithEvents("npm", npmGlobalInstallArgs(spec), npmOpts);
258
279
  return { installed: true, available: commandExists(modeConfig.cliName), forced: false };
259
280
  } catch (err) {
260
281
  if (!isNpmGlobalBinConflict(err, modeConfig.cliName)) throw err;
@@ -265,7 +286,7 @@ async function installPlugin(modeConfig, onEvent) {
265
286
  urls: [],
266
287
  });
267
288
  }
268
- await runCommandWithEvents("npm", ["install", "-g", "--force", spec], { onEvent, cwd: npmCwd });
289
+ await runCommandWithEvents("npm", npmGlobalInstallArgs(spec, { force: true }), npmOpts);
269
290
  return { installed: true, available: commandExists(modeConfig.cliName), forced: true };
270
291
  }
271
292
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-traderclaw",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "TraderClaw V1 — autonomous Solana memecoin trading for OpenClaw (team edition: X/Twitter journal and engagement tools)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",