@wowok/agent-mcp 2.6.1 → 2.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/customer/info-puzzle.d.ts +1 -1
  2. package/dist/customer/info-puzzle.js +4 -2
  3. package/dist/customer/risk-assessment.js +26 -4
  4. package/dist/customer/types.d.ts +2 -0
  5. package/dist/examples/guard-template-balance-check.json +38 -0
  6. package/dist/examples/guard-template-time-lock.json +39 -0
  7. package/dist/examples/machine-template-7node-rental.json +114 -0
  8. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  9. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  10. package/dist/examples/rental-ziroom-service-create.json +80 -0
  11. package/dist/examples/retail-myshop-service-create.json +88 -0
  12. package/dist/extensions/capability-manifest.js +24 -24
  13. package/dist/extensions/constraint-registry.js +18 -18
  14. package/dist/extensions/metric-registry.js +14 -14
  15. package/dist/extensions/mode-evaluator.js +16 -16
  16. package/dist/extensions/modes.js +131 -45
  17. package/dist/extensions/registry.d.ts +2 -0
  18. package/dist/extensions/registry.js +63 -30
  19. package/dist/extensions/types.d.ts +1 -0
  20. package/dist/index.js +50 -0
  21. package/dist/knowledge/deployment-scanner.js +1 -1
  22. package/dist/knowledge/fund-layer.d.ts +72 -0
  23. package/dist/knowledge/fund-layer.js +420 -0
  24. package/dist/knowledge/guard-render.d.ts +57 -0
  25. package/dist/knowledge/guard-render.js +700 -0
  26. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  27. package/dist/knowledge/guard-submission-prompt.js +171 -0
  28. package/dist/knowledge/machine-ledger.js +1 -1
  29. package/dist/knowledge/machine-render.d.ts +41 -0
  30. package/dist/knowledge/machine-render.js +565 -0
  31. package/dist/knowledge/machine-templates.js +4 -4
  32. package/dist/knowledge/reward-confirm.js +2 -2
  33. package/dist/knowledge/reward-puzzle.js +1 -1
  34. package/dist/knowledge/reward-risk.js +9 -9
  35. package/dist/knowledge/reward-templates.js +2 -2
  36. package/dist/knowledge/service-confirm.d.ts +1 -1
  37. package/dist/knowledge/service-confirm.js +3 -3
  38. package/dist/knowledge/service-context.js +1 -1
  39. package/dist/knowledge/service-ledger.js +1 -1
  40. package/dist/knowledge/service-risk.d.ts +1 -1
  41. package/dist/knowledge/service-risk.js +3 -3
  42. package/dist/knowledge/service-templates.js +2 -2
  43. package/dist/knowledge/service-translation.d.ts +1 -1
  44. package/dist/knowledge/service-translation.js +7 -7
  45. package/dist/project/deployment-bridge.js +6 -5
  46. package/dist/project/deployment-doc.js +5 -5
  47. package/dist/project/edit-planner.d.ts +123 -0
  48. package/dist/project/edit-planner.js +1371 -0
  49. package/dist/project/evaluation.js +314 -14
  50. package/dist/project/graph-builder.js +6 -1
  51. package/dist/project/handlers.d.ts +99 -2
  52. package/dist/project/handlers.js +358 -16
  53. package/dist/project/stage-gate.js +4 -4
  54. package/dist/schema/call/allocation.js +2 -2
  55. package/dist/schema/call/arbitration.js +19 -6
  56. package/dist/schema/call/contact.js +2 -2
  57. package/dist/schema/call/demand.js +2 -2
  58. package/dist/schema/call/guard.js +1 -1
  59. package/dist/schema/call/machine.d.ts +1975 -777
  60. package/dist/schema/call/machine.js +50 -4
  61. package/dist/schema/call/order.js +3 -6
  62. package/dist/schema/call/permission.js +2 -2
  63. package/dist/schema/call/repository.js +2 -2
  64. package/dist/schema/call/reward.js +3 -3
  65. package/dist/schema/call/semantic.js +7 -1
  66. package/dist/schema/call/service.d.ts +180 -8
  67. package/dist/schema/call/service.js +82 -27
  68. package/dist/schema/call/treasury.js +3 -3
  69. package/dist/schema/common/index.d.ts +2 -0
  70. package/dist/schema/common/index.js +46 -10
  71. package/dist/schema/local/index.js +5 -1
  72. package/dist/schema/operations.d.ts +755 -176
  73. package/dist/schema/operations.js +43 -7
  74. package/dist/schema/project/index.d.ts +969 -6
  75. package/dist/schema/project/index.js +268 -4
  76. package/dist/schema/query/index.d.ts +217 -0
  77. package/dist/schema/query/index.js +63 -33
  78. package/dist/schema/schema-query/index.d.ts +53 -3
  79. package/dist/schema/schema-query/index.js +17 -2
  80. package/dist/schema/utils/node-parser.js +13 -0
  81. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  82. package/dist/schema/utils/object-type-utils.js +35 -0
  83. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  84. package/dist/schema/utils/permission-machine-check.js +121 -0
  85. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  86. package/dist/schema/utils/skills-recommendation.js +76 -0
  87. package/dist/schema-query/index.d.ts +14 -1
  88. package/dist/schema-query/index.js +104 -2
  89. package/dist/schemas/account_operation.schema.json +1 -1
  90. package/dist/schemas/index.json +1 -1
  91. package/dist/schemas/onchain_events.output.json +1 -1
  92. package/dist/schemas/onchain_operations.output.json +2820 -0
  93. package/dist/schemas/onchain_operations.schema.json +115 -53
  94. package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
  95. package/dist/schemas/onchain_operations_arbitration.schema.json +9 -7
  96. package/dist/schemas/onchain_operations_contact.schema.json +3 -3
  97. package/dist/schemas/onchain_operations_demand.schema.json +3 -3
  98. package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
  99. package/dist/schemas/onchain_operations_guard.schema.json +1 -1
  100. package/dist/schemas/onchain_operations_machine.schema.json +4 -4
  101. package/dist/schemas/onchain_operations_order.schema.json +3 -3
  102. package/dist/schemas/onchain_operations_payment.schema.json +1 -1
  103. package/dist/schemas/onchain_operations_permission.schema.json +2 -2
  104. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  105. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  106. package/dist/schemas/onchain_operations_repository.schema.json +3 -3
  107. package/dist/schemas/onchain_operations_reward.schema.json +6 -6
  108. package/dist/schemas/onchain_operations_service.schema.json +77 -17
  109. package/dist/schemas/onchain_operations_treasury.schema.json +4 -4
  110. package/dist/schemas/onchain_table_data.output.json +1 -1
  111. package/dist/schemas/onchain_table_data.schema.json +10 -9
  112. package/dist/schemas/project_operation.output.json +1026 -7
  113. package/dist/schemas/project_operation.schema.json +46 -4
  114. package/dist/schemas/query_toolkit.output.json +15 -15
  115. package/dist/schemas/query_toolkit.schema.json +3 -3
  116. package/dist/schemas/schema_query.output.json +64 -1
  117. package/dist/schemas/schema_query.schema.json +3 -2
  118. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  119. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  120. package/dist/tools/handlers/onchain.js +571 -6
  121. package/dist/tools/handlers/project.js +25 -2
  122. package/dist/tools/handlers/schema-query.js +24 -1
  123. package/dist/tools/index.d.ts +8 -0
  124. package/dist/tools/index.js +177 -6
  125. package/package.json +2 -2
@@ -117,19 +117,19 @@ export class CapabilityRegistry {
117
117
  : Math.round(((covered.length - conflicting.length) / (covered.length + missing.length)) * 100);
118
118
  const recommendations = [];
119
119
  if (missing.length > 0) {
120
- recommendations.push(`缺失 ${missing.length} 个能力,需要新增:${missing.slice(0, 5).join(", ")}${missing.length > 5 ? "..." : ""}`);
120
+ recommendations.push(`Missing ${missing.length} capabilities, need to add: ${missing.slice(0, 5).join(", ")}${missing.length > 5 ? "..." : ""}`);
121
121
  }
122
122
  if (conflicting.length > 0) {
123
- recommendations.push(`检测到 ${conflicting.length} 个能力参数差异过大,需要重写配置`);
123
+ recommendations.push(`Detected ${conflicting.length} capabilities with large parameter differences, need to rewrite configuration`);
124
124
  }
125
125
  if (feasibility_score >= 80) {
126
- recommendations.push("迁移可行性高,可直接复用大部分能力");
126
+ recommendations.push("Migration feasibility is high, most capabilities can be reused directly");
127
127
  }
128
128
  else if (feasibility_score >= 50) {
129
- recommendations.push("迁移可行性中等,需要补充或重写部分能力");
129
+ recommendations.push("Migration feasibility is medium, need to supplement or rewrite some capabilities");
130
130
  }
131
131
  else {
132
- recommendations.push("迁移可行性低,建议基于 target 行业模板重新生成方案");
132
+ recommendations.push("Migration feasibility is low, recommend regenerating the plan based on the target industry template");
133
133
  }
134
134
  return {
135
135
  feasibility_score,
@@ -207,7 +207,7 @@ export class CapabilityRegistry {
207
207
  this.registerCard({
208
208
  capability_id: "permission.index_create",
209
209
  display_name: "Permission Index Create",
210
- description: "创建角色权限索引,支持 merchant/customer/arbiter 等多角色权限分配",
210
+ description: "Create role permission index, supports multi-role permission assignment such as merchant/customer/arbiter",
211
211
  object_type: "permission", module: "handler", category: "trust",
212
212
  industry_agnostic: "high",
213
213
  config_template: {
@@ -233,7 +233,7 @@ export class CapabilityRegistry {
233
233
  this.registerCard({
234
234
  capability_id: "permission.role_assign",
235
235
  display_name: "Permission Role Assign",
236
- description: "为对象(Machine/Service/Allocation)分配角色权限索引",
236
+ description: "Assign role permission index to objects (Machine/Service/Allocation)",
237
237
  object_type: "permission", module: "handler", category: "trust",
238
238
  industry_agnostic: "high",
239
239
  config_template: { target_object: "<obj>", role: "<role_name>" },
@@ -243,7 +243,7 @@ export class CapabilityRegistry {
243
243
  this.registerCard({
244
244
  capability_id: "guard.validate_buy",
245
245
  display_name: "Guard Validate Buy",
246
- description: "下单验证:检查买家资格、订单参数、库存等条件",
246
+ description: "Order validation: check buyer eligibility, order parameters, inventory and other conditions",
247
247
  object_type: "guard", module: "handler", category: "validation",
248
248
  industry_agnostic: "medium",
249
249
  config_template: { host: "service", templates: [] },
@@ -258,7 +258,7 @@ export class CapabilityRegistry {
258
258
  this.registerCard({
259
259
  capability_id: "guard.validate_wip_hash",
260
260
  display_name: "Guard Validate WIP Hash",
261
- description: "验证 WIP(Work-In-Progress)哈希,用于数字交付物的里程碑验证",
261
+ description: "Validate WIP (Work-In-Progress) hash, used for milestone validation of digital deliverables",
262
262
  object_type: "guard", module: "handler", category: "evidence",
263
263
  industry_agnostic: "low",
264
264
  config_template: { host: "machine", templates: ["tpl_validate_wip_hash"] },
@@ -272,7 +272,7 @@ export class CapabilityRegistry {
272
272
  this.registerCard({
273
273
  capability_id: "machine.node_topology",
274
274
  display_name: "Machine Node Topology",
275
- description: "工作流节点拓扑:定义订单从创建到完成的状态机",
275
+ description: "Workflow node topology: define the state machine from order creation to completion",
276
276
  object_type: "machine", module: "templates", category: "workflow",
277
277
  industry_agnostic: "low",
278
278
  config_template: {
@@ -311,7 +311,7 @@ export class CapabilityRegistry {
311
311
  this.registerCard({
312
312
  capability_id: "treasury.owner_receive",
313
313
  display_name: "Treasury Owner Receive",
314
- description: "资金托管:支持 owner_receive 模式,资金直接进入对象 owner 钱包",
314
+ description: "Fund escrow: supports owner_receive mode, funds go directly into the object owner wallet",
315
315
  object_type: "treasury", module: "handler", category: "fund_flow",
316
316
  industry_agnostic: "high",
317
317
  config_template: { owner_receive: true },
@@ -321,7 +321,7 @@ export class CapabilityRegistry {
321
321
  this.registerCard({
322
322
  capability_id: "allocation.distribute",
323
323
  display_name: "Multi-tier Allocation Distribution",
324
- description: "多级分账:支持按比例 / 按顺序 / 按条件分配资金给多个接收者",
324
+ description: "Multi-tier allocation: supports distributing funds to multiple recipients by ratio / by order / by condition",
325
325
  object_type: "allocation", module: "handler", category: "fund_flow",
326
326
  industry_agnostic: "medium",
327
327
  config_template: {
@@ -339,7 +339,7 @@ export class CapabilityRegistry {
339
339
  this.registerCard({
340
340
  capability_id: "allocation.distribute_milestone",
341
341
  display_name: "Milestone-based Allocation",
342
- description: "里程碑分账:按交付里程碑释放资金,每里程碑需 WIP 哈希验证",
342
+ description: "Milestone allocation: release funds by delivery milestones, each milestone requires WIP hash validation",
343
343
  object_type: "allocation", module: "handler", category: "fund_flow",
344
344
  industry_agnostic: "low",
345
345
  config_template: {
@@ -355,7 +355,7 @@ export class CapabilityRegistry {
355
355
  this.registerCard({
356
356
  capability_id: "service.publish",
357
357
  display_name: "Service Publish",
358
- description: "发布 Service 对象到链上,绑定 Machine/Guard/Permission/Allocation 等依赖",
358
+ description: "Publish Service object on-chain, bind Machine/Guard/Permission/Allocation and other dependencies",
359
359
  object_type: "service", module: "handler", category: "lifecycle",
360
360
  industry_agnostic: "high",
361
361
  config_template: {
@@ -364,7 +364,7 @@ export class CapabilityRegistry {
364
364
  permission: "<permission_name>",
365
365
  order_allocators: ["<allocation_name>"],
366
366
  compensation_fund_balance: 0,
367
- compensation_fund_add_hint: "Post-publish: call service.compensation_fund_add with Coin<T>. Recommend 5× max single-order amount.",
367
+ compensation_fund_add_hint: "Post-publish: call service.compensation_fund_add with Coin<T>. Recommend 3-10× max single-order amount (industry-specific: subscription 3×, retail 5×, rental 10×).",
368
368
  },
369
369
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
370
370
  depends_on_capabilities: [
@@ -376,7 +376,7 @@ export class CapabilityRegistry {
376
376
  this.registerCard({
377
377
  capability_id: "progress.advance",
378
378
  display_name: "Progress Advance",
379
- description: "订单履约进度推进:基于 Machine 节点拓扑前进到下一状态",
379
+ description: "Order fulfillment progress advance: advance to next state based on Machine node topology",
380
380
  object_type: "progress", module: "handler", category: "workflow",
381
381
  industry_agnostic: "medium",
382
382
  config_template: { parent: "<machine_name>" },
@@ -386,7 +386,7 @@ export class CapabilityRegistry {
386
386
  this.registerCard({
387
387
  capability_id: "arb.vote_weighted",
388
388
  display_name: "Arbitration Vote Weighted",
389
- description: "guard-based 加权投票仲裁:按 Guard 权重投票决定仲裁结果",
389
+ description: "guard-based weighted voting arbitration: vote by Guard weight to determine arbitration result",
390
390
  object_type: "arb", module: "handler", category: "trust",
391
391
  industry_agnostic: "medium",
392
392
  config_template: { guard: "<guard_name>", voting_rule: "guard_weighted" },
@@ -396,7 +396,7 @@ export class CapabilityRegistry {
396
396
  this.registerCard({
397
397
  capability_id: "reward.claim_guard",
398
398
  display_name: "Reward Claim Guard",
399
- description: "奖励申领:通过 Guard 验证申领条件(如好评、复购)后释放奖励",
399
+ description: "Reward claim: release reward after validating claim conditions (such as positive review, repurchase) via Guard",
400
400
  object_type: "reward", module: "handler", category: "fund_flow",
401
401
  industry_agnostic: "medium",
402
402
  config_template: { claim_guard: "<guard_name>", max_guard_count: 1 },
@@ -406,7 +406,7 @@ export class CapabilityRegistry {
406
406
  this.registerCard({
407
407
  capability_id: "contact.im_create",
408
408
  display_name: "Contact IM Create",
409
- description: "创建 IM 联系对象:买卖双方通过 Messenger 通信",
409
+ description: "Create IM contact object: buyer and seller communicate via Messenger",
410
410
  object_type: "contact", module: "handler", category: "communication",
411
411
  industry_agnostic: "high",
412
412
  config_template: {},
@@ -416,7 +416,7 @@ export class CapabilityRegistry {
416
416
  this.registerCard({
417
417
  capability_id: "demand.matching",
418
418
  display_name: "Demand Matching",
419
- description: "需求匹配:根据用户需求匹配对应 Service",
419
+ description: "Demand matching: match corresponding Service based on user demand",
420
420
  object_type: "demand", module: "handler", category: "query",
421
421
  industry_agnostic: "high",
422
422
  config_template: {},
@@ -426,7 +426,7 @@ export class CapabilityRegistry {
426
426
  this.registerCard({
427
427
  capability_id: "repository.write_validate",
428
428
  display_name: "Repository Write Validate",
429
- description: "知识库写入验证:通过 Guard 验证写入权限和数据格式",
429
+ description: "Knowledge base write validation: validate write permissions and data format via Guard",
430
430
  object_type: "repository", module: "handler", category: "validation",
431
431
  industry_agnostic: "high",
432
432
  config_template: {},
@@ -436,7 +436,7 @@ export class CapabilityRegistry {
436
436
  this.registerCard({
437
437
  capability_id: "proof.evidence_anchor",
438
438
  display_name: "Proof Evidence Anchor",
439
- description: "凭证上链:将交付凭证(哈希)锚定到链上 Progress 节点",
439
+ description: "Evidence on-chain: anchor delivery evidence (hash) to on-chain Progress node",
440
440
  object_type: "proof", module: "handler", category: "evidence",
441
441
  industry_agnostic: "medium",
442
442
  config_template: {},
@@ -446,7 +446,7 @@ export class CapabilityRegistry {
446
446
  this.registerCard({
447
447
  capability_id: "personal.profile_manage",
448
448
  display_name: "Personal Profile Manage",
449
- description: "个人档案管理:用户身份/偏好/历史记录管理",
449
+ description: "Personal profile management: user identity/preference/history management",
450
450
  object_type: "personal", module: "handler", category: "data_model",
451
451
  industry_agnostic: "high",
452
452
  config_template: {},
@@ -456,7 +456,7 @@ export class CapabilityRegistry {
456
456
  this.registerCard({
457
457
  capability_id: "payment.settle",
458
458
  display_name: "Payment Settle",
459
- description: "支付结算:与 Allocation 协作完成资金结算",
459
+ description: "Payment settlement: complete fund settlement in collaboration with Allocation",
460
460
  object_type: "payment", module: "handler", category: "fund_flow",
461
461
  industry_agnostic: "high",
462
462
  config_template: {},
@@ -1,8 +1,8 @@
1
1
  const BUILTIN_CONSTRAINTS = [
2
2
  {
3
3
  constraint_id: "require_arbitration",
4
- display_name: "必须仲裁",
5
- description: "模式必须包含仲裁能力(arb.*),用于争议解决",
4
+ display_name: "Require Arbitration",
5
+ description: "Mode must include arbitration capability (arb.*) for dispute resolution",
6
6
  rule: { type: "capability_required", capability_id: "arb.vote_weighted" },
7
7
  severity: "hard",
8
8
  on_violation: "block",
@@ -10,8 +10,8 @@ const BUILTIN_CONSTRAINTS = [
10
10
  },
11
11
  {
12
12
  constraint_id: "require_compensation_fund",
13
- display_name: "必须补偿基金",
14
- description: "模式必须包含资金托管能力(treasury.*),用于补偿基金",
13
+ display_name: "Require Compensation Fund",
14
+ description: "Mode must include fund escrow capability (treasury.*) for compensation fund",
15
15
  rule: { type: "capability_required", capability_id: "treasury.owner_receive" },
16
16
  severity: "hard",
17
17
  on_violation: "block",
@@ -19,8 +19,8 @@ const BUILTIN_CONSTRAINTS = [
19
19
  },
20
20
  {
21
21
  constraint_id: "require_wip_evidence",
22
- display_name: "必须 WIP 证据",
23
- description: "模式必须包含 WIP 证据能力(guard.validate_wip_hash),用于数字交付验证",
22
+ display_name: "Require WIP Evidence",
23
+ description: "Mode must include WIP evidence capability (guard.validate_wip_hash) for digital delivery validation",
24
24
  rule: { type: "capability_required", capability_id: "guard.validate_wip_hash" },
25
25
  severity: "soft",
26
26
  on_violation: "warn",
@@ -28,8 +28,8 @@ const BUILTIN_CONSTRAINTS = [
28
28
  },
29
29
  {
30
30
  constraint_id: "max_single_transaction_limit",
31
- display_name: "单笔交易限额",
32
- description: "单笔交易金额不超过 10000 WOW(默认值,可被模式覆盖)",
31
+ display_name: "Single Transaction Limit",
32
+ description: "Single transaction amount must not exceed 10000 WOW (default value, can be overridden by mode)",
33
33
  rule: { type: "numeric_limit", field: "max_single_transaction", max: 10000 },
34
34
  severity: "soft",
35
35
  on_violation: "warn",
@@ -117,10 +117,10 @@ export class ConstraintRegistry {
117
117
  return {
118
118
  constraint_id: constraint.constraint_id,
119
119
  display_name: constraint.display_name,
120
- violation: `缺少必需能力: ${rule.capability_id}`,
120
+ violation: `Missing required capability: ${rule.capability_id}`,
121
121
  severity: constraint.severity,
122
122
  action: constraint.on_violation,
123
- recommendation: `在 capabilities_used 中添加 "${rule.capability_id}"`,
123
+ recommendation: `Add "${rule.capability_id}" to capabilities_used`,
124
124
  };
125
125
  }
126
126
  return null;
@@ -130,10 +130,10 @@ export class ConstraintRegistry {
130
130
  return {
131
131
  constraint_id: constraint.constraint_id,
132
132
  display_name: constraint.display_name,
133
- violation: `包含禁止能力: ${rule.capability_id}`,
133
+ violation: `Contains forbidden capability: ${rule.capability_id}`,
134
134
  severity: constraint.severity,
135
135
  action: constraint.on_violation,
136
- recommendation: `从 capabilities_used 中移除 "${rule.capability_id}"`,
136
+ recommendation: `Remove "${rule.capability_id}" from capabilities_used`,
137
137
  };
138
138
  }
139
139
  return null;
@@ -146,20 +146,20 @@ export class ConstraintRegistry {
146
146
  return {
147
147
  constraint_id: constraint.constraint_id,
148
148
  display_name: constraint.display_name,
149
- violation: `${rule.field}=${fieldValue} 超过上限 ${rule.max}`,
149
+ violation: `${rule.field}=${fieldValue} exceeds upper limit ${rule.max}`,
150
150
  severity: constraint.severity,
151
151
  action: constraint.on_violation,
152
- recommendation: `将 ${rule.field} 降低到 ${rule.max} 以下`,
152
+ recommendation: `Reduce ${rule.field} below ${rule.max}`,
153
153
  };
154
154
  }
155
155
  if (rule.min !== undefined && fieldValue < rule.min) {
156
156
  return {
157
157
  constraint_id: constraint.constraint_id,
158
158
  display_name: constraint.display_name,
159
- violation: `${rule.field}=${fieldValue} 低于下限 ${rule.min}`,
159
+ violation: `${rule.field}=${fieldValue} below lower limit ${rule.min}`,
160
160
  severity: constraint.severity,
161
161
  action: constraint.on_violation,
162
- recommendation: `将 ${rule.field} 提高到 ${rule.min} 以上`,
162
+ recommendation: `Increase ${rule.field} above ${rule.min}`,
163
163
  };
164
164
  }
165
165
  return null;
@@ -168,10 +168,10 @@ export class ConstraintRegistry {
168
168
  return {
169
169
  constraint_id: constraint.constraint_id,
170
170
  display_name: constraint.display_name,
171
- violation: `自然语言条件待 AI 评估: "${rule.condition}"`,
171
+ violation: `Natural language condition pending AI evaluation: "${rule.condition}"`,
172
172
  severity: constraint.severity,
173
173
  action: constraint.on_violation,
174
- recommendation: `请 AI 评估该条件是否满足,并更新模式配置`,
174
+ recommendation: `Please have AI evaluate whether this condition is satisfied, and update the mode configuration`,
175
175
  };
176
176
  }
177
177
  default:
@@ -6,8 +6,8 @@ const LEVEL_WEIGHT = {
6
6
  const BUILTIN_RISK_METRICS = [
7
7
  {
8
8
  metric_id: "funds_risk",
9
- display_name: "资金风险",
10
- description: "直接操作资金 / 影响资金流向 / 无资金风险",
9
+ display_name: "Funds Risk",
10
+ description: "Directly operates funds / affects fund flow / no fund risk",
11
11
  type: "risk",
12
12
  scale: "level",
13
13
  weight: 1.0,
@@ -15,8 +15,8 @@ const BUILTIN_RISK_METRICS = [
15
15
  },
16
16
  {
17
17
  metric_id: "trust_risk",
18
- display_name: "信任风险",
19
- description: "影响信任机制的程度",
18
+ display_name: "Trust Risk",
19
+ description: "Degree of impact on trust mechanism",
20
20
  type: "risk",
21
21
  scale: "level",
22
22
  weight: 1.0,
@@ -24,8 +24,8 @@ const BUILTIN_RISK_METRICS = [
24
24
  },
25
25
  {
26
26
  metric_id: "delivery_risk",
27
- display_name: "履约风险",
28
- description: "影响订单履约的程度",
27
+ display_name: "Delivery Risk",
28
+ description: "Degree of impact on order fulfillment",
29
29
  type: "risk",
30
30
  scale: "level",
31
31
  weight: 1.0,
@@ -33,8 +33,8 @@ const BUILTIN_RISK_METRICS = [
33
33
  },
34
34
  {
35
35
  metric_id: "compliance_risk",
36
- display_name: "合规风险",
37
- description: "涉及监管的程度",
36
+ display_name: "Compliance Risk",
37
+ description: "Degree of regulatory involvement",
38
38
  type: "risk",
39
39
  scale: "level",
40
40
  weight: 1.0,
@@ -44,8 +44,8 @@ const BUILTIN_RISK_METRICS = [
44
44
  const BUILTIN_BENEFIT_METRICS = [
45
45
  {
46
46
  metric_id: "automation_level",
47
- display_name: "自动化等级",
48
- description: "全自动 / 半自动 / 手动",
47
+ display_name: "Automation Level",
48
+ description: "Fully automated / semi-automated / manual",
49
49
  type: "benefit",
50
50
  scale: "level",
51
51
  weight: 1.0,
@@ -53,8 +53,8 @@ const BUILTIN_BENEFIT_METRICS = [
53
53
  },
54
54
  {
55
55
  metric_id: "trust_boost",
56
- display_name: "信任提升",
57
- description: "对信任机制的增强程度",
56
+ display_name: "Trust Boost",
57
+ description: "Degree of enhancement to trust mechanism",
58
58
  type: "benefit",
59
59
  scale: "level",
60
60
  weight: 1.0,
@@ -62,8 +62,8 @@ const BUILTIN_BENEFIT_METRICS = [
62
62
  },
63
63
  {
64
64
  metric_id: "efficiency_gain",
65
- display_name: "效率提升",
66
- description: "对效率的提升程度",
65
+ display_name: "Efficiency Gain",
66
+ description: "Degree of efficiency improvement",
67
67
  type: "benefit",
68
68
  scale: "level",
69
69
  weight: 1.0,
@@ -70,34 +70,34 @@ export class ModeEvaluator {
70
70
  feasibility_score = Math.max(0, Math.min(100, Math.round(feasibility_score)));
71
71
  const recommendations = [];
72
72
  if (benefit_delta > 0) {
73
- recommendations.push(`收益提升 ${benefit_delta.toFixed(1)} 分,迁移有正向价值`);
73
+ recommendations.push(`Benefit increased by ${benefit_delta.toFixed(1)} points, migration has positive value`);
74
74
  }
75
75
  else if (benefit_delta < 0) {
76
- recommendations.push(`收益下降 ${Math.abs(benefit_delta).toFixed(1)} 分,需评估迁移必要性`);
76
+ recommendations.push(`Benefit decreased by ${Math.abs(benefit_delta).toFixed(1)} points, need to evaluate migration necessity`);
77
77
  }
78
78
  if (risk_delta > 10) {
79
- recommendations.push(`风险增加 ${risk_delta.toFixed(1)} 分,建议加强风险控制措施`);
79
+ recommendations.push(`Risk increased by ${risk_delta.toFixed(1)} points, recommend strengthening risk control measures`);
80
80
  }
81
81
  else if (risk_delta < -10) {
82
- recommendations.push(`风险降低 ${Math.abs(risk_delta).toFixed(1)} 分,迁移有助于风险管控`);
82
+ recommendations.push(`Risk decreased by ${Math.abs(risk_delta).toFixed(1)} points, migration helps risk management`);
83
83
  }
84
84
  if (added_capabilities.length > 0) {
85
- recommendations.push(`新增 ${added_capabilities.length} 个能力,需要额外配置:${added_capabilities.slice(0, 3).join(", ")}`);
85
+ recommendations.push(`Added ${added_capabilities.length} capabilities, need extra configuration: ${added_capabilities.slice(0, 3).join(", ")}`);
86
86
  }
87
87
  if (removed_capabilities.length > 0) {
88
- recommendations.push(`移除 ${removed_capabilities.length} 个能力,相关功能将不可用`);
88
+ recommendations.push(`Removed ${removed_capabilities.length} capabilities, related features will be unavailable`);
89
89
  }
90
90
  if (conflicting_capabilities.length > 0) {
91
- recommendations.push(`检测到 ${conflicting_capabilities.length} 个能力冲突,必须解决后才能迁移`);
91
+ recommendations.push(`Detected ${conflicting_capabilities.length} capability conflicts, must be resolved before migration`);
92
92
  }
93
93
  if (feasibility_score >= 70) {
94
- recommendations.push("迁移可行性高,建议执行");
94
+ recommendations.push("Migration feasibility is high, recommend executing");
95
95
  }
96
96
  else if (feasibility_score >= 40) {
97
- recommendations.push("迁移可行性中等,需谨慎评估");
97
+ recommendations.push("Migration feasibility is medium, need careful evaluation");
98
98
  }
99
99
  else {
100
- recommendations.push("迁移可行性低,建议保持当前模式或寻找替代方案");
100
+ recommendations.push("Migration feasibility is low, recommend keeping the current mode or finding an alternative");
101
101
  }
102
102
  return {
103
103
  feasibility_score,
@@ -142,13 +142,13 @@ export class ModeEvaluator {
142
142
  generateRecommendations(mode, risk_score, benefit_score, capability_conflicts, violated_constraints, unmet_conditions) {
143
143
  const recs = [];
144
144
  if (capability_conflicts.length > 0) {
145
- recs.push(`检测到 ${capability_conflicts.length} 个能力冲突,必须解决后才能应用模式`);
145
+ recs.push(`Detected ${capability_conflicts.length} capability conflicts, must be resolved before applying the mode`);
146
146
  }
147
147
  if (violated_constraints.length > 0) {
148
- recs.push(`检测到 ${violated_constraints.length} 个硬约束违规,需要补充缺失的能力或调整模式配置`);
148
+ recs.push(`Detected ${violated_constraints.length} hard constraint violations, need to supplement missing capabilities or adjust mode configuration`);
149
149
  }
150
150
  if (unmet_conditions.length > 0) {
151
- recs.push(`检测到 ${unmet_conditions.length} 个软约束未满足,建议调整以提升模式质量`);
151
+ recs.push(`Detected ${unmet_conditions.length} soft constraints not met, recommend adjusting to improve mode quality`);
152
152
  }
153
153
  const appetiteThresholds = {
154
154
  conservative: { max_risk: 30, min_benefit: 50 },
@@ -157,13 +157,13 @@ export class ModeEvaluator {
157
157
  };
158
158
  const threshold = appetiteThresholds[mode.risk_appetite];
159
159
  if (risk_score > threshold.max_risk) {
160
- recs.push(`风险评分 ${risk_score} 超过 ${mode.risk_appetite} 模式阈值 ${threshold.max_risk},建议降低风险或调整风险偏好`);
160
+ recs.push(`Risk score ${risk_score} exceeds ${mode.risk_appetite} mode threshold ${threshold.max_risk}, recommend reducing risk or adjusting risk appetite`);
161
161
  }
162
162
  if (benefit_score < threshold.min_benefit) {
163
- recs.push(`收益评分 ${benefit_score} 低于 ${mode.risk_appetite} 模式阈值 ${threshold.min_benefit},建议增加收益能力或调整风险偏好`);
163
+ recs.push(`Benefit score ${benefit_score} below ${mode.risk_appetite} mode threshold ${threshold.min_benefit}, recommend adding benefit capabilities or adjusting risk appetite`);
164
164
  }
165
165
  if (recs.length === 0) {
166
- recs.push(`模式评估通过:风险 ${risk_score} / 收益 ${benefit_score} / 风险-收益比 ${(benefit_score / Math.max(risk_score, 1)).toFixed(2)}`);
166
+ recs.push(`Mode evaluation passed: risk ${risk_score} / benefit ${benefit_score} / risk-benefit ratio ${(benefit_score / Math.max(risk_score, 1)).toFixed(2)}`);
167
167
  }
168
168
  return recs;
169
169
  }