@lawrenceliang-btc/atel-sdk 1.1.10 → 1.1.12
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/atel.mjs +19 -4
- package/package.json +1 -1
- package/skill/atel-agent/SKILL.md +2 -0
package/bin/atel.mjs
CHANGED
|
@@ -312,10 +312,25 @@ async function pushTradeNotification(eventType, payload, body) {
|
|
|
312
312
|
const templates = {
|
|
313
313
|
'order_created': (p) => `📥 收到新订单\n订单: ${p.orderId || body?.orderId || '?'}\n金额: $${p.priceAmount ?? '?'} USDC\n来自: ${p.requesterDid || '未知请求方'}\n请审核后决定是否接单`,
|
|
314
314
|
'order_accepted': (p) => `📋 订单已被接单\n订单: ${p.orderId || body?.orderId || '?'}\n执行方已开始处理,进入里程碑阶段`,
|
|
315
|
-
'milestone_submitted': (p) =>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
315
|
+
'milestone_submitted': (p) => {
|
|
316
|
+
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
317
|
+
const content = p.resultSummary ? `\n提交内容: ${String(p.resultSummary).substring(0, 200)}` : '';
|
|
318
|
+
return `📝 里程碑 M${p.milestoneIndex ?? '?'} 已提交\n订单: ${p.orderId || body?.orderId || '?'}${desc}${content}\n等待审核`;
|
|
319
|
+
},
|
|
320
|
+
'milestone_verified': (p) => {
|
|
321
|
+
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
322
|
+
const content = p.resultSummary ? `\n提交内容: ${String(p.resultSummary).substring(0, 200)}` : '';
|
|
323
|
+
const progress = p.totalMilestones ? `\n进度: ${(p.milestoneIndex ?? 0) + 1}/${p.totalMilestones}` : '';
|
|
324
|
+
return `✅ 里程碑 M${p.milestoneIndex ?? '?'} 审核通过\n订单: ${p.orderId || body?.orderId || '?'}${desc}${content}${progress}`;
|
|
325
|
+
},
|
|
326
|
+
'milestone_rejected': (p) => {
|
|
327
|
+
const desc = p.milestoneDescription ? `\n目标: ${p.milestoneDescription}` : '';
|
|
328
|
+
return `❌ 里程碑 M${p.milestoneIndex ?? '?'} 被拒绝\n订单: ${p.orderId || body?.orderId || '?'}${desc}\n原因: ${p.rejectReason || '未说明'}`;
|
|
329
|
+
},
|
|
330
|
+
'order_settled': (p) => {
|
|
331
|
+
const amount = p.priceAmount ? `\n金额: $${p.priceAmount} USDC` : '';
|
|
332
|
+
return `💰 订单已结算完成\n订单: ${p.orderId || body?.orderId || '?'}${amount}\nUSDC 已支付`;
|
|
333
|
+
},
|
|
319
334
|
};
|
|
320
335
|
const tmpl = templates[eventType];
|
|
321
336
|
if (!tmpl) return;
|
package/package.json
CHANGED
|
@@ -162,6 +162,8 @@ cd ~/atel-workspace
|
|
|
162
162
|
atel order <executor-DID> general <金额> --desc "任务描述"
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
⚠️ **`--desc` 是必填的,必须把用户的完整任务需求传进去。** 执行方只能通过 `--desc` 了解任务内容。如果不传或传空,执行方不知道要做什么,订单会失败。把用户说的任务要求(主题、字数、格式、具体要求等)全部写进 `--desc`。
|
|
166
|
+
|
|
165
167
|
发单前确保钱包有 USDC(`atel balance` 查看)。
|
|
166
168
|
|
|
167
169
|
⚠️ 双链说明:
|