@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
@@ -0,0 +1,9 @@
1
+ export { CUSTOMER_INTELLIGENCE_VERSION, RISK_LEVELS, RISK_DIMENSION_MAX, type PuzzleDepth, type ServiceBasics, type WorkflowAnalysis, type FundSafety, type TrustSignals, type MerchantBehavior, type MarketContext, type InfoPuzzle, type RiskDimensionName, type RiskCheck, type RiskDimensionScore, type RiskLevel, type RiskScore, type UserPreferences, type ReminderPriority, type Reminder, type GameScenario, type GameStrategy, type CustomerAdvice, } from "./types.js";
2
+ export { assembleServiceBasics, assembleWorkflowAnalysis, assembleFundSafety, assembleTrustSignals, assembleMerchantBehavior, assembleMarketContext, assembleInfoPuzzle, type ServiceRawData, type MachineNodeRaw, type ReviewRaw, type EventRaw, type PuzzleRawData, } from "./info-puzzle.js";
3
+ export { riskLevelFromScore, riskLevelLabel, riskLevelEmoji, assessRisk, passesRiskThreshold, } from "./risk-assessment.js";
4
+ export { getIndustryRiskChecks, getIndustryNeeds, checkIndustryNeeds, assessIndustryRisks, inferIndustry, type IndustryNeedTier, type IndustryNeed, type IndustryRiskCheck, type IndustryRiskResult, } from "./industry-risks.js";
5
+ export { getDefaultPreferences, getIndustryTemplate, inferPreferences, matchServiceToPreferences, mergePreferences, validatePreferences, SUPPORTED_INDUSTRIES, type Industry, type IndustryTemplate, type OrderHistoryEntry, type PreferenceInference, type ServiceForMatching, type PreferenceMatchResult, } from "./user-preferences.js";
6
+ export { monitorOrder, sortAlerts, getCriticalAlerts, getActionableAlerts, summarizeAlerts, isBlockingAlert, alertsToReminders, type AlertSeverity, type AlertCategory, type MonitorAlert, type OrderSnapshot, type OrderHistorySnapshot, type OrderMonitorContext, type MonitorThresholds, } from "./order-monitor.js";
7
+ export { recommendStrategy, detectScenarios, flowMigrationStrategy, repeatGameStrategy, rightsProtectionStrategy, type StrategyContext, type StrategyRecommendation, } from "./order-strategy.js";
8
+ export { generatePostPurchaseAdvice, trackRefund, handleQualityIssue, handleMerchantUnreachable, arbitrationSupport, generateArbitrationTemplate, type PostPurchasePhase, type PostPurchaseContext, type PostPurchaseAction, } from "./post-purchase.js";
9
+ export { generateReminders, sortAndCapReminders, generateMultiStageReminders, isBlocking, getBlockingReminders, summarizeReminders, topReminders, type ReminderStage, type ReminderContext, } from "./reminder-system.js";
@@ -0,0 +1,9 @@
1
+ export { CUSTOMER_INTELLIGENCE_VERSION, RISK_LEVELS, RISK_DIMENSION_MAX, } from "./types.js";
2
+ export { assembleServiceBasics, assembleWorkflowAnalysis, assembleFundSafety, assembleTrustSignals, assembleMerchantBehavior, assembleMarketContext, assembleInfoPuzzle, } from "./info-puzzle.js";
3
+ export { riskLevelFromScore, riskLevelLabel, riskLevelEmoji, assessRisk, passesRiskThreshold, } from "./risk-assessment.js";
4
+ export { getIndustryRiskChecks, getIndustryNeeds, checkIndustryNeeds, assessIndustryRisks, inferIndustry, } from "./industry-risks.js";
5
+ export { getDefaultPreferences, getIndustryTemplate, inferPreferences, matchServiceToPreferences, mergePreferences, validatePreferences, SUPPORTED_INDUSTRIES, } from "./user-preferences.js";
6
+ export { monitorOrder, sortAlerts, getCriticalAlerts, getActionableAlerts, summarizeAlerts, isBlockingAlert, alertsToReminders, } from "./order-monitor.js";
7
+ export { recommendStrategy, detectScenarios, flowMigrationStrategy, repeatGameStrategy, rightsProtectionStrategy, } from "./order-strategy.js";
8
+ export { generatePostPurchaseAdvice, trackRefund, handleQualityIssue, handleMerchantUnreachable, arbitrationSupport, generateArbitrationTemplate, } from "./post-purchase.js";
9
+ export { generateReminders, sortAndCapReminders, generateMultiStageReminders, isBlocking, getBlockingReminders, summarizeReminders, topReminders, } from "./reminder-system.js";
@@ -25,6 +25,10 @@ export interface IndustryRiskResult {
25
25
  score_adjustment: number;
26
26
  summary: string;
27
27
  }
28
+ export declare function _setRegistryLookup(fn: ((industry: string) => {
29
+ risk_checks?: IndustryRiskCheck[];
30
+ needs?: IndustryNeed[];
31
+ } | undefined) | null): void;
28
32
  export declare function getIndustryRiskChecks(industry: Industry): IndustryRiskCheck[];
29
33
  export declare function getIndustryNeeds(industry: Industry): IndustryNeed[];
30
34
  export declare function checkIndustryNeeds(puzzle: InfoPuzzle, industry: Industry): {
@@ -22,14 +22,14 @@ const INDUSTRY_RISK_CHECKS = {
22
22
  description: "WIP hash verified (work traceable)",
23
23
  weight: 30,
24
24
  passed: wipVerified,
25
- advice: "⚠️ WIP 未验证:自由职业交付物无法溯源,建议要求商家提供 WIP hash 并写入 WTS",
25
+ advice: "⚠️ WIP not verified: freelance deliverables cannot be traced. Recommend asking the merchant to provide a WIP hash and write it into WTS.",
26
26
  },
27
27
  {
28
28
  id: "fr_milestone_nodes", industry: "freelance", dimension: "workflow",
29
- description: "存在里程碑节点(分阶段验收)",
29
+ description: "Has milestone nodes (phased acceptance)",
30
30
  weight: 25,
31
31
  passed: hasMilestoneNodes,
32
- advice: "⚠️ 无里程碑节点:交付一次性完成无中间验收,建议要求商家增加分阶段交付节点。",
32
+ advice: "⚠️ No milestone nodes: delivery is completed in one go without intermediate acceptance. Recommend asking the merchant to add phased delivery nodes.",
33
33
  },
34
34
  {
35
35
  id: "fr_refund_path", industry: "freelance", dimension: "workflow",
@@ -49,17 +49,17 @@ const INDUSTRY_RISK_CHECKS = {
49
49
  rental: [
50
50
  {
51
51
  id: "rt_compensation_full", industry: "rental", dimension: "fund",
52
- description: "赔偿金完全覆盖订单金额",
52
+ description: "Compensation fully covers order amount",
53
53
  weight: 30,
54
54
  passed: compensationCoversOrder,
55
- advice: "🔴 赔偿金未完全覆盖:租赁物损坏时赔付不足,建议选择赔偿金充足的商家。",
55
+ advice: "🔴 Compensation not fully covered: insufficient payout when rental item is damaged. Recommend choosing a merchant with sufficient compensation fund.",
56
56
  },
57
57
  {
58
58
  id: "rt_lock_duration", industry: "rental", dimension: "fund",
59
- description: "锁定期安全(赔偿金不可被商家随时撤回)",
59
+ description: "Lock duration safe (compensation cannot be withdrawn by merchant at any time)",
60
60
  weight: 25,
61
61
  passed: lockDurationSafe,
62
- advice: "⚠️ 锁定期不安全:商家可能随时撤回赔偿金,押金安全无保障。",
62
+ advice: "⚠️ Lock duration not safe: merchant may withdraw compensation at any time, deposit safety not guaranteed.",
63
63
  },
64
64
  {
65
65
  id: "rt_arbitration", industry: "rental", dimension: "workflow",
@@ -70,10 +70,10 @@ const INDUSTRY_RISK_CHECKS = {
70
70
  },
71
71
  {
72
72
  id: "rt_user_operable", industry: "rental", dimension: "workflow",
73
- description: "存在用户可操作路径(归还/确认)",
73
+ description: "Has user-operable path (return/confirm)",
74
74
  weight: 20,
75
75
  passed: (p) => userOperableForwards(p) > 0,
76
- advice: "🔴 无用户可操作路径:归还流程完全依赖商家,可能被恶意拖延。",
76
+ advice: "🔴 No user-operable path: return process relies entirely on merchant, may be maliciously delayed.",
77
77
  },
78
78
  ],
79
79
  education: [
@@ -176,17 +176,17 @@ const INDUSTRY_RISK_CHECKS = {
176
176
  },
177
177
  {
178
178
  id: "ret_compensation_full", industry: "retail", dimension: "fund",
179
- description: "赔偿金完全覆盖",
179
+ description: "Compensation fully covers",
180
180
  weight: 25,
181
181
  passed: compensationCoversOrder,
182
- advice: "⚠️ 赔偿金未完全覆盖:退换货纠纷时赔付不足。",
182
+ advice: "⚠️ Compensation not fully covered: insufficient payout for return/exchange disputes.",
183
183
  },
184
184
  {
185
185
  id: "ret_refund_path", industry: "retail", dimension: "workflow",
186
- description: "存在退款路径(退换货)",
186
+ description: "Has refund path (return/exchange)",
187
187
  weight: 25,
188
188
  passed: hasRefundPath,
189
- advice: "🔴 无退款路径:退换货无保障。",
189
+ advice: "🔴 No refund path: return/exchange not guaranteed.",
190
190
  },
191
191
  {
192
192
  id: "ret_arbitration", industry: "retail", dimension: "workflow",
@@ -201,15 +201,15 @@ function commonNeeds() {
201
201
  return [
202
202
  {
203
203
  id: "need_arbitration", tier: "common",
204
- description: "配置仲裁(纠纷解决通道)",
204
+ description: "Arbitration configured (dispute resolution channel)",
205
205
  satisfied: hasArbitrationPath,
206
- advice: "未配置仲裁:纠纷无第三方解决通道。",
206
+ advice: "Arbitration not configured: no third-party resolution channel for disputes.",
207
207
  },
208
208
  {
209
209
  id: "need_refund_path", tier: "common",
210
210
  description: "Has refund path",
211
211
  satisfied: hasRefundPath,
212
- advice: "无退款路径:交付失败时资金难以回收。",
212
+ advice: "No refund path: funds hard to recover when delivery fails.",
213
213
  },
214
214
  {
215
215
  id: "need_user_operable", tier: "common",
@@ -221,7 +221,7 @@ function commonNeeds() {
221
221
  id: "need_messenger", tier: "common",
222
222
  description: "Messenger configured",
223
223
  satisfied: hasMessenger,
224
- advice: "商家无 Messenger 通道,无法协商或售后沟通。",
224
+ advice: "Merchant has no Messenger channel, cannot negotiate or conduct after-sales communication.",
225
225
  },
226
226
  ];
227
227
  }
@@ -230,9 +230,9 @@ const INDUSTRY_NEEDS = {
230
230
  ...commonNeeds(),
231
231
  {
232
232
  id: "need_wip_verified", tier: "personalized",
233
- description: "WIP 验证(作品知识产权可溯源)",
233
+ description: "WIP verified (work IP traceable)",
234
234
  satisfied: wipVerified,
235
- advice: "WIP 未验证:作品知识产权归属与原创性无法溯源。",
235
+ advice: "WIP not verified: IP ownership and originality of work cannot be traced.",
236
236
  },
237
237
  {
238
238
  id: "need_milestone_nodes", tier: "personalized",
@@ -242,9 +242,9 @@ const INDUSTRY_NEEDS = {
242
242
  },
243
243
  {
244
244
  id: "need_merchant_history", tier: "advanced",
245
- description: "商家历史 ≥3 单(履约经验)",
245
+ description: "Merchant history ≥3 orders (fulfillment experience)",
246
246
  satisfied: (p) => merchantTotalOrders(p) >= 3,
247
- advice: "商家历史订单不足 3 单:履约经验有限。",
247
+ advice: "Merchant history orders less than 3: fulfillment experience is limited.",
248
248
  },
249
249
  ],
250
250
  rental: [
@@ -278,15 +278,15 @@ const INDUSTRY_NEEDS = {
278
278
  },
279
279
  {
280
280
  id: "need_long_cycle_ok", tier: "personalized",
281
- description: "长周期可接受",
281
+ description: "Long cycle acceptable",
282
282
  satisfied: () => true,
283
- advice: "教育行业长周期属正常;建议跟踪课时消耗与出勤。",
283
+ advice: "Long cycles are normal in education; recommend tracking lesson consumption and attendance.",
284
284
  },
285
285
  {
286
286
  id: "need_high_reputation", tier: "advanced",
287
- description: "声誉评分高(trust_score ≥70",
287
+ description: "High reputation score (trust_score ≥70)",
288
288
  satisfied: (p) => trustScore(p) >= 70,
289
- advice: "商家声誉评分低于 70:课程口碑可能不佳。",
289
+ advice: "Merchant reputation score below 70: course reputation may be poor.",
290
290
  },
291
291
  ],
292
292
  travel: [
@@ -299,9 +299,9 @@ const INDUSTRY_NEEDS = {
299
299
  },
300
300
  {
301
301
  id: "need_compensation_full", tier: "personalized",
302
- description: "赔偿金完全覆盖(违约赔偿)",
302
+ description: "Compensation fully covers (breach compensation)",
303
303
  satisfied: compensationCoversOrder,
304
- advice: "赔偿金未完全覆盖:行程违约赔付不足。",
304
+ advice: "Compensation not fully covered: insufficient payout for itinerary breach.",
305
305
  },
306
306
  {
307
307
  id: "need_high_reputation", tier: "advanced",
@@ -314,9 +314,9 @@ const INDUSTRY_NEEDS = {
314
314
  ...commonNeeds(),
315
315
  {
316
316
  id: "need_no_lockin", tier: "personalized",
317
- description: "无长期锁定(无死端节点)",
317
+ description: "No long-term lock-in (no dead-end nodes)",
318
318
  satisfied: (p) => deadEndCount(p) === 0,
319
- advice: "存在死端节点:订阅可能被锁定,存在续费陷阱。",
319
+ advice: "Dead-end nodes exist: subscription may be locked, auto-renewal trap exists.",
320
320
  },
321
321
  {
322
322
  id: "need_low_dispute", tier: "personalized",
@@ -341,9 +341,9 @@ const INDUSTRY_NEEDS = {
341
341
  },
342
342
  {
343
343
  id: "need_compensation_full", tier: "personalized",
344
- description: "赔偿金完全覆盖",
344
+ description: "Compensation fully covers",
345
345
  satisfied: compensationCoversOrder,
346
- advice: "赔偿金未完全覆盖:退换货纠纷赔付不足。",
346
+ advice: "Compensation not fully covered: insufficient payout for return/exchange disputes.",
347
347
  },
348
348
  {
349
349
  id: "need_high_reputation", tier: "advanced",
@@ -353,10 +353,24 @@ const INDUSTRY_NEEDS = {
353
353
  },
354
354
  ],
355
355
  };
356
+ let _registryLookup = null;
357
+ export function _setRegistryLookup(fn) {
358
+ _registryLookup = fn;
359
+ }
356
360
  export function getIndustryRiskChecks(industry) {
361
+ if (_registryLookup) {
362
+ const profile = _registryLookup(industry);
363
+ if (profile?.risk_checks)
364
+ return profile.risk_checks;
365
+ }
357
366
  return INDUSTRY_RISK_CHECKS[industry];
358
367
  }
359
368
  export function getIndustryNeeds(industry) {
369
+ if (_registryLookup) {
370
+ const profile = _registryLookup(industry);
371
+ if (profile?.needs)
372
+ return profile.needs;
373
+ }
360
374
  return INDUSTRY_NEEDS[industry];
361
375
  }
362
376
  export function checkIndustryNeeds(puzzle, industry) {
@@ -20,8 +20,8 @@ export function monitorOrder(ctx) {
20
20
  id: "refund_received",
21
21
  category: "refund_received",
22
22
  severity: "info",
23
- title: "退款已到账",
24
- message: `订单 ${cur.order_id} 已退款到账`,
23
+ title: "Refund received",
24
+ message: `Order ${cur.order_id} refund has been received`,
25
25
  timestamp: cur.now,
26
26
  order_id: cur.order_id,
27
27
  service_id: cur.service_id,
@@ -36,9 +36,9 @@ export function monitorOrder(ctx) {
36
36
  id: "user_action_required",
37
37
  category: "user_action_required",
38
38
  severity: "info",
39
- title: "等待用户操作",
40
- message: `订单 ${cur.order_id} 已推进到节点 ${cur.current_node ?? "未知"},需要您操作才能继续`,
41
- action: "查看 Machine 节点要求并提交对应 Guard submission",
39
+ title: "Waiting for user action",
40
+ message: `Order ${cur.order_id} advanced to node ${cur.current_node ?? "unknown"}; your action is required to continue`,
41
+ action: "View the Machine node requirements and submit the corresponding Guard submission",
42
42
  timestamp: cur.now,
43
43
  order_id: cur.order_id,
44
44
  service_id: cur.service_id,
@@ -62,20 +62,20 @@ function detectProgressStall(cur, prev, t) {
62
62
  id: "progress_stall",
63
63
  category: "progress_stall",
64
64
  severity,
65
- title: severity === "critical" ? "订单严重停滞" : "订单推进停滞",
66
- message: `订单已停留在节点 ${cur.current_node} 超过 ${Math.round(stallHours)} 小时(预期 ${expected} 小时)`,
65
+ title: severity === "critical" ? "Order severely stalled" : "Order progress stalled",
66
+ message: `Order has been stuck at node ${cur.current_node} for over ${Math.round(stallHours)} hours (expected ${expected} hours)`,
67
67
  action: severity === "critical"
68
- ? "建议立即通过 Messenger 联系商家;若商家持续无响应,可考虑发起仲裁"
69
- : "建议通过 Messenger 联系商家询问进度",
68
+ ? "Recommend contacting the merchant immediately via Messenger; if the merchant remains unresponsive, consider initiating arbitration"
69
+ : "Recommend contacting the merchant via Messenger to ask about progress",
70
70
  timestamp: cur.now,
71
71
  order_id: cur.order_id,
72
72
  service_id: cur.service_id,
73
73
  node: cur.current_node,
74
74
  metric: {
75
- label: "停滞时长",
75
+ label: "Stall duration",
76
76
  value: Math.round(stallHours),
77
77
  threshold: Math.round(threshold),
78
- unit: "小时",
78
+ unit: "hours",
79
79
  },
80
80
  });
81
81
  }
@@ -87,18 +87,18 @@ function detectProgressStall(cur, prev, t) {
87
87
  id: "node_unchanged",
88
88
  category: "progress_stall",
89
89
  severity: "warning",
90
- title: "节点未变化",
91
- message: `自上次检查以来(${Math.round(sincePrevHours)} 小时),订单仍停留在 ${cur.current_node}`,
92
- action: "确认是否为预期行为;如非预期,联系商家",
90
+ title: "Node unchanged",
91
+ message: `Since the last check (${Math.round(sincePrevHours)} hours), the order is still at ${cur.current_node}`,
92
+ action: "Confirm whether this is expected; if not, contact the merchant",
93
93
  timestamp: cur.now,
94
94
  order_id: cur.order_id,
95
95
  service_id: cur.service_id,
96
96
  node: cur.current_node,
97
97
  metric: {
98
- label: "节点停留时长",
98
+ label: "Node stay duration",
99
99
  value: Math.round(sincePrevHours),
100
100
  threshold: Math.round(expected),
101
- unit: "小时",
101
+ unit: "hours",
102
102
  },
103
103
  });
104
104
  }
@@ -117,14 +117,14 @@ function detectCompensationChange(cur, prev, t) {
117
117
  id: "compensation_insufficient",
118
118
  category: "compensation_insufficient",
119
119
  severity,
120
- title: "赔偿金覆盖率不足",
121
- message: `商家赔偿金仅覆盖订单金额的 ${Math.round(ratio * 100)}%(要求 ${Math.round(t.compensation_coverage_min * 100)}%)`,
122
- action: "下单前要求商家补充赔偿金,或通过 Messenger 协商提高覆盖率",
120
+ title: "Compensation fund coverage insufficient",
121
+ message: `Merchant compensation fund covers only ${Math.round(ratio * 100)}% of the order amount (required ${Math.round(t.compensation_coverage_min * 100)}%)`,
122
+ action: "Require the merchant to top up the compensation fund before ordering, or negotiate higher coverage via Messenger",
123
123
  timestamp: cur.now,
124
124
  order_id: cur.order_id,
125
125
  service_id: cur.service_id,
126
126
  metric: {
127
- label: "赔偿金覆盖率",
127
+ label: "Compensation coverage",
128
128
  value: Math.round(ratio * 100),
129
129
  threshold: Math.round(t.compensation_coverage_min * 100),
130
130
  unit: "%",
@@ -142,14 +142,14 @@ function detectCompensationChange(cur, prev, t) {
142
142
  id: "compensation_drop",
143
143
  category: "compensation_drop",
144
144
  severity,
145
- title: "赔偿金余额显著下降",
146
- message: `商家赔偿金从 ${prevBal} 下降到 ${cur.compensation_balance}(下降 ${Math.round(dropRatio * 100)}%)`,
147
- action: "立即询问商家原因;若持续下降,可能表明商家正在处理其他订单的赔付,存在风险",
145
+ title: "Compensation fund balance dropped significantly",
146
+ message: `Merchant compensation fund dropped from ${prevBal} to ${cur.compensation_balance} (down ${Math.round(dropRatio * 100)}%)`,
147
+ action: "Immediately ask the merchant for the reason; if it keeps dropping, the merchant may be processing payouts for other orders, which is a risk",
148
148
  timestamp: cur.now,
149
149
  order_id: cur.order_id,
150
150
  service_id: cur.service_id,
151
151
  metric: {
152
- label: "赔偿金下降比例",
152
+ label: "Compensation drop ratio",
153
153
  value: Math.round(dropRatio * 100),
154
154
  threshold: Math.round(t.compensation_drop_ratio * 100),
155
155
  unit: "%",
@@ -167,9 +167,9 @@ function detectMessengerTimeout(cur, t) {
167
167
  id: "no_messenger_channel",
168
168
  category: "messenger_timeout",
169
169
  severity: "info",
170
- title: "商家无 Messenger 通道",
171
- message: "商家未配置 Messenger,无法在线协商或售后",
172
- action: "下单前确认其他联系方式;建议要求商家配置 Messenger",
170
+ title: "Merchant has no Messenger channel",
171
+ message: "Merchant has not configured Messenger; no way to negotiate online or get post-sale support",
172
+ action: "Confirm other contact methods before ordering; recommend requiring the merchant to configure Messenger",
173
173
  timestamp: cur.now,
174
174
  order_id: cur.order_id,
175
175
  service_id: cur.service_id,
@@ -185,19 +185,19 @@ function detectMessengerTimeout(cur, t) {
185
185
  id: "messenger_unanswered",
186
186
  category: "messenger_timeout",
187
187
  severity,
188
- title: "商家 Messenger 未回复",
189
- message: `商家已 ${Math.round(unansweredHours)} 小时未回复您的 Messenger 消息`,
188
+ title: "Merchant Messenger no reply",
189
+ message: `Merchant has not replied to your Messenger message for ${Math.round(unansweredHours)} hours`,
190
190
  action: cur.has_arbitration
191
- ? "可考虑发起仲裁申请(仲裁窗口有限)"
192
- : "商家未配置仲裁,建议通过其他联系方式催促;若无回应,资金可能冻结",
191
+ ? "Consider initiating an arbitration application (arbitration window is limited)"
192
+ : "Merchant has no arbitration configured; recommend urging via other contact methods; if there is no response, funds may be frozen",
193
193
  timestamp: cur.now,
194
194
  order_id: cur.order_id,
195
195
  service_id: cur.service_id,
196
196
  metric: {
197
- label: "未回复时长",
197
+ label: "No-reply duration",
198
198
  value: Math.round(unansweredHours),
199
199
  threshold: Math.round(t.messenger_timeout_hours),
200
- unit: "小时",
200
+ unit: "hours",
201
201
  },
202
202
  });
203
203
  }
@@ -211,17 +211,17 @@ function detectMessengerTimeout(cur, t) {
211
211
  id: "messenger_re_unanswered",
212
212
  category: "messenger_timeout",
213
213
  severity: "warning",
214
- title: "商家再次未回复",
215
- message: `您 ${Math.round(unansweredHours)} 小时前的消息商家尚未回复`,
216
- action: "可发送催促消息;若商家持续无响应,考虑仲裁",
214
+ title: "Merchant did not reply again",
215
+ message: `The merchant has not replied to your message from ${Math.round(unansweredHours)} hours ago`,
216
+ action: "Send a follow-up message; if the merchant remains unresponsive, consider arbitration",
217
217
  timestamp: cur.now,
218
218
  order_id: cur.order_id,
219
219
  service_id: cur.service_id,
220
220
  metric: {
221
- label: "再次未回复时长",
221
+ label: "Re-no-reply duration",
222
222
  value: Math.round(unansweredHours),
223
223
  threshold: Math.round(t.messenger_timeout_hours),
224
- unit: "小时",
224
+ unit: "hours",
225
225
  },
226
226
  });
227
227
  }
@@ -236,17 +236,17 @@ function detectPostCompletionAlerts(cur, t) {
236
236
  id: "review_window_closing",
237
237
  category: "review_window",
238
238
  severity: "info",
239
- title: "评价窗口即将关闭",
240
- message: `评价窗口将在 ${cur.review_window_days} 天后关闭`,
241
- action: "尽快提交评价(如有证据可一并提交)",
239
+ title: "Review window about to close",
240
+ message: `The review window will close in ${cur.review_window_days} day(s)`,
241
+ action: "Submit a review as soon as possible (evidence can be submitted together if available)",
242
242
  timestamp: cur.now,
243
243
  order_id: cur.order_id,
244
244
  service_id: cur.service_id,
245
245
  metric: {
246
- label: "剩余天数",
246
+ label: "Remaining days",
247
247
  value: cur.review_window_days,
248
248
  threshold: t.review_window_closing_days,
249
- unit: "",
249
+ unit: "days",
250
250
  },
251
251
  });
252
252
  }
@@ -255,9 +255,9 @@ function detectPostCompletionAlerts(cur, t) {
255
255
  id: "review_reminder",
256
256
  category: "review_window",
257
257
  severity: "info",
258
- title: "订单已完成",
259
- message: `订单已完成,评价窗口剩余 ${cur.review_window_days} 天`,
260
- action: "可提交评价帮助其他用户决策",
258
+ title: "Order completed",
259
+ message: `Order completed; review window has ${cur.review_window_days} day(s) remaining`,
260
+ action: "Submit a review to help other users decide",
261
261
  timestamp: cur.now,
262
262
  order_id: cur.order_id,
263
263
  service_id: cur.service_id,
@@ -270,17 +270,17 @@ function detectPostCompletionAlerts(cur, t) {
270
270
  id: "arb_window_closing",
271
271
  category: "arb_window",
272
272
  severity: "warning",
273
- title: "仲裁申请窗口即将关闭",
274
- message: `仲裁申请窗口将在 ${cur.arb_window_days} 天后关闭`,
275
- action: "若有未解决争议,立即发起仲裁申请",
273
+ title: "Arbitration application window about to close",
274
+ message: `The arbitration application window will close in ${cur.arb_window_days} day(s)`,
275
+ action: "If there are unresolved disputes, initiate an arbitration application immediately",
276
276
  timestamp: cur.now,
277
277
  order_id: cur.order_id,
278
278
  service_id: cur.service_id,
279
279
  metric: {
280
- label: "剩余天数",
280
+ label: "Remaining days",
281
281
  value: cur.arb_window_days,
282
282
  threshold: t.arb_window_closing_days,
283
- unit: "",
283
+ unit: "days",
284
284
  },
285
285
  });
286
286
  }
@@ -299,18 +299,18 @@ export function getActionableAlerts(alerts) {
299
299
  }
300
300
  export function summarizeAlerts(alerts) {
301
301
  if (alerts.length === 0)
302
- return "✅ 暂无告警,订单状态正常";
302
+ return "✅ No alerts; order status is normal";
303
303
  const critical = alerts.filter((a) => a.severity === "critical");
304
304
  const warning = alerts.filter((a) => a.severity === "warning");
305
305
  const info = alerts.filter((a) => a.severity === "info");
306
306
  const parts = [];
307
307
  if (critical.length > 0)
308
- parts.push(`🔴 ${critical.length} 条严重告警`);
308
+ parts.push(`🔴 ${critical.length} critical alert(s)`);
309
309
  if (warning.length > 0)
310
- parts.push(`🟠 ${warning.length} 条警告`);
310
+ parts.push(`🟠 ${warning.length} warning(s)`);
311
311
  if (info.length > 0)
312
- parts.push(`ℹ️ ${info.length} 条提示`);
313
- return parts.join("");
312
+ parts.push(`ℹ️ ${info.length} info`);
313
+ return parts.join(", ");
314
314
  }
315
315
  export function isBlockingAlert(alert) {
316
316
  return alert.severity === "critical";
@@ -321,7 +321,7 @@ export function alertsToReminders(alerts) {
321
321
  priority: a.severity === "critical" ? "required"
322
322
  : a.severity === "warning" ? "recommended"
323
323
  : "info",
324
- message: `${a.title}:${a.message}`,
324
+ message: `${a.title}: ${a.message}`,
325
325
  }));
326
326
  }
327
327
  export { CUSTOMER_INTELLIGENCE_VERSION };