@wowok/agent-mcp 2.6.1 → 2.6.4

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 (246) hide show
  1. package/dist/customer/customer-advice.d.ts +31 -0
  2. package/dist/customer/customer-advice.js +129 -0
  3. package/dist/customer/index.d.ts +2 -0
  4. package/dist/customer/index.js +2 -0
  5. package/dist/customer/info-puzzle.d.ts +9 -2
  6. package/dist/customer/info-puzzle.js +34 -7
  7. package/dist/customer/order-monitor.d.ts +2 -0
  8. package/dist/customer/order-monitor.js +3 -2
  9. package/dist/customer/post-purchase.d.ts +2 -0
  10. package/dist/customer/post-purchase.js +6 -5
  11. package/dist/customer/preorder-compare.d.ts +24 -0
  12. package/dist/customer/preorder-compare.js +34 -0
  13. package/dist/customer/reminder-system.d.ts +2 -0
  14. package/dist/customer/reminder-system.js +2 -1
  15. package/dist/customer/risk-assessment.js +30 -7
  16. package/dist/customer/types.d.ts +7 -0
  17. package/dist/examples/arbitration-dispute-create.json +41 -0
  18. package/dist/examples/arbitration-vote-weighted.json +35 -0
  19. package/dist/examples/arbitration-voting-guard-add.json +38 -0
  20. package/dist/examples/demand-present-service.json +33 -0
  21. package/dist/examples/gen-passport-verify-guard.json +48 -0
  22. package/dist/examples/guard-template-balance-check.json +59 -0
  23. package/dist/examples/guard-template-time-lock.json +60 -0
  24. package/dist/examples/insurance-guard-claim-timelock.json +75 -0
  25. package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
  26. package/dist/examples/insurance-machine-create-publish.json +75 -0
  27. package/dist/examples/insurance-service-allocators-publish.json +56 -0
  28. package/dist/examples/machine-multisig-threshold.json +86 -0
  29. package/dist/examples/machine-template-7node-rental.json +119 -0
  30. package/dist/examples/payment-scenario-bound.json +45 -0
  31. package/dist/examples/rental-ziroom-machine-create.json +149 -0
  32. package/dist/examples/rental-ziroom-permission-create.json +42 -0
  33. package/dist/examples/rental-ziroom-service-create.json +89 -0
  34. package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
  35. package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
  36. package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
  37. package/dist/examples/retail-adv-reward-guard-add.json +51 -0
  38. package/dist/examples/retail-myshop-allocation-activate.json +55 -0
  39. package/dist/examples/retail-myshop-arbitration-create.json +40 -0
  40. package/dist/examples/retail-myshop-contact-create.json +43 -0
  41. package/dist/examples/retail-myshop-order-create.json +56 -0
  42. package/dist/examples/retail-myshop-progress-operate.json +38 -0
  43. package/dist/examples/retail-myshop-reward-create.json +35 -0
  44. package/dist/examples/retail-myshop-service-create.json +88 -0
  45. package/dist/examples/service-discount-issue.json +46 -0
  46. package/dist/examples/threebody-guard-create.json +56 -0
  47. package/dist/examples/threebody-machine-create.json +72 -0
  48. package/dist/examples/threebody-permission-create.json +38 -0
  49. package/dist/examples/threebody-service-allocators.json +49 -0
  50. package/dist/examples/travel-guard-time-lock.json +69 -0
  51. package/dist/examples/travel-guard-weather-oracle.json +70 -0
  52. package/dist/examples/travel-machine-create.json +136 -0
  53. package/dist/examples/travel-repository-create.json +47 -0
  54. package/dist/examples/travel-service-create.json +102 -0
  55. package/dist/examples/travel-treasury-create.json +34 -0
  56. package/dist/examples/treasury-deposit.json +37 -0
  57. package/dist/examples/treasury-withdraw.json +38 -0
  58. package/dist/extensions/business-modules.d.ts +49 -0
  59. package/dist/extensions/business-modules.js +287 -0
  60. package/dist/extensions/capability-manifest.js +216 -29
  61. package/dist/extensions/constraint-registry.js +21 -19
  62. package/dist/extensions/metric-registry.js +14 -14
  63. package/dist/extensions/mode-evaluator.js +16 -16
  64. package/dist/extensions/modes.js +141 -49
  65. package/dist/extensions/registry.d.ts +16 -9
  66. package/dist/extensions/registry.js +132 -44
  67. package/dist/extensions/types.d.ts +2 -0
  68. package/dist/index.js +50 -0
  69. package/dist/knowledge/deployment-scanner.js +1 -1
  70. package/dist/knowledge/fund-layer.d.ts +138 -0
  71. package/dist/knowledge/fund-layer.js +969 -0
  72. package/dist/knowledge/guard-render.d.ts +57 -0
  73. package/dist/knowledge/guard-render.js +700 -0
  74. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  75. package/dist/knowledge/guard-submission-prompt.js +171 -0
  76. package/dist/knowledge/guard-templates.d.ts +10 -0
  77. package/dist/knowledge/guard-templates.js +50 -0
  78. package/dist/knowledge/index.d.ts +2 -2
  79. package/dist/knowledge/index.js +2 -2
  80. package/dist/knowledge/machine-ledger.js +1 -1
  81. package/dist/knowledge/machine-render.d.ts +41 -0
  82. package/dist/knowledge/machine-render.js +565 -0
  83. package/dist/knowledge/machine-risk.js +4 -1
  84. package/dist/knowledge/machine-templates.js +4 -4
  85. package/dist/knowledge/progress-context.js +1 -1
  86. package/dist/knowledge/progress-ledger.js +3 -3
  87. package/dist/knowledge/progress-templates.js +1 -1
  88. package/dist/knowledge/progress-translation.js +1 -1
  89. package/dist/knowledge/reward-confirm.js +2 -2
  90. package/dist/knowledge/reward-puzzle.js +1 -1
  91. package/dist/knowledge/reward-risk.js +9 -9
  92. package/dist/knowledge/reward-templates.js +2 -2
  93. package/dist/knowledge/safety-rules.d.ts +83 -1
  94. package/dist/knowledge/safety-rules.js +166 -2
  95. package/dist/knowledge/scenario-modes.d.ts +1 -1
  96. package/dist/knowledge/scenario-modes.js +13 -11
  97. package/dist/knowledge/service-confirm.d.ts +1 -1
  98. package/dist/knowledge/service-confirm.js +3 -3
  99. package/dist/knowledge/service-context.js +1 -1
  100. package/dist/knowledge/service-ledger.js +1 -1
  101. package/dist/knowledge/service-risk.d.ts +1 -1
  102. package/dist/knowledge/service-risk.js +3 -3
  103. package/dist/knowledge/service-templates.js +2 -2
  104. package/dist/knowledge/service-translation.d.ts +1 -1
  105. package/dist/knowledge/service-translation.js +7 -7
  106. package/dist/knowledge/template-registry.d.ts +48 -0
  107. package/dist/knowledge/template-registry.js +341 -0
  108. package/dist/knowledge/tool-constraints.js +6 -6
  109. package/dist/knowledge/tools-reference.js +11 -8
  110. package/dist/participation/merchant-interest.d.ts +32 -0
  111. package/dist/participation/merchant-interest.js +100 -0
  112. package/dist/participation/radar-core.d.ts +104 -0
  113. package/dist/participation/radar-core.js +269 -0
  114. package/dist/project/context-assembly.js +8 -0
  115. package/dist/project/deployment-bridge.js +6 -5
  116. package/dist/project/deployment-doc.js +5 -5
  117. package/dist/project/edit-planner.d.ts +123 -0
  118. package/dist/project/edit-planner.js +1342 -0
  119. package/dist/project/evaluation.d.ts +36 -0
  120. package/dist/project/evaluation.js +734 -68
  121. package/dist/project/game-theory.d.ts +43 -0
  122. package/dist/project/game-theory.js +177 -0
  123. package/dist/project/graph-builder.js +7 -1
  124. package/dist/project/handlers.d.ts +137 -2
  125. package/dist/project/handlers.js +423 -51
  126. package/dist/project/intent-analyzer.d.ts +71 -0
  127. package/dist/project/intent-analyzer.js +149 -0
  128. package/dist/project/machine-nodes.d.ts +2 -0
  129. package/dist/project/machine-nodes.js +36 -0
  130. package/dist/project/merchant-guide.d.ts +165 -0
  131. package/dist/project/merchant-guide.js +264 -0
  132. package/dist/project/mode-actions.d.ts +199 -0
  133. package/dist/project/mode-actions.js +309 -0
  134. package/dist/project/participation-radar.d.ts +18 -0
  135. package/dist/project/participation-radar.js +428 -0
  136. package/dist/project/pipeline-actions.d.ts +101 -0
  137. package/dist/project/pipeline-actions.js +109 -0
  138. package/dist/project/semantic-graph.d.ts +95 -0
  139. package/dist/project/semantic-graph.js +245 -0
  140. package/dist/project/stage-gate.js +4 -4
  141. package/dist/schema/call/allocation.d.ts +11 -11
  142. package/dist/schema/call/allocation.js +13 -3
  143. package/dist/schema/call/arbitration.d.ts +21 -21
  144. package/dist/schema/call/arbitration.js +30 -9
  145. package/dist/schema/call/base.d.ts +2 -2
  146. package/dist/schema/call/base.js +1 -1
  147. package/dist/schema/call/bridge.d.ts +127 -127
  148. package/dist/schema/call/bridge.js +12 -12
  149. package/dist/schema/call/contact.d.ts +3 -3
  150. package/dist/schema/call/contact.js +2 -2
  151. package/dist/schema/call/demand.d.ts +3 -3
  152. package/dist/schema/call/demand.js +2 -2
  153. package/dist/schema/call/guard.d.ts +11 -11
  154. package/dist/schema/call/guard.js +2 -2
  155. package/dist/schema/call/machine.d.ts +2072 -679
  156. package/dist/schema/call/machine.js +51 -5
  157. package/dist/schema/call/order.d.ts +7 -7
  158. package/dist/schema/call/order.js +3 -6
  159. package/dist/schema/call/payment.d.ts +3 -3
  160. package/dist/schema/call/permission.d.ts +3 -3
  161. package/dist/schema/call/permission.js +2 -2
  162. package/dist/schema/call/personal.d.ts +337 -3
  163. package/dist/schema/call/personal.js +10 -0
  164. package/dist/schema/call/progress.d.ts +177 -9
  165. package/dist/schema/call/progress.js +7 -3
  166. package/dist/schema/call/proof.d.ts +6 -6
  167. package/dist/schema/call/repository.d.ts +3 -3
  168. package/dist/schema/call/repository.js +2 -2
  169. package/dist/schema/call/reward.d.ts +57 -57
  170. package/dist/schema/call/reward.js +3 -3
  171. package/dist/schema/call/semantic.js +48 -2
  172. package/dist/schema/call/service.d.ts +285 -113
  173. package/dist/schema/call/service.js +92 -28
  174. package/dist/schema/call/treasury.d.ts +57 -57
  175. package/dist/schema/call/treasury.js +3 -3
  176. package/dist/schema/common/index.d.ts +2 -0
  177. package/dist/schema/common/index.js +46 -10
  178. package/dist/schema/local/index.js +5 -1
  179. package/dist/schema/messenger/index.js +4 -1
  180. package/dist/schema/operations.d.ts +1318 -317
  181. package/dist/schema/operations.js +76 -7
  182. package/dist/schema/project/index.d.ts +5662 -164
  183. package/dist/schema/project/index.js +1136 -5
  184. package/dist/schema/query/index.d.ts +580 -19
  185. package/dist/schema/query/index.js +88 -36
  186. package/dist/schema/schema-query/index.d.ts +59 -3
  187. package/dist/schema/schema-query/index.js +45 -6
  188. package/dist/schema/trust/index.d.ts +1012 -6
  189. package/dist/schema/trust/index.js +212 -11
  190. package/dist/schema/utils/node-parser.js +13 -0
  191. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  192. package/dist/schema/utils/object-type-utils.js +35 -0
  193. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  194. package/dist/schema/utils/permission-machine-check.js +121 -0
  195. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  196. package/dist/schema/utils/skills-recommendation.js +77 -0
  197. package/dist/schema-query/index.d.ts +17 -1
  198. package/dist/schema-query/index.js +359 -3
  199. package/dist/schemas/account_operation.schema.json +1 -1
  200. package/dist/schemas/bridge_operation.schema.json +14 -7
  201. package/dist/schemas/guard2file.schema.json +2 -0
  202. package/dist/schemas/index.json +1 -1
  203. package/dist/schemas/machineNode2file.schema.json +2 -0
  204. package/dist/schemas/messenger_operation.schema.json +1 -1
  205. package/dist/schemas/onchain_events.output.json +1 -1
  206. package/dist/schemas/onchain_operations.output.json +2820 -0
  207. package/dist/schemas/onchain_operations.schema.json +255 -65
  208. package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
  209. package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
  210. package/dist/schemas/onchain_operations_contact.schema.json +4 -3
  211. package/dist/schemas/onchain_operations_demand.schema.json +4 -3
  212. package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
  213. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
  214. package/dist/schemas/onchain_operations_guard.schema.json +579 -1
  215. package/dist/schemas/onchain_operations_machine.schema.json +5 -4
  216. package/dist/schemas/onchain_operations_order.schema.json +7 -6
  217. package/dist/schemas/onchain_operations_payment.schema.json +2 -1
  218. package/dist/schemas/onchain_operations_permission.schema.json +3 -2
  219. package/dist/schemas/onchain_operations_personal.schema.json +37 -0
  220. package/dist/schemas/onchain_operations_progress.schema.json +91 -4
  221. package/dist/schemas/onchain_operations_proof.schema.json +2 -1
  222. package/dist/schemas/onchain_operations_repository.schema.json +4 -3
  223. package/dist/schemas/onchain_operations_reward.schema.json +7 -6
  224. package/dist/schemas/onchain_operations_service.schema.json +80 -19
  225. package/dist/schemas/onchain_operations_treasury.schema.json +5 -4
  226. package/dist/schemas/onchain_table_data.output.json +1 -1
  227. package/dist/schemas/onchain_table_data.schema.json +10 -9
  228. package/dist/schemas/project_operation.output.json +3318 -57
  229. package/dist/schemas/project_operation.schema.json +728 -4
  230. package/dist/schemas/query_toolkit.output.json +16 -16
  231. package/dist/schemas/query_toolkit.schema.json +40 -3
  232. package/dist/schemas/schema_query.output.json +65 -2
  233. package/dist/schemas/schema_query.schema.json +31 -5
  234. package/dist/schemas/trust_score.output.json +392 -1
  235. package/dist/schemas/trust_score.schema.json +275 -1
  236. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  237. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  238. package/dist/tools/handlers/onchain.js +636 -6
  239. package/dist/tools/handlers/project.js +71 -2
  240. package/dist/tools/handlers/query.js +117 -2
  241. package/dist/tools/handlers/schema-query.js +65 -1
  242. package/dist/tools/handlers/trust.js +192 -6
  243. package/dist/tools/index.d.ts +8 -0
  244. package/dist/tools/index.js +229 -15
  245. package/dist/tools/wrap.js +194 -15
  246. 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: {
@@ -229,21 +229,37 @@ export class CapabilityRegistry {
229
229
  },
230
230
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
231
231
  depends_on_capabilities: [], version: "v1",
232
+ risk_profile: {
233
+ funds_risk: "low", trust_risk: "low", delivery_risk: "low", compliance_risk: "low",
234
+ known_risks: ["Index proliferation without naming convention makes permission audits harder"],
235
+ },
236
+ benefit_profile: {
237
+ automation_level: "medium", trust_boost: "high", efficiency_gain: "medium",
238
+ benefits: ["Role-based governance foundation for all other objects"],
239
+ },
232
240
  });
233
241
  this.registerCard({
234
242
  capability_id: "permission.role_assign",
235
243
  display_name: "Permission Role Assign",
236
- description: "为对象(Machine/Service/Allocation)分配角色权限索引",
244
+ description: "Assign role permission index to objects (Machine/Service/Allocation)",
237
245
  object_type: "permission", module: "handler", category: "trust",
238
246
  industry_agnostic: "high",
239
247
  config_template: { target_object: "<obj>", role: "<role_name>" },
240
248
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
241
249
  depends_on_capabilities: ["permission.index_create"], version: "v1",
250
+ risk_profile: {
251
+ funds_risk: "low", trust_risk: "medium", delivery_risk: "low", compliance_risk: "low",
252
+ known_risks: ["Mis-assigned role grants unintended operational authority"],
253
+ },
254
+ benefit_profile: {
255
+ automation_level: "high", trust_boost: "high", efficiency_gain: "medium",
256
+ benefits: ["Binds governance roles to concrete objects"],
257
+ },
242
258
  });
243
259
  this.registerCard({
244
260
  capability_id: "guard.validate_buy",
245
261
  display_name: "Guard Validate Buy",
246
- description: "下单验证:检查买家资格、订单参数、库存等条件",
262
+ description: "Order validation: check buyer eligibility, order parameters, inventory and other conditions",
247
263
  object_type: "guard", module: "handler", category: "validation",
248
264
  industry_agnostic: "medium",
249
265
  config_template: { host: "service", templates: [] },
@@ -254,11 +270,19 @@ export class CapabilityRegistry {
254
270
  },
255
271
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
256
272
  depends_on_capabilities: ["permission.index_create"], version: "v1",
273
+ risk_profile: {
274
+ funds_risk: "low", trust_risk: "medium", delivery_risk: "medium", compliance_risk: "low",
275
+ known_risks: ["Over-strict buy validation blocks legitimate orders; over-loose validation admits fraud"],
276
+ },
277
+ benefit_profile: {
278
+ automation_level: "high", trust_boost: "high", efficiency_gain: "high",
279
+ benefits: ["Automated purchase gating without manual review"],
280
+ },
257
281
  });
258
282
  this.registerCard({
259
283
  capability_id: "guard.validate_wip_hash",
260
284
  display_name: "Guard Validate WIP Hash",
261
- description: "验证 WIP(Work-In-Progress)哈希,用于数字交付物的里程碑验证",
285
+ description: "Validate WIP (Work-In-Progress) hash, used for milestone validation of digital deliverables",
262
286
  object_type: "guard", module: "handler", category: "evidence",
263
287
  industry_agnostic: "low",
264
288
  config_template: { host: "machine", templates: ["tpl_validate_wip_hash"] },
@@ -268,20 +292,28 @@ export class CapabilityRegistry {
268
292
  observed_in_industries: {}, success_count: 0, failure_count: 0,
269
293
  known_failure_modes: ["milestone mode requires WIP hash evidence — without WIP, allocation cannot advance"],
270
294
  depends_on_capabilities: ["guard.validate_buy"], version: "v1",
295
+ risk_profile: {
296
+ funds_risk: "low", trust_risk: "medium", delivery_risk: "high", compliance_risk: "low",
297
+ known_risks: ["Wrong hash algorithm or field mapping stalls milestone release"],
298
+ },
299
+ benefit_profile: {
300
+ automation_level: "high", trust_boost: "medium", efficiency_gain: "medium",
301
+ benefits: ["Tamper-proof delivery evidence for digital deliverables"],
302
+ },
271
303
  });
272
304
  this.registerCard({
273
305
  capability_id: "machine.node_topology",
274
306
  display_name: "Machine Node Topology",
275
- description: "工作流节点拓扑:定义订单从创建到完成的状态机",
307
+ description: "Workflow node topology: define the state machine from order creation to completion",
276
308
  object_type: "machine", module: "templates", category: "workflow",
277
309
  industry_agnostic: "low",
278
310
  config_template: {
279
311
  nodes: [
280
312
  { name: "paid", role: "Entry: order created and paid" },
281
313
  { name: "delivering", role: "Service delivery in progress" },
314
+ { name: "delivered", role: "Deliverable available for review" },
282
315
  { name: "completed", role: "Service completed, funds released" },
283
- { name: "refunded", role: "Customer refund path" },
284
- { name: "cancelled", role: "Pre-delivery cancellation" },
316
+ { name: "cancelled", role: "Pre-delivery cancellation — triggers refund Allocator" },
285
317
  ],
286
318
  },
287
319
  industry_overrides: {
@@ -291,7 +323,7 @@ export class CapabilityRegistry {
291
323
  { name: "delivered", role: "Goods delivered" },
292
324
  { name: "confirmed", role: "Buyer confirms receipt" },
293
325
  { name: "completed", role: "Funds released" },
294
- { name: "refunded", role: "Return & refund" },
326
+ { name: "returned", role: "Buyer ships goods back — triggers refund Allocator (R-M1-11)" },
295
327
  { name: "cancelled", role: "Pre-ship cancellation" },
296
328
  ] },
297
329
  freelance: { nodes: [
@@ -301,27 +333,42 @@ export class CapabilityRegistry {
301
333
  { name: "accepted", role: "Buyer accepts deliverable" },
302
334
  { name: "completed", role: "Funds released" },
303
335
  { name: "revision", role: "Revision requested" },
304
- { name: "refunded", role: "Refund path" },
305
- { name: "cancelled", role: "Pre-start cancellation" },
336
+ { name: "cancelled", role: "Pre-start cancellation — triggers refund Allocator (R-M1-11)" },
306
337
  ] },
307
338
  },
308
339
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
309
340
  depends_on_capabilities: ["permission.index_create"], version: "v1",
341
+ risk_profile: {
342
+ funds_risk: "low", trust_risk: "medium", delivery_risk: "high", compliance_risk: "low",
343
+ known_risks: ["Dead-end nodes or missing refund paths trap order funds"],
344
+ },
345
+ benefit_profile: {
346
+ automation_level: "medium", trust_boost: "medium", efficiency_gain: "high",
347
+ benefits: ["Declarative workflow from order creation to completion"],
348
+ },
310
349
  });
311
350
  this.registerCard({
312
351
  capability_id: "treasury.owner_receive",
313
352
  display_name: "Treasury Owner Receive",
314
- description: "资金托管:支持 owner_receive 模式,资金直接进入对象 owner 钱包",
353
+ description: "Fund escrow: supports owner_receive mode, funds go directly into the object owner wallet",
315
354
  object_type: "treasury", module: "handler", category: "fund_flow",
316
355
  industry_agnostic: "high",
317
356
  config_template: { owner_receive: true },
318
357
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
319
358
  depends_on_capabilities: [], version: "v1",
359
+ risk_profile: {
360
+ funds_risk: "high", trust_risk: "medium", delivery_risk: "low", compliance_risk: "low",
361
+ known_risks: ["Direct fund custody — misconfigured owner diverts all proceeds"],
362
+ },
363
+ benefit_profile: {
364
+ automation_level: "high", trust_boost: "medium", efficiency_gain: "medium",
365
+ benefits: ["Automated escrow and owner settlement"],
366
+ },
320
367
  });
321
368
  this.registerCard({
322
369
  capability_id: "allocation.distribute",
323
370
  display_name: "Multi-tier Allocation Distribution",
324
- description: "多级分账:支持按比例 / 按顺序 / 按条件分配资金给多个接收者",
371
+ description: "Multi-tier allocation: supports distributing funds to multiple recipients by ratio / by order / by condition",
325
372
  object_type: "allocation", module: "handler", category: "fund_flow",
326
373
  industry_agnostic: "medium",
327
374
  config_template: {
@@ -335,11 +382,19 @@ export class CapabilityRegistry {
335
382
  observed_in_industries: {}, success_count: 0, failure_count: 0,
336
383
  known_failure_modes: ["milestone mode requires WIP hash evidence — without WIP, allocation cannot advance"],
337
384
  depends_on_capabilities: ["treasury.owner_receive", "guard.validate_buy"], version: "v1",
385
+ risk_profile: {
386
+ funds_risk: "high", trust_risk: "low", delivery_risk: "medium", compliance_risk: "low",
387
+ known_risks: ["Wrong split ratios or recipient addresses misdirect settlement funds"],
388
+ },
389
+ benefit_profile: {
390
+ automation_level: "high", trust_boost: "medium", efficiency_gain: "high",
391
+ benefits: ["Multi-recipient settlement without manual transfers"],
392
+ },
338
393
  });
339
394
  this.registerCard({
340
395
  capability_id: "allocation.distribute_milestone",
341
396
  display_name: "Milestone-based Allocation",
342
- description: "里程碑分账:按交付里程碑释放资金,每里程碑需 WIP 哈希验证",
397
+ description: "Milestone allocation: release funds by delivery milestones, each milestone requires WIP hash validation",
343
398
  object_type: "allocation", module: "handler", category: "fund_flow",
344
399
  industry_agnostic: "low",
345
400
  config_template: {
@@ -351,11 +406,19 @@ export class CapabilityRegistry {
351
406
  },
352
407
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
353
408
  depends_on_capabilities: ["allocation.distribute", "guard.validate_wip_hash"], version: "v1",
409
+ risk_profile: {
410
+ funds_risk: "high", trust_risk: "medium", delivery_risk: "medium", compliance_risk: "low",
411
+ known_risks: ["Stuck milestone gates lock buyer funds until evidence is supplied"],
412
+ },
413
+ benefit_profile: {
414
+ automation_level: "medium", trust_boost: "high", efficiency_gain: "medium",
415
+ benefits: ["Evidence-gated release protects both buyer and provider"],
416
+ },
354
417
  });
355
418
  this.registerCard({
356
419
  capability_id: "service.publish",
357
420
  display_name: "Service Publish",
358
- description: "发布 Service 对象到链上,绑定 Machine/Guard/Permission/Allocation 等依赖",
421
+ description: "Publish Service object on-chain, bind Machine/Guard/Permission/Allocation and other dependencies",
359
422
  object_type: "service", module: "handler", category: "lifecycle",
360
423
  industry_agnostic: "high",
361
424
  config_template: {
@@ -364,7 +427,7 @@ export class CapabilityRegistry {
364
427
  permission: "<permission_name>",
365
428
  order_allocators: ["<allocation_name>"],
366
429
  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.",
430
+ 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
431
  },
369
432
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
370
433
  depends_on_capabilities: [
@@ -372,96 +435,220 @@ export class CapabilityRegistry {
372
435
  "allocation.distribute", "treasury.owner_receive",
373
436
  ],
374
437
  version: "v1",
438
+ risk_profile: {
439
+ funds_risk: "medium", trust_risk: "medium", delivery_risk: "medium", compliance_risk: "medium",
440
+ known_risks: ["Publish freezes machine binding and order_allocators permanently (E_ALREADY_PUBLISHED)"],
441
+ },
442
+ benefit_profile: {
443
+ automation_level: "medium", trust_boost: "medium", efficiency_gain: "medium",
444
+ benefits: ["On-chain discoverability and order intake"],
445
+ },
375
446
  });
376
447
  this.registerCard({
377
448
  capability_id: "progress.advance",
378
449
  display_name: "Progress Advance",
379
- description: "订单履约进度推进:基于 Machine 节点拓扑前进到下一状态",
450
+ description: "Order fulfillment progress advance: advance to next state based on Machine node topology",
380
451
  object_type: "progress", module: "handler", category: "workflow",
381
452
  industry_agnostic: "medium",
382
453
  config_template: { parent: "<machine_name>" },
383
454
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
384
455
  depends_on_capabilities: ["machine.node_topology"], version: "v1",
456
+ risk_profile: {
457
+ funds_risk: "medium", trust_risk: "low", delivery_risk: "high", compliance_risk: "low",
458
+ known_risks: ["Forward without authorized executor permanently stalls the order"],
459
+ },
460
+ benefit_profile: {
461
+ automation_level: "high", trust_boost: "medium", efficiency_gain: "high",
462
+ benefits: ["Deterministic order state progression"],
463
+ },
385
464
  });
386
465
  this.registerCard({
387
466
  capability_id: "arb.vote_weighted",
388
467
  display_name: "Arbitration Vote Weighted",
389
- description: "guard-based 加权投票仲裁:按 Guard 权重投票决定仲裁结果",
468
+ description: "guard-based weighted voting arbitration: vote by Guard weight to determine arbitration result",
390
469
  object_type: "arb", module: "handler", category: "trust",
391
470
  industry_agnostic: "medium",
392
471
  config_template: { guard: "<guard_name>", voting_rule: "guard_weighted" },
393
472
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
394
473
  depends_on_capabilities: ["guard.validate_buy"], version: "v1",
474
+ risk_profile: {
475
+ funds_risk: "low", trust_risk: "high", delivery_risk: "medium", compliance_risk: "medium",
476
+ known_risks: ["Shared permission with Service destroys dispute independence (E_ARBITRATION_PERMISSION_CONFLICT)"],
477
+ },
478
+ benefit_profile: {
479
+ automation_level: "medium", trust_boost: "high", efficiency_gain: "low",
480
+ benefits: ["Neutral third-party dispute resolution"],
481
+ },
395
482
  });
396
483
  this.registerCard({
397
484
  capability_id: "reward.claim_guard",
398
485
  display_name: "Reward Claim Guard",
399
- description: "奖励申领:通过 Guard 验证申领条件(如好评、复购)后释放奖励",
486
+ description: "Reward claim: release reward after validating claim conditions (such as positive review, repurchase) via Guard",
400
487
  object_type: "reward", module: "handler", category: "fund_flow",
401
488
  industry_agnostic: "medium",
402
489
  config_template: { claim_guard: "<guard_name>", max_guard_count: 1 },
403
490
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
404
491
  depends_on_capabilities: ["guard.validate_buy"], version: "v1",
492
+ risk_profile: {
493
+ funds_risk: "medium", trust_risk: "low", delivery_risk: "low", compliance_risk: "low",
494
+ known_risks: ["Loose claim conditions drain the reward pool"],
495
+ },
496
+ benefit_profile: {
497
+ automation_level: "high", trust_boost: "medium", efficiency_gain: "medium",
498
+ benefits: ["Incentivizes reviews and repurchase"],
499
+ },
405
500
  });
406
501
  this.registerCard({
407
502
  capability_id: "contact.im_create",
408
503
  display_name: "Contact IM Create",
409
- description: "创建 IM 联系对象:买卖双方通过 Messenger 通信",
504
+ description: "Create IM contact object: buyer and seller communicate via Messenger",
410
505
  object_type: "contact", module: "handler", category: "communication",
411
506
  industry_agnostic: "high",
412
507
  config_template: {},
413
508
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
414
509
  depends_on_capabilities: [], version: "v1",
510
+ risk_profile: {
511
+ funds_risk: "low", trust_risk: "low", delivery_risk: "low", compliance_risk: "low",
512
+ known_risks: ["Unattended IM channel degrades dispute response time"],
513
+ },
514
+ benefit_profile: {
515
+ automation_level: "medium", trust_boost: "medium", efficiency_gain: "medium",
516
+ benefits: ["Direct buyer-seller encrypted communication"],
517
+ },
415
518
  });
416
519
  this.registerCard({
417
520
  capability_id: "demand.matching",
418
521
  display_name: "Demand Matching",
419
- description: "需求匹配:根据用户需求匹配对应 Service",
522
+ description: "Demand matching: match corresponding Service based on user demand",
420
523
  object_type: "demand", module: "handler", category: "query",
421
524
  industry_agnostic: "high",
422
525
  config_template: {},
423
526
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
424
527
  depends_on_capabilities: ["service.publish"], version: "v1",
528
+ risk_profile: {
529
+ funds_risk: "low", trust_risk: "low", delivery_risk: "low", compliance_risk: "low",
530
+ known_risks: ["Poor matching signals bury quality services"],
531
+ },
532
+ benefit_profile: {
533
+ automation_level: "medium", trust_boost: "low", efficiency_gain: "medium",
534
+ benefits: ["Demand-side discovery channel"],
535
+ },
425
536
  });
426
537
  this.registerCard({
427
538
  capability_id: "repository.write_validate",
428
539
  display_name: "Repository Write Validate",
429
- description: "知识库写入验证:通过 Guard 验证写入权限和数据格式",
540
+ description: "Knowledge base write validation: validate write permissions and data format via Guard",
430
541
  object_type: "repository", module: "handler", category: "validation",
431
542
  industry_agnostic: "high",
432
543
  config_template: {},
433
544
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
434
545
  depends_on_capabilities: ["guard.validate_buy"], version: "v1",
546
+ risk_profile: {
547
+ funds_risk: "low", trust_risk: "medium", delivery_risk: "low", compliance_risk: "medium",
548
+ known_risks: ["Unvalidated writes pollute the knowledge base with unverifiable claims"],
549
+ },
550
+ benefit_profile: {
551
+ automation_level: "medium", trust_boost: "high", efficiency_gain: "medium",
552
+ benefits: ["Guard-gated attestation for off-chain data"],
553
+ },
435
554
  });
436
555
  this.registerCard({
437
556
  capability_id: "proof.evidence_anchor",
438
557
  display_name: "Proof Evidence Anchor",
439
- description: "凭证上链:将交付凭证(哈希)锚定到链上 Progress 节点",
558
+ description: "Evidence on-chain: anchor delivery evidence (hash) to on-chain Progress node",
440
559
  object_type: "proof", module: "handler", category: "evidence",
441
560
  industry_agnostic: "medium",
442
561
  config_template: {},
443
562
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
444
563
  depends_on_capabilities: ["progress.advance"], version: "v1",
564
+ risk_profile: {
565
+ funds_risk: "low", trust_risk: "medium", delivery_risk: "low", compliance_risk: "low",
566
+ known_risks: ["Anchored evidence is immutable — wrong hash cannot be corrected"],
567
+ },
568
+ benefit_profile: {
569
+ automation_level: "high", trust_boost: "high", efficiency_gain: "medium",
570
+ benefits: ["Immutable WTS evidence for Messenger confirmations"],
571
+ },
445
572
  });
446
573
  this.registerCard({
447
574
  capability_id: "personal.profile_manage",
448
575
  display_name: "Personal Profile Manage",
449
- description: "个人档案管理:用户身份/偏好/历史记录管理",
576
+ description: "Personal profile management: user identity/preference/history management",
450
577
  object_type: "personal", module: "handler", category: "data_model",
451
578
  industry_agnostic: "high",
452
579
  config_template: {},
453
580
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
454
581
  depends_on_capabilities: [], version: "v1",
582
+ risk_profile: {
583
+ funds_risk: "low", trust_risk: "low", delivery_risk: "low", compliance_risk: "medium",
584
+ known_risks: ["Profile data may fall under privacy regulation (PII)"],
585
+ },
586
+ benefit_profile: {
587
+ automation_level: "medium", trust_boost: "low", efficiency_gain: "low",
588
+ benefits: ["Portable user identity across services"],
589
+ },
455
590
  });
456
591
  this.registerCard({
457
592
  capability_id: "payment.settle",
458
593
  display_name: "Payment Settle",
459
- description: "支付结算:与 Allocation 协作完成资金结算",
594
+ description: "Payment settlement: complete fund settlement in collaboration with Allocation",
460
595
  object_type: "payment", module: "handler", category: "fund_flow",
461
596
  industry_agnostic: "high",
462
597
  config_template: {},
463
598
  observed_in_industries: {}, success_count: 0, failure_count: 0, known_failure_modes: [],
464
599
  depends_on_capabilities: ["allocation.distribute", "treasury.owner_receive"], version: "v1",
600
+ risk_profile: {
601
+ funds_risk: "high", trust_risk: "low", delivery_risk: "low", compliance_risk: "medium",
602
+ known_risks: ["Settlement errors are irreversible once funds transfer"],
603
+ },
604
+ benefit_profile: {
605
+ automation_level: "high", trust_boost: "low", efficiency_gain: "high",
606
+ benefits: ["Atomic settlement in collaboration with Allocation"],
607
+ },
608
+ });
609
+ this.registerCard({
610
+ capability_id: "guard.validate_withdraw",
611
+ display_name: "Guard Validate Withdraw",
612
+ description: "Withdrawal validation: gate fund release from Allocation escrow on delivery confirmation",
613
+ object_type: "guard", module: "handler", category: "validation",
614
+ industry_agnostic: "medium",
615
+ config_template: { host: "service", templates: ["tpl_withdraw_on_completed"] },
616
+ industry_overrides: {
617
+ retail_d2c: { templates: ["tpl_withdraw_on_completed"] },
618
+ },
619
+ observed_in_industries: {}, success_count: 0, failure_count: 0,
620
+ known_failure_modes: ["Withdraw gate on wrong node lets merchant pull funds before delivery"],
621
+ depends_on_capabilities: ["allocation.distribute"], version: "v1",
622
+ risk_profile: {
623
+ funds_risk: "high", trust_risk: "medium", delivery_risk: "medium", compliance_risk: "low",
624
+ known_risks: ["Mis-gated withdrawal releases escrowed funds prematurely"],
625
+ },
626
+ benefit_profile: {
627
+ automation_level: "high", trust_boost: "high", efficiency_gain: "high",
628
+ benefits: ["Contract-enforced delivery gate replaces platform custody"],
629
+ },
630
+ });
631
+ this.registerCard({
632
+ capability_id: "guard.validate_refund",
633
+ display_name: "Guard Validate Refund",
634
+ description: "Refund validation: gate buyer refund on cancellation or return conditions",
635
+ object_type: "guard", module: "handler", category: "validation",
636
+ industry_agnostic: "medium",
637
+ config_template: { host: "service", templates: ["tpl_refund_on_cancelled"] },
638
+ industry_overrides: {
639
+ retail_d2c: { templates: ["tpl_refund_on_cancelled"] },
640
+ },
641
+ observed_in_industries: {}, success_count: 0, failure_count: 0,
642
+ known_failure_modes: ["Missing refund path on pre-delivery cancellation traps buyer funds"],
643
+ depends_on_capabilities: ["guard.validate_buy"], version: "v1",
644
+ risk_profile: {
645
+ funds_risk: "medium", trust_risk: "medium", delivery_risk: "medium", compliance_risk: "low",
646
+ known_risks: ["Over-broad refund conditions enable buyer abuse"],
647
+ },
648
+ benefit_profile: {
649
+ automation_level: "high", trust_boost: "high", efficiency_gain: "high",
650
+ benefits: ["Trustless buyer refund without merchant approval"],
651
+ },
465
652
  });
466
653
  }
467
654
  registerBuiltinEdges() {
@@ -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",
@@ -92,7 +92,9 @@ export class ConstraintRegistry {
92
92
  return this.constraints.delete(constraint_id);
93
93
  }
94
94
  checkConstraints(mode, _capabilityRegistry, extraConstraints) {
95
- const allConstraints = [...this.constraints.values()];
95
+ const disabled = new Set(mode.disabled_builtin_constraints ?? []);
96
+ const allConstraints = [...this.constraints.values()]
97
+ .filter(c => !(c.scope === "builtin" && disabled.has(c.constraint_id)));
96
98
  if (extraConstraints) {
97
99
  for (const c of extraConstraints) {
98
100
  if (!allConstraints.some(existing => existing.constraint_id === c.constraint_id)) {
@@ -117,10 +119,10 @@ export class ConstraintRegistry {
117
119
  return {
118
120
  constraint_id: constraint.constraint_id,
119
121
  display_name: constraint.display_name,
120
- violation: `缺少必需能力: ${rule.capability_id}`,
122
+ violation: `Missing required capability: ${rule.capability_id}`,
121
123
  severity: constraint.severity,
122
124
  action: constraint.on_violation,
123
- recommendation: `在 capabilities_used 中添加 "${rule.capability_id}"`,
125
+ recommendation: `Add "${rule.capability_id}" to capabilities_used`,
124
126
  };
125
127
  }
126
128
  return null;
@@ -130,10 +132,10 @@ export class ConstraintRegistry {
130
132
  return {
131
133
  constraint_id: constraint.constraint_id,
132
134
  display_name: constraint.display_name,
133
- violation: `包含禁止能力: ${rule.capability_id}`,
135
+ violation: `Contains forbidden capability: ${rule.capability_id}`,
134
136
  severity: constraint.severity,
135
137
  action: constraint.on_violation,
136
- recommendation: `从 capabilities_used 中移除 "${rule.capability_id}"`,
138
+ recommendation: `Remove "${rule.capability_id}" from capabilities_used`,
137
139
  };
138
140
  }
139
141
  return null;
@@ -146,20 +148,20 @@ export class ConstraintRegistry {
146
148
  return {
147
149
  constraint_id: constraint.constraint_id,
148
150
  display_name: constraint.display_name,
149
- violation: `${rule.field}=${fieldValue} 超过上限 ${rule.max}`,
151
+ violation: `${rule.field}=${fieldValue} exceeds upper limit ${rule.max}`,
150
152
  severity: constraint.severity,
151
153
  action: constraint.on_violation,
152
- recommendation: `将 ${rule.field} 降低到 ${rule.max} 以下`,
154
+ recommendation: `Reduce ${rule.field} below ${rule.max}`,
153
155
  };
154
156
  }
155
157
  if (rule.min !== undefined && fieldValue < rule.min) {
156
158
  return {
157
159
  constraint_id: constraint.constraint_id,
158
160
  display_name: constraint.display_name,
159
- violation: `${rule.field}=${fieldValue} 低于下限 ${rule.min}`,
161
+ violation: `${rule.field}=${fieldValue} below lower limit ${rule.min}`,
160
162
  severity: constraint.severity,
161
163
  action: constraint.on_violation,
162
- recommendation: `将 ${rule.field} 提高到 ${rule.min} 以上`,
164
+ recommendation: `Increase ${rule.field} above ${rule.min}`,
163
165
  };
164
166
  }
165
167
  return null;
@@ -168,10 +170,10 @@ export class ConstraintRegistry {
168
170
  return {
169
171
  constraint_id: constraint.constraint_id,
170
172
  display_name: constraint.display_name,
171
- violation: `自然语言条件待 AI 评估: "${rule.condition}"`,
173
+ violation: `Natural language condition pending AI evaluation: "${rule.condition}"`,
172
174
  severity: constraint.severity,
173
175
  action: constraint.on_violation,
174
- recommendation: `请 AI 评估该条件是否满足,并更新模式配置`,
176
+ recommendation: `Please have AI evaluate whether this condition is satisfied, and update the mode configuration`,
175
177
  };
176
178
  }
177
179
  default: