traderclaw-cli 1.0.111 → 1.0.113

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.
@@ -67,6 +67,7 @@ const VERSION = CLI_VERSION || PLUGIN_VERSION;
67
67
  const PLUGIN_ID = "solana-trader";
68
68
  const LEGACY_PLUGIN_IDS = ["traderclaw-v1", "solana-traderclaw-v1", "solana-traderclaw"];
69
69
  const KAYBA_TRACING_PLUGIN_ID = "kayba-tracing";
70
+ const OPENAI_PLUGIN_ALLOW_ID = "openai";
70
71
  const KAYBA_TRACING_NPM_PACKAGE = "@kayba_ai/openclaw-tracing";
71
72
  const KAYBA_TRACING_FOLDER_DEFAULT = "traderclaw-agent";
72
73
  const CONFIG_DIR = join(homedir(), ".openclaw");
@@ -463,6 +464,16 @@ function getPluginConfig(config) {
463
464
  return plugin.config || null;
464
465
  }
465
466
 
467
+ function ensurePluginAllowId(config, pluginId) {
468
+ if (typeof pluginId !== "string" || !pluginId.trim()) return;
469
+ normalizePluginConfigShape(config);
470
+ if (!config.plugins) config.plugins = {};
471
+ if (!Array.isArray(config.plugins.allow)) config.plugins.allow = [];
472
+ if (!config.plugins.allow.includes(pluginId)) {
473
+ config.plugins.allow.push(pluginId);
474
+ }
475
+ }
476
+
466
477
  function setPluginConfig(config, pluginConfig) {
467
478
  normalizePluginConfigShape(config);
468
479
  if (!config.plugins) config.plugins = {};
@@ -471,16 +482,15 @@ function setPluginConfig(config, pluginConfig) {
471
482
  enabled: true,
472
483
  config: pluginConfig,
473
484
  };
485
+ ensurePluginAllowId(config, OPENAI_PLUGIN_ALLOW_ID);
474
486
  }
475
487
 
476
488
  function setKaybaTracingPluginConfig(config, kaybaApiKey, folder) {
477
489
  normalizePluginConfigShape(config);
478
490
  if (!config.plugins) config.plugins = {};
479
491
  if (!config.plugins.entries) config.plugins.entries = {};
480
- if (!Array.isArray(config.plugins.allow)) config.plugins.allow = [];
481
- if (!config.plugins.allow.includes(KAYBA_TRACING_PLUGIN_ID)) {
482
- config.plugins.allow.push(KAYBA_TRACING_PLUGIN_ID);
483
- }
492
+ ensurePluginAllowId(config, KAYBA_TRACING_PLUGIN_ID);
493
+ ensurePluginAllowId(config, OPENAI_PLUGIN_ALLOW_ID);
484
494
  const prev = config.plugins.entries[KAYBA_TRACING_PLUGIN_ID];
485
495
  const prevConfig = prev && typeof prev.config === "object" && prev.config !== null ? prev.config : {};
486
496
  config.plugins.entries[KAYBA_TRACING_PLUGIN_ID] = {
@@ -1585,6 +1595,25 @@ async function cmdGateway(args) {
1585
1595
  process.exit(1);
1586
1596
  }
1587
1597
 
1598
+ async function cmdMaintenance(subArgs) {
1599
+ const sub = subArgs[0];
1600
+ if (sub !== "session-cleanup") {
1601
+ printError("Usage: traderclaw maintenance session-cleanup");
1602
+ print("");
1603
+ printInfo("Archives bloated *.checkpoint.*.jsonl (and heartbeat session logs) under the OpenClaw agent sessions dir,");
1604
+ printInfo("then runs systemctl --user stop / daemon-reload / start on the gateway unit (same as TraderClaw persistence).");
1605
+ printInfo(`Env and cron examples: see ${join(PLUGIN_ROOT, "scripts", "openclaw-session-cleanup.sh")}`);
1606
+ process.exit(sub ? 1 : 0);
1607
+ }
1608
+ const scriptPath = join(PLUGIN_ROOT, "scripts", "openclaw-session-cleanup.sh");
1609
+ if (!existsSync(scriptPath)) {
1610
+ printError(`Session cleanup script not found: ${scriptPath}`);
1611
+ process.exit(1);
1612
+ }
1613
+ const r = spawnSync("bash", [scriptPath, ...subArgs.slice(1)], { stdio: "inherit", env: process.env });
1614
+ process.exit(r.status === null ? 1 : r.status);
1615
+ }
1616
+
1588
1617
  async function cmdLogin(args) {
1589
1618
  const config = readConfig();
1590
1619
  const pluginConfig = getPluginConfig(config);
@@ -4492,6 +4521,7 @@ Commands:
4492
4521
  install Launch installer flows (--wizard for localhost GUI)
4493
4522
  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)
4494
4523
  gateway Gateway helpers (see subcommands below)
4524
+ maintenance Session disk hygiene (checkpoint archive + gateway restart)
4495
4525
  login Re-authenticate (uses refresh token when valid; full challenge only if needed)
4496
4526
  logout Revoke current session and clear tokens
4497
4527
  status Check connection health and wallet status
@@ -4546,6 +4576,9 @@ Gateway subcommands (Linux):
4546
4576
  gateway start Start gateway after manual edits
4547
4577
  gateway ensure-persistent Set up systemd linger + enable unit
4548
4578
 
4579
+ Maintenance:
4580
+ maintenance session-cleanup Archive large session checkpoints + restart gateway (see script header for OPENCLAW_STATE_DIR, STRIP_ALL_CHECKPOINTS, DRY_RUN, ARCHIVE_RETENTION_DAYS)
4581
+
4549
4582
  Install wizard (traderclaw install --wizard):
4550
4583
  --port Local port for the wizard (default 17890)
4551
4584
  --llm-provider e.g. openai, openai-codex, anthropic
@@ -4583,6 +4616,7 @@ Examples:
4583
4616
  traderclaw config set-llm cli-cloud MY_API_KEY
4584
4617
  traderclaw gateway stop # pause gateway to edit openclaw.json manually
4585
4618
  traderclaw gateway start # resume after manual edit
4619
+ STRIP_ALL_CHECKPOINTS=1 OPENCLAW_STATE_DIR=/root/.openclaw traderclaw maintenance session-cleanup
4586
4620
  traderclaw test-session
4587
4621
  traderclaw test-session --wallet-private-key <base58_key>
4588
4622
  traderclaw update
@@ -4844,6 +4878,9 @@ async function main() {
4844
4878
  case "gateway":
4845
4879
  await cmdGateway(args.slice(1));
4846
4880
  break;
4881
+ case "maintenance":
4882
+ await cmdMaintenance(args.slice(1));
4883
+ break;
4847
4884
  case "login":
4848
4885
  await cmdLogin(args.slice(1));
4849
4886
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traderclaw-cli",
3
- "version": "1.0.111",
3
+ "version": "1.0.113",
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.111"
20
+ "solana-traderclaw": "^1.0.113"
21
21
  },
22
22
  "keywords": [
23
23
  "traderclaw",