traderclaw-cli 1.0.54 → 1.0.57

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.
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { createInterface } from "readline";
4
4
  import { readFileSync, writeFileSync, mkdirSync, appendFileSync, existsSync } from "fs";
5
- import { join } from "path";
5
+ import { dirname, join } from "path";
6
+ import { fileURLToPath } from "url";
6
7
  import { homedir } from "os";
7
8
  import { randomUUID, createPrivateKey, sign as cryptoSign } from "crypto";
8
9
  import { execFile, execSync } from "child_process";
@@ -17,9 +18,27 @@ const execFileAsync = promisify(execFile);
17
18
  const OPENCLAW_MODELS_PER_PROVIDER_TIMEOUT_MS = 16_000;
18
19
 
19
20
  const PLUGIN_ROOT = resolvePluginPackageRoot(import.meta.url);
20
- const PACKAGE_JSON = JSON.parse(readFileSync(join(PLUGIN_ROOT, "package.json"), "utf-8"));
21
- const VERSION = PACKAGE_JSON.version;
22
- const NPM_PACKAGE_NAME = typeof PACKAGE_JSON.name === "string" ? PACKAGE_JSON.name : "solana-traderclaw";
21
+ const PLUGIN_PACKAGE_JSON = JSON.parse(readFileSync(join(PLUGIN_ROOT, "package.json"), "utf-8"));
22
+ const PLUGIN_VERSION =
23
+ typeof PLUGIN_PACKAGE_JSON.version === "string" ? PLUGIN_PACKAGE_JSON.version.trim() : "0.0.0";
24
+ /** npm folder name for skills path (always the plugin package). */
25
+ const NPM_PACKAGE_NAME =
26
+ typeof PLUGIN_PACKAGE_JSON.name === "string" ? PLUGIN_PACKAGE_JSON.name : "solana-traderclaw";
27
+
28
+ /** When installed via `npm i -g traderclaw-cli`, bin/ lives under traderclaw-cli — show that version for --version. */
29
+ let CLI_VERSION = null;
30
+ try {
31
+ const cliPkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
32
+ const cliPkg = JSON.parse(readFileSync(cliPkgPath, "utf-8"));
33
+ if (cliPkg.name === "traderclaw-cli" && typeof cliPkg.version === "string") {
34
+ CLI_VERSION = cliPkg.version.trim();
35
+ }
36
+ } catch {
37
+ /* git checkout: only plugin package.json next to bin */
38
+ }
39
+
40
+ /** User-facing CLI version (wrapper package when present, else plugin). */
41
+ const VERSION = CLI_VERSION || PLUGIN_VERSION;
23
42
  const PLUGIN_ID = "solana-trader";
24
43
  const LEGACY_PLUGIN_IDS = ["traderclaw-v1", "solana-traderclaw-v1", "solana-traderclaw"];
25
44
  const CONFIG_DIR = join(homedir(), ".openclaw");
@@ -3188,7 +3207,11 @@ async function main() {
3188
3207
  }
3189
3208
 
3190
3209
  if (command === "--version" || command === "-v") {
3191
- print(`traderclaw v${VERSION}`);
3210
+ if (CLI_VERSION && PLUGIN_VERSION && CLI_VERSION !== PLUGIN_VERSION) {
3211
+ print(`traderclaw v${CLI_VERSION} (plugin solana-traderclaw v${PLUGIN_VERSION})`);
3212
+ } else {
3213
+ print(`traderclaw v${VERSION}`);
3214
+ }
3192
3215
  process.exit(0);
3193
3216
  }
3194
3217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traderclaw-cli",
3
- "version": "1.0.54",
3
+ "version": "1.0.57",
4
4
  "description": "Global TraderClaw CLI (install --wizard, setup, precheck). Installs solana-traderclaw as a dependency for OpenClaw plugin files.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  "node": ">=22"
18
18
  },
19
19
  "dependencies": {
20
- "solana-traderclaw": "^1.0.51"
20
+ "solana-traderclaw": "^1.0.57"
21
21
  },
22
22
  "keywords": [
23
23
  "traderclaw",