traderclaw-cli 1.0.79 → 1.0.81
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/bin/installer-step-engine.mjs +47 -10
- package/bin/openclaw-trader.mjs +5 -4
- package/package.json +2 -2
|
@@ -10,6 +10,9 @@ import { getLinuxGatewayPersistenceSnapshot } from "./gateway-persistence-linux.
|
|
|
10
10
|
const CONFIG_DIR = join(homedir(), ".openclaw");
|
|
11
11
|
const CONFIG_FILE = join(CONFIG_DIR, "openclaw.json");
|
|
12
12
|
|
|
13
|
+
/** Pinned openclaw platform version — bump deliberately after testing, never use "latest". */
|
|
14
|
+
export const OPENCLAW_VERSION = "2026.4.9";
|
|
15
|
+
|
|
13
16
|
/** Directory containing solana-traderclaw (openclaw.plugin.json) — works for plugin layout or traderclaw-cli + dependency. */
|
|
14
17
|
const PLUGIN_PACKAGE_ROOT = resolvePluginPackageRoot(import.meta.url);
|
|
15
18
|
|
|
@@ -357,7 +360,7 @@ function gatewayTimeoutRemediation() {
|
|
|
357
360
|
"- Check RAM: openclaw gateway requires >=512MB free (>=2GB total recommended)",
|
|
358
361
|
"- Check disk: df -h ~/.openclaw",
|
|
359
362
|
"- Try: openclaw config validate && openclaw gateway doctor || true",
|
|
360
|
-
|
|
363
|
+
`- If config schema error appears, run: npm install -g openclaw@${OPENCLAW_VERSION}`,
|
|
361
364
|
"Once the gateway shows 'running' in status, click Start Installation again.",
|
|
362
365
|
].join("\n");
|
|
363
366
|
}
|
|
@@ -380,7 +383,7 @@ function gatewayConfigValidationRemediation() {
|
|
|
380
383
|
"The first `openclaw config validate` in this installer runs before plugins install; validation must be re-run once plugin schemas are registered — that is why this can appear only at gateway.",
|
|
381
384
|
"On the VPS, try in order:",
|
|
382
385
|
"1) openclaw --version",
|
|
383
|
-
|
|
386
|
+
`2) npm install -g openclaw@${OPENCLAW_VERSION}`,
|
|
384
387
|
"3) openclaw config validate",
|
|
385
388
|
"4) openclaw plugins doctor",
|
|
386
389
|
"5) cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak.$(date +%s) || true",
|
|
@@ -400,6 +403,14 @@ function isOpenClawConfigSchemaFailure(text) {
|
|
|
400
403
|
function runCommandWithEvents(cmd, args = [], opts = {}) {
|
|
401
404
|
return new Promise((resolve, reject) => {
|
|
402
405
|
const { onEvent, ...spawnOpts } = opts;
|
|
406
|
+
const isNpm = /(?:^|[\\/])npm(?:\.cmd)?$/.test(cmd) || cmd === "npm";
|
|
407
|
+
if (isNpm && !spawnOpts.env?.NODE_OPTIONS?.includes("max-old-space-size")) {
|
|
408
|
+
spawnOpts.env = {
|
|
409
|
+
...process.env,
|
|
410
|
+
...spawnOpts.env,
|
|
411
|
+
NODE_OPTIONS: [spawnOpts.env?.NODE_OPTIONS || process.env.NODE_OPTIONS || "", "--max-old-space-size=512"].filter(Boolean).join(" "),
|
|
412
|
+
};
|
|
413
|
+
}
|
|
403
414
|
const child = spawn(cmd, args, {
|
|
404
415
|
stdio: "pipe",
|
|
405
416
|
shell: true,
|
|
@@ -427,14 +438,19 @@ function runCommandWithEvents(cmd, args = [], opts = {}) {
|
|
|
427
438
|
const urls = [...new Set([...extractUrls(stdout), ...extractUrls(stderr)])];
|
|
428
439
|
if (code === 0) resolve({ stdout, stderr, code, urls });
|
|
429
440
|
else {
|
|
441
|
+
const isOom = code === 137 || (stderr || stdout || "").includes("Killed");
|
|
430
442
|
const raw = (stderr || "").trim();
|
|
431
443
|
const tailLines = raw.split("\n").filter((l) => l.length > 0).slice(-40).join("\n");
|
|
432
444
|
const stderrPreview = tailLines.length > 8000 ? tailLines.slice(-8000) : tailLines;
|
|
433
|
-
const
|
|
445
|
+
const prefix = isOom
|
|
446
|
+
? `Out of memory (exit 137 / SIGKILL): the host killed '${cmd}' — try a machine with ≥1 GB free RAM, or reduce concurrency with npm_config_maxsockets=2`
|
|
447
|
+
: `command failed with exit code ${code}`;
|
|
448
|
+
const err = new Error(stderrPreview ? `${prefix}: ${stderrPreview}` : prefix);
|
|
434
449
|
err.code = code;
|
|
435
450
|
err.stdout = stdout;
|
|
436
451
|
err.stderr = stderr;
|
|
437
452
|
err.urls = urls;
|
|
453
|
+
err.oom = isOom;
|
|
438
454
|
reject(err);
|
|
439
455
|
}
|
|
440
456
|
});
|
|
@@ -454,6 +470,14 @@ function getGlobalOpenClawPackageDir() {
|
|
|
454
470
|
* incomplete `node_modules` after `npm install -g` (hoisting, optional deps, or interrupted
|
|
455
471
|
* installs). OpenClaw then fails at runtime with `Cannot find module 'grammy'` while loading
|
|
456
472
|
* config. Installing from the package directory restores declared dependencies.
|
|
473
|
+
*
|
|
474
|
+
* `--ignore-scripts` avoids OpenClaw's postinstall (and nested installs) failing on hosts without
|
|
475
|
+
* a C toolchain: e.g. `@discordjs/opus` has no prebuild for Node 22 and falls back to `node-gyp`
|
|
476
|
+
* (`make` not found). Skipping scripts still installs declared JS deps (e.g. `grammy`). Users who
|
|
477
|
+
* need native/voice features can install build-essential and re-run `npm install` without
|
|
478
|
+
* `--ignore-scripts` in the global openclaw directory.
|
|
479
|
+
*
|
|
480
|
+
* We still run `npm install grammy @buape/carbon --no-save` with `--ignore-scripts` as a safety net.
|
|
457
481
|
*/
|
|
458
482
|
/** Runs `npm install` in the global `openclaw` package directory (fixes missing `grammy` etc.). */
|
|
459
483
|
export async function ensureOpenClawGlobalPackageDependencies() {
|
|
@@ -461,10 +485,23 @@ export async function ensureOpenClawGlobalPackageDependencies() {
|
|
|
461
485
|
if (!dir) {
|
|
462
486
|
return { skipped: true, reason: "global_openclaw_dir_not_found" };
|
|
463
487
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
488
|
+
const registry = "https://registry.npmjs.org/";
|
|
489
|
+
const installFlags = ["install", "--omit=dev", "--ignore-scripts", "--registry", registry];
|
|
490
|
+
await runCommandWithEvents("npm", installFlags, { cwd: dir, shell: false });
|
|
491
|
+
await runCommandWithEvents(
|
|
492
|
+
"npm",
|
|
493
|
+
[
|
|
494
|
+
"install",
|
|
495
|
+
"--omit=dev",
|
|
496
|
+
"--no-save",
|
|
497
|
+
"--ignore-scripts",
|
|
498
|
+
"--registry",
|
|
499
|
+
registry,
|
|
500
|
+
"grammy",
|
|
501
|
+
"@buape/carbon",
|
|
502
|
+
],
|
|
503
|
+
{ cwd: dir, shell: false },
|
|
504
|
+
);
|
|
468
505
|
return { repaired: true, dir };
|
|
469
506
|
}
|
|
470
507
|
|
|
@@ -477,11 +514,11 @@ export async function ensureOpenClawGlobalPackageDependencies() {
|
|
|
477
514
|
async function installOpenClawPlatform() {
|
|
478
515
|
const hadOpenclaw = commandExists("openclaw");
|
|
479
516
|
const previousVersion = hadOpenclaw ? getCommandOutput("openclaw --version") : null;
|
|
480
|
-
await runCommandWithEvents("npm", ["install", "-g", "--registry", "https://registry.npmjs.org/",
|
|
517
|
+
await runCommandWithEvents("npm", ["install", "-g", "--ignore-scripts", "--registry", "https://registry.npmjs.org/", `openclaw@${OPENCLAW_VERSION}`]);
|
|
481
518
|
const available = commandExists("openclaw");
|
|
482
519
|
const version = available ? getCommandOutput("openclaw --version") : null;
|
|
483
520
|
if (!available) {
|
|
484
|
-
throw new Error(
|
|
521
|
+
throw new Error(`npm install -g openclaw@${OPENCLAW_VERSION} finished but \`openclaw\` is not available on PATH`);
|
|
485
522
|
}
|
|
486
523
|
return {
|
|
487
524
|
alreadyInstalled: hadOpenclaw,
|
|
@@ -514,7 +551,7 @@ function isNpmFilesystemPackageSpec(spec) {
|
|
|
514
551
|
* IMPORTANT: run with `{ shell: false }` — `spawn(..., { shell: true })` can drop argv on Unix and npm then mis-resolves the package name.
|
|
515
552
|
*/
|
|
516
553
|
function npmGlobalInstallArgs(spec, { force = false } = {}) {
|
|
517
|
-
const args = ["install", "-g"];
|
|
554
|
+
const args = ["install", "-g", "--ignore-scripts"];
|
|
518
555
|
if (force) args.push("--force");
|
|
519
556
|
if (!isNpmFilesystemPackageSpec(spec)) {
|
|
520
557
|
args.push("--registry", "https://registry.npmjs.org/");
|
package/bin/openclaw-trader.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { execFile, execSync } from "child_process";
|
|
|
10
10
|
import { promisify } from "util";
|
|
11
11
|
import { createServer } from "http";
|
|
12
12
|
import { resolvePluginPackageRoot } from "./resolve-plugin-root.mjs";
|
|
13
|
+
import { OPENCLAW_VERSION } from "./installer-step-engine.mjs";
|
|
13
14
|
|
|
14
15
|
const execFileAsync = promisify(execFile);
|
|
15
16
|
|
|
@@ -1816,7 +1817,7 @@ async function cmdPrecheck(args) {
|
|
|
1816
1817
|
} else if (opts.mode === "allow-install") {
|
|
1817
1818
|
log.info("Installing openclaw (allow-install mode)");
|
|
1818
1819
|
try {
|
|
1819
|
-
execSync(
|
|
1820
|
+
execSync(`npm install -g --ignore-scripts --registry https://registry.npmjs.org/ openclaw@${OPENCLAW_VERSION}`, { stdio: "ignore" });
|
|
1820
1821
|
if (commandExists("openclaw")) log.pass("openclaw installed successfully");
|
|
1821
1822
|
else log.fail("openclaw install completed but command is still missing");
|
|
1822
1823
|
} catch {
|
|
@@ -4078,7 +4079,7 @@ Commands:
|
|
|
4078
4079
|
signup Create a new account (alias for: setup --signup; run locally, not via the agent)
|
|
4079
4080
|
precheck Run environment checks (dry-run or allow-install)
|
|
4080
4081
|
install Launch installer flows (--wizard for localhost GUI)
|
|
4081
|
-
repair-openclaw Re-run npm install in the global openclaw package (fixes missing grammy
|
|
4082
|
+
repair-openclaw Re-run npm install in the global openclaw package (fixes missing grammy / @buape/carbon; uses --ignore-scripts so @discordjs/opus does not require build tools)
|
|
4082
4083
|
gateway Gateway helpers (see subcommands below)
|
|
4083
4084
|
login Re-authenticate (uses refresh token when valid; full challenge only if needed)
|
|
4084
4085
|
logout Revoke current session and clear tokens
|
|
@@ -4152,10 +4153,10 @@ Examples:
|
|
|
4152
4153
|
|
|
4153
4154
|
async function cmdRepairOpenclaw() {
|
|
4154
4155
|
const { ensureOpenClawGlobalPackageDependencies } = await import("./installer-step-engine.mjs");
|
|
4155
|
-
printInfo("Repairing global OpenClaw npm dependencies (fixes missing grammy /
|
|
4156
|
+
printInfo("Repairing global OpenClaw npm dependencies (fixes missing grammy, @buape/carbon, etc.)...");
|
|
4156
4157
|
const r = await ensureOpenClawGlobalPackageDependencies();
|
|
4157
4158
|
if (r.skipped) {
|
|
4158
|
-
printError(`Could not find global OpenClaw package (${r.reason}). Install or upgrade: npm install -g openclaw
|
|
4159
|
+
printError(`Could not find global OpenClaw package (${r.reason}). Install or upgrade: npm install -g openclaw@${OPENCLAW_VERSION}`);
|
|
4159
4160
|
process.exit(1);
|
|
4160
4161
|
}
|
|
4161
4162
|
printSuccess(`Dependencies refreshed under ${r.dir}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "traderclaw-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
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.
|
|
20
|
+
"solana-traderclaw": "^1.0.81"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"traderclaw",
|