solana-traderclaw 1.0.29 → 1.0.30

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.
@@ -436,6 +436,7 @@ function seedPluginConfig(modeConfig, orchestratorUrl, configPath = CONFIG_FILE)
436
436
  // Do not set plugins.allow here: OpenClaw validates allow[] against the plugin registry, and
437
437
  // the id is not registered until after `openclaw plugins install`. Pre-seeding allow caused:
438
438
  // "plugins.allow: plugin not found: <id>".
439
+ ensureAgentsDefaultsSchemaCompat(config);
439
440
 
440
441
  mkdirSync(CONFIG_DIR, { recursive: true });
441
442
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
@@ -576,6 +577,7 @@ function mergePluginsAllowlist(modeConfig, configPath = CONFIG_FILE) {
576
577
  );
577
578
  allowSet.add(modeConfig.pluginId);
578
579
  config.plugins.allow = [...allowSet];
580
+ ensureAgentsDefaultsSchemaCompat(config);
579
581
  mkdirSync(CONFIG_DIR, { recursive: true });
580
582
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
581
583
  }
@@ -1082,6 +1084,40 @@ function resolveLlmModelSelection(provider, requestedModel) {
1082
1084
  return { model: fallbackModelForProvider(provider), source: "fallback_guess", availableModels, warnings };
1083
1085
  }
1084
1086
 
1087
+ /**
1088
+ * OpenClaw 2026+ validates `agents.defaults` with Zod/Ajv: if `defaults` exists it must include
1089
+ * `heartbeat` and `model` objects. `openclaw plugins install/enable` can merge config and drop
1090
+ * these keys, which surfaces as obscure stack errors (e.g. "ajv implementation error") on the next CLI call.
1091
+ */
1092
+ function ensureAgentsDefaultsSchemaCompat(config) {
1093
+ if (!config || typeof config !== "object") return;
1094
+ if (!config.agents || typeof config.agents !== "object") return;
1095
+ if (!config.agents.defaults || typeof config.agents.defaults !== "object") return;
1096
+ if (!config.agents.defaults.heartbeat || typeof config.agents.defaults.heartbeat !== "object") {
1097
+ config.agents.defaults.heartbeat = {};
1098
+ }
1099
+ if (!config.agents.defaults.model || typeof config.agents.defaults.model !== "object") {
1100
+ config.agents.defaults.model = {};
1101
+ }
1102
+ }
1103
+
1104
+ /** Re-read config from disk and re-apply defaults shape before gateway/plugin commands that validate the file. */
1105
+ function normalizeOpenClawConfigFileShape(configPath = CONFIG_FILE) {
1106
+ let config = {};
1107
+ try {
1108
+ config = JSON.parse(readFileSync(configPath, "utf-8"));
1109
+ } catch {
1110
+ return;
1111
+ }
1112
+ ensureAgentsDefaultsSchemaCompat(config);
1113
+ try {
1114
+ mkdirSync(dirname(configPath), { recursive: true });
1115
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
1116
+ } catch {
1117
+ // best effort
1118
+ }
1119
+ }
1120
+
1085
1121
  function configureOpenClawLlmProvider({ provider, model, credential }, configPath = CONFIG_FILE) {
1086
1122
  if (!provider || !credential) {
1087
1123
  throw new Error("LLM provider and credential are required.");
@@ -1123,15 +1159,7 @@ function configureOpenClawLlmProvider({ provider, model, credential }, configPat
1123
1159
 
1124
1160
  if (!config.agents) config.agents = {};
1125
1161
  if (!config.agents.defaults) config.agents.defaults = {};
1126
- // OpenClaw 2026+ Zod schema requires agents.defaults.heartbeat whenever defaults exists
1127
- // (see OpenClaw AgentDefaultsSchema). Omitting it makes openclaw plugins install fail at
1128
- // writeConfigFile → validateConfigObjectRaw with a stack-only error in the UI.
1129
- if (!config.agents.defaults.heartbeat || typeof config.agents.defaults.heartbeat !== "object") {
1130
- config.agents.defaults.heartbeat = {};
1131
- }
1132
- if (!config.agents.defaults.model || typeof config.agents.defaults.model !== "object") {
1133
- config.agents.defaults.model = {};
1134
- }
1162
+ ensureAgentsDefaultsSchemaCompat(config);
1135
1163
  config.agents.defaults.model.primary = model;
1136
1164
 
1137
1165
  mkdirSync(CONFIG_DIR, { recursive: true });
@@ -1587,6 +1615,7 @@ export class InstallerStepEngine {
1587
1615
  if (!this.options.skipGatewayBootstrap) {
1588
1616
  await this.runStep("gateway_bootstrap", "Starting OpenClaw gateway and Funnel", async () => {
1589
1617
  try {
1618
+ normalizeOpenClawConfigFileShape(CONFIG_FILE);
1590
1619
  await this.runWithPrivilegeGuidance("gateway_bootstrap", "openclaw", ["gateway", "install"]);
1591
1620
  await this.runWithPrivilegeGuidance("gateway_bootstrap", "openclaw", ["gateway", "restart"]);
1592
1621
  return this.runFunnel();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solana-traderclaw",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
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",