@wowok/agent-mcp 2.3.18 → 2.4.3

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.
Files changed (121) hide show
  1. package/dist/customer/industry-risks.js +31 -31
  2. package/dist/customer/order-monitor.js +57 -57
  3. package/dist/customer/order-strategy.js +89 -89
  4. package/dist/customer/post-purchase.js +97 -97
  5. package/dist/customer/reminder-system.js +26 -26
  6. package/dist/customer/risk-assessment.js +46 -46
  7. package/dist/customer/types.d.ts +4 -4
  8. package/dist/customer/types.js +4 -4
  9. package/dist/customer/user-preferences.js +50 -50
  10. package/dist/experience/intent-distill.js +6 -6
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +11 -1624
  13. package/dist/knowledge/acquisition-flywheel.js +64 -64
  14. package/dist/knowledge/arbitration-trust.js +10 -10
  15. package/dist/knowledge/demand-matching.js +8 -8
  16. package/dist/knowledge/dynamic-pricing.js +18 -18
  17. package/dist/knowledge/flywheel-loop.js +11 -11
  18. package/dist/knowledge/glossary.js +22 -22
  19. package/dist/knowledge/guard-ledger.d.ts +1 -1
  20. package/dist/knowledge/guard-ledger.js +145 -104
  21. package/dist/knowledge/guard-lint.d.ts +77 -0
  22. package/dist/knowledge/guard-lint.js +670 -0
  23. package/dist/knowledge/guard-migration.d.ts +48 -0
  24. package/dist/knowledge/guard-migration.js +228 -0
  25. package/dist/knowledge/guard-puzzle.d.ts +109 -14
  26. package/dist/knowledge/guard-puzzle.js +627 -101
  27. package/dist/knowledge/guard-risk.d.ts +10 -1
  28. package/dist/knowledge/guard-risk.js +1634 -292
  29. package/dist/knowledge/guard-templates.d.ts +38 -0
  30. package/dist/knowledge/guard-templates.js +605 -0
  31. package/dist/knowledge/guard-translation.d.ts +14 -2
  32. package/dist/knowledge/guard-translation.js +825 -194
  33. package/dist/knowledge/index.d.ts +8 -4
  34. package/dist/knowledge/index.js +9 -5
  35. package/dist/knowledge/industry-evolution.js +29 -29
  36. package/dist/knowledge/industry-generalizer.js +52 -52
  37. package/dist/knowledge/industry-registry.js +20 -33
  38. package/dist/knowledge/intent-metrics.js +67 -67
  39. package/dist/knowledge/process-model.js +80 -80
  40. package/dist/knowledge/reputation-rules.js +9 -9
  41. package/dist/knowledge/reward-templates.js +51 -51
  42. package/dist/knowledge/safety-rules.js +3 -3
  43. package/dist/knowledge/tool-constraints.js +20 -4
  44. package/dist/knowledge/trust-metrics.js +26 -26
  45. package/dist/project/graph.d.ts +1 -0
  46. package/dist/project/graph.js +27 -1
  47. package/dist/project/index.d.ts +1 -0
  48. package/dist/project/index.js +39 -2
  49. package/dist/project/namespace.d.ts +11 -1
  50. package/dist/project/namespace.js +27 -2
  51. package/dist/project/query.d.ts +2 -0
  52. package/dist/project/query.js +56 -15
  53. package/dist/rules.d.ts +12 -0
  54. package/dist/rules.js +9 -0
  55. package/dist/schema/call/allocation.d.ts +10 -10
  56. package/dist/schema/call/base.js +19 -19
  57. package/dist/schema/call/bridge.d.ts +32 -32
  58. package/dist/schema/call/demand.d.ts +84 -84
  59. package/dist/schema/call/guard.d.ts +153 -0
  60. package/dist/schema/call/guard.js +50 -0
  61. package/dist/schema/call/machine.d.ts +38 -38
  62. package/dist/schema/call/permission.d.ts +78 -78
  63. package/dist/schema/call/repository.d.ts +22 -22
  64. package/dist/schema/call/semantic.js +229 -25
  65. package/dist/schema/call/service.d.ts +7 -7
  66. package/dist/schema/local/wip.d.ts +39 -19
  67. package/dist/schema/local/wip.js +5 -5
  68. package/dist/schema/messenger/index.d.ts +26 -26
  69. package/dist/schema/messenger/index.js +2 -2
  70. package/dist/schema/operations.d.ts +270 -192
  71. package/dist/schema/query/index.d.ts +184 -184
  72. package/dist/schema/query/index.js +15 -9
  73. package/dist/schema/trust/index.d.ts +4 -4
  74. package/dist/schema/utils/guard-parser.js +4 -4
  75. package/dist/schema/utils/guard-query-utils.d.ts +7 -0
  76. package/dist/schema/utils/guard-query-utils.js +14 -1
  77. package/dist/schema/utils/node-parser.js +14 -14
  78. package/dist/schemas/bridge_operation.output.json +15 -15
  79. package/dist/schemas/index.json +1 -1
  80. package/dist/schemas/messenger_operation.output.json +18 -16
  81. package/dist/schemas/onchain_events.output.json +15 -15
  82. package/dist/schemas/onchain_operations.output.json +16 -16
  83. package/dist/schemas/onchain_operations.schema.json +11 -20
  84. package/dist/schemas/onchain_operations_allocation.schema.json +7 -10
  85. package/dist/schemas/onchain_operations_machine.schema.json +2 -5
  86. package/dist/schemas/onchain_operations_service.schema.json +2 -5
  87. package/dist/schemas/onchain_table_data.output.json +20 -26
  88. package/dist/schemas/wip_file.output.json +24 -1
  89. package/dist/tools/handlers/bridge.d.ts +1 -0
  90. package/dist/tools/handlers/bridge.js +1 -0
  91. package/dist/tools/handlers/config.d.ts +2 -0
  92. package/dist/tools/handlers/config.js +71 -0
  93. package/dist/tools/handlers/file-export.d.ts +3 -0
  94. package/dist/tools/handlers/file-export.js +90 -0
  95. package/dist/tools/handlers/local.d.ts +30 -0
  96. package/dist/tools/handlers/local.js +27 -0
  97. package/dist/tools/handlers/messenger.d.ts +16 -0
  98. package/dist/tools/handlers/messenger.js +187 -0
  99. package/dist/tools/handlers/onchain.d.ts +2 -0
  100. package/dist/tools/handlers/onchain.js +246 -0
  101. package/dist/tools/handlers/project.d.ts +2 -0
  102. package/dist/tools/handlers/project.js +53 -0
  103. package/dist/tools/handlers/query.d.ts +5 -0
  104. package/dist/tools/handlers/query.js +256 -0
  105. package/dist/tools/handlers/schema-query.d.ts +2 -0
  106. package/dist/tools/handlers/schema-query.js +92 -0
  107. package/dist/tools/handlers/trust.d.ts +2 -0
  108. package/dist/tools/handlers/trust.js +194 -0
  109. package/dist/tools/handlers/wip.d.ts +2 -0
  110. package/dist/tools/handlers/wip.js +44 -0
  111. package/dist/tools/index.d.ts +13 -0
  112. package/dist/tools/index.js +479 -0
  113. package/dist/tools/rules-hook.d.ts +2 -0
  114. package/dist/tools/rules-hook.js +22 -0
  115. package/dist/tools/shared.d.ts +29 -0
  116. package/dist/tools/shared.js +130 -0
  117. package/dist/tools/types.d.ts +35 -0
  118. package/dist/tools/types.js +1 -0
  119. package/dist/tools/wrap.d.ts +6 -0
  120. package/dist/tools/wrap.js +55 -0
  121. package/package.json +19 -5
@@ -20,9 +20,9 @@ export function trackRefund(ctx) {
20
20
  id: "refund_complete",
21
21
  phase: "refund_tracking",
22
22
  priority: "info",
23
- title: "退款已完成",
24
- message: `✅ 订单 ${ctx.order_id} 退款已全额到账(${refunded} 最小单位)`,
25
- next_step: "可关闭售后跟踪,建议提交订单评价",
23
+ title: "Refund complete",
24
+ message: `✅ Order ${ctx.order_id} refund fully received (${refunded} smallest units)`,
25
+ next_step: "You can close post-purchase tracking; recommend submitting an order review",
26
26
  });
27
27
  return actions;
28
28
  }
@@ -32,9 +32,9 @@ export function trackRefund(ctx) {
32
32
  id: "refund_partial",
33
33
  phase: "refund_tracking",
34
34
  priority: "required",
35
- title: "退款不完整",
36
- message: `⚠️ 订单 ${ctx.order_id} 仅退款 ${refunded}/${orderAmount},差额 ${diff} 最小单位未到账`,
37
- next_step: "通过 Messenger 催促商家补足差额,或发起仲裁追回",
35
+ title: "Refund incomplete",
36
+ message: `⚠️ Order ${ctx.order_id} only refunded ${refunded}/${orderAmount}; the difference of ${diff} smallest units has not been received`,
37
+ next_step: "Urge the merchant via Messenger to make up the difference, or initiate arbitration to recover it",
38
38
  tool: "messenger_send",
39
39
  });
40
40
  return actions;
@@ -44,9 +44,9 @@ export function trackRefund(ctx) {
44
44
  id: "refund_waiting",
45
45
  phase: "refund_tracking",
46
46
  priority: "recommended",
47
- title: "等待商家退款",
48
- message: `⏳ 订单 ${ctx.order_id} 已申请退款,等待商家触发退款 Allocator`,
49
- next_step: " 48 小时内未到账,建议通过 Messenger 催促或发起仲裁",
47
+ title: "Waiting for merchant refund",
48
+ message: `⏳ Order ${ctx.order_id} refund has been requested; waiting for the merchant to trigger the refund Allocator`,
49
+ next_step: "If not received within 48 hours, recommend urging via Messenger or initiating arbitration",
50
50
  tool: "query_toolkit",
51
51
  });
52
52
  return actions;
@@ -57,9 +57,9 @@ export function trackRefund(ctx) {
57
57
  id: "refund_trigger_available",
58
58
  phase: "refund_tracking",
59
59
  priority: "recommended",
60
- title: "可通过 Allocator 触发退款",
61
- message: `ℹ️ 订单 ${ctx.order_id} 存在退款路径,可触发 refund Allocator 退款`,
62
- next_step: "通过 query_toolkit 查询 refund Allocator 触发条件并申请退款",
60
+ title: "Can trigger refund via Allocator",
61
+ message: `ℹ️ Order ${ctx.order_id} has a refund path; you can trigger the refund Allocator to refund`,
62
+ next_step: "Query the refund Allocator trigger conditions via query_toolkit and apply for a refund",
63
63
  tool: "query_toolkit",
64
64
  });
65
65
  return actions;
@@ -68,9 +68,9 @@ export function trackRefund(ctx) {
68
68
  id: "refund_no_path",
69
69
  phase: "refund_tracking",
70
70
  priority: "required",
71
- title: "无退款路径,需通过仲裁",
72
- message: `🔴 订单 ${ctx.order_id} 无退款 Allocator 路径,需通过仲裁追回资金`,
73
- next_step: "切换到 arbitration_support 阶段,发起仲裁申请",
71
+ title: "No refund path; arbitration required",
72
+ message: `🔴 Order ${ctx.order_id} has no refund Allocator path; funds must be recovered via arbitration`,
73
+ next_step: "Switch to the arbitration_support phase and submit an arbitration application",
74
74
  tool: "mark_arbitration",
75
75
  });
76
76
  return actions;
@@ -84,11 +84,11 @@ export function handleQualityIssue(ctx) {
84
84
  id: "quality_wip_mismatch",
85
85
  phase: "quality_issue",
86
86
  priority: "required",
87
- title: "检测到 WIP hash 不一致",
88
- message: `🔴 订单 ${ctx.order_id} WIP hash 与下单时不一致,可能存在交付物变更。\n` +
89
- ` 原始:${ctx.original_wip_hash}\n` +
90
- ` 当前:${ctx.wip_hash}`,
91
- next_step: "通过 query_toolkit 复核 WIP,并立即发起仲裁",
87
+ title: "WIP hash mismatch detected",
88
+ message: `🔴 Order ${ctx.order_id} WIP hash differs from the one at order time; the deliverable may have been changed.\n` +
89
+ ` Original: ${ctx.original_wip_hash}\n` +
90
+ ` Current: ${ctx.wip_hash}`,
91
+ next_step: "Re-verify the WIP via query_toolkit and initiate arbitration immediately",
92
92
  tool: "query_toolkit",
93
93
  });
94
94
  }
@@ -97,9 +97,9 @@ export function handleQualityIssue(ctx) {
97
97
  id: "quality_wip_missing",
98
98
  phase: "quality_issue",
99
99
  priority: "recommended",
100
- title: "要求商家提供 WIP hash 验证",
101
- message: `⚠️ 订单 ${ctx.order_id} 缺少当前 WIP hash,无法验证交付物完整性`,
102
- next_step: "通过 Messenger 索取最新 WIP hash 并与原始 hash 对比",
100
+ title: "Require merchant to provide WIP hash verification",
101
+ message: `⚠️ Order ${ctx.order_id} is missing the current WIP hash; deliverable integrity cannot be verified`,
102
+ next_step: "Request the latest WIP hash via Messenger and compare it with the original hash",
103
103
  tool: "messenger_send",
104
104
  });
105
105
  }
@@ -109,12 +109,12 @@ export function handleQualityIssue(ctx) {
109
109
  id: "quality_collect_evidence",
110
110
  phase: "quality_issue",
111
111
  priority: "recommended",
112
- title: "收集证据:截图、聊天记录、交付物样品",
113
- message: `📋 订单 ${ctx.order_id} 暂无证据收集记录。建议立即收集:\n` +
114
- ` • 交付物截图 / 录屏\n` +
115
- ` • Messenger 聊天记录(导出 WTS 凭证)\n` +
116
- ` • 交付物样品或测试结果`,
117
- next_step: "通过 messenger_mark_evidence 生成 WTS 证据文件",
112
+ title: "Collect evidence: screenshots, chat logs, deliverable samples",
113
+ message: `📋 Order ${ctx.order_id} has no evidence collected yet. Recommend collecting immediately:\n` +
114
+ ` • Deliverable screenshots / screen recordings\n` +
115
+ ` • Messenger chat logs (export WTS evidence)\n` +
116
+ ` • Deliverable samples or test results`,
117
+ next_step: "Generate a WTS evidence file via messenger_mark_evidence",
118
118
  tool: "messenger_mark_evidence",
119
119
  });
120
120
  }
@@ -123,10 +123,10 @@ export function handleQualityIssue(ctx) {
123
123
  id: "quality_supplement_evidence",
124
124
  phase: "quality_issue",
125
125
  priority: "recommended",
126
- title: `补充更多证据(当前 ${evidenceCount} 项,建议 ≥3 项)`,
127
- message: `⚠️ 订单 ${ctx.order_id} 已收集 ${evidenceCount} 项证据,建议补充至 3 项以上以增强仲裁胜算。\n` +
128
- ` 当前证据:${ctx.evidence?.join(" / ") ?? ""}`,
129
- next_step: "补充截图、聊天记录或第三方鉴定报告",
126
+ title: `Supplement more evidence (currently ${evidenceCount} item(s); recommend ≥3)`,
127
+ message: `⚠️ Order ${ctx.order_id} has collected ${evidenceCount} item(s) of evidence; recommend supplementing to at least 3 to strengthen the arbitration case.\n` +
128
+ ` Current evidence: ${ctx.evidence?.join(" / ") ?? "none"}`,
129
+ next_step: "Add screenshots, chat logs, or third-party appraisal reports",
130
130
  tool: "messenger_mark_evidence",
131
131
  });
132
132
  }
@@ -135,9 +135,9 @@ export function handleQualityIssue(ctx) {
135
135
  id: "quality_ok",
136
136
  phase: "quality_issue",
137
137
  priority: "info",
138
- title: "质量验证通过",
139
- message: `✅ 订单 ${ctx.order_id} WIP hash 与原始一致,证据齐全(${evidenceCount} 项)`,
140
- next_step: "可正常推进验收流程",
138
+ title: "Quality verification passed",
139
+ message: `✅ Order ${ctx.order_id} WIP hash matches the original, and evidence is complete (${evidenceCount} item(s))`,
140
+ next_step: "You can proceed with the acceptance workflow",
141
141
  });
142
142
  }
143
143
  return actions;
@@ -155,9 +155,9 @@ export function handleMerchantUnreachable(ctx) {
155
155
  id: "unreachable_arb_recommend",
156
156
  phase: "merchant_unreachable",
157
157
  priority: "required",
158
- title: "建议发起仲裁",
159
- message: `🔴 订单 ${ctx.order_id} 商家已失联 ${days} 天,资金可能冻结。建议立即发起仲裁。`,
160
- next_step: "切换到 arbitration_support 阶段,提交仲裁申请",
158
+ title: "Recommend initiating arbitration",
159
+ message: `🔴 Order ${ctx.order_id} merchant has been unreachable for ${days} days; funds may be frozen. Recommend initiating arbitration immediately.`,
160
+ next_step: "Switch to the arbitration_support phase and submit an arbitration application",
161
161
  tool: "mark_arbitration",
162
162
  });
163
163
  }
@@ -166,9 +166,9 @@ export function handleMerchantUnreachable(ctx) {
166
166
  id: "unreachable_no_arb",
167
167
  phase: "merchant_unreachable",
168
168
  priority: "required",
169
- title: "无仲裁通道,资金可能冻结,建议联系 WoWok 官方",
170
- message: `🔴 订单 ${ctx.order_id} 商家已失联 ${days} 天,且未配置仲裁通道,资金可能长期冻结。建议联系 WoWok 官方协助处理。`,
171
- next_step: "联系 WoWok 官方支持并提供订单与沟通记录",
169
+ title: "No arbitration channel; funds may be frozen; recommend contacting WoWok officials",
170
+ message: `🔴 Order ${ctx.order_id} merchant has been unreachable for ${days} days, and no arbitration channel is configured; funds may be frozen long-term. Recommend contacting WoWok officials for assistance.`,
171
+ next_step: "Contact WoWok official support and provide the order and communication records",
172
172
  });
173
173
  }
174
174
  return actions;
@@ -178,9 +178,9 @@ export function handleMerchantUnreachable(ctx) {
178
178
  id: "unreachable_urge",
179
179
  phase: "merchant_unreachable",
180
180
  priority: "recommended",
181
- title: "持续无响应,发送催促消息",
182
- message: `⚠️ 订单 ${ctx.order_id} 商家已 ${days} 天未回复,建议通过 Messenger 发送催促消息并保留记录`,
183
- next_step: " 3 天内仍无回复,发起仲裁",
181
+ title: "Persistent no response; send a follow-up message",
182
+ message: `⚠️ Order ${ctx.order_id} merchant has not replied for ${days} days; recommend sending a follow-up message via Messenger and keeping a record`,
183
+ next_step: "If there is still no reply within 3 days, initiate arbitration",
184
184
  tool: "messenger_send",
185
185
  });
186
186
  return actions;
@@ -189,9 +189,9 @@ export function handleMerchantUnreachable(ctx) {
189
189
  id: "unreachable_wait",
190
190
  phase: "merchant_unreachable",
191
191
  priority: "info",
192
- title: "商家可能忙碌,等待回复",
193
- message: `ℹ️ 订单 ${ctx.order_id} 商家 ${days === Infinity ? "尚未回复" : `已 ${days} 天未回复`},可能正在忙碌。建议再等待 1-2 天`,
194
- next_step: " 3 天后仍无回复,发送催促消息",
192
+ title: "Merchant may be busy; await reply",
193
+ message: `ℹ️ Order ${ctx.order_id} merchant ${days === Infinity ? "has not replied yet" : `has not replied for ${days} day(s)`}; may be busy. Recommend waiting another 1-2 days`,
194
+ next_step: "If there is still no reply after 3 days, send a follow-up message",
195
195
  });
196
196
  return actions;
197
197
  }
@@ -205,9 +205,9 @@ export function arbitrationSupport(ctx) {
205
205
  id: "arb_not_initiated",
206
206
  phase: "arbitration_support",
207
207
  priority: "required",
208
- title: "建议发起仲裁申请",
209
- message: `🔔 订单 ${ctx.order_id} 尚未发起仲裁。建议立即生成仲裁申请模板并提交。`,
210
- next_step: "调用 generateArbitrationTemplate 生成申请模板",
208
+ title: "Recommend initiating an arbitration application",
209
+ message: `🔔 Order ${ctx.order_id} has not initiated arbitration. Recommend generating an arbitration application template and submitting it immediately.`,
210
+ next_step: "Call generateArbitrationTemplate to generate the application template",
211
211
  tool: "mark_arbitration",
212
212
  });
213
213
  if (arbWindowDays > 0 && arbWindowDays <= 7) {
@@ -215,9 +215,9 @@ export function arbitrationSupport(ctx) {
215
215
  id: "arb_window_closing_soon",
216
216
  phase: "arbitration_support",
217
217
  priority: "required",
218
- title: `仲裁窗口将在 ${arbWindowDays} 天后关闭`,
219
- message: `⏰ 订单 ${ctx.order_id} 的仲裁申请窗口仅剩 ${arbWindowDays} 天,请尽快提交仲裁申请`,
220
- next_step: "立即提交仲裁申请",
218
+ title: `Arbitration window will close in ${arbWindowDays} day(s)`,
219
+ message: `⏰ Order ${ctx.order_id} arbitration application window has only ${arbWindowDays} day(s) left; please submit the arbitration application as soon as possible`,
220
+ next_step: "Submit the arbitration application immediately",
221
221
  deadline: ctx.now + arbWindowDays * 24 * 60 * 60 * 1000,
222
222
  });
223
223
  }
@@ -228,9 +228,9 @@ export function arbitrationSupport(ctx) {
228
228
  id: "arb_window_urgent",
229
229
  phase: "arbitration_support",
230
230
  priority: "required",
231
- title: "仲裁窗口即将关闭",
232
- message: `⏰ 订单 ${ctx.order_id} 的仲裁窗口仅剩 ${arbWindowDays} 天,请尽快补充证据并跟进投票进度`,
233
- next_step: "立即补充证据并查询仲裁进度",
231
+ title: "Arbitration window about to close",
232
+ message: `⏰ Order ${ctx.order_id} arbitration window has only ${arbWindowDays} day(s) left; please supplement evidence and follow up on voting progress as soon as possible`,
233
+ next_step: "Immediately supplement evidence and query arbitration progress",
234
234
  tool: "query_toolkit",
235
235
  deadline: ctx.now + arbWindowDays * 24 * 60 * 60 * 1000,
236
236
  });
@@ -240,12 +240,12 @@ export function arbitrationSupport(ctx) {
240
240
  id: "arb_no_evidence",
241
241
  phase: "arbitration_support",
242
242
  priority: "required",
243
- title: "补充证据",
244
- message: `📋 订单 ${ctx.order_id} 已发起仲裁但无证据记录。建议立即收集:\n` +
245
- ` • Messenger 聊天记录\n` +
246
- ` • WIP hash 对比记录\n` +
247
- ` • Progress 停滞截图`,
248
- next_step: "通过 messenger_mark_evidence 生成证据文件并提交",
243
+ title: "Supplement evidence",
244
+ message: `📋 Order ${ctx.order_id} arbitration has been initiated but no evidence is recorded. Recommend collecting immediately:\n` +
245
+ ` • Messenger chat logs\n` +
246
+ ` • WIP hash comparison records\n` +
247
+ ` • Progress stall screenshots`,
248
+ next_step: "Generate an evidence file via messenger_mark_evidence and submit it",
249
249
  tool: "messenger_mark_evidence",
250
250
  });
251
251
  }
@@ -254,10 +254,10 @@ export function arbitrationSupport(ctx) {
254
254
  id: "arb_supplement_evidence",
255
255
  phase: "arbitration_support",
256
256
  priority: "recommended",
257
- title: `补充更多证据以增强仲裁胜算(当前 ${evidenceCount} 项)`,
258
- message: `⚠️ 订单 ${ctx.order_id} 已提交 ${evidenceCount} 项证据,建议补充至 3 项以上。\n` +
259
- ` 当前证据:${ctx.evidence?.join(" / ") ?? ""}`,
260
- next_step: "补充第三方鉴定、聊天记录或交付物截图",
257
+ title: `Supplement more evidence to strengthen the arbitration case (currently ${evidenceCount} item(s))`,
258
+ message: `⚠️ Order ${ctx.order_id} has submitted ${evidenceCount} item(s) of evidence; recommend supplementing to at least 3.\n` +
259
+ ` Current evidence: ${ctx.evidence?.join(" / ") ?? "none"}`,
260
+ next_step: "Add third-party appraisals, chat logs, or deliverable screenshots",
261
261
  tool: "messenger_mark_evidence",
262
262
  });
263
263
  }
@@ -266,9 +266,9 @@ export function arbitrationSupport(ctx) {
266
266
  id: "arb_monitor_progress",
267
267
  phase: "arbitration_support",
268
268
  priority: "info",
269
- title: "仲裁进行中,持续监控投票进度",
270
- message: `📊 订单 ${ctx.order_id} 仲裁已发起,证据 ${evidenceCount} 项齐全。建议定期查询投票进度并准备补充证据。`,
271
- next_step: "通过 query_toolkit 查询仲裁投票状态",
269
+ title: "Arbitration in progress; continuously monitor voting progress",
270
+ message: `📊 Order ${ctx.order_id} arbitration has been initiated, with ${evidenceCount} item(s) of evidence complete. Recommend periodically querying voting progress and preparing supplemental evidence.`,
271
+ next_step: "Query arbitration voting status via query_toolkit",
272
272
  tool: "query_toolkit",
273
273
  });
274
274
  }
@@ -277,44 +277,44 @@ export function arbitrationSupport(ctx) {
277
277
  export function generateArbitrationTemplate(ctx) {
278
278
  const phaseLabel = phaseToLabel(ctx.phase);
279
279
  const evidenceCount = ctx.evidence?.length ?? 0;
280
- const title = `订单 ${ctx.order_id} 仲裁申请 — ${phaseLabel}`;
280
+ const title = `Order ${ctx.order_id} Arbitration Application — ${phaseLabel}`;
281
281
  const descriptionParts = [];
282
- descriptionParts.push(`订单 ID:${ctx.order_id}`);
283
- descriptionParts.push(`Service ID:${ctx.service_id}`);
284
- descriptionParts.push(`纠纷类型:${phaseLabel}`);
282
+ descriptionParts.push(`Order ID: ${ctx.order_id}`);
283
+ descriptionParts.push(`Service ID: ${ctx.service_id}`);
284
+ descriptionParts.push(`Dispute type: ${phaseLabel}`);
285
285
  switch (ctx.phase) {
286
286
  case "refund_tracking":
287
- descriptionParts.push(`纠纷概述:商家未按要求退款。订单金额 ${ctx.order_amount ?? "未知"} 最小单位,已退款 ${ctx.refunded_amount ?? 0n} 最小单位。`);
287
+ descriptionParts.push(`Dispute summary: The merchant did not refund as required. Order amount ${ctx.order_amount ?? "unknown"} smallest units, refunded ${ctx.refunded_amount ?? 0n} smallest units.`);
288
288
  break;
289
289
  case "quality_issue":
290
- descriptionParts.push(`纠纷概述:交付物质量存在问题。WIP hash 原始:${ctx.original_wip_hash ?? "未知"},当前:${ctx.wip_hash ?? "未知"}。`);
290
+ descriptionParts.push(`Dispute summary: The deliverable has quality issues. Original WIP hash: ${ctx.original_wip_hash ?? "unknown"}, current: ${ctx.wip_hash ?? "unknown"}.`);
291
291
  break;
292
292
  case "merchant_unreachable":
293
- descriptionParts.push(`纠纷概述:商家长期失联。最后回复时间:${ctx.last_merchant_reply_at ? new Date(ctx.last_merchant_reply_at).toISOString() : "未知"}。`);
293
+ descriptionParts.push(`Dispute summary: The merchant has been unreachable for a long time. Last reply time: ${ctx.last_merchant_reply_at ? new Date(ctx.last_merchant_reply_at).toISOString() : "unknown"}.`);
294
294
  break;
295
295
  case "arbitration_support":
296
- descriptionParts.push("纠纷概述:详见上述阶段记录。");
296
+ descriptionParts.push("Dispute summary: See the phase records above.");
297
297
  break;
298
298
  }
299
- descriptionParts.push(`已收集证据:${evidenceCount} 项`);
299
+ descriptionParts.push(`Evidence collected: ${evidenceCount} item(s)`);
300
300
  const description = descriptionParts.join("\n");
301
301
  const evidence_required = [
302
- "Messenger 沟通记录(导出 WTS 证据文件)",
303
- "订单创建与支付凭证",
304
- "Progress 节点推进记录",
302
+ "Messenger communication logs (export WTS evidence file)",
303
+ "Order creation and payment proof",
304
+ "Progress node advancement records",
305
305
  ];
306
306
  switch (ctx.phase) {
307
307
  case "quality_issue":
308
- evidence_required.push("WIP hash 对比记录(原始 vs 当前)");
309
- evidence_required.push("交付物截图或样品");
308
+ evidence_required.push("WIP hash comparison record (original vs current)");
309
+ evidence_required.push("Deliverable screenshots or samples");
310
310
  break;
311
311
  case "merchant_unreachable":
312
- evidence_required.push("失联时长记录(基于 last_merchant_reply_at");
313
- evidence_required.push("催促消息发送记录");
312
+ evidence_required.push("Unreachable duration record (based on last_merchant_reply_at)");
313
+ evidence_required.push("Follow-up message sending records");
314
314
  break;
315
315
  case "refund_tracking":
316
- evidence_required.push("退款申请记录");
317
- evidence_required.push("退款差额计算凭证");
316
+ evidence_required.push("Refund application record");
317
+ evidence_required.push("Refund difference calculation proof");
318
318
  break;
319
319
  }
320
320
  const claim = buildClaim(ctx);
@@ -322,10 +322,10 @@ export function generateArbitrationTemplate(ctx) {
322
322
  }
323
323
  function phaseToLabel(phase) {
324
324
  switch (phase) {
325
- case "refund_tracking": return "退款纠纷";
326
- case "quality_issue": return "质量问题";
327
- case "merchant_unreachable": return "商家失联";
328
- case "arbitration_support": return "仲裁支持";
325
+ case "refund_tracking": return "Refund dispute";
326
+ case "quality_issue": return "Quality issue";
327
+ case "merchant_unreachable": return "Merchant unreachable";
328
+ case "arbitration_support": return "Arbitration support";
329
329
  }
330
330
  }
331
331
  function buildClaim(ctx) {
@@ -335,16 +335,16 @@ function buildClaim(ctx) {
335
335
  const refunded = ctx.refunded_amount ?? 0n;
336
336
  const diff = orderAmount - refunded;
337
337
  if (refunded === 0n) {
338
- return `请求仲裁商家全额退款(${orderAmount} 最小单位)。`;
338
+ return `Request the arbitrator to order a full refund (${orderAmount} smallest units).`;
339
339
  }
340
- return `请求仲裁商家补足退款差额(${diff} 最小单位)。`;
340
+ return `Request the arbitrator to order the merchant to make up the refund difference (${diff} smallest units).`;
341
341
  }
342
342
  case "quality_issue":
343
- return "请求仲裁商家重新交付符合约定的交付物,或全额退款。";
343
+ return "Request the arbitrator to order the merchant to redeliver a deliverable that meets the agreement, or to fully refund.";
344
344
  case "merchant_unreachable":
345
- return "请求仲裁商家履行订单义务或退还全部款项,并赔偿因失联造成的损失。";
345
+ return "Request the arbitrator to order the merchant to fulfill the order obligations or refund all payments, and to compensate for losses caused by being unreachable.";
346
346
  case "arbitration_support":
347
- return "请求仲裁支持本方诉求,依据所附证据判定商家违约并赔偿。";
347
+ return "Request the arbitrator to support this party's claim, and based on the attached evidence, rule that the merchant breached the contract and order compensation.";
348
348
  }
349
349
  }
350
350
  export { CUSTOMER_INTELLIGENCE_VERSION };
@@ -14,11 +14,11 @@ const REMINDER_RULES = [
14
14
  priority: "recommended",
15
15
  message: (ctx) => {
16
16
  if (!ctx.avg_market_price || !ctx.service_price || ctx.avg_market_price === 0n) {
17
- return "⚠️ 价格异常低,请警惕质量风险";
17
+ return "⚠️ Price is abnormally low, beware of quality risk";
18
18
  }
19
19
  const ratio = Number(ctx.service_price * 100n / ctx.avg_market_price) / 100;
20
20
  const below = Math.round((1 - ratio) * 100);
21
- return `⚠️ 价格低于同类均价 ${below}%,请警惕质量风险`;
21
+ return `⚠️ Price is ${below}% below the average for similar services, beware of quality risk`;
22
22
  },
23
23
  applies: (ctx) => {
24
24
  if (!ctx.avg_market_price || !ctx.service_price)
@@ -34,7 +34,7 @@ const REMINDER_RULES = [
34
34
  id: "browse_no_arbitration",
35
35
  stage: "browse",
36
36
  priority: "recommended",
37
- message: "⚠️ Service 未配置仲裁,纠纷无解决通道",
37
+ message: "⚠️ This Service has no arbitration configured; disputes have no resolution channel",
38
38
  applies: (ctx) => ctx.has_arbitration === false,
39
39
  dedup_key: "no_arbitration",
40
40
  },
@@ -42,7 +42,7 @@ const REMINDER_RULES = [
42
42
  id: "browse_no_compensation",
43
43
  stage: "browse",
44
44
  priority: "recommended",
45
- message: "⚠️ Service 无赔偿金,订单失败时无自动赔付来源",
45
+ message: "⚠️ This Service has no compensation fund; no automatic payout source if the order fails",
46
46
  applies: (ctx) => ctx.has_compensation === false,
47
47
  dedup_key: "no_compensation",
48
48
  },
@@ -66,7 +66,7 @@ const REMINDER_RULES = [
66
66
  id: "evaluate_medium_high_risk",
67
67
  stage: "evaluate",
68
68
  priority: "recommended",
69
- message: (ctx) => `🟠 综合风险分 ${ctx.risk_score}/100,谨慎购买,需重点关注 2-3 项风险`,
69
+ message: (ctx) => `🟠 Composite risk score ${ctx.risk_score}/100, purchase with caution and focus on 2-3 key risks`,
70
70
  applies: (ctx) => (ctx.risk_level ?? "low") === "medium_high",
71
71
  dedup_key: "medium_high_risk",
72
72
  },
@@ -74,7 +74,7 @@ const REMINDER_RULES = [
74
74
  id: "evaluate_ambiguous_guard",
75
75
  stage: "evaluate",
76
76
  priority: "required",
77
- message: (ctx) => `🔴 检测到 ${ctx.ambiguous_guards?.length ?? 0} 个模糊 Guard,必须人工审查后才能继续:${ctx.ambiguous_guards?.join(", ") ?? ""}`,
77
+ message: (ctx) => `🔴 Detected ${ctx.ambiguous_guards?.length ?? 0} ambiguous Guard(s); manual review is required before proceeding: ${ctx.ambiguous_guards?.join(", ") ?? ""}`,
78
78
  applies: (ctx) => (ctx.ambiguous_guards?.length ?? 0) > 0,
79
79
  dedup_key: "ambiguous_guard",
80
80
  },
@@ -82,7 +82,7 @@ const REMINDER_RULES = [
82
82
  id: "evaluate_no_refund_path",
83
83
  stage: "evaluate",
84
84
  priority: "recommended",
85
- message: "⚠️ 无退款路径:若交付失败,资金可能无法回收。建议 Messenger 协商退款条款",
85
+ message: "⚠️ No refund path: if delivery fails, funds may be unrecoverable. Recommend negotiating refund terms via Messenger",
86
86
  applies: (ctx) => ctx.has_refund_path === false,
87
87
  dedup_key: "no_refund_path",
88
88
  },
@@ -90,7 +90,7 @@ const REMINDER_RULES = [
90
90
  id: "evaluate_no_user_operable",
91
91
  stage: "evaluate",
92
92
  priority: "required",
93
- message: "🔴 流程中无任何用户可操作步骤:订单进度完全依赖商家",
93
+ message: "🔴 No user-operable steps in the workflow: order progress depends entirely on the merchant",
94
94
  applies: (ctx) => ctx.has_user_operable === false,
95
95
  dedup_key: "no_user_operable",
96
96
  },
@@ -108,7 +108,7 @@ const REMINDER_RULES = [
108
108
  id: "preorder_payment_confirm",
109
109
  stage: "preorder",
110
110
  priority: "required",
111
- message: (ctx) => `🔔 即将支付 ${ctx.service_price} 最小单位到托管账户,请确认`,
111
+ message: (ctx) => `🔔 About to pay ${ctx.service_price} smallest units to the escrow account, please confirm`,
112
112
  applies: (ctx) => ctx.service_price !== undefined,
113
113
  dedup_key: "payment_confirm",
114
114
  },
@@ -124,7 +124,7 @@ const REMINDER_RULES = [
124
124
  id: "preorder_user_require_arb_missing",
125
125
  stage: "preorder",
126
126
  priority: "required",
127
- message: "🔴 您的偏好要求必备仲裁,但该 Service 未配置",
127
+ message: "🔴 Your preferences require arbitration, but this Service does not have it configured",
128
128
  applies: (ctx) => ctx.user_require_arbitration === true && ctx.has_arbitration === false,
129
129
  dedup_key: "user_require_arb_missing",
130
130
  },
@@ -132,7 +132,7 @@ const REMINDER_RULES = [
132
132
  id: "preorder_user_require_comp_missing",
133
133
  stage: "preorder",
134
134
  priority: "required",
135
- message: "🔴 您的偏好要求必备赔偿金,但该 Service ",
135
+ message: "🔴 Your preferences require a compensation fund, but this Service has none",
136
136
  applies: (ctx) => ctx.user_require_compensation === true && ctx.has_compensation === false,
137
137
  dedup_key: "user_require_comp_missing",
138
138
  },
@@ -140,7 +140,7 @@ const REMINDER_RULES = [
140
140
  id: "preorder_no_messenger",
141
141
  stage: "preorder",
142
142
  priority: "recommended",
143
- message: "⚠️ 商家无 Messenger 通道,下单后无法协商或售后",
143
+ message: "⚠️ Merchant has no Messenger channel; no way to negotiate or get post-sale support after ordering",
144
144
  applies: (ctx) => ctx.has_messenger === false,
145
145
  dedup_key: "no_messenger",
146
146
  },
@@ -148,7 +148,7 @@ const REMINDER_RULES = [
148
148
  id: "in_progress_progress_stalled",
149
149
  stage: "in_progress",
150
150
  priority: "recommended",
151
- message: (ctx) => `⚠️ 订单已停留在节点 ${ctx.current_node} 超过 ${ctx.hours_since_last_progress} 小时,建议联系商家`,
151
+ message: (ctx) => `⚠️ Order has been stuck at node ${ctx.current_node} for over ${ctx.hours_since_last_progress} hours, suggest contacting the merchant`,
152
152
  applies: (ctx) => {
153
153
  const stallHours = ctx.hours_since_last_progress ?? 0;
154
154
  const expected = ctx.expected_progress_hours ?? 24;
@@ -160,7 +160,7 @@ const REMINDER_RULES = [
160
160
  id: "in_progress_compensation_drop",
161
161
  stage: "in_progress",
162
162
  priority: "recommended",
163
- message: "⚠️ 商家赔偿金余额下降 30%,请注意",
163
+ message: "⚠️ Merchant compensation fund balance dropped 30%, please note",
164
164
  applies: () => false,
165
165
  dedup_key: "compensation_drop",
166
166
  },
@@ -168,7 +168,7 @@ const REMINDER_RULES = [
168
168
  id: "in_progress_user_action_required",
169
169
  stage: "in_progress",
170
170
  priority: "reminder",
171
- message: (ctx) => `🔔 订单推进到节点 ${ctx.current_node},需要您操作`,
171
+ message: (ctx) => `🔔 Order advanced to node ${ctx.current_node}, your action is required`,
172
172
  applies: (ctx) => ctx.current_node !== undefined && ctx.current_node !== "",
173
173
  dedup_key: "user_action_required",
174
174
  },
@@ -176,7 +176,7 @@ const REMINDER_RULES = [
176
176
  id: "in_progress_messenger_unanswered",
177
177
  stage: "in_progress",
178
178
  priority: "recommended",
179
- message: (ctx) => `⚠️ 商家已 ${ctx.hours_since_messenger_reply} 小时未回复 Messenger,可考虑发起仲裁`,
179
+ message: (ctx) => `⚠️ Merchant has not replied on Messenger for ${ctx.hours_since_messenger_reply} hours; consider initiating arbitration`,
180
180
  applies: (ctx) => (ctx.hours_since_messenger_reply ?? 0) > 24,
181
181
  dedup_key: "messenger_unanswered",
182
182
  },
@@ -184,7 +184,7 @@ const REMINDER_RULES = [
184
184
  id: "complete_review_reminder",
185
185
  stage: "complete",
186
186
  priority: "info",
187
- message: "💡 订单已完成,是否要提交评价?",
187
+ message: "💡 Order completed, would you like to submit a review?",
188
188
  applies: () => true,
189
189
  dedup_key: "review_reminder",
190
190
  },
@@ -192,7 +192,7 @@ const REMINDER_RULES = [
192
192
  id: "complete_review_window",
193
193
  stage: "complete",
194
194
  priority: "reminder",
195
- message: (ctx) => `⏰ 评价窗口将在 ${ctx.review_window_days} 天后关闭`,
195
+ message: (ctx) => `⏰ The review window will close in ${ctx.review_window_days} days`,
196
196
  applies: (ctx) => (ctx.review_window_days ?? 0) > 0,
197
197
  dedup_key: "review_window",
198
198
  },
@@ -200,7 +200,7 @@ const REMINDER_RULES = [
200
200
  id: "after_sale_arb_window",
201
201
  stage: "after_sale",
202
202
  priority: "reminder",
203
- message: (ctx) => `⏰ 仲裁申请窗口将在 ${ctx.arb_window_days} 天后关闭`,
203
+ message: (ctx) => `⏰ The arbitration application window will close in ${ctx.arb_window_days} day(s)`,
204
204
  applies: (ctx) => (ctx.arb_window_days ?? 0) > 0,
205
205
  dedup_key: "arb_window",
206
206
  },
@@ -208,7 +208,7 @@ const REMINDER_RULES = [
208
208
  id: "after_sale_refund_received",
209
209
  stage: "after_sale",
210
210
  priority: "info",
211
- message: "✅ 退款已到账",
211
+ message: "✅ Refund received",
212
212
  applies: () => false,
213
213
  dedup_key: "refund_received",
214
214
  },
@@ -273,21 +273,21 @@ export function getBlockingReminders(reminders) {
273
273
  }
274
274
  export function summarizeReminders(reminders) {
275
275
  if (reminders.length === 0)
276
- return "无提醒";
276
+ return "No reminders";
277
277
  const required = reminders.filter((r) => r.priority === "required");
278
278
  const recommended = reminders.filter((r) => r.priority === "recommended");
279
279
  const info = reminders.filter((r) => r.priority === "info");
280
280
  const reminderOnly = reminders.filter((r) => r.priority === "reminder");
281
281
  const parts = [];
282
282
  if (required.length)
283
- parts.push(`🔴 必读 ${required.length} 条`);
283
+ parts.push(`🔴 Must-read: ${required.length}`);
284
284
  if (recommended.length)
285
- parts.push(`⚠️ 建议 ${recommended.length} 条`);
285
+ parts.push(`⚠️ Recommended: ${recommended.length}`);
286
286
  if (info.length)
287
- parts.push(`💡 提示 ${info.length} 条`);
287
+ parts.push(`💡 Info: ${info.length}`);
288
288
  if (reminderOnly.length)
289
- parts.push(`🔔 提醒 ${reminderOnly.length} 条`);
290
- return parts.join("");
289
+ parts.push(`🔔 Reminder: ${reminderOnly.length}`);
290
+ return parts.join(", ");
291
291
  }
292
292
  export function topReminders(reminders, n = 5) {
293
293
  return sortAndCapReminders(reminders).slice(0, n);