@wowok/agent-mcp 2.3.16 → 2.4.1

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 (136) hide show
  1. package/dist/customer/index.d.ts +9 -0
  2. package/dist/customer/index.js +9 -0
  3. package/dist/customer/industry-risks.d.ts +4 -0
  4. package/dist/customer/industry-risks.js +45 -31
  5. package/dist/customer/order-monitor.js +57 -57
  6. package/dist/customer/order-strategy.js +89 -89
  7. package/dist/customer/post-purchase.js +97 -97
  8. package/dist/customer/reminder-system.js +26 -26
  9. package/dist/customer/risk-assessment.js +46 -46
  10. package/dist/customer/types.d.ts +4 -4
  11. package/dist/customer/types.js +4 -4
  12. package/dist/customer/user-preferences.d.ts +3 -0
  13. package/dist/customer/user-preferences.js +59 -50
  14. package/dist/experience/intent-distill.js +6 -6
  15. package/dist/experience/realtime-feedback.js +17 -0
  16. package/dist/index.js +360 -273
  17. package/dist/knowledge/acquisition-flywheel.d.ts +3 -0
  18. package/dist/knowledge/acquisition-flywheel.js +73 -64
  19. package/dist/knowledge/arbitration-trust.js +10 -10
  20. package/dist/knowledge/demand-matching.js +8 -8
  21. package/dist/knowledge/dynamic-pricing.js +18 -18
  22. package/dist/knowledge/flywheel-loop.js +11 -11
  23. package/dist/knowledge/glossary.js +22 -22
  24. package/dist/knowledge/guard-ledger.d.ts +19 -0
  25. package/dist/knowledge/guard-ledger.js +246 -0
  26. package/dist/knowledge/guard-lint.d.ts +76 -0
  27. package/dist/knowledge/guard-lint.js +590 -0
  28. package/dist/knowledge/guard-puzzle.d.ts +188 -0
  29. package/dist/knowledge/guard-puzzle.js +804 -0
  30. package/dist/knowledge/guard-risk.d.ts +67 -0
  31. package/dist/knowledge/guard-risk.js +1046 -0
  32. package/dist/knowledge/guard-templates.d.ts +37 -0
  33. package/dist/knowledge/guard-templates.js +329 -0
  34. package/dist/knowledge/guard-translation.d.ts +58 -0
  35. package/dist/knowledge/guard-translation.js +1118 -0
  36. package/dist/knowledge/index.d.ts +17 -0
  37. package/dist/knowledge/index.js +17 -0
  38. package/dist/knowledge/industry-evolution.js +29 -29
  39. package/dist/knowledge/industry-generalizer.js +52 -52
  40. package/dist/knowledge/industry-registry.d.ts +1 -2
  41. package/dist/knowledge/industry-registry.js +43 -36
  42. package/dist/knowledge/intent-metrics.js +67 -67
  43. package/dist/knowledge/process-model.js +80 -80
  44. package/dist/knowledge/reputation-rules.js +9 -9
  45. package/dist/knowledge/reward-templates.js +51 -51
  46. package/dist/knowledge/safety-rules.js +63 -2
  47. package/dist/knowledge/tool-constraints.js +17 -11
  48. package/dist/knowledge/trust-metrics.js +26 -26
  49. package/dist/safety/confirm-gate.d.ts +4 -2
  50. package/dist/safety/confirm-gate.js +48 -4
  51. package/dist/schema/call/allocation.d.ts +24 -14
  52. package/dist/schema/call/arbitration.d.ts +142 -132
  53. package/dist/schema/call/base.d.ts +901 -43
  54. package/dist/schema/call/base.js +77 -13
  55. package/dist/schema/call/bridge-handler.js +15 -2
  56. package/dist/schema/call/bridge.d.ts +795 -27
  57. package/dist/schema/call/bridge.js +37 -0
  58. package/dist/schema/call/contact.d.ts +10 -0
  59. package/dist/schema/call/demand.d.ts +94 -84
  60. package/dist/schema/call/guard.d.ts +229 -46
  61. package/dist/schema/call/guard.js +50 -0
  62. package/dist/schema/call/handler.js +46 -14
  63. package/dist/schema/call/machine.d.ts +158 -138
  64. package/dist/schema/call/order.d.ts +10 -0
  65. package/dist/schema/call/payment.d.ts +10 -0
  66. package/dist/schema/call/permission.d.ts +314 -304
  67. package/dist/schema/call/personal.d.ts +10 -0
  68. package/dist/schema/call/progress.d.ts +10 -0
  69. package/dist/schema/call/proof.d.ts +20 -0
  70. package/dist/schema/call/repository.d.ts +32 -22
  71. package/dist/schema/call/reward.d.ts +10 -0
  72. package/dist/schema/call/semantic.d.ts +9 -2
  73. package/dist/schema/call/semantic.js +617 -25
  74. package/dist/schema/call/service.d.ts +20 -10
  75. package/dist/schema/call/treasury.d.ts +10 -0
  76. package/dist/schema/config/index.d.ts +18 -0
  77. package/dist/schema/config/index.js +17 -0
  78. package/dist/schema/index.d.ts +6 -0
  79. package/dist/schema/index.js +5 -0
  80. package/dist/schema/local/index.d.ts +9 -9
  81. package/dist/schema/local/index.js +9 -0
  82. package/dist/schema/local/wip.d.ts +39 -19
  83. package/dist/schema/local/wip.js +5 -5
  84. package/dist/schema/messenger/index.d.ts +376 -55
  85. package/dist/schema/messenger/index.js +19 -19
  86. package/dist/schema/operations.d.ts +1881 -681
  87. package/dist/schema/operations.js +91 -96
  88. package/dist/schema/project/index.d.ts +21 -0
  89. package/dist/schema/project/index.js +32 -0
  90. package/dist/schema/query/index.d.ts +1074 -168
  91. package/dist/schema/query/index.js +8 -8
  92. package/dist/schema/schema-query/index.d.ts +33 -0
  93. package/dist/schema/schema-query/index.js +36 -0
  94. package/dist/schema/schema-version.d.ts +25 -0
  95. package/dist/schema/schema-version.js +76 -0
  96. package/dist/schema/trust/index.d.ts +407 -0
  97. package/dist/schema/trust/index.js +113 -0
  98. package/dist/schema/utils/guard-parser.js +4 -4
  99. package/dist/schema/utils/node-parser.js +14 -14
  100. package/dist/schemas/bridge_operation.output.json +233 -9
  101. package/dist/schemas/bridge_operation.schema.json +67 -8
  102. package/dist/schemas/config_operation.output.json +18 -0
  103. package/dist/schemas/config_operation.schema.json +34 -0
  104. package/dist/schemas/guard-node-schema.json +82 -0
  105. package/dist/schemas/guard2file.schema.json +8 -0
  106. package/dist/schemas/index.json +19 -1
  107. package/dist/schemas/machineNode2file.schema.json +8 -0
  108. package/dist/schemas/messenger_operation.output.json +236 -10
  109. package/dist/schemas/onchain_events.output.json +718 -0
  110. package/dist/schemas/onchain_operations.output.json +286 -11
  111. package/dist/schemas/onchain_operations.schema.json +19 -16
  112. package/dist/schemas/onchain_operations_allocation.schema.json +8 -0
  113. package/dist/schemas/onchain_operations_arbitration.schema.json +8 -0
  114. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  115. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  116. package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -0
  117. package/dist/schemas/onchain_operations_guard.schema.json +11 -16
  118. package/dist/schemas/onchain_operations_machine.schema.json +8 -0
  119. package/dist/schemas/onchain_operations_order.schema.json +8 -0
  120. package/dist/schemas/onchain_operations_payment.schema.json +8 -0
  121. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  122. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  123. package/dist/schemas/onchain_operations_progress.schema.json +8 -0
  124. package/dist/schemas/onchain_operations_repository.schema.json +8 -0
  125. package/dist/schemas/onchain_operations_reward.schema.json +8 -0
  126. package/dist/schemas/onchain_operations_service.schema.json +8 -0
  127. package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
  128. package/dist/schemas/onchain_table_data.output.json +718 -0
  129. package/dist/schemas/project_operation.output.json +18 -0
  130. package/dist/schemas/project_operation.schema.json +42 -0
  131. package/dist/schemas/query_toolkit.schema.json +360 -368
  132. package/dist/schemas/schema_query.schema.json +6 -3
  133. package/dist/schemas/trust_score.output.json +327 -0
  134. package/dist/schemas/trust_score.schema.json +46 -0
  135. package/dist/schemas/wip_file.output.json +24 -1
  136. package/package.json +2 -2
@@ -5,7 +5,7 @@ export function riskLevelFromScore(score) {
5
5
  }
6
6
  export function riskLevelLabel(level) {
7
7
  const entry = RISK_LEVELS.find((l) => l.level === level);
8
- return entry ? `${entry.color} ${entry.label}` : "🔴 高风险";
8
+ return entry ? `${entry.color} ${entry.label}` : "🔴 High risk";
9
9
  }
10
10
  export function riskLevelEmoji(level) {
11
11
  const entry = RISK_LEVELS.find((l) => l.level === level);
@@ -18,47 +18,47 @@ function assessWorkflowRisk(puzzle) {
18
18
  checks.push({
19
19
  id: "wf_refund_path",
20
20
  dimension: "workflow",
21
- description: "存在退款路径(100%→Order Allocator",
21
+ description: "Refund path exists (100%→Order Allocator)",
22
22
  weight: 10,
23
23
  passed: hasRefund,
24
- advice: hasRefund ? undefined : "⚠️ 无退款路径:若交付失败,资金可能无法回收。建议下单前通过 Messenger 与商家协商退款条款并写入 WTS",
24
+ advice: hasRefund ? undefined : "⚠️ No refund path: if delivery fails, funds may not be recoverable. Recommend negotiating refund terms with the merchant via Messenger and writing them into the WTS before ordering.",
25
25
  });
26
26
  const hasArb = wf?.has_arbitration_path ?? false;
27
27
  checks.push({
28
28
  id: "wf_arbitration_path",
29
29
  dimension: "workflow",
30
- description: "存在仲裁路径",
30
+ description: "Arbitration path exists",
31
31
  weight: 10,
32
32
  passed: hasArb,
33
- advice: hasArb ? undefined : "⚠️ 无仲裁路径:纠纷无法升级到第三方仲裁。建议要求商家绑定 Arbitration 服务后再下单。",
33
+ advice: hasArb ? undefined : "⚠️ No arbitration path: disputes cannot be escalated to third-party arbitration. Recommend requiring the merchant to bind an Arbitration service before ordering.",
34
34
  });
35
35
  const userOps = wf?.user_operable_forwards ?? 0;
36
36
  checks.push({
37
37
  id: "wf_user_operable",
38
38
  dimension: "workflow",
39
- description: "至少 1 条用户可操作 Forward",
39
+ description: "At least 1 user-operable Forward",
40
40
  weight: 8,
41
41
  passed: userOps > 0,
42
- advice: userOps > 0 ? undefined : "🔴 流程中无任何用户可操作步骤:订单进度完全依赖商家,你将处于被动地位。",
42
+ advice: userOps > 0 ? undefined : "🔴 No user-operable steps in the workflow: order progress depends entirely on the merchant, leaving you in a passive position.",
43
43
  });
44
44
  const deadEnds = wf?.dead_end_nodes ?? [];
45
45
  const noDeadEnds = deadEnds.length === 0;
46
46
  checks.push({
47
47
  id: "wf_no_dead_ends",
48
48
  dimension: "workflow",
49
- description: "无潜在死端节点",
49
+ description: "No potential dead-end nodes",
50
50
  weight: 4,
51
51
  passed: noDeadEnds,
52
- advice: noDeadEnds ? undefined : `⚠️ 检测到 ${deadEnds.length} 个潜在死端节点:${deadEnds.join(", ")}。这些节点的所有出口都依赖商家操作。`,
52
+ advice: noDeadEnds ? undefined : `⚠️ Detected ${deadEnds.length} potential dead-end node(s): ${deadEnds.join(", ")}. All exits of these nodes depend on merchant action.`,
53
53
  });
54
54
  const machineUsable = wf ? (wf.machine_published && !wf.machine_paused) : false;
55
55
  checks.push({
56
56
  id: "wf_machine_usable",
57
57
  dimension: "workflow",
58
- description: "Machine 已发布且未暂停",
58
+ description: "Machine is published and not paused",
59
59
  weight: 3,
60
60
  passed: machineUsable,
61
- advice: machineUsable ? undefined : "⚠️ Machine 未发布或已暂停:流程可能尚未生效或被商家主动暂停。",
61
+ advice: machineUsable ? undefined : "⚠️ Machine is not published or is paused: the workflow may not be in effect or has been actively paused by the merchant.",
62
62
  });
63
63
  const score = checks.reduce((sum, c) => sum + (c.passed ? c.weight : 0), 0);
64
64
  return { name: "workflow", score, max_score: RISK_DIMENSION_MAX.workflow, checks };
@@ -74,11 +74,11 @@ function assessFundRisk(puzzle) {
74
74
  }
75
75
  else if (fund.compensation_ratio > 0) {
76
76
  compScore = Math.round(fund.compensation_ratio * 10);
77
- compAdvice = `⚠️ 赔偿金仅覆盖订单金额的 ${Math.round(fund.compensation_ratio * 100)}%,不足以全额赔付。`;
77
+ compAdvice = `⚠️ Compensation fund covers only ${Math.round(fund.compensation_ratio * 100)}% of the order amount; insufficient for a full payout.`;
78
78
  }
79
79
  else {
80
80
  compScore = 0;
81
- compAdvice = "🔴 无赔偿金:商家未设置 compensation_fund,订单失败时无自动赔付来源。";
81
+ compAdvice = "🔴 No compensation fund: the merchant has not set up a compensation_fund; no automatic payout source if the order fails.";
82
82
  }
83
83
  }
84
84
  else {
@@ -87,7 +87,7 @@ function assessFundRisk(puzzle) {
87
87
  checks.push({
88
88
  id: "fund_compensation",
89
89
  dimension: "fund",
90
- description: "赔偿金充足度(覆盖订单金额)",
90
+ description: "Compensation fund adequacy (covers the order amount)",
91
91
  weight: 10,
92
92
  passed: compScore >= 7,
93
93
  advice: compAdvice,
@@ -96,28 +96,28 @@ function assessFundRisk(puzzle) {
96
96
  checks.push({
97
97
  id: "fund_refund_allocator",
98
98
  dimension: "fund",
99
- description: "存在 100%→Order 退款 Allocator",
99
+ description: "100%→Order refund Allocator exists",
100
100
  weight: 8,
101
101
  passed: hasRefundAllocator,
102
- advice: hasRefundAllocator ? undefined : "⚠️ 未检测到 100%→Order Allocator:退款需要商家手动操作或通过仲裁裁定。",
102
+ advice: hasRefundAllocator ? undefined : "⚠️ No 100%→Order Allocator detected: refunds require manual merchant action or arbitration ruling.",
103
103
  });
104
104
  const priceOk = fund ? fund.price_anomaly === "none" : true;
105
105
  checks.push({
106
106
  id: "fund_price_normal",
107
107
  dimension: "fund",
108
- description: "价格无异常(与赔偿金和市场价比对)",
108
+ description: "No price anomaly (compared with compensation fund and market price)",
109
109
  weight: 4,
110
110
  passed: priceOk,
111
- advice: priceOk ? undefined : `⚠️ 价格异常(${fund?.price_anomaly}):可能存在欺诈定价或异常低价诱惑。`,
111
+ advice: priceOk ? undefined : `⚠️ Price anomaly (${fund?.price_anomaly}): possible fraudulent pricing or abnormally-low-price lure.`,
112
112
  });
113
113
  const lockSafe = fund?.lock_duration_safe ?? true;
114
114
  checks.push({
115
115
  id: "fund_lock_safe",
116
116
  dimension: "fund",
117
- description: "赔偿金锁定期合理(≥7天或无锁定)",
117
+ description: "Compensation fund lock period is reasonable (≥7 days or no lock)",
118
118
  weight: 3,
119
119
  passed: lockSafe,
120
- advice: lockSafe ? undefined : "⚠️ 赔偿金锁定期过短:商家可能随时撤回资金。",
120
+ advice: lockSafe ? undefined : "⚠️ Compensation fund lock period is too short: the merchant may withdraw funds at any time.",
121
121
  });
122
122
  const naiveScore = checks.reduce((sum, c) => sum + (c.passed ? c.weight : 0), 0);
123
123
  const score = fund && !fund.compensation_covers_order && fund.compensation_ratio > 0
@@ -132,10 +132,10 @@ function assessTrustRisk(puzzle) {
132
132
  checks.push({
133
133
  id: "trust_arb_independent",
134
134
  dimension: "trust",
135
- description: "仲裁方与商家无利益关联",
135
+ description: "Arbitrator has no conflict of interest with the merchant",
136
136
  weight: 6,
137
137
  passed: arbIndependent,
138
- advice: arbIndependent ? undefined : "🔴 仲裁方与商家为同一地址:仲裁公正性无法保证。",
138
+ advice: arbIndependent ? undefined : "🔴 Arbitrator and merchant are the same address: arbitration fairness cannot be guaranteed.",
139
139
  });
140
140
  let reviewPassed = false;
141
141
  let reviewAdvice;
@@ -146,11 +146,11 @@ function assessTrustRisk(puzzle) {
146
146
  }
147
147
  else if (likeRate >= 0.6) {
148
148
  reviewPassed = true;
149
- reviewAdvice = `⚠️ 好评率 ${Math.round(likeRate * 100)}%,存在一定争议。`;
149
+ reviewAdvice = `⚠️ Like rate is ${Math.round(likeRate * 100)}%; there is some controversy.`;
150
150
  }
151
151
  else {
152
152
  reviewPassed = false;
153
- reviewAdvice = `🔴 好评率仅 ${Math.round(likeRate * 100)}%(${trust.review_likes}/${trust.review_total}),差评较多。`;
153
+ reviewAdvice = `🔴 Like rate is only ${Math.round(likeRate * 100)}% (${trust.review_likes}/${trust.review_total}); many negative reviews.`;
154
154
  }
155
155
  }
156
156
  else if (trust) {
@@ -162,7 +162,7 @@ function assessTrustRisk(puzzle) {
162
162
  checks.push({
163
163
  id: "trust_review_reputation",
164
164
  dimension: "trust",
165
- description: "评价声誉良好(好评率 ≥60%)",
165
+ description: "Good review reputation (like rate ≥60%)",
166
166
  weight: 5,
167
167
  passed: reviewPassed,
168
168
  advice: reviewAdvice,
@@ -172,20 +172,20 @@ function assessTrustRisk(puzzle) {
172
172
  checks.push({
173
173
  id: "trust_score",
174
174
  dimension: "trust",
175
- description: `综合信任分 ≥50(当前 ${trustScore})`,
175
+ description: `Composite trust score ≥50 (current ${trustScore})`,
176
176
  weight: 4,
177
177
  passed: trustPassed,
178
- advice: trustPassed ? undefined : `🔴 综合信任分仅 ${trustScore}/100,建议寻找更高信任度的商家。`,
178
+ advice: trustPassed ? undefined : `🔴 Composite trust score is only ${trustScore}/100; recommend finding a more trustworthy merchant.`,
179
179
  });
180
180
  const hasContact = trust?.has_contact ?? false;
181
181
  const hasMessenger = trust?.has_messenger ?? false;
182
182
  checks.push({
183
183
  id: "trust_contact",
184
184
  dimension: "trust",
185
- description: "商家有可联系的 Messenger 通道",
185
+ description: "Merchant has a contactable Messenger channel",
186
186
  weight: 5,
187
187
  passed: hasContact && hasMessenger,
188
- advice: (hasContact && hasMessenger) ? undefined : "🔴 商家无可联系通道(um 为空):无法进行 pre-order 协商或售后沟通。",
188
+ advice: (hasContact && hasMessenger) ? undefined : "🔴 Merchant has no contactable channel (um is empty): no way to conduct pre-order negotiation or post-sale communication.",
189
189
  });
190
190
  const score = checks.reduce((sum, c) => sum + (c.passed ? c.weight : 0), 0);
191
191
  return { name: "trust", score, max_score: RISK_DIMENSION_MAX.trust, checks };
@@ -204,7 +204,7 @@ function assessBehaviorRisk(puzzle) {
204
204
  }
205
205
  else {
206
206
  trendPassed = false;
207
- trendAdvice = "🔴 商家近期争议率上升:履约质量可能在恶化。";
207
+ trendAdvice = "🔴 Merchant's recent dispute rate is rising: fulfillment quality may be deteriorating.";
208
208
  }
209
209
  }
210
210
  else {
@@ -213,7 +213,7 @@ function assessBehaviorRisk(puzzle) {
213
213
  checks.push({
214
214
  id: "behavior_trend",
215
215
  dimension: "behavior",
216
- description: "近期履约趋势稳定或改善",
216
+ description: "Recent fulfillment trend is stable or improving",
217
217
  weight: 6,
218
218
  passed: trendPassed,
219
219
  advice: trendAdvice,
@@ -222,37 +222,37 @@ function assessBehaviorRisk(puzzle) {
222
222
  checks.push({
223
223
  id: "behavior_completion_rate",
224
224
  dimension: "behavior",
225
- description: "订单完成率 ≥85%",
225
+ description: "Order completion rate ≥85%",
226
226
  weight: 4,
227
227
  passed: completionPassed,
228
- advice: completionPassed ? undefined : `🔴 完成率仅 ${Math.round((beh?.completed_rate ?? 0) * 100)}%:高于平均的订单以失败告终。`,
228
+ advice: completionPassed ? undefined : `🔴 Completion rate is only ${Math.round((beh?.completed_rate ?? 0) * 100)}%: a higher-than-average share of orders end in failure.`,
229
229
  });
230
230
  const disputeOk = beh ? beh.dispute_rate <= 0.1 : true;
231
231
  checks.push({
232
232
  id: "behavior_low_dispute",
233
233
  dimension: "behavior",
234
- description: "争议率 ≤10%",
234
+ description: "Dispute rate ≤10%",
235
235
  weight: 4,
236
236
  passed: disputeOk,
237
- advice: disputeOk ? undefined : `⚠️ 争议率 ${Math.round((beh?.dispute_rate ?? 0) * 100)}%:高于行业平均水平。`,
237
+ advice: disputeOk ? undefined : `⚠️ Dispute rate is ${Math.round((beh?.dispute_rate ?? 0) * 100)}%: above the industry average.`,
238
238
  });
239
239
  const arbLossOk = beh ? beh.arb_loss_rate <= 0.3 : true;
240
240
  checks.push({
241
241
  id: "behavior_arb_loss",
242
242
  dimension: "behavior",
243
- description: "仲裁败诉率 ≤30%",
243
+ description: "Arbitration loss rate ≤30%",
244
244
  weight: 3,
245
245
  passed: arbLossOk,
246
- advice: arbLossOk ? undefined : `🔴 仲裁败诉率 ${Math.round((beh?.arb_loss_rate ?? 0) * 100)}%:商家多次在仲裁中败诉,存在违规倾向。`,
246
+ advice: arbLossOk ? undefined : `🔴 Arbitration loss rate is ${Math.round((beh?.arb_loss_rate ?? 0) * 100)}%: the merchant has lost multiple arbitration cases, indicating a tendency to violate rules.`,
247
247
  });
248
248
  const noRedFlags = beh ? beh.red_flags.length === 0 : true;
249
249
  checks.push({
250
250
  id: "behavior_no_red_flags",
251
251
  dimension: "behavior",
252
- description: "无行为 red_flags",
252
+ description: "No behavior red_flags",
253
253
  weight: 3,
254
254
  passed: noRedFlags,
255
- advice: noRedFlags ? undefined : `⚠️ 检测到行为警示信号:${beh?.red_flags.join(", ")}`,
255
+ advice: noRedFlags ? undefined : `⚠️ Detected behavioral warning signals: ${beh?.red_flags.join(", ")}`,
256
256
  });
257
257
  const score = checks.reduce((sum, c) => sum + (c.passed ? c.weight : 0), 0);
258
258
  return { name: "behavior", score, max_score: RISK_DIMENSION_MAX.behavior, checks };
@@ -297,18 +297,18 @@ function generateAdvice(puzzle, total, level, dimensions) {
297
297
  const advice = [];
298
298
  const emoji = riskLevelEmoji(level);
299
299
  const levelEntry = RISK_LEVELS.find((l) => l.level === level);
300
- advice.push(`${emoji} 综合风险评分:${total}/100(${levelEntry?.label ?? "未知"})`);
300
+ advice.push(`${emoji} Composite risk score: ${total}/100 (${levelEntry?.label ?? "unknown"})`);
301
301
  if (level === "high") {
302
- advice.push("🚫 建议放弃此订单:风险水平过高,资金安全无法保证。");
302
+ advice.push("🚫 Recommend abandoning this order: the risk level is too high; fund safety cannot be guaranteed.");
303
303
  }
304
304
  else if (level === "medium_high") {
305
- advice.push("⚠️ 建议谨慎下单:务必通过 Messenger 协商补充条款,并要求生成 WTS 凭证。");
305
+ advice.push("⚠️ Recommend ordering with caution: be sure to negotiate supplementary terms via Messenger and request a WTS evidence file.");
306
306
  }
307
307
  else if (level === "medium_low") {
308
- advice.push("✅ 可以下单:建议持续关注订单进度,保留沟通记录。");
308
+ advice.push("✅ You may order: recommend continuously monitoring order progress and keeping communication records.");
309
309
  }
310
310
  else {
311
- advice.push("✅ 安全订单:可放心下单,仍建议启用订单监控提醒。");
311
+ advice.push("✅ Safe order: you can order with confidence; still recommend enabling order monitoring reminders.");
312
312
  }
313
313
  const sortedDims = [...dimensions].sort((a, b) => (a.score / a.max_score) - (b.score / b.max_score));
314
314
  for (const dim of sortedDims) {
@@ -316,7 +316,7 @@ function generateAdvice(puzzle, total, level, dimensions) {
316
316
  if (ratio < 0.5) {
317
317
  const failedChecks = dim.checks.filter((c) => !c.passed);
318
318
  if (failedChecks.length > 0) {
319
- advice.push(`📊 ${dim.name} 维度 ${dim.score}/${dim.max_score}:${failedChecks.length} 项未通过。`);
319
+ advice.push(`📊 ${dim.name} dimension ${dim.score}/${dim.max_score}: ${failedChecks.length} check(s) failed.`);
320
320
  const critical = failedChecks.find((c) => c.advice?.startsWith("🔴"));
321
321
  if (critical?.advice)
322
322
  advice.push(critical.advice);
@@ -324,7 +324,7 @@ function generateAdvice(puzzle, total, level, dimensions) {
324
324
  }
325
325
  }
326
326
  if (puzzle.completeness < 0.8) {
327
- advice.push(`ℹ️ 信息完整度仅 ${Math.round(puzzle.completeness * 100)}%,缺失:${puzzle.gaps.join(", ") || ""}。建议补充数据后再决策。`);
327
+ advice.push(`ℹ️ Information completeness is only ${Math.round(puzzle.completeness * 100)}%; missing: ${puzzle.gaps.join(", ") || "none"}. Recommend supplementing data before making a decision.`);
328
328
  }
329
329
  return advice;
330
330
  }
@@ -172,22 +172,22 @@ export declare const CUSTOMER_INTELLIGENCE_VERSION = 1;
172
172
  export declare const RISK_LEVELS: readonly [{
173
173
  readonly min: 85;
174
174
  readonly level: "low";
175
- readonly label: "低风险";
175
+ readonly label: "Low risk";
176
176
  readonly color: "🟢";
177
177
  }, {
178
178
  readonly min: 70;
179
179
  readonly level: "medium_low";
180
- readonly label: "中低风险";
180
+ readonly label: "Medium-low risk";
181
181
  readonly color: "🟡";
182
182
  }, {
183
183
  readonly min: 50;
184
184
  readonly level: "medium_high";
185
- readonly label: "中高风险";
185
+ readonly label: "Medium-high risk";
186
186
  readonly color: "🟠";
187
187
  }, {
188
188
  readonly min: 0;
189
189
  readonly level: "high";
190
- readonly label: "高风险";
190
+ readonly label: "High risk";
191
191
  readonly color: "🔴";
192
192
  }];
193
193
  export declare const RISK_DIMENSION_MAX: Record<RiskDimensionName, number>;
@@ -1,9 +1,9 @@
1
1
  export const CUSTOMER_INTELLIGENCE_VERSION = 1;
2
2
  export const RISK_LEVELS = [
3
- { min: 85, level: "low", label: "低风险", color: "🟢" },
4
- { min: 70, level: "medium_low", label: "中低风险", color: "🟡" },
5
- { min: 50, level: "medium_high", label: "中高风险", color: "🟠" },
6
- { min: 0, level: "high", label: "高风险", color: "🔴" },
3
+ { min: 85, level: "low", label: "Low risk", color: "🟢" },
4
+ { min: 70, level: "medium_low", label: "Medium-low risk", color: "🟡" },
5
+ { min: 50, level: "medium_high", label: "Medium-high risk", color: "🟠" },
6
+ { min: 0, level: "high", label: "High risk", color: "🔴" },
7
7
  ];
8
8
  export const RISK_DIMENSION_MAX = {
9
9
  workflow: 35,
@@ -12,6 +12,9 @@ export interface IndustryTemplate {
12
12
  after_sales_expectation: UserPreferences["after_sales_expectation"];
13
13
  }
14
14
  export declare function getDefaultPreferences(industry?: Industry): UserPreferences;
15
+ export declare function _setRegistryLookup(fn: ((industry: string) => {
16
+ preference_template?: IndustryTemplate;
17
+ } | undefined) | null): void;
15
18
  export declare function getIndustryTemplate(industry: Industry): IndustryTemplate;
16
19
  export interface OrderHistoryEntry {
17
20
  service_id: string;