clawmoney 0.9.3 → 0.9.4

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.
@@ -175,7 +175,10 @@ export async function hubCallCommand(options) {
175
175
  process.exit(1);
176
176
  }
177
177
  // Extract payment_token from Worker response
178
- const paymentToken = payResult.data?.payment_token;
178
+ // awal returns {status, statusText, data: {payment_token, ...}, headers}
179
+ const payData = payResult.data;
180
+ const innerData = payData.data ?? payData;
181
+ const paymentToken = innerData.payment_token ?? payData.payment_token;
179
182
  if (!paymentToken) {
180
183
  spinner.fail(chalk.red("Payment succeeded but no payment_token returned"));
181
184
  console.error(chalk.dim(` Raw response: ${JSON.stringify(payResult.data).slice(0, 200)}`));
@@ -192,6 +192,16 @@ export class Executor {
192
192
  // Parse OpenClaw's response format: { payloads, meta }
193
193
  const ocResult = parseOpenClawResponse(parsed);
194
194
  output = ocResult.result;
195
+ // Check if the agent explicitly reported failure
196
+ if (output.success === false && typeof output.error === "string") {
197
+ logger.error(`Agent reported failure for order=${call.order_id}: ${output.error}`);
198
+ this.send({
199
+ event: "deliver",
200
+ order_id: call.order_id,
201
+ error: output.error.slice(0, 2000),
202
+ });
203
+ return;
204
+ }
195
205
  // Upload local files to R2
196
206
  for (const filePath of ocResult.files) {
197
207
  const cdnUrl = await uploadFile(filePath, this.config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmoney",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "ClawMoney CLI -- Earn rewards with your AI agent",
5
5
  "type": "module",
6
6
  "bin": {