akemon 0.2.14 → 0.2.15
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/dist/task-module.js +3 -2
- package/package.json +1 -1
package/dist/task-module.js
CHANGED
|
@@ -315,7 +315,7 @@ Relay API (use curl with -H "Authorization: Bearer ${this.secretKey}" -H "Conten
|
|
|
315
315
|
Accept order: POST ${this.relayHttp}/v1/orders/${order.id}/accept
|
|
316
316
|
Deliver order: POST ${this.relayHttp}/v1/orders/${order.id}/deliver -d '{"result":"your response"}'
|
|
317
317
|
Extend order: PUT ${this.relayHttp}/v1/orders/${order.id}/extend`;
|
|
318
|
-
const question = `[Order id=${order.id} status=${order.status}] ${order.product_name ? `Product: ${order.product_name}\n` : ""}Buyer: ${order.buyer_agent_name || order.
|
|
318
|
+
const question = `[Order id=${order.id} status=${order.status}] ${order.product_name ? `Product: ${order.product_name}\n` : ""}Buyer: ${order.buyer_agent_name || order.buyer_ip || "?"}\nRequest: ${order.buyer_task || "(no specific request)"}
|
|
319
319
|
|
|
320
320
|
Steps:
|
|
321
321
|
1. If order status is "pending", accept it first (POST .../accept)
|
|
@@ -338,7 +338,8 @@ RESPOND IN THE SAME LANGUAGE AS THE REQUEST.`;
|
|
|
338
338
|
const duration = Date.now() - startTime;
|
|
339
339
|
const nurl = this.notifyUrl || (await loadAgentConfig(workdir, agentName)).notify_url;
|
|
340
340
|
// Save conversation round for order-based interactions
|
|
341
|
-
|
|
341
|
+
// buyer_ip holds the publisherId (e.g. "f4e8ebbb7a01" or "ip-abc123") set by relay
|
|
342
|
+
const orderBuyer = order.buyer_agent_name || order.buyer_ip || "anonymous";
|
|
342
343
|
const orderConvId = resolveConvId(orderBuyer, order.id);
|
|
343
344
|
const orderUserMsg = order.buyer_task || "(no message)";
|
|
344
345
|
const orderAgentMsg = (result.response || "").slice(0, 2000);
|