traderclaw-cli 1.0.123 → 1.0.126
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 +276 -1
- package/bin/openclaw-trader.mjs +48 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ import { homedir, tmpdir } from "os";
|
|
|
5
5
|
import { basename, dirname, join } from "path";
|
|
6
6
|
import { resolvePluginPackageRoot } from "./resolve-plugin-root.mjs";
|
|
7
7
|
import { choosePreferredProviderModel } from "./llm-model-preference.mjs";
|
|
8
|
-
import { getLinuxGatewayPersistenceSnapshot } from "./gateway-persistence-linux.mjs";
|
|
8
|
+
import { getLinuxGatewayPersistenceSnapshot, isLinuxGatewayPersistenceEligible } from "./gateway-persistence-linux.mjs";
|
|
9
9
|
|
|
10
10
|
const CONFIG_DIR = join(homedir(), ".openclaw");
|
|
11
11
|
const CONFIG_FILE = join(CONFIG_DIR, "openclaw.json");
|
|
@@ -1630,6 +1630,29 @@ function getAccessPairForAgent(wizardOpts, agentId) {
|
|
|
1630
1630
|
return { at, ats };
|
|
1631
1631
|
}
|
|
1632
1632
|
|
|
1633
|
+
function readPluginOrchestratorUrl(pluginId) {
|
|
1634
|
+
try {
|
|
1635
|
+
const config = JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
|
|
1636
|
+
const entry = config?.plugins?.entries?.[pluginId];
|
|
1637
|
+
const u = entry?.config?.orchestratorUrl;
|
|
1638
|
+
if (typeof u === "string" && u.trim()) return u.trim().replace(/\/+$/, "");
|
|
1639
|
+
} catch {
|
|
1640
|
+
/* keep default */
|
|
1641
|
+
}
|
|
1642
|
+
return "https://api.traderclaw.ai";
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
function readPluginApiKeyForVerify(pluginId) {
|
|
1646
|
+
try {
|
|
1647
|
+
const config = JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
|
|
1648
|
+
const entry = config?.plugins?.entries?.[pluginId];
|
|
1649
|
+
const k = entry?.config?.apiKey;
|
|
1650
|
+
return typeof k === "string" ? k.trim() : "";
|
|
1651
|
+
} catch {
|
|
1652
|
+
return "";
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1633
1656
|
function seedXConfig(modeConfig, configPath = CONFIG_FILE, wizardOpts = {}) {
|
|
1634
1657
|
let config = {};
|
|
1635
1658
|
try {
|
|
@@ -2458,6 +2481,17 @@ export class InstallerStepEngine {
|
|
|
2458
2481
|
this.state.autoRecovery.backupPath = backupPath;
|
|
2459
2482
|
this.emitLog(stepId, "warn", `Auto-recovery: applied ${changed.join(", ")} with backup at ${backupPath}`);
|
|
2460
2483
|
|
|
2484
|
+
if (isLinuxGatewayPersistenceEligible()) {
|
|
2485
|
+
const lingerSnap = getLinuxGatewayPersistenceSnapshot();
|
|
2486
|
+
if (lingerSnap.linger !== true) {
|
|
2487
|
+
try {
|
|
2488
|
+
await this.runWithPrivilegeGuidance(stepId, "sudo", ["loginctl", "enable-linger", lingerSnap.username]);
|
|
2489
|
+
} catch {
|
|
2490
|
+
// best effort; gateway install may still surface a clearer error
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2461
2495
|
try {
|
|
2462
2496
|
await this.runWithPrivilegeGuidance(stepId, "openclaw", ["gateway", "stop"]);
|
|
2463
2497
|
} catch {
|
|
@@ -2812,6 +2846,23 @@ export class InstallerStepEngine {
|
|
|
2812
2846
|
ensureGatewayBootstrapDefaults(CONFIG_FILE, (msg) =>
|
|
2813
2847
|
this.emitLog("gateway_bootstrap", "info", msg),
|
|
2814
2848
|
);
|
|
2849
|
+
// `openclaw gateway install` uses user systemd; linger must be enabled before install
|
|
2850
|
+
// (gateway_persistence runs later — too late). VPS userdata may already do this as root.
|
|
2851
|
+
if (isLinuxGatewayPersistenceEligible()) {
|
|
2852
|
+
const lingerSnap = getLinuxGatewayPersistenceSnapshot();
|
|
2853
|
+
if (lingerSnap.linger !== true) {
|
|
2854
|
+
this.emitLog(
|
|
2855
|
+
"gateway_bootstrap",
|
|
2856
|
+
"info",
|
|
2857
|
+
"Enabling systemd user linger before openclaw gateway install (required for headless/SSH).",
|
|
2858
|
+
);
|
|
2859
|
+
await this.runWithPrivilegeGuidance("gateway_bootstrap", "sudo", [
|
|
2860
|
+
"loginctl",
|
|
2861
|
+
"enable-linger",
|
|
2862
|
+
lingerSnap.username,
|
|
2863
|
+
]);
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2815
2866
|
await this.runWithPrivilegeGuidance("gateway_bootstrap", "openclaw", ["gateway", "install"]);
|
|
2816
2867
|
await this.runWithPrivilegeGuidance("gateway_bootstrap", "openclaw", ["gateway", "restart"]);
|
|
2817
2868
|
if (this.options.skipFunnel) {
|
|
@@ -3053,6 +3104,230 @@ export async function tailscaleFunnelOpenclaw18789(options = {}) {
|
|
|
3053
3104
|
return { funnelUrl: firstUrl(statusOut) || null, rawStatus: statusOut };
|
|
3054
3105
|
}
|
|
3055
3106
|
|
|
3107
|
+
/**
|
|
3108
|
+
* Re-run installer bootstrap steps (pinned OpenClaw platform, dependency repair, plugin activation,
|
|
3109
|
+
* gateway persistence, scheduling, workspace bootstrap, gateway templates) without LLM or Tailscale flows.
|
|
3110
|
+
* Intended for `traderclaw update --deep` after npm/plugin sync.
|
|
3111
|
+
*/
|
|
3112
|
+
export async function runTraderClawDeepUpdate(options = {}) {
|
|
3113
|
+
const modeConfig = options.modeConfig;
|
|
3114
|
+
if (!modeConfig?.pluginId || !modeConfig?.pluginPackage || !modeConfig?.gatewayConfig || !modeConfig?.cliName) {
|
|
3115
|
+
throw new Error("runTraderClawDeepUpdate: modeConfig must include pluginId, pluginPackage, gatewayConfig, cliName");
|
|
3116
|
+
}
|
|
3117
|
+
const skipPluginTarballSync = options.skipPluginTarballSync === true;
|
|
3118
|
+
const onLog = typeof options.hooks?.onLog === "function" ? options.hooks.onLog : () => {};
|
|
3119
|
+
const onStep = typeof options.hooks?.onStepEvent === "function" ? options.hooks.onStepEvent : () => {};
|
|
3120
|
+
|
|
3121
|
+
const emitLog = (stepId, level, text) => {
|
|
3122
|
+
const clean = typeof text === "string" ? stripAnsi(text) : text;
|
|
3123
|
+
onLog({ at: nowIso(), stepId, level, text: clean, urls: [] });
|
|
3124
|
+
};
|
|
3125
|
+
|
|
3126
|
+
async function runDeepStep(stepId, title, handler) {
|
|
3127
|
+
onStep({ at: nowIso(), stepId, status: "in_progress", detail: title });
|
|
3128
|
+
try {
|
|
3129
|
+
const result = await handler();
|
|
3130
|
+
onStep({ at: nowIso(), stepId, status: "completed", detail: title });
|
|
3131
|
+
return result;
|
|
3132
|
+
} catch (err) {
|
|
3133
|
+
const detail = stripAnsi(err?.message || String(err));
|
|
3134
|
+
onStep({ at: nowIso(), stepId, status: "failed", detail });
|
|
3135
|
+
throw err;
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
await runDeepStep("deep_preflight", "Checking prerequisites", async () => {
|
|
3140
|
+
if (!commandExists("node") || !commandExists("npm")) {
|
|
3141
|
+
throw new Error("node and npm are required for deep update");
|
|
3142
|
+
}
|
|
3143
|
+
return { node: true, npm: true };
|
|
3144
|
+
});
|
|
3145
|
+
|
|
3146
|
+
await runDeepStep("deep_install_openclaw", "Installing or upgrading OpenClaw platform (pinned)", async () =>
|
|
3147
|
+
installOpenClawPlatform((evt) =>
|
|
3148
|
+
emitLog("deep_install_openclaw", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3149
|
+
),
|
|
3150
|
+
);
|
|
3151
|
+
|
|
3152
|
+
await runDeepStep("deep_device_approval_check", "Checking OpenClaw device approval status", async () => {
|
|
3153
|
+
const check = checkOpenClawDeviceApproval();
|
|
3154
|
+
if (!check.ran) {
|
|
3155
|
+
emitLog("deep_device_approval_check", "info", "Device approval check skipped (openclaw CLI unavailable).");
|
|
3156
|
+
return { ran: false };
|
|
3157
|
+
}
|
|
3158
|
+
const needsAction = check.pendingIds.length > 0 || check.repairDetected;
|
|
3159
|
+
if (!needsAction) {
|
|
3160
|
+
emitLog("deep_device_approval_check", "info", "No pending or repair-state devices found.");
|
|
3161
|
+
return { ran: true, ok: true };
|
|
3162
|
+
}
|
|
3163
|
+
const lines = [
|
|
3164
|
+
"ACTION REQUIRED — OpenClaw device approval needed.",
|
|
3165
|
+
"Run: openclaw devices list",
|
|
3166
|
+
...(check.pendingIds.length > 0
|
|
3167
|
+
? check.pendingIds.map((id) => ` openclaw devices approve ${id}`)
|
|
3168
|
+
: [" openclaw devices approve <requestId>"]),
|
|
3169
|
+
];
|
|
3170
|
+
emitLog("deep_device_approval_check", "warn", lines.join("\n"));
|
|
3171
|
+
return { ran: true, ok: false, pendingIds: check.pendingIds };
|
|
3172
|
+
});
|
|
3173
|
+
|
|
3174
|
+
if (!skipPluginTarballSync) {
|
|
3175
|
+
await runDeepStep("deep_install_traderclaw_cli", "Ensuring TraderClaw CLI npm package", async () =>
|
|
3176
|
+
installPlugin(modeConfig, (evt) =>
|
|
3177
|
+
emitLog("deep_install_traderclaw_cli", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3178
|
+
),
|
|
3179
|
+
);
|
|
3180
|
+
await runDeepStep("deep_openclaw_global_deps", "Ensuring OpenClaw global package dependencies", async () =>
|
|
3181
|
+
ensureOpenClawGlobalPackageDependencies(),
|
|
3182
|
+
);
|
|
3183
|
+
await runDeepStep("deep_install_qmd", "Installing QMD memory engine (vector search)", async () => {
|
|
3184
|
+
if (commandExists("qmd")) {
|
|
3185
|
+
const ver = getCommandOutput("qmd --version");
|
|
3186
|
+
emitLog("deep_install_qmd", "info", `QMD already installed: ${ver}`);
|
|
3187
|
+
return { alreadyInstalled: true, version: ver };
|
|
3188
|
+
}
|
|
3189
|
+
emitLog("deep_install_qmd", "info", "Installing @tobilu/qmd globally...");
|
|
3190
|
+
try {
|
|
3191
|
+
await runCommandWithEvents(
|
|
3192
|
+
"npm",
|
|
3193
|
+
["install", "-g", "--ignore-scripts", "--no-audit", "--no-fund", "--registry", "https://registry.npmjs.org/", "@tobilu/qmd"],
|
|
3194
|
+
{
|
|
3195
|
+
onEvent: (evt) =>
|
|
3196
|
+
emitLog("deep_install_qmd", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3197
|
+
},
|
|
3198
|
+
);
|
|
3199
|
+
} catch (err) {
|
|
3200
|
+
emitLog(
|
|
3201
|
+
"deep_install_qmd",
|
|
3202
|
+
"warn",
|
|
3203
|
+
`QMD install failed (non-fatal): ${err?.message || err}. Install manually: npm install -g @tobilu/qmd`,
|
|
3204
|
+
);
|
|
3205
|
+
return { installed: false, error: err?.message || String(err) };
|
|
3206
|
+
}
|
|
3207
|
+
const available = commandExists("qmd");
|
|
3208
|
+
return { installed: available, version: available ? getCommandOutput("qmd --version") : null };
|
|
3209
|
+
});
|
|
3210
|
+
|
|
3211
|
+
const orchUrl = readPluginOrchestratorUrl(modeConfig.pluginId);
|
|
3212
|
+
await runDeepStep("deep_activate_openclaw_plugin", "Installing and enabling TraderClaw inside OpenClaw", async () =>
|
|
3213
|
+
installAndEnableOpenClawPlugin(
|
|
3214
|
+
modeConfig,
|
|
3215
|
+
(evt) =>
|
|
3216
|
+
emitLog("deep_activate_openclaw_plugin", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3217
|
+
orchUrl,
|
|
3218
|
+
),
|
|
3219
|
+
);
|
|
3220
|
+
} else {
|
|
3221
|
+
emitLog(
|
|
3222
|
+
"deep_plugin_sync",
|
|
3223
|
+
"warn",
|
|
3224
|
+
'Skipping TraderClaw CLI npm install, QMD bootstrap, and plugin activate (--skip-plugins). OpenClaw platform upgrade still ran.',
|
|
3225
|
+
);
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
normalizeOpenClawConfigFileShape(CONFIG_FILE);
|
|
3229
|
+
|
|
3230
|
+
await runDeepStep("deep_gateway_bootstrap_defaults", "Ensuring gateway bootstrap defaults in openclaw.json", async () => {
|
|
3231
|
+
ensureGatewayBootstrapDefaults(CONFIG_FILE, (msg) => emitLog("deep_gateway_bootstrap_defaults", "info", msg));
|
|
3232
|
+
return { ok: true };
|
|
3233
|
+
});
|
|
3234
|
+
|
|
3235
|
+
await runDeepStep("deep_openclaw_config_validate", "Validating OpenClaw config", async () => {
|
|
3236
|
+
try {
|
|
3237
|
+
await runCommandWithEvents("openclaw", ["config", "validate"], {
|
|
3238
|
+
onEvent: (evt) =>
|
|
3239
|
+
emitLog("deep_openclaw_config_validate", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3240
|
+
});
|
|
3241
|
+
} catch (err) {
|
|
3242
|
+
const blob = `${err?.message || ""}\n${err?.stderr || ""}\n${err?.stdout || ""}`;
|
|
3243
|
+
if (isOpenClawConfigSchemaFailure(blob)) {
|
|
3244
|
+
throw new Error(gatewayConfigValidationRemediation());
|
|
3245
|
+
}
|
|
3246
|
+
throw err;
|
|
3247
|
+
}
|
|
3248
|
+
return { ok: true };
|
|
3249
|
+
});
|
|
3250
|
+
|
|
3251
|
+
const { ensureLinuxGatewayPersistence } = await import("./gateway-persistence-linux.mjs");
|
|
3252
|
+
await runDeepStep("deep_gateway_persistence", "SSH-safe gateway (systemd user linger)", async () =>
|
|
3253
|
+
ensureLinuxGatewayPersistence({
|
|
3254
|
+
emitLog: (level, text) => emitLog("deep_gateway_persistence", level, text),
|
|
3255
|
+
runPrivileged: (cmd, args) =>
|
|
3256
|
+
runCommandWithEvents(cmd, args, {
|
|
3257
|
+
onEvent: (evt) =>
|
|
3258
|
+
emitLog("deep_gateway_persistence", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3259
|
+
}),
|
|
3260
|
+
}),
|
|
3261
|
+
);
|
|
3262
|
+
|
|
3263
|
+
await runDeepStep("deep_enable_responses", "Enabling /v1/responses endpoint", async () => {
|
|
3264
|
+
const configPath = ensureOpenResponsesEnabled(CONFIG_FILE);
|
|
3265
|
+
return { configPath };
|
|
3266
|
+
});
|
|
3267
|
+
|
|
3268
|
+
await runDeepStep("deep_gateway_scheduling", "Configuring heartbeat and cron schedules", async () => {
|
|
3269
|
+
const result = configureGatewayScheduling(modeConfig, CONFIG_FILE);
|
|
3270
|
+
emitLog("deep_gateway_scheduling", "info", `Agents configured: ${result.agentsConfigured}`);
|
|
3271
|
+
if (result.removedLegacyCronJobs) {
|
|
3272
|
+
emitLog("deep_gateway_scheduling", "warn", "Removed legacy 'cron.jobs' from openclaw.json for schema compatibility.");
|
|
3273
|
+
}
|
|
3274
|
+
return result;
|
|
3275
|
+
});
|
|
3276
|
+
|
|
3277
|
+
await runDeepStep("deep_workspace_heartbeat", "Installing HEARTBEAT.md into agent workspace", async () =>
|
|
3278
|
+
deployWorkspaceHeartbeat(modeConfig),
|
|
3279
|
+
);
|
|
3280
|
+
|
|
3281
|
+
await runDeepStep("deep_workspace_bootstrap", "Installing workspace context files", async () =>
|
|
3282
|
+
deployWorkspaceBootstrapFiles(modeConfig),
|
|
3283
|
+
);
|
|
3284
|
+
|
|
3285
|
+
await runDeepStep("deep_gateway_config", "Deploying gateway config template", async () =>
|
|
3286
|
+
deployGatewayConfig(modeConfig),
|
|
3287
|
+
);
|
|
3288
|
+
|
|
3289
|
+
await runDeepStep("deep_x_credentials", "Merging X/Twitter credentials from environment", async () =>
|
|
3290
|
+
seedXConfig(modeConfig, CONFIG_FILE, {}),
|
|
3291
|
+
);
|
|
3292
|
+
|
|
3293
|
+
const telegramEnv =
|
|
3294
|
+
String(process.env.TRADERCLAW_HEADLESS_TELEGRAM_TOKEN || "").trim()
|
|
3295
|
+
|| String(process.env.OPENCLAW_TELEGRAM_BOT_TOKEN || "").trim();
|
|
3296
|
+
if (telegramEnv) {
|
|
3297
|
+
await runDeepStep("deep_telegram_env", "Applying Telegram bot token from environment", async () => {
|
|
3298
|
+
writeTelegramChannelConfig(telegramEnv, CONFIG_FILE);
|
|
3299
|
+
const policy = ensureTelegramGroupPolicyOpenForWizard();
|
|
3300
|
+
if (policy.changed) {
|
|
3301
|
+
emitLog("deep_telegram_env", "info", "Set channels.telegram.groupPolicy=open for wizard-compatible groups.");
|
|
3302
|
+
}
|
|
3303
|
+
return { configured: true };
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
await runDeepStep("deep_openclaw_config_validate_final", "Re-validating OpenClaw config", async () => {
|
|
3308
|
+
normalizeOpenClawConfigFileShape(CONFIG_FILE);
|
|
3309
|
+
await runCommandWithEvents("openclaw", ["config", "validate"], {
|
|
3310
|
+
onEvent: (evt) =>
|
|
3311
|
+
emitLog("deep_openclaw_config_validate_final", evt.type === "stderr" ? "warn" : "info", evt.text),
|
|
3312
|
+
});
|
|
3313
|
+
return { ok: true };
|
|
3314
|
+
});
|
|
3315
|
+
|
|
3316
|
+
await runDeepStep("deep_restart_gateway", "Restarting gateway", async () => restartGateway());
|
|
3317
|
+
|
|
3318
|
+
await runDeepStep("deep_verify", "Verifying installation", async () => {
|
|
3319
|
+
const apiKey = readPluginApiKeyForVerify(modeConfig.pluginId);
|
|
3320
|
+
const checks = verifyInstallation(modeConfig, apiKey);
|
|
3321
|
+
for (const c of checks) {
|
|
3322
|
+
const prefix = c.ok ? "ok" : "warn";
|
|
3323
|
+
emitLog("deep_verify", c.ok ? "info" : "warn", `${prefix}: ${c.label}${c.note ? ` — ${c.note}` : ""}`);
|
|
3324
|
+
}
|
|
3325
|
+
return { checks };
|
|
3326
|
+
});
|
|
3327
|
+
|
|
3328
|
+
return { status: "completed" };
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3056
3331
|
export function assertWizardXCredentials(modeConfig, options = {}) {
|
|
3057
3332
|
const t = (s) => (typeof s === "string" ? s.trim() : "");
|
|
3058
3333
|
const o = options || {};
|
package/bin/openclaw-trader.mjs
CHANGED
|
@@ -4729,11 +4729,14 @@ Commands:
|
|
|
4729
4729
|
config View and manage configuration
|
|
4730
4730
|
test-session Test session auth flow (refresh, rotation, challenge) without reinstalling
|
|
4731
4731
|
update Update global traderclaw-cli, re-sync the OpenClaw plugin (openclaw.json), force-install solana-traderclaw, and restart the gateway
|
|
4732
|
+
update --deep Same as update, then re-run installer bootstrap (pinned OpenClaw, scheduling, workspace, gateway template, persistence) without LLM/Tailscale
|
|
4732
4733
|
|
|
4733
4734
|
Update options (traderclaw update):
|
|
4734
4735
|
--beta Use the npm dist-tag "beta" for traderclaw-cli and solana-traderclaw (default: "latest")
|
|
4735
4736
|
--dry-run Show / simulate actions without fully applying (where supported)
|
|
4736
|
-
--
|
|
4737
|
+
--deep After npm/plugin sync, run installer reconciliation (OpenClaw pin, scheduling, workspace…); omits LLM/Tailscale
|
|
4738
|
+
--skip-plugins Do not run openclaw "plugins update" or "plugins install --force" (only npm + gateway restart).
|
|
4739
|
+
With --deep: skips TraderClaw CLI npm reinstall + plugin activate inside deep sync (pinned OpenClaw upgrade still runs)
|
|
4737
4740
|
|
|
4738
4741
|
Setup options:
|
|
4739
4742
|
--api-key, -k API key (skip interactive prompt)
|
|
@@ -4836,6 +4839,7 @@ Examples:
|
|
|
4836
4839
|
traderclaw update
|
|
4837
4840
|
traderclaw update --beta
|
|
4838
4841
|
traderclaw update --dry-run
|
|
4842
|
+
traderclaw update --deep
|
|
4839
4843
|
`);
|
|
4840
4844
|
}
|
|
4841
4845
|
|
|
@@ -4843,12 +4847,16 @@ async function cmdUpdate(args) {
|
|
|
4843
4847
|
const tag = args.includes("--beta") ? "beta" : "latest";
|
|
4844
4848
|
const dryRun = args.includes("--dry-run");
|
|
4845
4849
|
const skipPlugins = args.includes("--skip-plugins");
|
|
4850
|
+
const deep = args.includes("--deep");
|
|
4846
4851
|
|
|
4847
4852
|
print("\nTraderClaw — Update\n");
|
|
4848
4853
|
print("=".repeat(45));
|
|
4849
4854
|
if (dryRun) {
|
|
4850
4855
|
printInfo(" (dry-run: npm install and gateway restart are simulated where noted)\n");
|
|
4851
4856
|
}
|
|
4857
|
+
if (deep && !dryRun) {
|
|
4858
|
+
printInfo(" (--deep: full installer reconciliation will run after npm/plugin sync)\n");
|
|
4859
|
+
}
|
|
4852
4860
|
|
|
4853
4861
|
let currentVersion = "unknown";
|
|
4854
4862
|
try {
|
|
@@ -4990,6 +4998,45 @@ async function cmdUpdate(args) {
|
|
|
4990
4998
|
);
|
|
4991
4999
|
}
|
|
4992
5000
|
|
|
5001
|
+
if (deep) {
|
|
5002
|
+
/** Matches wizard / headless install (TraderClaw v1 multi-agent gateway profile). */
|
|
5003
|
+
const deepModeConfig = {
|
|
5004
|
+
pluginPackage: "solana-traderclaw",
|
|
5005
|
+
pluginId: "solana-trader",
|
|
5006
|
+
cliName: "traderclaw",
|
|
5007
|
+
gatewayConfig: "gateway-v1.json5",
|
|
5008
|
+
agents: ["cto", "onchain-analyst", "alpha-signal-analyst", "risk-officer", "strategy-researcher"],
|
|
5009
|
+
};
|
|
5010
|
+
if (dryRun) {
|
|
5011
|
+
print(
|
|
5012
|
+
`\n [dry-run] Would run installer reconciliation (--deep): pinned OpenClaw platform, config normalize + validate, systemd linger, ` +
|
|
5013
|
+
`responses endpoint, heartbeat/cron/hooks, workspace bootstrap, gateway template, optional Telegram from env, gateway restart, verify.` +
|
|
5014
|
+
`${skipPlugins ? " (--skip-plugins: skip TraderClaw CLI npm + plugin activate inside deep)" : ""}\n`,
|
|
5015
|
+
);
|
|
5016
|
+
} else {
|
|
5017
|
+
print("\n Deep update — installer reconciliation (LLM / Tailscale unchanged)...\n");
|
|
5018
|
+
try {
|
|
5019
|
+
const { runTraderClawDeepUpdate } = await import("./installer-step-engine.mjs");
|
|
5020
|
+
await runTraderClawDeepUpdate({
|
|
5021
|
+
modeConfig: deepModeConfig,
|
|
5022
|
+
skipPluginTarballSync: skipPlugins,
|
|
5023
|
+
hooks: {
|
|
5024
|
+
onLog: ({ text }) => {
|
|
5025
|
+
if (text) print(String(text));
|
|
5026
|
+
},
|
|
5027
|
+
onStepEvent: ({ stepId, status, detail }) => {
|
|
5028
|
+
print(`[deep] ${stepId} ${status}${detail ? ` — ${detail}` : ""}`);
|
|
5029
|
+
},
|
|
5030
|
+
},
|
|
5031
|
+
});
|
|
5032
|
+
printSuccess("\n Deep reconciliation finished.");
|
|
5033
|
+
} catch (err) {
|
|
5034
|
+
printError(err?.message || String(err));
|
|
5035
|
+
process.exit(1);
|
|
5036
|
+
}
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
|
|
4993
5040
|
if (dryRun) {
|
|
4994
5041
|
print(`\n [dry-run] Would run: systemctl --user enable --now + restart (Linux) or openclaw gateway restart\n`);
|
|
4995
5042
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "traderclaw-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
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.126"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"traderclaw",
|