@wowok/agent-mcp 2.3.18 → 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 (65) 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/knowledge/acquisition-flywheel.js +64 -64
  12. package/dist/knowledge/arbitration-trust.js +10 -10
  13. package/dist/knowledge/demand-matching.js +8 -8
  14. package/dist/knowledge/dynamic-pricing.js +18 -18
  15. package/dist/knowledge/flywheel-loop.js +11 -11
  16. package/dist/knowledge/glossary.js +22 -22
  17. package/dist/knowledge/guard-ledger.d.ts +1 -1
  18. package/dist/knowledge/guard-ledger.js +131 -104
  19. package/dist/knowledge/guard-lint.d.ts +76 -0
  20. package/dist/knowledge/guard-lint.js +590 -0
  21. package/dist/knowledge/guard-puzzle.d.ts +109 -14
  22. package/dist/knowledge/guard-puzzle.js +627 -101
  23. package/dist/knowledge/guard-risk.d.ts +8 -1
  24. package/dist/knowledge/guard-risk.js +868 -296
  25. package/dist/knowledge/guard-templates.d.ts +37 -0
  26. package/dist/knowledge/guard-templates.js +329 -0
  27. package/dist/knowledge/guard-translation.d.ts +14 -2
  28. package/dist/knowledge/guard-translation.js +825 -194
  29. package/dist/knowledge/index.d.ts +8 -4
  30. package/dist/knowledge/index.js +9 -5
  31. package/dist/knowledge/industry-evolution.js +29 -29
  32. package/dist/knowledge/industry-generalizer.js +52 -52
  33. package/dist/knowledge/industry-registry.js +20 -33
  34. package/dist/knowledge/intent-metrics.js +67 -67
  35. package/dist/knowledge/process-model.js +80 -80
  36. package/dist/knowledge/reputation-rules.js +9 -9
  37. package/dist/knowledge/reward-templates.js +51 -51
  38. package/dist/knowledge/safety-rules.js +3 -3
  39. package/dist/knowledge/tool-constraints.js +20 -4
  40. package/dist/knowledge/trust-metrics.js +26 -26
  41. package/dist/schema/call/base.js +16 -16
  42. package/dist/schema/call/bridge.d.ts +32 -32
  43. package/dist/schema/call/demand.d.ts +84 -84
  44. package/dist/schema/call/guard.d.ts +153 -0
  45. package/dist/schema/call/guard.js +50 -0
  46. package/dist/schema/call/permission.d.ts +78 -78
  47. package/dist/schema/call/repository.d.ts +22 -22
  48. package/dist/schema/call/semantic.js +228 -24
  49. package/dist/schema/local/wip.d.ts +39 -19
  50. package/dist/schema/local/wip.js +5 -5
  51. package/dist/schema/messenger/index.d.ts +26 -26
  52. package/dist/schema/messenger/index.js +2 -2
  53. package/dist/schema/operations.d.ts +222 -144
  54. package/dist/schema/query/index.d.ts +38 -38
  55. package/dist/schema/trust/index.d.ts +4 -4
  56. package/dist/schema/utils/guard-parser.js +4 -4
  57. package/dist/schema/utils/node-parser.js +14 -14
  58. package/dist/schemas/bridge_operation.output.json +14 -14
  59. package/dist/schemas/index.json +1 -1
  60. package/dist/schemas/messenger_operation.output.json +17 -15
  61. package/dist/schemas/onchain_events.output.json +14 -14
  62. package/dist/schemas/onchain_operations.output.json +14 -14
  63. package/dist/schemas/onchain_table_data.output.json +14 -14
  64. package/dist/schemas/wip_file.output.json +24 -1
  65. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { INDUSTRY_EVOLUTION_THRESHOLDS } from "./industry-evolution.js";
2
2
  export const BUILTIN_INTENT_SPECS = {
3
3
  default: {
4
4
  intent: "default",
5
- display_name: "默认(Phase 4 原始模型)",
5
+ display_name: "Default (Phase 4 original model)",
6
6
  weights: {
7
7
  completed_rate: 35,
8
8
  dispute_rate: 25,
@@ -22,7 +22,7 @@ export const BUILTIN_INTENT_SPECS = {
22
22
  },
23
23
  growth: {
24
24
  intent: "growth",
25
- display_name: "增长(关注新客、复购、订单增速)",
25
+ display_name: "Growth (focus on new customers, repurchase, order-volume growth)",
26
26
  weights: {
27
27
  repeat_buyer_rate: 35,
28
28
  completed_rate: 25,
@@ -43,8 +43,8 @@ export const BUILTIN_INTENT_SPECS = {
43
43
  threshold: 0.3,
44
44
  suggestion_type: "update_flywheel",
45
45
  field: "flywheel.rewardStrategy",
46
- suggested_value: "强化忠诚度 Reward + 阶梯复购奖励 + 推荐返现",
47
- evidence_template: "增长意图下复购率 {value}% ≥ {threshold}%,建议强化忠诚度飞轮",
46
+ suggested_value: "Strengthen loyalty Reward + tiered repurchase reward + referral cashback",
47
+ evidence_template: "Under growth intent, repurchase rate {value}% ≥ {threshold}%; recommend strengthening the loyalty flywheel",
48
48
  confidence: 0.85,
49
49
  priority: "high",
50
50
  target_roles: ["merchant"],
@@ -55,8 +55,8 @@ export const BUILTIN_INTENT_SPECS = {
55
55
  threshold: 0.15,
56
56
  suggestion_type: "update_flywheel",
57
57
  field: "flywheel.rewardStrategy",
58
- suggested_value: "首单奖励 + 7 日内复购折扣 + 推荐返现",
59
- evidence_template: "增长意图下复购率 {value}% < {threshold}%,建议加强首单激励",
58
+ suggested_value: "First-order reward + 7-day repurchase discount + referral cashback",
59
+ evidence_template: "Under growth intent, repurchase rate {value}% < {threshold}%; recommend strengthening first-order incentives",
60
60
  confidence: 0.75,
61
61
  priority: "medium",
62
62
  target_roles: ["merchant"],
@@ -64,14 +64,14 @@ export const BUILTIN_INTENT_SPECS = {
64
64
  ],
65
65
  level_thresholds: { thriving: 80, healthy: 60, stressed: 40 },
66
66
  role_advice_routing: {
67
- user: ["关注复购 Reward 与推荐返现"],
68
- merchant: ["强化忠诚度飞轮", "优化首单转化", "加大 Reward 投入"],
67
+ user: ["Focus on repurchase Reward and referral cashback"],
68
+ merchant: ["Strengthen the loyalty flywheel", "Optimize first-order conversion", "Increase Reward investment"],
69
69
  arbitrator: [],
70
70
  },
71
71
  },
72
72
  retention: {
73
73
  intent: "retention",
74
- display_name: "留存(关注复购、争议、退款)",
74
+ display_name: "Retention (focus on repurchase, disputes, refunds)",
75
75
  weights: {
76
76
  repeat_buyer_rate: 30,
77
77
  dispute_rate: 30,
@@ -94,10 +94,10 @@ export const BUILTIN_INTENT_SPECS = {
94
94
  field: "risk_checks",
95
95
  suggested_value: {
96
96
  id: "retention_dispute_check",
97
- description: "留存意图:争议率高,建议强制仲裁 + 赔偿金",
97
+ description: "Retention intent: high dispute rate; recommend mandatory arbitration + compensation fund",
98
98
  weight: 35,
99
99
  },
100
- evidence_template: "留存意图下争议率 {value}% > {threshold}%,建议加强纠纷解决通道",
100
+ evidence_template: "Under retention intent, dispute rate {value}% > {threshold}%; recommend strengthening dispute-resolution channels",
101
101
  confidence: 0.85,
102
102
  priority: "high",
103
103
  target_roles: ["merchant", "arbitrator"],
@@ -109,7 +109,7 @@ export const BUILTIN_INTENT_SPECS = {
109
109
  suggestion_type: "adjust_preference",
110
110
  field: "preference_template.require_arbitration",
111
111
  suggested_value: true,
112
- evidence_template: "留存意图下退款率 {value}% > {threshold}%,建议强制仲裁",
112
+ evidence_template: "Under retention intent, refund rate {value}% > {threshold}%; recommend mandatory arbitration",
113
113
  confidence: 0.8,
114
114
  priority: "high",
115
115
  target_roles: ["user", "merchant"],
@@ -117,14 +117,14 @@ export const BUILTIN_INTENT_SPECS = {
117
117
  ],
118
118
  level_thresholds: { thriving: 80, healthy: 60, stressed: 45 },
119
119
  role_advice_routing: {
120
- user: ["优先选择有仲裁的商家", "关注退款政策"],
121
- merchant: ["降低争议率", "优化退款流程", "加强交付质量"],
122
- arbitrator: ["关注高争议行业", "主动提供纠纷解决通道"],
120
+ user: ["Prefer merchants with arbitration", "Pay attention to refund policy"],
121
+ merchant: ["Reduce dispute rate", "Optimize refund process", "Strengthen delivery quality"],
122
+ arbitrator: ["Watch high-dispute industries", "Proactively provide dispute-resolution channels"],
123
123
  },
124
124
  },
125
125
  compliance: {
126
126
  intent: "compliance",
127
- display_name: "合规(关注仲裁、赔偿金、监管)",
127
+ display_name: "Compliance (focus on arbitration, compensation fund, regulation)",
128
128
  weights: {
129
129
  arbitration_coverage: 35,
130
130
  compensation_coverage: 30,
@@ -147,7 +147,7 @@ export const BUILTIN_INTENT_SPECS = {
147
147
  suggestion_type: "adjust_preference",
148
148
  field: "preference_template.require_arbitration",
149
149
  suggested_value: true,
150
- evidence_template: "合规意图下仲裁覆盖率 {value}% < 100%,建议强制配置仲裁",
150
+ evidence_template: "Under compliance intent, arbitration coverage {value}% < 100%; recommend mandatory arbitration configuration",
151
151
  confidence: 0.95,
152
152
  priority: "high",
153
153
  target_roles: ["merchant", "arbitrator"],
@@ -160,10 +160,10 @@ export const BUILTIN_INTENT_SPECS = {
160
160
  field: "risk_checks",
161
161
  suggested_value: {
162
162
  id: "compliance_compensation_check",
163
- description: "合规意图:赔偿金覆盖率不足",
163
+ description: "Compliance intent: compensation fund coverage insufficient",
164
164
  weight: 40,
165
165
  },
166
- evidence_template: "合规意图下赔偿金覆盖率 {value}% < {threshold}%,建议增加赔偿金",
166
+ evidence_template: "Under compliance intent, compensation fund coverage {value}% < {threshold}%; recommend increasing the compensation fund",
167
167
  confidence: 0.9,
168
168
  priority: "high",
169
169
  target_roles: ["merchant"],
@@ -171,14 +171,14 @@ export const BUILTIN_INTENT_SPECS = {
171
171
  ],
172
172
  level_thresholds: { thriving: 90, healthy: 70, stressed: 50 },
173
173
  role_advice_routing: {
174
- user: ["只与有仲裁的商家交易", "确认赔偿金充足"],
175
- merchant: ["配置仲裁", "增加赔偿金", "合规优先"],
176
- arbitrator: ["主动监控高监管行业", "提供合规咨询"],
174
+ user: ["Only transact with merchants that have arbitration", "Confirm compensation fund adequacy"],
175
+ merchant: ["Configure arbitration", "Increase compensation fund", "Compliance first"],
176
+ arbitrator: ["Proactively monitor highly regulated industries", "Provide compliance consulting"],
177
177
  },
178
178
  },
179
179
  efficiency: {
180
180
  intent: "efficiency",
181
- display_name: "效率(关注周期、里程碑、沟通)",
181
+ display_name: "Efficiency (focus on cycle, milestones, communication)",
182
182
  weights: {
183
183
  cycle_efficiency: 45,
184
184
  milestone_adoption: 25,
@@ -200,7 +200,7 @@ export const BUILTIN_INTENT_SPECS = {
200
200
  suggestion_type: "adjust_preference",
201
201
  field: "preference_template.max_acceptable_cycle",
202
202
  suggested_value: 14,
203
- evidence_template: "效率意图下平均周期 {value} 小时 > {threshold} 小时,建议缩短最大可接受周期",
203
+ evidence_template: "Under efficiency intent, average cycle {value} hours > {threshold} hours; recommend shortening the maximum acceptable cycle",
204
204
  confidence: 0.8,
205
205
  priority: "high",
206
206
  target_roles: ["merchant"],
@@ -211,8 +211,8 @@ export const BUILTIN_INTENT_SPECS = {
211
211
  threshold: 0.4,
212
212
  suggestion_type: "update_flywheel",
213
213
  field: "flywheel.keyActions",
214
- suggested_value: "增加里程碑节点 + 分阶段验收 Reward",
215
- evidence_template: "效率意图下里程碑采用率 {value}% < {threshold}%,建议引入里程碑",
214
+ suggested_value: "Add milestone nodes + phased-acceptance Reward",
215
+ evidence_template: "Under efficiency intent, milestone adoption {value}% < {threshold}%; recommend introducing milestones",
216
216
  confidence: 0.75,
217
217
  priority: "medium",
218
218
  target_roles: ["merchant"],
@@ -220,14 +220,14 @@ export const BUILTIN_INTENT_SPECS = {
220
220
  ],
221
221
  level_thresholds: { thriving: 85, healthy: 65, stressed: 45 },
222
222
  role_advice_routing: {
223
- user: ["优先选择有里程碑的商家"],
224
- merchant: ["优化 Machine 节点拆分", "引入里程碑验收", "缩短交付周期"],
223
+ user: ["Prefer merchants with milestones"],
224
+ merchant: ["Optimize Machine node splitting", "Introduce milestone acceptance", "Shorten the delivery cycle"],
225
225
  arbitrator: [],
226
226
  },
227
227
  },
228
228
  trust_building: {
229
229
  intent: "trust_building",
230
- display_name: "信任建设(关注仲裁独立性、评价、赔偿金)",
230
+ display_name: "Trust building (focus on arbitration independence, reviews, compensation fund)",
231
231
  weights: {
232
232
  arbitration_coverage: 25,
233
233
  compensation_coverage: 25,
@@ -251,8 +251,8 @@ export const BUILTIN_INTENT_SPECS = {
251
251
  threshold: 0.3,
252
252
  suggestion_type: "update_flywheel",
253
253
  field: "flywheel.trustSellingPoints",
254
- suggested_value: "公开评价上链 + 带凭证评价权重更高",
255
- evidence_template: "信任建设意图下评价公开度 {value}% < {threshold}%,建议引入公开评价",
254
+ suggested_value: "On-chain public reviews + higher weight for credential-backed reviews",
255
+ evidence_template: "Under trust-building intent, review openness {value}% < {threshold}%; recommend introducing public reviews",
256
256
  confidence: 0.8,
257
257
  priority: "medium",
258
258
  target_roles: ["merchant"],
@@ -265,10 +265,10 @@ export const BUILTIN_INTENT_SPECS = {
265
265
  field: "risk_checks",
266
266
  suggested_value: {
267
267
  id: "trust_arbitration_check",
268
- description: "信任建设:仲裁未配置",
268
+ description: "Trust building: arbitration not configured",
269
269
  weight: 35,
270
270
  },
271
- evidence_template: "信任建设意图下仲裁覆盖率 {value}% < 100%,建议强制配置仲裁",
271
+ evidence_template: "Under trust-building intent, arbitration coverage {value}% < 100%; recommend mandatory arbitration configuration",
272
272
  confidence: 0.9,
273
273
  priority: "high",
274
274
  target_roles: ["merchant", "arbitrator"],
@@ -276,14 +276,14 @@ export const BUILTIN_INTENT_SPECS = {
276
276
  ],
277
277
  level_thresholds: { thriving: 85, healthy: 65, stressed: 50 },
278
278
  role_advice_routing: {
279
- user: ["查看公开评价", "确认仲裁独立性"],
280
- merchant: ["引入公开评价 Repository", "配置仲裁", "增加赔偿金"],
281
- arbitrator: ["保持独立性", "主动公开判决理由"],
279
+ user: ["View public reviews", "Confirm arbitration independence"],
280
+ merchant: ["Introduce a public review Repository", "Configure arbitration", "Increase compensation fund"],
281
+ arbitrator: ["Maintain independence", "Proactively disclose verdict rationale"],
282
282
  },
283
283
  },
284
284
  custom: {
285
285
  intent: "custom",
286
- display_name: "自定义(运行时注册)",
286
+ display_name: "Custom (registered at runtime)",
287
287
  weights: {},
288
288
  healthy_thresholds: {},
289
289
  suggestion_triggers: [],
@@ -320,8 +320,8 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
320
320
  const weaknesses = [];
321
321
  const recommendations = [];
322
322
  if (metrics.sample_size < INDUSTRY_EVOLUTION_THRESHOLDS.min_sample_size) {
323
- weaknesses.push(`样本量不足(${metrics.sample_size} < ${INDUSTRY_EVOLUTION_THRESHOLDS.min_sample_size}),评估置信度低`);
324
- recommendations.push("继续累积订单数据以提升评估精度");
323
+ weaknesses.push(`Insufficient sample size (${metrics.sample_size} < ${INDUSTRY_EVOLUTION_THRESHOLDS.min_sample_size}); evaluation confidence is low`);
324
+ recommendations.push("Continue accumulating order data to improve evaluation accuracy");
325
325
  }
326
326
  let healthScore = 0;
327
327
  const wCompleted = weights.completed_rate ?? 0;
@@ -330,11 +330,11 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
330
330
  healthScore += score;
331
331
  const thr = thresholds.completed_rate ?? 0.9;
332
332
  if (metrics.completed_rate >= thr) {
333
- strengths.push(`完成率高(${Math.round(metrics.completed_rate * 100)}%)`);
333
+ strengths.push(`High completion rate (${Math.round(metrics.completed_rate * 100)}%)`);
334
334
  }
335
335
  else if (metrics.completed_rate < thr * 0.8) {
336
- weaknesses.push(`完成率偏低(${Math.round(metrics.completed_rate * 100)}%)`);
337
- recommendations.push("排查未完成订单根因,加强 Messenger 沟通");
336
+ weaknesses.push(`Low completion rate (${Math.round(metrics.completed_rate * 100)}%)`);
337
+ recommendations.push("Investigate the root cause of incomplete orders; strengthen Messenger communication");
338
338
  }
339
339
  }
340
340
  const wDispute = weights.dispute_rate ?? 0;
@@ -343,11 +343,11 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
343
343
  healthScore += score;
344
344
  const thr = thresholds.dispute_rate ?? 0.05;
345
345
  if (metrics.dispute_rate <= thr) {
346
- strengths.push(`争议率低(${Math.round(metrics.dispute_rate * 100)}%)`);
346
+ strengths.push(`Low dispute rate (${Math.round(metrics.dispute_rate * 100)}%)`);
347
347
  }
348
348
  else if (metrics.dispute_rate > thr * 2) {
349
- weaknesses.push(`争议率高(${Math.round(metrics.dispute_rate * 100)}%)`);
350
- recommendations.push("争议率超阈值,建议强制配置仲裁 + 赔偿金 + 交付 Guard");
349
+ weaknesses.push(`High dispute rate (${Math.round(metrics.dispute_rate * 100)}%)`);
350
+ recommendations.push("Dispute rate exceeds threshold; recommend mandatory arbitration + compensation fund + delivery Guard");
351
351
  }
352
352
  }
353
353
  const wRefund = weights.refund_rate ?? 0;
@@ -355,8 +355,8 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
355
355
  const score = (1 - Math.min(1, metrics.refund_rate)) * wRefund;
356
356
  healthScore += score;
357
357
  if (metrics.refund_rate > 0.2) {
358
- weaknesses.push(`退款率高(${Math.round(metrics.refund_rate * 100)}%)`);
359
- recommendations.push("退款率异常,建议检查交付质量或商品描述一致性");
358
+ weaknesses.push(`High refund rate (${Math.round(metrics.refund_rate * 100)}%)`);
359
+ recommendations.push("Abnormal refund rate; recommend checking delivery quality or product description consistency");
360
360
  }
361
361
  }
362
362
  const wRepeat = weights.repeat_buyer_rate ?? 0;
@@ -365,11 +365,11 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
365
365
  healthScore += score;
366
366
  const thr = thresholds.repeat_buyer_rate ?? 0.25;
367
367
  if (metrics.repeat_buyer_rate >= thr) {
368
- strengths.push(`复购率高(${Math.round(metrics.repeat_buyer_rate * 100)}%)`);
368
+ strengths.push(`High repurchase rate (${Math.round(metrics.repeat_buyer_rate * 100)}%)`);
369
369
  }
370
370
  else if (metrics.repeat_buyer_rate < thr * 0.5 && metrics.sample_size >= 20) {
371
- weaknesses.push(`复购率低(${Math.round(metrics.repeat_buyer_rate * 100)}%)`);
372
- recommendations.push("复购率低,建议设置忠诚度 Reward + 推荐返现");
371
+ weaknesses.push(`Low repurchase rate (${Math.round(metrics.repeat_buyer_rate * 100)}%)`);
372
+ recommendations.push("Low repurchase rate; recommend setting loyalty Reward + referral cashback");
373
373
  }
374
374
  }
375
375
  const wCycle = weights.cycle_efficiency ?? 0;
@@ -378,33 +378,33 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
378
378
  healthScore += cycleScore * wCycle;
379
379
  const thr = thresholds.cycle_efficiency ?? 24 * 7;
380
380
  if (metrics.avg_cycle_hours <= thr) {
381
- strengths.push(`交付周期短(${Math.round(metrics.avg_cycle_hours)} 小时)`);
381
+ strengths.push(`Short delivery cycle (${Math.round(metrics.avg_cycle_hours)} hours)`);
382
382
  }
383
383
  else if (metrics.avg_cycle_hours > 24 * 30) {
384
- weaknesses.push(`交付周期过长(${Math.round(metrics.avg_cycle_hours / 24)} 天)`);
385
- recommendations.push("交付周期过长,建议优化 Machine 节点拆分");
384
+ weaknesses.push(`Long delivery cycle (${Math.round(metrics.avg_cycle_hours / 24)} days)`);
385
+ recommendations.push("Delivery cycle too long; recommend optimizing Machine node splitting");
386
386
  }
387
387
  }
388
388
  const wArb = weights.arbitration_coverage ?? 0;
389
389
  if (wArb > 0) {
390
- const hasArbAnomaly = metrics.anomalies.some((a) => a.includes("仲裁"));
390
+ const hasArbAnomaly = metrics.anomalies.some((a) => a.includes("arbitration"));
391
391
  const coverage = hasArbAnomaly ? 0 : 1;
392
392
  const score = coverage * wArb;
393
393
  healthScore += score;
394
394
  if (coverage < 1) {
395
- weaknesses.push("仲裁覆盖率不足");
396
- recommendations.push("建议强制配置仲裁(合规/信任意图下必备)");
395
+ weaknesses.push("Insufficient arbitration coverage");
396
+ recommendations.push("Recommend mandatory arbitration configuration (required under compliance/trust intents)");
397
397
  }
398
398
  }
399
399
  const wComp = weights.compensation_coverage ?? 0;
400
400
  if (wComp > 0) {
401
- const hasCompAnomaly = metrics.anomalies.some((a) => a.includes("赔偿金"));
401
+ const hasCompAnomaly = metrics.anomalies.some((a) => a.includes("compensation fund"));
402
402
  const coverage = hasCompAnomaly ? 0 : 1;
403
403
  const score = coverage * wComp;
404
404
  healthScore += score;
405
405
  if (coverage < 0.8) {
406
- weaknesses.push("赔偿金覆盖率不足");
407
- recommendations.push("建议增加 compensation_fund 余额");
406
+ weaknesses.push("Insufficient compensation fund coverage");
407
+ recommendations.push("Recommend increasing the compensation_fund balance");
408
408
  }
409
409
  }
410
410
  const wMilestone = weights.milestone_adoption ?? 0;
@@ -413,19 +413,19 @@ export function evaluateIndustryHealthByIntent(industry, metrics, intent = "defa
413
413
  const score = adoptionSignal * wMilestone;
414
414
  healthScore += score;
415
415
  if (adoptionSignal < 0.4) {
416
- weaknesses.push("里程碑采用率低");
417
- recommendations.push("建议引入里程碑节点 + 分阶段验收");
416
+ weaknesses.push("Low milestone adoption rate");
417
+ recommendations.push("Recommend introducing milestone nodes + phased acceptance");
418
418
  }
419
419
  }
420
420
  const wReview = weights.review_openness ?? 0;
421
421
  if (wReview > 0) {
422
- const hasReviewPattern = metrics.emerging_patterns.some((p) => p.includes("评价"));
422
+ const hasReviewPattern = metrics.emerging_patterns.some((p) => p.includes("review"));
423
423
  const openness = hasReviewPattern ? 0.6 : 0.3;
424
424
  const score = openness * wReview;
425
425
  healthScore += score;
426
426
  if (openness < 0.4) {
427
- weaknesses.push("评价公开度低");
428
- recommendations.push("建议引入公开评价 Repository");
427
+ weaknesses.push("Low review openness");
428
+ recommendations.push("Recommend introducing a public review Repository");
429
429
  }
430
430
  }
431
431
  const normalizedScore = Math.round((healthScore / totalWeight) * 100);
@@ -486,13 +486,13 @@ function getMetricValue(metrics, dim) {
486
486
  case "repeat_buyer_rate": return metrics.repeat_buyer_rate;
487
487
  case "cycle_efficiency": return metrics.avg_cycle_hours;
488
488
  case "arbitration_coverage":
489
- return metrics.anomalies.some((a) => a.includes("仲裁")) ? 0 : 1;
489
+ return metrics.anomalies.some((a) => a.includes("arbitration")) ? 0 : 1;
490
490
  case "compensation_coverage":
491
- return metrics.anomalies.some((a) => a.includes("赔偿金")) ? 0 : 1;
491
+ return metrics.anomalies.some((a) => a.includes("compensation fund")) ? 0 : 1;
492
492
  case "milestone_adoption":
493
493
  return metrics.trait_signals.long_cycle === true ? 0.6 : 0.3;
494
494
  case "review_openness":
495
- return metrics.emerging_patterns.some((p) => p.includes("评价")) ? 0.6 : 0.3;
495
+ return metrics.emerging_patterns.some((p) => p.includes("review")) ? 0.6 : 0.3;
496
496
  default: return undefined;
497
497
  }
498
498
  }
@@ -26,124 +26,124 @@ export const PERMISSION_TYPES = [
26
26
  ];
27
27
  export const GAME_ELEMENTS = [
28
28
  {
29
- id: 1, type: "player", name: "商户 vs 客户",
30
- description: "博弈的基本参与方:提供服务的商户和购买服务的客户。",
31
- wowokApplication: "Service 创建者(商户)和 Order 创建者(客户)。",
32
- onChainMechanism: "Service + Order 对象,各自有独立的 on-chain address",
29
+ id: 1, type: "player", name: "Merchant vs Customer",
30
+ description: "The basic participants of the game: the merchant providing the service and the customer purchasing the service.",
31
+ wowokApplication: "Service creator (merchant) and Order creator (customer).",
32
+ onChainMechanism: "Service + Order objects, each with an independent on-chain address.",
33
33
  },
34
34
  {
35
- id: 2, type: "player", name: "仲裁员",
36
- description: "第三方仲裁员参与争议解决博弈。",
37
- wowokApplication: "Arb 对象的 NamedOperator,由 Service 指定。",
38
- onChainMechanism: "Arbitration 对象 + NamedOperator 权限。",
35
+ id: 2, type: "player", name: "Arbitrator",
36
+ description: "Third-party arbitrators participate in the dispute resolution game.",
37
+ wowokApplication: "NamedOperator of the Arb object, designated by the Service.",
38
+ onChainMechanism: "Arbitration object + NamedOperator permission.",
39
39
  },
40
40
  {
41
- id: 3, type: "strategy", name: "合作 vs 欺骗",
42
- description: "商户可以选择诚实履约(合作)或欺诈(欺骗)。客户可以选择信任或拒绝。",
43
- wowokApplication: "商户发货 vs 不发货;客户付款 vs 拒付。",
44
- onChainMechanism: "Progress 节点推进 + 链上状态不可篡改。",
41
+ id: 3, type: "strategy", name: "Cooperation vs Deception",
42
+ description: "The merchant can choose honest fulfillment (cooperation) or fraud (deception). The customer can choose to trust or refuse.",
43
+ wowokApplication: "Merchant ships vs doesn't ship; customer pays vs refuses to pay.",
44
+ onChainMechanism: "Progress node advancement + immutable on-chain state.",
45
45
  },
46
46
  {
47
- id: 4, type: "payoff", name: "履约收益 vs 欺诈收益",
48
- description: "诚实履约获得持续收入 + 声誉;欺诈获得一次性收益但损失声誉和补偿金。",
49
- wowokApplication: "compensation_fund 作为欺诈的经济惩罚;repeat business 作为合作的长期收益。",
50
- onChainMechanism: "Service.compensation_fund + Treasury 锁定资金。",
47
+ id: 4, type: "payoff", name: "Fulfillment payoff vs Fraud payoff",
48
+ description: "Honest fulfillment yields sustained income + reputation; fraud yields one-time income but loses reputation and compensation fund.",
49
+ wowokApplication: "compensation_fund as economic penalty for fraud; repeat business as long-term payoff for cooperation.",
50
+ onChainMechanism: "Service.compensation_fund + Treasury locked funds.",
51
51
  },
52
52
  {
53
- id: 5, type: "utility", name: "声誉效用",
54
- description: "商户的总效用 = 即期收益 + 声誉折现的未来收益 - 惩罚预期。",
55
- wowokApplication: "声誉分高的商户获得更多订单(Demand 匹配优先)。",
56
- onChainMechanism: "ReviewRepository (链上公开评价) + Demand 匹配引擎。",
53
+ id: 5, type: "utility", name: "Reputation utility",
54
+ description: "Merchant's total utility = immediate income + reputation-discounted future income - expected penalty.",
55
+ wowokApplication: "Merchants with high reputation scores get more orders (Demand matching priority).",
56
+ onChainMechanism: "ReviewRepository (on-chain public reviews) + Demand matching engine.",
57
57
  },
58
58
  {
59
- id: 6, type: "equilibrium", name: "纳什均衡:双方合作",
60
- description: "当惩罚足够大、声誉足够重要时,双方合作的策略组合成为纳什均衡。",
61
- wowokApplication: "compensation_fund 足够大 + 链上声誉不可篡改 合作成为最优策略。",
62
- onChainMechanism: "Guard 验证 compensation_fund 金额 + ReviewRepository 公开。",
59
+ id: 6, type: "equilibrium", name: "Nash equilibrium: mutual cooperation",
60
+ description: "When penalties are large enough and reputation is important enough, the strategy profile of mutual cooperation becomes a Nash equilibrium.",
61
+ wowokApplication: "compensation_fund large enough + immutable on-chain reputation -> cooperation becomes the optimal strategy.",
62
+ onChainMechanism: "Guard verifies compensation_fund amount + ReviewRepository public.",
63
63
  },
64
64
  {
65
- id: 7, type: "information", name: "不完全信息",
66
- description: "客户不完全了解商户的服务质量;商户不完全了解客户的支付能力。",
67
- wowokApplication: "Service.description + Guard 验证作为信号;客户钱包余额链上可查。",
68
- onChainMechanism: "Guard + Personal 对象 + 链上交易历史。",
65
+ id: 7, type: "information", name: "Incomplete information",
66
+ description: "Customers don't fully understand the merchant's service quality; merchants don't fully understand the customer's payment capacity.",
67
+ wowokApplication: "Service.description + Guard verification as signals; customer wallet balance is queryable on-chain.",
68
+ onChainMechanism: "Guard + Personal object + on-chain transaction history.",
69
69
  },
70
70
  {
71
- id: 8, type: "sequence", name: "序贯博弈",
72
- description: "客户先下单付款,商户后履约这是典型的序贯博弈。",
73
- wowokApplication: "Order 创建 Progress 推进 Acceptance/Arbitration",
74
- onChainMechanism: "Machine 节点序列 + Progress 状态机。",
71
+ id: 8, type: "sequence", name: "Sequential game",
72
+ description: "Customer places order and pays first, merchant fulfills later this is a typical sequential game.",
73
+ wowokApplication: "Order creation -> Progress advancement -> Acceptance/Arbitration.",
74
+ onChainMechanism: "Machine node sequence + Progress state machine.",
75
75
  },
76
76
  {
77
- id: 9, type: "repetition", name: "重复博弈",
78
- description: "商户和客户可能多次交易,重复博弈使得合作策略更优。",
79
- wowokApplication: "客户的复购 + Demand 匹配优先推荐高声誉商户。",
80
- onChainMechanism: "ReviewRepository 累积评价 + Demand 匹配引擎。",
77
+ id: 9, type: "repetition", name: "Repeated game",
78
+ description: "Merchants and customers may transact multiple times; repeated games make cooperation strategies superior.",
79
+ wowokApplication: "Customer repeat purchases + Demand matching prioritizes high-reputation merchants.",
80
+ onChainMechanism: "ReviewRepository accumulates reviews + Demand matching engine.",
81
81
  },
82
82
  {
83
- id: 10, type: "commitment", name: "补偿金承诺",
84
- description: "商户通过锁定 compensation_fund 做出可信承诺,降低客户的风险感知。",
85
- wowokApplication: "Service.compensation_fund 锁定资金,欺诈时客户可索赔。",
86
- onChainMechanism: "Treasury 对象 + Guard 验证金额 + 提取规则。",
83
+ id: 10, type: "commitment", name: "Compensation fund commitment",
84
+ description: "Merchants make a credible commitment by locking compensation_fund, reducing customers' risk perception.",
85
+ wowokApplication: "Service.compensation_fund locks funds; customers can claim compensation in case of fraud.",
86
+ onChainMechanism: "Treasury object + Guard verifies amount + withdrawal rules.",
87
87
  },
88
88
  {
89
- id: 11, type: "punishment", name: "补偿金惩罚",
90
- description: "商户欺诈时,补偿金被划给客户,构成经济惩罚。",
91
- wowokApplication: "Arbitration 判决 compensation_fund 提取 客户获得赔偿。",
92
- onChainMechanism: "Arbitration verdict + Treasury 提取规则。",
89
+ id: 11, type: "punishment", name: "Compensation fund penalty",
90
+ description: "When a merchant commits fraud, the compensation fund is transferred to the customer, constituting economic punishment.",
91
+ wowokApplication: "Arbitration verdict -> compensation_fund withdrawal -> customer receives compensation.",
92
+ onChainMechanism: "Arbitration verdict + Treasury withdrawal rules.",
93
93
  },
94
94
  {
95
- id: 12, type: "reward", name: "Reward 营销激励",
96
- description: "商户通过 Reward 对象发放奖励,激励客户行为(首单、裂变、忠诚度)。",
97
- wowokApplication: "Reward 对象 + Guard 验证领取条件(如:完成首单)。",
98
- onChainMechanism: "Reward 对象 + Guard claim 条件 + Allocation 分发。",
95
+ id: 12, type: "reward", name: "Reward marketing incentive",
96
+ description: "Merchants issue rewards via Reward objects, incentivizing customer behavior (first order, referral, loyalty).",
97
+ wowokApplication: "Reward object + Guard verifies claim conditions (e.g., completed first order).",
98
+ onChainMechanism: "Reward object + Guard claim conditions + Allocation distribution.",
99
99
  },
100
100
  {
101
- id: 13, type: "reputation", name: "链上公开声誉",
102
- description: "所有交易和评价记录在链上,形成不可篡改的声誉系统。",
103
- wowokApplication: "ReviewRepository 存储 like/dislike/评价标签,链上可检测。",
104
- onChainMechanism: "Repository 对象 + Guard 防刷 + 地址为 key 的评价记录。",
101
+ id: 13, type: "reputation", name: "On-chain public reputation",
102
+ description: "All transactions and reviews are recorded on-chain, forming an immutable reputation system.",
103
+ wowokApplication: "ReviewRepository stores like/dislike/review tags, queryable on-chain.",
104
+ onChainMechanism: "Repository object + Guard anti-spam + address-keyed review records.",
105
105
  },
106
106
  {
107
- id: 14, type: "signaling", name: "质量信号",
108
- description: "商户通过 Guard 验证、compensation_fund 金额、Machine 透明度发送质量信号。",
109
- wowokApplication: "buy_guard 验证 信号;compensation_fund 金额 信号;Machine 公开 信号。",
110
- onChainMechanism: "Guard + Treasury + Machine 对象的链上公开数据。",
107
+ id: 14, type: "signaling", name: "Quality signal",
108
+ description: "Merchants send quality signals via Guard verification, compensation_fund amount, and Machine transparency.",
109
+ wowokApplication: "buy_guard verification -> signal; compensation_fund amount -> signal; Machine public -> signal.",
110
+ onChainMechanism: "Guard + Treasury + Machine object's on-chain public data.",
111
111
  },
112
112
  {
113
- id: 15, type: "screening", name: "客户筛选",
114
- description: "商户通过 Guard 筛选客户(如:验证身份、信用分、钱包余额)。",
115
- wowokApplication: "Service.buy_guard 验证客户资格。",
116
- onChainMechanism: "Guard 对象 + gen_passport 验证凭证。",
113
+ id: 15, type: "screening", name: "Customer screening",
114
+ description: "Merchants screen customers via Guard (e.g., verify identity, credit score, wallet balance).",
115
+ wowokApplication: "Service.buy_guard verifies customer eligibility.",
116
+ onChainMechanism: "Guard object + gen_passport verifies credentials.",
117
117
  },
118
118
  {
119
- id: 16, type: "bargaining", name: "价格议价",
120
- description: "客户和商户可以通过 Messenger 议价,最终价格通过 Demand 提交。",
121
- wowokApplication: "Messenger 加密通信 Demand 提交带 reward 的需求。",
122
- onChainMechanism: "Contact + Messenger + Demand 对象。",
119
+ id: 16, type: "bargaining", name: "Price bargaining",
120
+ description: "Customers and merchants can bargain via Messenger; the final price is submitted via Demand.",
121
+ wowokApplication: "Messenger encrypted communication -> Demand submits demand with reward.",
122
+ onChainMechanism: "Contact + Messenger + Demand objects.",
123
123
  },
124
124
  {
125
- id: 17, type: "auction", name: "Demand 竞标",
126
- description: "多个服务商可以竞争同一个 Demand,形成竞标机制。",
127
- wowokApplication: "Demand 发布需求 多个 Service 提交方案 客户选择。",
128
- onChainMechanism: "Demand 对象 + order 创建 + Progress 推进。",
125
+ id: 17, type: "auction", name: "Demand bidding",
126
+ description: "Multiple service providers can compete for the same Demand, forming a bidding mechanism.",
127
+ wowokApplication: "Demand publishes demand -> multiple Services submit proposals -> customer chooses.",
128
+ onChainMechanism: "Demand object + order creation + Progress advancement.",
129
129
  },
130
130
  {
131
- id: 18, type: "mechanism", name: "机制设计",
132
- description: "WoWok 的整体架构就是机制设计:通过链上规则激励合作、惩罚欺诈。",
133
- wowokApplication: "compensation_fund + Arbitration + ReviewRepository 组合形成信任机制。",
134
- onChainMechanism: "Move 合约层面的对象组合 + Guard 验证 + 不可篡改性。",
131
+ id: 18, type: "mechanism", name: "Mechanism design",
132
+ description: "WoWok's overall architecture is mechanism design: incentivizing cooperation and punishing fraud via on-chain rules.",
133
+ wowokApplication: "compensation_fund + Arbitration + ReviewRepository combine to form a trust mechanism.",
134
+ onChainMechanism: "Move contract-level object composition + Guard verification + immutability.",
135
135
  },
136
136
  {
137
- id: 19, type: "constraint", name: "资金约束",
138
- description: "compensation_fund Reward 资金锁定构成经济约束,限制商户的欺诈动机。",
139
- wowokApplication: "资金锁定 > 欺诈收益 合作是理性选择。",
140
- onChainMechanism: "Treasury + Allocation 资金锁定。",
137
+ id: 19, type: "constraint", name: "Fund constraint",
138
+ description: "compensation_fund and Reward fund locks constitute economic constraints, limiting the merchant's incentive to commit fraud.",
139
+ wowokApplication: "Fund lock > fraud payoff -> cooperation is the rational choice.",
140
+ onChainMechanism: "Treasury + Allocation fund lock.",
141
141
  },
142
142
  {
143
- id: 20, type: "cooperation", name: "供应链协作",
144
- description: "多个商户通过 Machine 组合形成供应链,合作完成复杂订单(子订单)。",
145
- wowokApplication: "Service order_allocators 支持多供应商分配;Machine 节点间 forward 组合。",
146
- onChainMechanism: "Allocation + Machine Forward + Progress 跨对象组合。",
143
+ id: 20, type: "cooperation", name: "Supply chain collaboration",
144
+ description: "Multiple merchants combine via Machine to form a supply chain, cooperating to fulfill complex orders (sub-orders).",
145
+ wowokApplication: "Service's order_allocators supports multi-supplier allocation; Machine node forwards combine.",
146
+ onChainMechanism: "Allocation + Machine Forward + Progress cross-object composition.",
147
147
  },
148
148
  ];
149
149
  const PERMISSION_INDEX = new Map(PERMISSION_TYPES.map((p) => [p.name, p]));
@@ -3,13 +3,13 @@ export function buildReviewRepositorySetup(serviceName) {
3
3
  return {
4
4
  repositoryName: `${serviceName}_reviews`,
5
5
  guardName: `${serviceName}_review_guard`,
6
- guardRules: "验证提交者有该 Service 的已完成订单(query order history == 已完成)—— 防刷评",
6
+ guardRules: "Verify that the submitter has a completed order for this Service (query order history == completed) — anti-review-spam",
7
7
  setupSteps: [
8
- `1. 创建 Guard: name='${serviceName}_review_guard', 规则验证购买者身份`,
9
- `2. 创建 Repository: name='${serviceName}_reviews', attach Guard`,
10
- `3. Repository 关联到 Service: onchain_operations service modify`,
11
- `4. 用户提交评价时: onchain_operations repository writeGuard 自动验证)`,
12
- `5. 查询评价: onchain_table_data repository query`,
8
+ `1. Create Guard: name='${serviceName}_review_guard', rule verifies buyer identity`,
9
+ `2. Create Repository: name='${serviceName}_reviews', attach Guard`,
10
+ `3. Associate Repository with Service: onchain_operations service modify`,
11
+ `4. When user submits a review: onchain_operations repository write (Guard auto-validates)`,
12
+ `5. Query reviews: onchain_table_data repository query`,
13
13
  ],
14
14
  };
15
15
  }
@@ -81,18 +81,18 @@ export function detectReviewManipulation(reviews) {
81
81
  }
82
82
  const duplicates = Array.from(reviewerCounts.entries()).filter(([, count]) => count > 1);
83
83
  if (duplicates.length > 0) {
84
- reasons.push(`${duplicates.length} 个地址提交了多次评价`);
84
+ reasons.push(`${duplicates.length} address(es) submitted multiple reviews`);
85
85
  }
86
86
  const allLikes = reviews.every((r) => r.rating === "like");
87
87
  const noneVerified = reviews.every((r) => !r.verified);
88
88
  if (allLikes && reviews.length > 5 && noneVerified) {
89
- reasons.push("全部好评但无带凭证评价,可能存在刷评");
89
+ reasons.push("All likes but no verified reviews; possible review spam");
90
90
  }
91
91
  if (reviews.length > 10) {
92
92
  const sorted = [...reviews].sort((a, b) => (a.timestamp ?? 0) - (b.timestamp ?? 0));
93
93
  const timeSpan = (sorted[sorted.length - 1].timestamp ?? 0) - (sorted[0].timestamp ?? 0);
94
94
  if (timeSpan > 0 && timeSpan < 3600 * 1000) {
95
- reasons.push(`${reviews.length} 条评价在 1 小时内提交,时间异常集中`);
95
+ reasons.push(`${reviews.length} reviews submitted within 1 hour; abnormally concentrated timing`);
96
96
  }
97
97
  }
98
98
  return { suspicious: reasons.length > 0, reasons };