clawmoney 0.15.41 → 0.15.43

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.
@@ -168,7 +168,15 @@ export async function setupCommand() {
168
168
  return;
169
169
  }
170
170
  const checkData = checkResp.data;
171
- if (!checkData.exists || checkData.status === 'UNCLAIMED') {
171
+ // Backend returns agent details nested under `agent` now; fall back
172
+ // to legacy top-level fields so an older backend still works.
173
+ // Status is normalized to uppercase so case differences between
174
+ // backend builds (active vs ACTIVE) don't trip the branch select.
175
+ const agentInfo = checkData.agent ?? {};
176
+ const agentStatus = (agentInfo.status ?? checkData.status ?? '').toUpperCase();
177
+ const agentSlug = agentInfo.slug ?? checkData.slug;
178
+ const agentIdFromCheck = agentInfo.id ?? checkData.agent_id;
179
+ if (!checkData.exists || agentStatus === 'UNCLAIMED') {
172
180
  // Step 6: Register new agent
173
181
  agentSpinner.text = 'Registering agent...';
174
182
  const registerBody = { email };
@@ -191,9 +199,9 @@ export async function setupCommand() {
191
199
  wallet_address: walletAddress || undefined,
192
200
  });
193
201
  }
194
- else if (checkData.status === 'ACTIVE') {
202
+ else if (agentStatus === 'ACTIVE') {
195
203
  // Step 7: Login existing agent via OTP
196
- agentSpinner.info(`Agent found: ${checkData.slug || checkData.agent_id}`);
204
+ agentSpinner.info(`Agent found: ${agentSlug || agentIdFromCheck}`);
197
205
  const loginSpinner2 = ora('Sending login OTP...').start();
198
206
  const loginResp = await apiPost('/api/v1/claw-agents/login', { email });
199
207
  if (!loginResp.ok) {
@@ -225,7 +233,7 @@ export async function setupCommand() {
225
233
  });
226
234
  }
227
235
  else {
228
- agentSpinner.warn(`Agent status: ${checkData.status}`);
236
+ agentSpinner.warn(`Agent status: ${agentStatus || '(unknown)'}`);
229
237
  console.log(chalk.yellow('Please contact support if you need help.'));
230
238
  return;
231
239
  }
@@ -1,4 +1,9 @@
1
1
  import { spawn } from 'node:child_process';
2
+ // Windows resolves .cmd / .bat launchers only through the shell;
3
+ // POSIX (macOS/Linux) `spawn` walks PATH on its own and prints a
4
+ // DEP0190 deprecation warning when shell:true is combined with
5
+ // argument arrays. Keep shell:true only where we actually need it.
6
+ const USE_SHELL = process.platform === 'win32';
2
7
  /**
3
8
  * Execute an awal CLI command and parse the JSON output.
4
9
  * Always appends --json flag for machine-readable output.
@@ -9,7 +14,7 @@ export async function awalExec(args) {
9
14
  return new Promise((resolve, reject) => {
10
15
  const child = spawn('npx', ['awal', ...finalArgs], {
11
16
  stdio: ['inherit', 'pipe', 'pipe'],
12
- shell: true,
17
+ shell: USE_SHELL,
13
18
  });
14
19
  let stdout = '';
15
20
  let stderr = '';
@@ -64,7 +69,7 @@ export async function awalExecInteractive(args) {
64
69
  return new Promise((resolve, reject) => {
65
70
  const child = spawn('npx', ['awal', ...finalArgs], {
66
71
  stdio: ['inherit', 'pipe', 'pipe'],
67
- shell: true,
72
+ shell: USE_SHELL,
68
73
  });
69
74
  let stdout = '';
70
75
  let stderr = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmoney",
3
- "version": "0.15.41",
3
+ "version": "0.15.43",
4
4
  "description": "ClawMoney CLI -- Earn rewards with your AI agent",
5
5
  "type": "module",
6
6
  "bin": {