@wowok/agent-mcp 2.7.2 → 2.7.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 (383) hide show
  1. package/dist/config/runtime.js +1 -1
  2. package/dist/customer/account-events.d.ts +32 -0
  3. package/dist/customer/account-events.js +1 -0
  4. package/dist/customer/customer-advice.d.ts +1 -0
  5. package/dist/customer/customer-advice.js +1 -1
  6. package/dist/customer/info-puzzle.js +1 -1
  7. package/dist/customer/order-strategy.d.ts +1 -1
  8. package/dist/customer/reminder-system.d.ts +2 -0
  9. package/dist/customer/reminder-system.js +1 -1
  10. package/dist/customer/risk-assessment.d.ts +1 -0
  11. package/dist/customer/risk-assessment.js +1 -1
  12. package/dist/customer/types.d.ts +2 -0
  13. package/dist/evaluation/builtins/arbitration-score.d.ts +41 -0
  14. package/dist/evaluation/builtins/arbitration-score.js +1 -0
  15. package/dist/evaluation/builtins/index.d.ts +1 -0
  16. package/dist/evaluation/builtins/index.js +1 -1
  17. package/dist/evaluation/category-match-rules.d.ts +30 -0
  18. package/dist/evaluation/category-match-rules.js +1 -0
  19. package/dist/evaluation/engine.js +1 -1
  20. package/dist/evaluation/extract.js +1 -1
  21. package/dist/evaluation/index.d.ts +1 -0
  22. package/dist/evaluation/index.js +1 -1
  23. package/dist/evaluation/location-match.d.ts +42 -0
  24. package/dist/evaluation/location-match.js +1 -0
  25. package/dist/evaluation/path-reasoning.d.ts +35 -0
  26. package/dist/evaluation/path-reasoning.js +1 -0
  27. package/dist/evaluation/region.d.ts +6 -0
  28. package/dist/evaluation/region.js +1 -1
  29. package/dist/evaluation/types.d.ts +17 -0
  30. package/dist/experience/realtime-feedback.js +1 -1
  31. package/dist/experience/user-profile.d.ts +1 -1
  32. package/dist/extensions/index.d.ts +6 -0
  33. package/dist/extensions/index.js +1 -1
  34. package/dist/extensions/industry-layers.d.ts +75 -0
  35. package/dist/extensions/industry-layers.js +1 -0
  36. package/dist/extensions/industry-pack.d.ts +105 -0
  37. package/dist/extensions/industry-pack.js +1 -0
  38. package/dist/extensions/metric-registry.js +1 -1
  39. package/dist/extensions/mode-evaluator.d.ts +1 -1
  40. package/dist/extensions/registry.d.ts +1 -0
  41. package/dist/extensions/registry.js +1 -1
  42. package/dist/graph/base.d.ts +8 -0
  43. package/dist/graph/base.js +1 -0
  44. package/dist/harness/index.d.ts +1 -0
  45. package/dist/harness/index.js +1 -1
  46. package/dist/harness/plan.d.ts +2 -0
  47. package/dist/harness/plan.js +1 -1
  48. package/dist/harness/recover.d.ts +1 -1
  49. package/dist/harness/types.d.ts +2 -3
  50. package/dist/index.js +1 -1
  51. package/dist/knowledge/allocation-confirm.js +1 -1
  52. package/dist/knowledge/anti-cheat.d.ts +37 -0
  53. package/dist/knowledge/anti-cheat.js +1 -0
  54. package/dist/knowledge/arb-confirm.d.ts +28 -0
  55. package/dist/knowledge/arb-confirm.js +1 -0
  56. package/dist/knowledge/arb-translation.d.ts +48 -0
  57. package/dist/knowledge/arb-translation.js +1 -0
  58. package/dist/knowledge/arbitration-context.js +1 -1
  59. package/dist/knowledge/arbitration-ledger.js +1 -1
  60. package/dist/knowledge/bridge-confirm.d.ts +26 -0
  61. package/dist/knowledge/bridge-confirm.js +1 -0
  62. package/dist/knowledge/bridge-translation.d.ts +37 -0
  63. package/dist/knowledge/bridge-translation.js +1 -0
  64. package/dist/knowledge/contact-confirm.d.ts +27 -0
  65. package/dist/knowledge/contact-confirm.js +1 -0
  66. package/dist/knowledge/contact-translation.d.ts +39 -0
  67. package/dist/knowledge/contact-translation.js +1 -0
  68. package/dist/knowledge/demand-confirm.js +1 -1
  69. package/dist/knowledge/demand-context.d.ts +17 -0
  70. package/dist/knowledge/demand-context.js +1 -0
  71. package/dist/knowledge/demand-ledger.d.ts +26 -0
  72. package/dist/knowledge/demand-ledger.js +1 -0
  73. package/dist/knowledge/demand-puzzle.d.ts +29 -0
  74. package/dist/knowledge/demand-puzzle.js +1 -0
  75. package/dist/knowledge/demand-risk.js +1 -1
  76. package/dist/knowledge/demand-templates.d.ts +12 -0
  77. package/dist/knowledge/demand-templates.js +1 -0
  78. package/dist/knowledge/demand-translation.js +1 -1
  79. package/dist/knowledge/deployment-scanner.js +1 -1
  80. package/dist/knowledge/evidence-review.d.ts +12 -0
  81. package/dist/knowledge/evidence-review.js +1 -0
  82. package/dist/knowledge/examples-scanner-cli.js +1 -1
  83. package/dist/knowledge/examples-scanner.js +1 -1
  84. package/dist/knowledge/flywheel-loop.d.ts +0 -1
  85. package/dist/knowledge/flywheel-loop.js +1 -1
  86. package/dist/knowledge/guard-design-patterns.js +1 -1
  87. package/dist/knowledge/guard-migration.d.ts +1 -1
  88. package/dist/knowledge/index.d.ts +71 -3
  89. package/dist/knowledge/index.js +1 -1
  90. package/dist/knowledge/industry-registry.js +1 -1
  91. package/dist/knowledge/machine-render.js +1 -1
  92. package/dist/knowledge/market-metrics.d.ts +12 -0
  93. package/dist/knowledge/market-metrics.js +1 -0
  94. package/dist/knowledge/market-operations.d.ts +46 -0
  95. package/dist/knowledge/market-operations.js +1 -0
  96. package/dist/knowledge/mcp-schema-audit-cli.js +1 -1
  97. package/dist/knowledge/mcp-schema-audit.d.ts +22 -22
  98. package/dist/knowledge/mcp-schema-audit.js +1 -1
  99. package/dist/knowledge/onchain-constants.d.ts +2 -2
  100. package/dist/knowledge/onchain-constants.js +1 -1
  101. package/dist/knowledge/payment-confirm.d.ts +26 -0
  102. package/dist/knowledge/payment-confirm.js +1 -0
  103. package/dist/knowledge/payment-risk.js +1 -1
  104. package/dist/knowledge/payment-translation.d.ts +37 -0
  105. package/dist/knowledge/payment-translation.js +1 -0
  106. package/dist/knowledge/permission-context.d.ts +11 -0
  107. package/dist/knowledge/permission-context.js +1 -1
  108. package/dist/knowledge/permission-ledger.d.ts +11 -0
  109. package/dist/knowledge/permission-ledger.js +1 -1
  110. package/dist/knowledge/personal-confirm.d.ts +29 -0
  111. package/dist/knowledge/personal-confirm.js +1 -0
  112. package/dist/knowledge/personal-risk.js +1 -1
  113. package/dist/knowledge/personal-translation.d.ts +37 -0
  114. package/dist/knowledge/personal-translation.js +1 -0
  115. package/dist/knowledge/process-model.d.ts +1 -11
  116. package/dist/knowledge/process-model.js +1 -1
  117. package/dist/knowledge/progress-ledger.js +1 -1
  118. package/dist/knowledge/progress-risk.js +1 -1
  119. package/dist/knowledge/progress-templates.js +1 -1
  120. package/dist/knowledge/progress-translation.js +1 -1
  121. package/dist/knowledge/proof-context.d.ts +17 -0
  122. package/dist/knowledge/proof-context.js +1 -0
  123. package/dist/knowledge/proof-ledger.d.ts +34 -0
  124. package/dist/knowledge/proof-ledger.js +1 -0
  125. package/dist/knowledge/proof-puzzle.d.ts +35 -0
  126. package/dist/knowledge/proof-puzzle.js +1 -0
  127. package/dist/knowledge/proof-templates.d.ts +22 -0
  128. package/dist/knowledge/proof-templates.js +1 -0
  129. package/dist/knowledge/registrar-confirm.d.ts +26 -0
  130. package/dist/knowledge/registrar-confirm.js +1 -0
  131. package/dist/knowledge/registrar-risk.js +1 -1
  132. package/dist/knowledge/registrar-translation.d.ts +37 -0
  133. package/dist/knowledge/registrar-translation.js +1 -0
  134. package/dist/knowledge/repository-context.d.ts +12 -0
  135. package/dist/knowledge/repository-context.js +1 -0
  136. package/dist/knowledge/repository-ledger.d.ts +25 -0
  137. package/dist/knowledge/repository-ledger.js +1 -0
  138. package/dist/knowledge/repository-puzzle.d.ts +30 -0
  139. package/dist/knowledge/repository-puzzle.js +1 -0
  140. package/dist/knowledge/repository-templates.d.ts +14 -0
  141. package/dist/knowledge/repository-templates.js +1 -0
  142. package/dist/knowledge/resource-confirm.d.ts +25 -0
  143. package/dist/knowledge/resource-confirm.js +1 -0
  144. package/dist/knowledge/resource-translation.d.ts +37 -0
  145. package/dist/knowledge/resource-translation.js +1 -0
  146. package/dist/knowledge/reward-context.d.ts +2 -2
  147. package/dist/knowledge/reward-ledger.js +1 -1
  148. package/dist/knowledge/reward-translation.js +1 -1
  149. package/dist/knowledge/safety-rules.d.ts +1 -0
  150. package/dist/knowledge/safety-rules.js +1 -1
  151. package/dist/knowledge/service-risk.d.ts +1 -1
  152. package/dist/knowledge/service-risk.js +1 -1
  153. package/dist/knowledge/template-registry.js +1 -1
  154. package/dist/knowledge/tools-reference.js +1 -1
  155. package/dist/knowledge/treasury-context.d.ts +1 -1
  156. package/dist/knowledge/treasury-context.js +1 -1
  157. package/dist/knowledge/treasury-ledger.js +1 -1
  158. package/dist/knowledge/treasury-risk.js +1 -1
  159. package/dist/knowledge/universal-template.d.ts +22 -0
  160. package/dist/knowledge/universal-template.js +1 -0
  161. package/dist/knowledge/util-confirm.d.ts +24 -0
  162. package/dist/knowledge/util-confirm.js +1 -0
  163. package/dist/knowledge/util-risk.js +1 -1
  164. package/dist/knowledge/util-translation.d.ts +39 -0
  165. package/dist/knowledge/util-translation.js +1 -0
  166. package/dist/knowledge/workflow-guidance.d.ts +180 -0
  167. package/dist/knowledge/workflow-guidance.js +1 -0
  168. package/dist/participation/employee-kpi.d.ts +25 -0
  169. package/dist/participation/employee-kpi.js +1 -0
  170. package/dist/participation/employee-store.d.ts +16 -0
  171. package/dist/participation/employee-store.js +1 -0
  172. package/dist/participation/index.d.ts +2 -0
  173. package/dist/participation/index.js +1 -0
  174. package/dist/persona/defaults.js +1 -1
  175. package/dist/persona/index.d.ts +9 -2
  176. package/dist/persona/index.js +1 -1
  177. package/dist/persona/local-region.d.ts +20 -0
  178. package/dist/persona/local-region.js +1 -0
  179. package/dist/persona/model.js +1 -1
  180. package/dist/persona/overrides.d.ts +10 -0
  181. package/dist/persona/overrides.js +1 -0
  182. package/dist/persona/pack-personae.d.ts +11 -0
  183. package/dist/persona/pack-personae.js +1 -0
  184. package/dist/persona/strategy-intent.d.ts +20 -0
  185. package/dist/persona/strategy-intent.js +1 -0
  186. package/dist/persona/types.d.ts +3 -1
  187. package/dist/project/business-puzzle.d.ts +1 -1
  188. package/dist/project/business-puzzle.js +1 -1
  189. package/dist/project/deployment-doc.js +1 -1
  190. package/dist/project/edit-planner.js +1 -1
  191. package/dist/project/evaluation.d.ts +37 -1
  192. package/dist/project/evaluation.js +1 -1
  193. package/dist/project/graph-builder.d.ts +2 -2
  194. package/dist/project/graph-builder.js +1 -1
  195. package/dist/project/graph.d.ts +3 -6
  196. package/dist/project/handlers.d.ts +33 -2
  197. package/dist/project/handlers.js +1 -1
  198. package/dist/project/index.d.ts +1 -0
  199. package/dist/project/index.js +1 -1
  200. package/dist/project/merchant-guide.d.ts +19 -0
  201. package/dist/project/merchant-guide.js +1 -1
  202. package/dist/project/mode-actions.js +1 -1
  203. package/dist/project/rollback-policy.js +1 -1
  204. package/dist/project/semantic-assembler.d.ts +2 -2
  205. package/dist/project/semantic-assembler.js +1 -1
  206. package/dist/project/semantic-graph.d.ts +3 -5
  207. package/dist/project/workflow-design-assessment.d.ts +24 -0
  208. package/dist/project/workflow-design-assessment.js +1 -0
  209. package/dist/safety/confirm-gate.d.ts +1 -1
  210. package/dist/safety/confirm-gate.js +1 -1
  211. package/dist/schema/call/allocation.d.ts +186 -1385
  212. package/dist/schema/call/arbitration.d.ts +272 -1871
  213. package/dist/schema/call/base.d.ts +1831 -9076
  214. package/dist/schema/call/base.js +1 -1
  215. package/dist/schema/call/bridge.d.ts +911 -3171
  216. package/dist/schema/call/contact.d.ts +135 -931
  217. package/dist/schema/call/demand.d.ts +164 -1194
  218. package/dist/schema/call/guard.d.ts +298 -1140
  219. package/dist/schema/call/guard.js +1 -1
  220. package/dist/schema/call/machine.d.ts +459 -5403
  221. package/dist/schema/call/machine.js +1 -1
  222. package/dist/schema/call/order.d.ts +137 -844
  223. package/dist/schema/call/payment.d.ts +74 -561
  224. package/dist/schema/call/permission.d.ts +335 -2791
  225. package/dist/schema/call/personal.d.ts +227 -1814
  226. package/dist/schema/call/progress.d.ts +140 -843
  227. package/dist/schema/call/proof.d.ts +42 -258
  228. package/dist/schema/call/repository.d.ts +324 -2222
  229. package/dist/schema/call/reward.d.ts +153 -1183
  230. package/dist/schema/call/semantic.js +1 -1
  231. package/dist/schema/call/service.d.ts +376 -3431
  232. package/dist/schema/call/treasury.d.ts +252 -2158
  233. package/dist/schema/common/index.d.ts +222 -697
  234. package/dist/schema/common/index.js +1 -1
  235. package/dist/schema/config/index.d.ts +18 -161
  236. package/dist/schema/employee/index.d.ts +99 -0
  237. package/dist/schema/employee/index.js +1 -0
  238. package/dist/schema/evaluation/index.d.ts +1035 -3918
  239. package/dist/schema/evaluation/index.js +1 -1
  240. package/dist/schema/index.d.ts +5 -0
  241. package/dist/schema/index.js +1 -1
  242. package/dist/schema/industry-pack/index.d.ts +132 -0
  243. package/dist/schema/industry-pack/index.js +1 -0
  244. package/dist/schema/intent-radar/index.d.ts +92 -245
  245. package/dist/schema/intent-radar/index.js +1 -1
  246. package/dist/schema/local/index.d.ts +2045 -18080
  247. package/dist/schema/local/index.js +1 -1
  248. package/dist/schema/local/wip.d.ts +61 -651
  249. package/dist/schema/local/wip.js +1 -1
  250. package/dist/schema/messenger/index.d.ts +949 -5557
  251. package/dist/schema/messenger/index.js +1 -1
  252. package/dist/schema/operations.d.ts +3168 -26468
  253. package/dist/schema/operations.js +1 -1
  254. package/dist/schema/permission/index.d.ts +121 -0
  255. package/dist/schema/permission/index.js +1 -0
  256. package/dist/schema/persona/index.d.ts +469 -1820
  257. package/dist/schema/persona/index.js +1 -1
  258. package/dist/schema/project/index.d.ts +1023 -8450
  259. package/dist/schema/project/index.js +1 -1
  260. package/dist/schema/query/index.d.ts +12121 -75556
  261. package/dist/schema/query/index.js +1 -1
  262. package/dist/schema/schema-query/index.d.ts +35 -98
  263. package/dist/schema/schema-query/index.js +1 -1
  264. package/dist/schema/schema-version.js +1 -1
  265. package/dist/schema/task-status.d.ts +26 -132
  266. package/dist/schema/trust/index.d.ts +194 -1290
  267. package/dist/schema/utils/guard-parser.js +1 -1
  268. package/dist/schema/utils/node-parser.js +1 -1
  269. package/dist/schema/utils/skills-recommendation.d.ts +1 -0
  270. package/dist/schema/utils/skills-recommendation.js +1 -1
  271. package/dist/schema/workflow/index.d.ts +161 -0
  272. package/dist/schema/workflow/index.js +1 -0
  273. package/dist/schema/workspace/index.d.ts +69 -0
  274. package/dist/schema/workspace/index.js +1 -0
  275. package/dist/{schema-query → schema-query-impl}/index.js +1 -1
  276. package/dist/schemas/account_operation.output.json +3147 -1655
  277. package/dist/schemas/account_operation.schema.json +225 -218
  278. package/dist/schemas/bridge_operation.output.json +1168 -653
  279. package/dist/schemas/bridge_operation.schema.json +736 -504
  280. package/dist/schemas/config_operation.output.json +185 -179
  281. package/dist/schemas/config_operation.schema.json +21 -26
  282. package/dist/schemas/employee_operation.output.json +207 -0
  283. package/dist/schemas/employee_operation.schema.json +176 -0
  284. package/dist/schemas/evaluation_operation.output.json +2268 -601
  285. package/dist/schemas/evaluation_operation.schema.json +2919 -787
  286. package/dist/schemas/guard2file.output.json +58 -64
  287. package/dist/schemas/guard2file.schema.json +79 -81
  288. package/dist/schemas/index.json +41 -11
  289. package/dist/schemas/industry_pack_operation.output.json +594 -0
  290. package/dist/schemas/industry_pack_operation.schema.json +55 -0
  291. package/dist/schemas/intent_radar.output.json +275 -203
  292. package/dist/schemas/intent_radar.schema.json +124 -126
  293. package/dist/schemas/local_info_operation.output.json +1174 -660
  294. package/dist/schemas/local_info_operation.schema.json +119 -125
  295. package/dist/schemas/local_mark_operation.output.json +1239 -692
  296. package/dist/schemas/local_mark_operation.schema.json +91 -96
  297. package/dist/schemas/machineNode2file.output.json +63 -69
  298. package/dist/schemas/machineNode2file.schema.json +79 -81
  299. package/dist/schemas/messenger_operation.output.json +2722 -1531
  300. package/dist/schemas/messenger_operation.schema.json +1482 -1264
  301. package/dist/schemas/onchain_events.output.json +2590 -978
  302. package/dist/schemas/onchain_events.schema.json +117 -99
  303. package/dist/schemas/onchain_operations.output.json +3957 -2312
  304. package/dist/schemas/onchain_operations.schema.json +20799 -9285
  305. package/dist/schemas/onchain_operations_allocation.schema.json +171 -107
  306. package/dist/schemas/onchain_operations_arbitration.schema.json +233 -146
  307. package/dist/schemas/onchain_operations_contact.schema.json +129 -90
  308. package/dist/schemas/onchain_operations_demand.schema.json +170 -112
  309. package/dist/schemas/onchain_operations_gen_passport.schema.json +61 -646
  310. package/dist/schemas/onchain_operations_gen_proof.schema.json +40 -172
  311. package/dist/schemas/onchain_operations_guard.schema.json +3765 -294
  312. package/dist/schemas/onchain_operations_machine.schema.json +536 -163
  313. package/dist/schemas/onchain_operations_order.schema.json +126 -96
  314. package/dist/schemas/onchain_operations_payment.schema.json +82 -67
  315. package/dist/schemas/onchain_operations_permission.schema.json +331 -93
  316. package/dist/schemas/onchain_operations_personal.schema.json +636 -96
  317. package/dist/schemas/onchain_operations_progress.schema.json +125 -92
  318. package/dist/schemas/onchain_operations_proof.schema.json +76 -69
  319. package/dist/schemas/onchain_operations_repository.schema.json +636 -249
  320. package/dist/schemas/onchain_operations_reward.schema.json +218 -108
  321. package/dist/schemas/onchain_operations_service.schema.json +678 -220
  322. package/dist/schemas/onchain_operations_treasury.schema.json +401 -135
  323. package/dist/schemas/onchain_table_data.output.json +6833 -2432
  324. package/dist/schemas/onchain_table_data.schema.json +684 -417
  325. package/dist/schemas/permission_operation.output.json +173 -0
  326. package/dist/schemas/permission_operation.schema.json +39 -0
  327. package/dist/schemas/persona_operation.output.json +1568 -268
  328. package/dist/schemas/persona_operation.schema.json +346 -205
  329. package/dist/schemas/project_operation.output.json +6922 -5132
  330. package/dist/schemas/project_operation.schema.json +1050 -1020
  331. package/dist/schemas/query_task_status.output.json +195 -99
  332. package/dist/schemas/query_task_status.schema.json +12 -18
  333. package/dist/schemas/query_toolkit.output.json +18862 -14561
  334. package/dist/schemas/query_toolkit.schema.json +614 -522
  335. package/dist/schemas/schema_query.output.json +127 -129
  336. package/dist/schemas/schema_query.schema.json +64 -69
  337. package/dist/schemas/trust_score.output.json +678 -587
  338. package/dist/schemas/trust_score.schema.json +289 -277
  339. package/dist/schemas/wip_file.output.json +116 -124
  340. package/dist/schemas/wip_file.schema.json +142 -143
  341. package/dist/schemas/workflow_operation.output.json +164 -0
  342. package/dist/schemas/workflow_operation.schema.json +116 -0
  343. package/dist/schemas/workspace_operation.output.json +277 -0
  344. package/dist/schemas/workspace_operation.schema.json +45 -0
  345. package/dist/schemas/wowok_buildin_info.output.json +1682 -844
  346. package/dist/schemas/wowok_buildin_info.schema.json +576 -526
  347. package/dist/tools/handlers/bridge.d.ts +8 -1
  348. package/dist/tools/handlers/bridge.js +1 -1
  349. package/dist/tools/handlers/config.js +1 -1
  350. package/dist/tools/handlers/employee.d.ts +2 -0
  351. package/dist/tools/handlers/employee.js +1 -0
  352. package/dist/tools/handlers/evaluation.js +1 -1
  353. package/dist/tools/handlers/file-export.js +1 -1
  354. package/dist/tools/handlers/industry-pack.d.ts +2 -0
  355. package/dist/tools/handlers/industry-pack.js +1 -0
  356. package/dist/tools/handlers/onchain.js +1 -1
  357. package/dist/tools/handlers/permission.d.ts +2 -0
  358. package/dist/tools/handlers/permission.js +1 -0
  359. package/dist/tools/handlers/persona.js +1 -1
  360. package/dist/tools/handlers/project.js +1 -1
  361. package/dist/tools/handlers/query.js +1 -1
  362. package/dist/tools/handlers/schema-query.js +1 -1
  363. package/dist/tools/handlers/trust.js +1 -1
  364. package/dist/tools/handlers/wip.js +1 -1
  365. package/dist/tools/handlers/workflow.d.ts +2 -0
  366. package/dist/tools/handlers/workflow.js +1 -0
  367. package/dist/tools/handlers/workspace.d.ts +4 -0
  368. package/dist/tools/handlers/workspace.js +1 -0
  369. package/dist/tools/index.d.ts +2 -1
  370. package/dist/tools/index.js +1 -1
  371. package/dist/tools/rules-hook.d.ts +1 -1
  372. package/dist/tools/rules-hook.js +1 -1
  373. package/dist/tools/shared.d.ts +1 -1
  374. package/dist/tools/shared.js +1 -1
  375. package/dist/tools/types.d.ts +2 -1
  376. package/package.json +4 -5
  377. package/dist/knowledge/arbitration-trust.d.ts +0 -24
  378. package/dist/knowledge/arbitration-trust.js +0 -1
  379. package/dist/schema/call/bridge-handler.d.ts +0 -8
  380. package/dist/schema/call/bridge-handler.js +0 -1
  381. package/dist/schema/sync-layer4.d.ts +0 -21
  382. package/dist/schema/sync-layer4.js +0 -1
  383. /package/dist/{schema-query → schema-query-impl}/index.d.ts +0 -0
@@ -1,817 +1,1332 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://wowok.net/schemas/bridge_operation.json",
3
+ "$id": "https://wowok.net/schemas/bridge_operation.output.json",
4
4
  "title": "Bridge - Cross-Chain Operations",
5
- "description": "Simplified cross-chain bridge between WOW and EVM (Ethereum mainnet). Operations: cross_chain_wow_to_evm, cross_chain_evm_to_wow, withdraw, query_active_evm_account, query_supported_evm_chains, query_supported_tokens, query_transfer_list, query_transfer_status, manage_evm_rpc. Global single activeEvmAccount auto-generated on first use. Use schema_query (name='bridge_operation') for exact field structures.",
6
- "$ref": "#/definitions/bridge_operation",
7
- "definitions": {
8
- "bridge_operation": {
9
- "type": "object",
10
- "properties": {
11
- "message": {
12
- "type": "string",
13
- "description": "Result summary or hint message"
14
- },
15
- "result": {
16
- "anyOf": [
17
- {
18
- "type": "object",
19
- "properties": {
20
- "type": {
21
- "type": "string",
22
- "const": "data"
23
- },
24
- "data": {
25
- "description": "Operation result data (structure varies by operation_type)"
26
- }
27
- },
28
- "required": [
29
- "type"
30
- ],
31
- "additionalProperties": false,
32
- "description": "Successful result"
5
+ "description": "Bridge operation output (matches CallOutput structure returned by the handler)",
6
+ "type": "object",
7
+ "properties": {
8
+ "message": {
9
+ "description": "Result summary or hint message",
10
+ "type": "string"
11
+ },
12
+ "result": {
13
+ "oneOf": [
14
+ {
15
+ "type": "object",
16
+ "properties": {
17
+ "type": {
18
+ "type": "string",
19
+ "const": "data"
33
20
  },
34
- {
35
- "type": "object",
36
- "properties": {
37
- "type": {
38
- "type": "string",
39
- "const": "error"
40
- },
41
- "error": {
42
- "type": "string",
43
- "description": "Error message"
44
- },
45
- "error_code": {
46
- "type": "string",
47
- "enum": [
48
- "invalid_parameter",
49
- "guard_rejected",
50
- "state_conflict",
51
- "insufficient_balance",
52
- "object_not_found",
53
- "permission_denied",
54
- "immutable_violation",
55
- "network_error",
56
- "rate_limit",
57
- "gas_exceeded",
58
- "bcs_error",
59
- "signature_error",
60
- "config_error",
61
- "wip_verification_failed",
62
- "unknown"
63
- ],
64
- "description": "Error classification for programmatic recovery"
65
- },
66
- "retryable": {
67
- "type": "boolean",
68
- "description": "Whether the operation can be retried as-is"
69
- },
70
- "recovery_hint": {
71
- "type": "string",
72
- "description": "Recovery suggestion for AI or user"
73
- }
74
- },
75
- "required": [
76
- "type",
77
- "error"
78
- ],
79
- "additionalProperties": false,
80
- "description": "Error result"
21
+ "data": {
22
+ "description": "Operation result data (structure varies by operation_type)"
81
23
  }
24
+ },
25
+ "required": [
26
+ "type",
27
+ "data"
82
28
  ],
83
- "description": "Bridge operation result (data or error)"
29
+ "additionalProperties": false,
30
+ "description": "Successful result"
84
31
  },
85
- "semantic": {
32
+ {
86
33
  "type": "object",
87
34
  "properties": {
88
- "intent": {
35
+ "type": {
89
36
  "type": "string",
90
- "description": "Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"
37
+ "const": "error"
91
38
  },
92
- "status": {
39
+ "error": {
93
40
  "type": "string",
94
- "enum": [
95
- "success",
96
- "partial",
97
- "failed",
98
- "pending_input"
99
- ],
100
- "description": "Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"
41
+ "description": "Error message"
101
42
  },
102
- "summary": {
43
+ "error_code": {
44
+ "description": "Error classification for programmatic recovery",
103
45
  "type": "string",
104
- "description": "One-sentence human-readable summary of what happened. AI should read this first. Example: 'Successfully published Service my-shop with Machine bound'"
46
+ "enum": [
47
+ "invalid_parameter",
48
+ "guard_rejected",
49
+ "state_conflict",
50
+ "insufficient_balance",
51
+ "object_not_found",
52
+ "permission_denied",
53
+ "immutable_violation",
54
+ "network_error",
55
+ "rate_limit",
56
+ "gas_exceeded",
57
+ "bcs_error",
58
+ "signature_error",
59
+ "config_error",
60
+ "wip_verification_failed",
61
+ "unknown"
62
+ ]
105
63
  },
106
- "created": {
107
- "type": "array",
108
- "items": {
64
+ "retryable": {
65
+ "description": "Whether the operation can be retried as-is",
66
+ "type": "boolean"
67
+ },
68
+ "recovery_hint": {
69
+ "description": "Recovery suggestion for AI or user",
70
+ "type": "string"
71
+ }
72
+ },
73
+ "required": [
74
+ "type",
75
+ "error"
76
+ ],
77
+ "additionalProperties": false,
78
+ "description": "Error result"
79
+ }
80
+ ],
81
+ "description": "Bridge operation result (data or error)"
82
+ },
83
+ "semantic": {
84
+ "description": "Business semantic summary for bridge operation",
85
+ "type": "object",
86
+ "properties": {
87
+ "intent": {
88
+ "type": "string",
89
+ "description": "Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"
90
+ },
91
+ "status": {
92
+ "type": "string",
93
+ "enum": [
94
+ "success",
95
+ "partial",
96
+ "failed",
97
+ "pending_input"
98
+ ],
99
+ "description": "Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"
100
+ },
101
+ "summary": {
102
+ "type": "string",
103
+ "description": "One-sentence human-readable summary of what happened. AI should read this first. Example: 'Successfully published Service my-shop with Machine bound'"
104
+ },
105
+ "created": {
106
+ "description": "Objects newly created in this operation, tagged with roles",
107
+ "type": "array",
108
+ "items": {
109
+ "type": "object",
110
+ "properties": {
111
+ "id": {
112
+ "type": "string",
113
+ "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
114
+ },
115
+ "name": {
116
+ "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null",
117
+ "anyOf": [
118
+ {
119
+ "type": "string"
120
+ },
121
+ {
122
+ "type": "null"
123
+ }
124
+ ]
125
+ },
126
+ "role": {
127
+ "type": "string",
128
+ "enum": [
129
+ "Permission",
130
+ "Guard",
131
+ "Machine",
132
+ "Progress",
133
+ "Service",
134
+ "Order",
135
+ "Allocation",
136
+ "Arbitration",
137
+ "ArbCase",
138
+ "Messenger",
139
+ "Contact",
140
+ "Demand",
141
+ "Reward",
142
+ "Personal",
143
+ "Repository",
144
+ "Treasury",
145
+ "Discount",
146
+ "Payment",
147
+ "Passport",
148
+ "Proof",
149
+ "Other"
150
+ ],
151
+ "description": "Business role of the object in the dependency graph. Constraint: enum of 21 values. Relation: derived from objectType last segment; drives Plan/Verify Loop positioning. Example: 'Service'"
152
+ },
153
+ "relation": {
154
+ "description": "Relationship to another object in the dependency graph",
109
155
  "type": "object",
110
156
  "properties": {
111
- "id": {
112
- "type": "string",
113
- "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
114
- },
115
- "name": {
116
- "type": [
117
- "string",
118
- "null"
119
- ],
120
- "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null"
121
- },
122
- "role": {
123
- "type": "string",
124
- "enum": [
125
- "Permission",
126
- "Guard",
127
- "Machine",
128
- "Progress",
129
- "Service",
130
- "Order",
131
- "Allocation",
132
- "Arbitration",
133
- "ArbCase",
134
- "Messenger",
135
- "Contact",
136
- "Demand",
137
- "Reward",
138
- "Personal",
139
- "Repository",
140
- "Treasury",
141
- "Discount",
142
- "Other"
143
- ],
144
- "description": "Business role of the object in the dependency graph. Constraint: enum of 18 values. Relation: derived from objectType last segment; drives Plan/Verify Loop positioning. Example: 'Service'"
145
- },
146
- "relation": {
147
- "type": "object",
148
- "properties": {
149
- "parent": {
150
- "type": [
151
- "string",
152
- "null"
153
- ],
154
- "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null"
157
+ "parent": {
158
+ "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null",
159
+ "anyOf": [
160
+ {
161
+ "type": "string"
155
162
  },
156
- "relation_type": {
157
- "type": "string",
158
- "enum": [
159
- "machine_of",
160
- "guard_of",
161
- "allocator_of",
162
- "permission_of",
163
- "progress_of",
164
- "allocation_of",
165
- "arb_of",
166
- "other"
167
- ],
168
- "description": "How this object relates to its parent. Example: 'machine_of'"
163
+ {
164
+ "type": "null"
169
165
  }
170
- },
171
- "additionalProperties": false,
172
- "description": "Relationship to another object in the dependency graph"
166
+ ]
173
167
  },
174
- "immutable": {
175
- "type": "boolean",
176
- "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true"
168
+ "relation_type": {
169
+ "description": "How this object relates to its parent. Example: 'machine_of'",
170
+ "type": "string",
171
+ "enum": [
172
+ "machine_of",
173
+ "guard_of",
174
+ "allocator_of",
175
+ "permission_of",
176
+ "progress_of",
177
+ "allocation_of",
178
+ "arb_of",
179
+ "other"
180
+ ]
177
181
  }
178
182
  },
179
- "required": [
180
- "id",
181
- "role"
182
- ],
183
- "additionalProperties": false,
184
- "description": "An object tagged with its business role and relationship within the object dependency graph"
183
+ "additionalProperties": false
185
184
  },
186
- "description": "Objects newly created in this operation, tagged with roles"
185
+ "immutable": {
186
+ "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true",
187
+ "type": "boolean"
188
+ }
187
189
  },
188
- "modified": {
189
- "type": "array",
190
- "items": {
191
- "$ref": "#/definitions/bridge_operation/properties/semantic/properties/created/items"
190
+ "required": [
191
+ "id",
192
+ "role"
193
+ ],
194
+ "additionalProperties": false,
195
+ "description": "An object tagged with its business role and relationship within the object dependency graph"
196
+ }
197
+ },
198
+ "modified": {
199
+ "description": "Objects mutated in this operation, tagged with roles",
200
+ "type": "array",
201
+ "items": {
202
+ "type": "object",
203
+ "properties": {
204
+ "id": {
205
+ "type": "string",
206
+ "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
192
207
  },
193
- "description": "Objects mutated in this operation, tagged with roles"
194
- },
195
- "released": {
196
- "type": "array",
197
- "items": {
208
+ "name": {
209
+ "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null",
210
+ "anyOf": [
211
+ {
212
+ "type": "string"
213
+ },
214
+ {
215
+ "type": "null"
216
+ }
217
+ ]
218
+ },
219
+ "role": {
220
+ "type": "string",
221
+ "enum": [
222
+ "Permission",
223
+ "Guard",
224
+ "Machine",
225
+ "Progress",
226
+ "Service",
227
+ "Order",
228
+ "Allocation",
229
+ "Arbitration",
230
+ "ArbCase",
231
+ "Messenger",
232
+ "Contact",
233
+ "Demand",
234
+ "Reward",
235
+ "Personal",
236
+ "Repository",
237
+ "Treasury",
238
+ "Discount",
239
+ "Payment",
240
+ "Passport",
241
+ "Proof",
242
+ "Other"
243
+ ],
244
+ "description": "Business role of the object in the dependency graph. Constraint: enum of 21 values. Relation: derived from objectType last segment; drives Plan/Verify Loop positioning. Example: 'Service'"
245
+ },
246
+ "relation": {
247
+ "description": "Relationship to another object in the dependency graph",
198
248
  "type": "object",
199
249
  "properties": {
200
- "amount": {
201
- "type": "string",
202
- "description": "Amount change as stringified integer (smallest unit). Negative=spend, positive=receive. Example: '-10000000000'"
203
- },
204
- "coinType": {
205
- "type": "string",
206
- "description": "Coin type tag (format: {address}::{module}::{struct}). Example: '0x2::wow::WOW'"
250
+ "parent": {
251
+ "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null",
252
+ "anyOf": [
253
+ {
254
+ "type": "string"
255
+ },
256
+ {
257
+ "type": "null"
258
+ }
259
+ ]
207
260
  },
208
- "role": {
261
+ "relation_type": {
262
+ "description": "How this object relates to its parent. Example: 'machine_of'",
209
263
  "type": "string",
210
264
  "enum": [
211
- "payment",
212
- "refund",
213
- "change",
214
- "compensation",
215
- "reward",
216
- "gas",
217
- "deposit",
218
- "release",
265
+ "machine_of",
266
+ "guard_of",
267
+ "allocator_of",
268
+ "permission_of",
269
+ "progress_of",
270
+ "allocation_of",
271
+ "arb_of",
219
272
  "other"
220
- ],
221
- "description": "Business role of this fund movement. Constraint: enum of 9 values. Relation: derived from operation context. Example: 'payment'"
273
+ ]
274
+ }
275
+ },
276
+ "additionalProperties": false
277
+ },
278
+ "immutable": {
279
+ "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true",
280
+ "type": "boolean"
281
+ }
282
+ },
283
+ "required": [
284
+ "id",
285
+ "role"
286
+ ],
287
+ "additionalProperties": false,
288
+ "description": "An object tagged with its business role and relationship within the object dependency graph"
289
+ }
290
+ },
291
+ "released": {
292
+ "description": "Fund movements in this operation, tagged with roles",
293
+ "type": "array",
294
+ "items": {
295
+ "type": "object",
296
+ "properties": {
297
+ "amount": {
298
+ "type": "string",
299
+ "description": "Amount change as stringified integer (smallest unit). Negative=spend, positive=receive. Example: '-10000000000'"
300
+ },
301
+ "coinType": {
302
+ "type": "string",
303
+ "description": "Coin type tag (format: {address}::{module}::{struct}). Example: '0x2::wow::WOW'"
304
+ },
305
+ "role": {
306
+ "type": "string",
307
+ "enum": [
308
+ "payment",
309
+ "refund",
310
+ "change",
311
+ "compensation",
312
+ "reward",
313
+ "gas",
314
+ "deposit",
315
+ "release",
316
+ "other"
317
+ ],
318
+ "description": "Business role of this fund movement. Constraint: enum of 9 values. Relation: derived from operation context. Example: 'payment'"
319
+ },
320
+ "from": {
321
+ "description": "Sender address if known. Example: '0xabc...' or null",
322
+ "anyOf": [
323
+ {
324
+ "type": "string"
222
325
  },
223
- "from": {
224
- "type": [
225
- "string",
226
- "null"
227
- ],
228
- "description": "Sender address if known. Example: '0xabc...' or null"
326
+ {
327
+ "type": "null"
328
+ }
329
+ ]
330
+ },
331
+ "to": {
332
+ "description": "Recipient address if known. Example: '0xdef...' or null",
333
+ "anyOf": [
334
+ {
335
+ "type": "string"
229
336
  },
230
- "to": {
231
- "type": [
232
- "string",
233
- "null"
234
- ],
235
- "description": "Recipient address if known. Example: '0xdef...' or null"
337
+ {
338
+ "type": "null"
236
339
  }
237
- },
238
- "required": [
239
- "amount",
240
- "coinType",
241
- "role"
340
+ ]
341
+ }
342
+ },
343
+ "required": [
344
+ "amount",
345
+ "coinType",
346
+ "role"
347
+ ],
348
+ "additionalProperties": false,
349
+ "description": "A fund movement tagged with its business role"
350
+ }
351
+ },
352
+ "events": {
353
+ "description": "On-chain events annotated with business semantics (S-8)",
354
+ "type": "array",
355
+ "items": {
356
+ "type": "object",
357
+ "properties": {
358
+ "event_type": {
359
+ "type": "string",
360
+ "description": "Raw on-chain event type tag. Example: '0x2::service::ServicePublishedEvent'"
361
+ },
362
+ "business_meaning": {
363
+ "type": "string",
364
+ "description": "Human-readable business meaning. Example: 'Service has been published and is now immutable'"
365
+ },
366
+ "category": {
367
+ "type": "string",
368
+ "enum": [
369
+ "lifecycle",
370
+ "state_change",
371
+ "fund_flow",
372
+ "permission",
373
+ "guard",
374
+ "other"
242
375
  ],
243
- "additionalProperties": false,
244
- "description": "A fund movement tagged with its business role"
376
+ "description": "Business category. Constraint: enum of 6 values. Example: 'lifecycle'"
377
+ },
378
+ "related_object": {
379
+ "description": "Object ID the event relates to, if extractable. Example: '0x123...'",
380
+ "type": "string"
381
+ },
382
+ "side_effect": {
383
+ "description": "Side effect description for AI. Example: 'Customers can now place orders against this Service'",
384
+ "type": "string"
385
+ }
386
+ },
387
+ "required": [
388
+ "event_type",
389
+ "business_meaning",
390
+ "category"
391
+ ],
392
+ "additionalProperties": false,
393
+ "description": "An on-chain event annotated with business semantics"
394
+ }
395
+ },
396
+ "next_actions": {
397
+ "description": "Recommended next actions to drive the workflow forward",
398
+ "type": "array",
399
+ "items": {
400
+ "type": "object",
401
+ "properties": {
402
+ "action": {
403
+ "type": "string",
404
+ "description": "Recommended next action. Example: 'add sales products'"
405
+ },
406
+ "reason": {
407
+ "type": "string",
408
+ "description": "Why this action is recommended. Example: 'Service has no products; customers cannot order'"
409
+ },
410
+ "tool": {
411
+ "description": "MCP tool to use, if applicable. Example: 'onchain_operations'",
412
+ "type": "string"
413
+ },
414
+ "prerequisite": {
415
+ "description": "Condition that must hold before this action. Example: 'Service must be created first'",
416
+ "type": "string"
417
+ },
418
+ "priority": {
419
+ "type": "string",
420
+ "enum": [
421
+ "required",
422
+ "recommended",
423
+ "optional"
424
+ ],
425
+ "description": "Priority. Constraint: enum. Example: 'required'"
426
+ }
427
+ },
428
+ "required": [
429
+ "action",
430
+ "reason",
431
+ "priority"
432
+ ],
433
+ "additionalProperties": false,
434
+ "description": "A recommended next action with priority and rationale"
435
+ }
436
+ },
437
+ "warnings": {
438
+ "description": "Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'",
439
+ "type": "array",
440
+ "items": {
441
+ "type": "string"
442
+ }
443
+ },
444
+ "experience": {
445
+ "description": "Experience layer feedback from past operations (Phase 2 Topic 2)",
446
+ "type": "object",
447
+ "properties": {
448
+ "advice": {
449
+ "description": "Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'",
450
+ "type": "string"
451
+ },
452
+ "avoid": {
453
+ "description": "Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']",
454
+ "type": "array",
455
+ "items": {
456
+ "type": "string"
457
+ }
458
+ },
459
+ "relevance": {
460
+ "description": "Relevance score 0-1 of the matched experience. Example: 0.85",
461
+ "type": "number",
462
+ "minimum": 0,
463
+ "maximum": 1
464
+ },
465
+ "matched_scenario": {
466
+ "description": "Matched historical scenario. Example: 'publish_service_freelance'",
467
+ "type": "string"
468
+ }
469
+ },
470
+ "additionalProperties": false
471
+ },
472
+ "service_status": {
473
+ "description": "Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response.",
474
+ "type": "object",
475
+ "properties": {
476
+ "active": {
477
+ "type": "array",
478
+ "items": {
479
+ "type": "string"
245
480
  },
246
- "description": "Fund movements in this operation, tagged with roles"
481
+ "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
247
482
  },
248
- "events": {
483
+ "inactive": {
484
+ "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']",
485
+ "type": "array",
486
+ "items": {
487
+ "type": "string"
488
+ }
489
+ }
490
+ },
491
+ "required": [
492
+ "active"
493
+ ],
494
+ "additionalProperties": false
495
+ },
496
+ "customer_advice": {
497
+ "description": "Buyer-side advice (Phase 3 C-3.3). Populated when customer_intelligence service is enabled AND operation is order/query on a Service. Contains risk_score, recommendations, reminders, and preference_match.",
498
+ "type": "object",
499
+ "properties": {
500
+ "risk_score": {
501
+ "description": "Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75",
502
+ "type": "number",
503
+ "minimum": 0,
504
+ "maximum": 100
505
+ },
506
+ "risk_level": {
507
+ "description": "Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'",
508
+ "type": "string",
509
+ "enum": [
510
+ "low",
511
+ "medium_low",
512
+ "medium_high",
513
+ "high"
514
+ ]
515
+ },
516
+ "recommendations": {
517
+ "type": "array",
518
+ "items": {
519
+ "type": "string"
520
+ },
521
+ "description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
522
+ },
523
+ "reminders": {
249
524
  "type": "array",
250
525
  "items": {
251
526
  "type": "object",
252
527
  "properties": {
253
- "event_type": {
528
+ "id": {
254
529
  "type": "string",
255
- "description": "Raw on-chain event type tag. Example: '0x2::service::ServicePublishedEvent'"
530
+ "description": "Reminder rule id. Example: 'high_risk_score'"
256
531
  },
257
- "business_meaning": {
532
+ "stage": {
258
533
  "type": "string",
259
- "description": "Human-readable business meaning. Example: 'Service has been published and is now immutable'"
534
+ "enum": [
535
+ "browse",
536
+ "evaluate",
537
+ "preorder",
538
+ "in_progress",
539
+ "complete",
540
+ "after_sale"
541
+ ],
542
+ "description": "Order lifecycle stage when this reminder fires. Example: 'evaluate'"
260
543
  },
261
- "category": {
544
+ "priority": {
262
545
  "type": "string",
263
546
  "enum": [
264
- "lifecycle",
265
- "state_change",
266
- "fund_flow",
267
- "permission",
268
- "guard",
269
- "other"
547
+ "required",
548
+ "recommended",
549
+ "info",
550
+ "reminder"
270
551
  ],
271
- "description": "Business category. Constraint: enum of 6 values. Example: 'lifecycle'"
552
+ "description": "Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"
272
553
  },
273
- "related_object": {
554
+ "message": {
274
555
  "type": "string",
275
- "description": "Object ID the event relates to, if extractable. Example: '0x123...'"
556
+ "description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
276
557
  },
277
- "side_effect": {
278
- "type": "string",
279
- "description": "Side effect description for AI. Example: 'Customers can now place orders against this Service'"
558
+ "action": {
559
+ "description": "Suggested next action. Example: 'require merchant to bind Arbitration before ordering'",
560
+ "type": "string"
280
561
  }
281
562
  },
282
563
  "required": [
283
- "event_type",
284
- "business_meaning",
285
- "category"
564
+ "id",
565
+ "stage",
566
+ "priority",
567
+ "message"
286
568
  ],
287
569
  "additionalProperties": false,
288
- "description": "An on-chain event annotated with business semantics"
570
+ "description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
571
+ },
572
+ "description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
573
+ },
574
+ "preference_match": {
575
+ "description": "Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}",
576
+ "type": "object",
577
+ "properties": {
578
+ "score": {
579
+ "type": "number",
580
+ "minimum": 0,
581
+ "maximum": 100,
582
+ "description": "Match score 0-100 (higher = better fit). Example: 75"
583
+ },
584
+ "matches": {
585
+ "type": "array",
586
+ "items": {
587
+ "type": "string"
588
+ },
589
+ "description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
590
+ },
591
+ "mismatches": {
592
+ "type": "array",
593
+ "items": {
594
+ "type": "string"
595
+ },
596
+ "description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
597
+ }
598
+ },
599
+ "required": [
600
+ "score",
601
+ "matches",
602
+ "mismatches"
603
+ ],
604
+ "additionalProperties": false
605
+ }
606
+ },
607
+ "required": [
608
+ "recommendations",
609
+ "reminders"
610
+ ],
611
+ "additionalProperties": false
612
+ },
613
+ "evolution_context": {
614
+ "description": "Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice.",
615
+ "type": "object",
616
+ "properties": {
617
+ "industry_signal": {
618
+ "description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'",
619
+ "type": "string"
620
+ },
621
+ "evolution_advice": {
622
+ "description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'",
623
+ "type": "string"
624
+ },
625
+ "confidence": {
626
+ "type": "number",
627
+ "minimum": 0,
628
+ "maximum": 1,
629
+ "description": "Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"
630
+ },
631
+ "health_score": {
632
+ "description": "Industry health score 0-100 if available. Example: 82",
633
+ "type": "number",
634
+ "minimum": 0,
635
+ "maximum": 100
636
+ },
637
+ "pending_suggestions": {
638
+ "description": "Count of pending industry update suggestions (filtered by role if role is set). Example: 3",
639
+ "type": "integer",
640
+ "minimum": 0,
641
+ "maximum": 9007199254740991
642
+ },
643
+ "intent": {
644
+ "description": "Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'",
645
+ "type": "string",
646
+ "enum": [
647
+ "default",
648
+ "growth",
649
+ "retention",
650
+ "compliance",
651
+ "efficiency",
652
+ "trust_building",
653
+ "custom"
654
+ ]
655
+ },
656
+ "role_advice": {
657
+ "description": "Phase 4 P4-6.C: Role-targeted advice strings (merchant/customer/prospect/supplier/collaborator/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']",
658
+ "type": "array",
659
+ "items": {
660
+ "type": "string"
661
+ }
662
+ },
663
+ "role": {
664
+ "description": "Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'",
665
+ "type": "string",
666
+ "enum": [
667
+ "merchant",
668
+ "customer",
669
+ "prospect",
670
+ "supplier",
671
+ "collaborator",
672
+ "arbitrator"
673
+ ]
674
+ }
675
+ },
676
+ "required": [
677
+ "confidence"
678
+ ],
679
+ "additionalProperties": false
680
+ },
681
+ "guard_advice": {
682
+ "description": "Phase 5 Guard capability advice (populated when user intent involves Guard). Provides puzzle status, scene matching, suggested patterns, available queries, risk warnings, and confirmation text. AI uses this to guide Guard design dialogue (R1-R10).",
683
+ "type": "object",
684
+ "properties": {
685
+ "current_round": {
686
+ "description": "Current R1-R10 dialogue round. R1=intent, R2=table, R3=tree, R4=rely, R5=binding, R6=review, R7=CREATE, R8=test, R9=bind, R10=verify. Example: 'R3'",
687
+ "type": "string",
688
+ "enum": [
689
+ "R1",
690
+ "R2",
691
+ "R3",
692
+ "R4",
693
+ "R5",
694
+ "R6",
695
+ "R7",
696
+ "R8",
697
+ "R9",
698
+ "R10"
699
+ ]
700
+ },
701
+ "puzzle_status": {
702
+ "description": "Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE.",
703
+ "type": "object",
704
+ "properties": {
705
+ "intent": {
706
+ "type": "boolean",
707
+ "description": "Intent dimension complete (action + rule + failure conditions)"
708
+ },
709
+ "binding": {
710
+ "type": "boolean",
711
+ "description": "Binding dimension complete (host object + field + circular ref)"
712
+ },
713
+ "data": {
714
+ "type": "boolean",
715
+ "description": "Data dimension complete (table entries + witnesses)"
716
+ },
717
+ "query": {
718
+ "type": "boolean",
719
+ "description": "Query dimension complete (query instructions if needed)"
720
+ },
721
+ "logic": {
722
+ "type": "boolean",
723
+ "description": "Logic dimension complete (root node returns Bool)"
724
+ },
725
+ "constraints": {
726
+ "type": "boolean",
727
+ "description": "Constraints dimension complete (10 Pitfalls checked)"
728
+ }
289
729
  },
290
- "description": "On-chain events annotated with business semantics (S-8)"
730
+ "required": [
731
+ "intent",
732
+ "binding",
733
+ "data",
734
+ "query",
735
+ "logic",
736
+ "constraints"
737
+ ],
738
+ "additionalProperties": false
739
+ },
740
+ "matched_scene": {
741
+ "description": "Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'",
742
+ "type": "string"
291
743
  },
292
- "next_actions": {
744
+ "scene_description": {
745
+ "description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'",
746
+ "type": "string"
747
+ },
748
+ "scene_constraints": {
749
+ "description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']",
750
+ "type": "array",
751
+ "items": {
752
+ "type": "string"
753
+ }
754
+ },
755
+ "suggested_patterns": {
756
+ "description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']",
757
+ "type": "array",
758
+ "items": {
759
+ "type": "string"
760
+ }
761
+ },
762
+ "available_queries": {
763
+ "description": "Available query instructions for the current context (subset of 375 GUARDQUERY entries)",
293
764
  "type": "array",
294
765
  "items": {
295
766
  "type": "object",
296
767
  "properties": {
297
- "action": {
298
- "type": "string",
299
- "description": "Recommended next action. Example: 'add sales products'"
768
+ "id": {
769
+ "type": "integer",
770
+ "minimum": -9007199254740991,
771
+ "maximum": 9007199254740991,
772
+ "description": "Query instruction ID. Example: 1253"
300
773
  },
301
- "reason": {
774
+ "name": {
302
775
  "type": "string",
303
- "description": "Why this action is recommended. Example: 'Service has no products; customers cannot order'"
776
+ "description": "Query instruction name. Example: 'progress.current'"
304
777
  },
305
- "tool": {
778
+ "objectType": {
306
779
  "type": "string",
307
- "description": "MCP tool to use, if applicable. Example: 'onchain_operations'"
780
+ "description": "Target object type. Example: 'Progress'"
308
781
  },
309
- "prerequisite": {
782
+ "returnType": {
310
783
  "type": "string",
311
- "description": "Condition that must hold before this action. Example: 'Service must be created first'"
784
+ "description": "Return value type. Example: 'String'"
312
785
  },
313
- "priority": {
314
- "type": "string",
315
- "enum": [
316
- "required",
317
- "recommended",
318
- "optional"
319
- ],
320
- "description": "Priority. Constraint: enum. Example: 'required'"
786
+ "description": {
787
+ "description": "Query description",
788
+ "type": "string"
321
789
  }
322
790
  },
323
791
  "required": [
324
- "action",
325
- "reason",
326
- "priority"
792
+ "id",
793
+ "name",
794
+ "objectType",
795
+ "returnType"
327
796
  ],
328
797
  "additionalProperties": false,
329
- "description": "A recommended next action with priority and rationale"
330
- },
331
- "description": "Recommended next actions to drive the workflow forward"
798
+ "description": "A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries)."
799
+ }
332
800
  },
333
- "warnings": {
801
+ "risk_warnings": {
802
+ "description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']",
334
803
  "type": "array",
335
804
  "items": {
336
- "type": "string"
337
- },
338
- "description": "Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'"
339
- },
340
- "experience": {
341
- "type": "object",
342
- "properties": {
343
- "advice": {
344
- "type": "string",
345
- "description": "Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'"
346
- },
347
- "avoid": {
348
- "type": "array",
349
- "items": {
350
- "type": "string"
351
- },
352
- "description": "Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']"
353
- },
354
- "relevance": {
355
- "type": "number",
356
- "minimum": 0,
357
- "maximum": 1,
358
- "description": "Relevance score 0-1 of the matched experience. Example: 0.85"
359
- },
360
- "matched_scenario": {
361
- "type": "string",
362
- "description": "Matched historical scenario. Example: 'publish_service_freelance'"
363
- }
364
- },
365
- "additionalProperties": false,
366
- "description": "Experience layer feedback from past operations (Phase 2 Topic 2)"
805
+ "type": "string"
806
+ }
807
+ },
808
+ "pending_questions": {
809
+ "description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']",
810
+ "type": "array",
811
+ "items": {
812
+ "type": "string"
813
+ }
814
+ },
815
+ "confirmation_text": {
816
+ "description": "Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE.",
817
+ "type": "string"
367
818
  },
368
- "service_status": {
819
+ "test_result": {
820
+ "description": "gen_passport static test result. Must pass before CREATE.",
369
821
  "type": "object",
370
822
  "properties": {
371
- "active": {
372
- "type": "array",
373
- "items": {
374
- "type": "string"
375
- },
376
- "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
823
+ "status": {
824
+ "type": "string",
825
+ "enum": [
826
+ "pass",
827
+ "fail",
828
+ "not_tested"
829
+ ]
377
830
  },
378
- "inactive": {
379
- "type": "array",
380
- "items": {
381
- "type": "string"
382
- },
383
- "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']"
831
+ "failure_node": {
832
+ "description": "Node that caused failure (if fail)",
833
+ "type": "string"
834
+ },
835
+ "passport_id": {
836
+ "description": "Generated Passport ID (if pass)",
837
+ "type": "string"
384
838
  }
385
839
  },
386
840
  "required": [
387
- "active"
841
+ "status"
388
842
  ],
389
- "additionalProperties": false,
390
- "description": "Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response."
843
+ "additionalProperties": false
391
844
  },
392
- "customer_advice": {
845
+ "risk_assessment": {
846
+ "description": "Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax.",
393
847
  "type": "object",
394
848
  "properties": {
395
- "risk_score": {
396
- "type": "number",
397
- "minimum": 0,
398
- "maximum": 100,
399
- "description": "Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75"
400
- },
401
- "risk_level": {
849
+ "overall_risk": {
402
850
  "type": "string",
403
851
  "enum": [
852
+ "critical",
853
+ "high",
854
+ "medium",
404
855
  "low",
405
- "medium_low",
406
- "medium_high",
407
- "high"
856
+ "info"
408
857
  ],
409
- "description": "Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'"
858
+ "description": "Overall risk level (highest from all risks)"
859
+ },
860
+ "risk_count": {
861
+ "type": "integer",
862
+ "minimum": -9007199254740991,
863
+ "maximum": 9007199254740991,
864
+ "description": "Total number of detected risks"
865
+ },
866
+ "critical_count": {
867
+ "type": "integer",
868
+ "minimum": -9007199254740991,
869
+ "maximum": 9007199254740991,
870
+ "description": "Number of critical risks"
871
+ },
872
+ "high_count": {
873
+ "type": "integer",
874
+ "minimum": -9007199254740991,
875
+ "maximum": 9007199254740991,
876
+ "description": "Number of high risks"
877
+ },
878
+ "needs_human_review": {
879
+ "type": "boolean",
880
+ "description": "Whether human review is required (critical or 2+ high risks)"
410
881
  },
411
- "recommendations": {
882
+ "top_risks": {
412
883
  "type": "array",
413
884
  "items": {
414
885
  "type": "string"
415
886
  },
416
- "description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
887
+ "description": "Top risk titles (critical and high, max 3)"
417
888
  },
418
- "reminders": {
419
- "type": "array",
420
- "items": {
889
+ "stakeholder_advice": {
890
+ "description": "Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list",
891
+ "type": "object",
892
+ "propertyNames": {
893
+ "type": "string"
894
+ },
895
+ "additionalProperties": {
896
+ "type": "array",
897
+ "items": {
898
+ "type": "string"
899
+ }
900
+ }
901
+ }
902
+ },
903
+ "required": [
904
+ "overall_risk",
905
+ "risk_count",
906
+ "critical_count",
907
+ "high_count",
908
+ "needs_human_review",
909
+ "top_risks"
910
+ ],
911
+ "additionalProperties": false
912
+ }
913
+ },
914
+ "additionalProperties": false
915
+ },
916
+ "workflow_guidance": {
917
+ "description": "K3 permission-aware workflow guidance: current node + ALL reachable next nodes with their operator/permission/guard + K3 recommendation. Populated when a Progress (or Order with Progress) is queried and after progress operate. AI must read this BEFORE proposing the next workflow operation.",
918
+ "type": "object",
919
+ "properties": {
920
+ "current_node": {
921
+ "type": "string",
922
+ "description": "Current node of the Progress. Example: 'serving'"
923
+ },
924
+ "caller": {
925
+ "description": "The account (name/address) this guidance is framed for (env.account). Example: 'london_guide'",
926
+ "type": "string"
927
+ },
928
+ "options": {
929
+ "type": "array",
930
+ "items": {
931
+ "type": "object",
932
+ "properties": {
933
+ "next_node": {
934
+ "type": "string",
935
+ "description": "Target node this forward advances INTO. Example: 'serving'"
936
+ },
937
+ "forward": {
938
+ "type": "string",
939
+ "description": "Forward (operation) name. Example: 'StartService'"
940
+ },
941
+ "weight": {
942
+ "type": "number",
943
+ "description": "Forward weight contributed toward the pair threshold. Example: 1"
944
+ },
945
+ "operator": {
421
946
  "type": "object",
422
947
  "properties": {
423
- "id": {
424
- "type": "string",
425
- "description": "Reminder rule id. Example: 'high_risk_score'"
426
- },
427
- "stage": {
948
+ "kind": {
428
949
  "type": "string",
429
950
  "enum": [
430
- "browse",
431
- "evaluate",
432
- "preorder",
433
- "in_progress",
434
- "complete",
435
- "after_sale"
951
+ "order_holder",
952
+ "permission_index",
953
+ "named_operator"
436
954
  ],
437
- "description": "Order lifecycle stage when this reminder fires. Example: 'evaluate'"
955
+ "description": "Who can execute this forward (K3 feasibility). 'order_holder' = the Order owner (customer; forward namedOperator=''), 'permission_index' = a permission role, 'named_operator' = a specific Progress namespace operator."
438
956
  },
439
- "priority": {
440
- "type": "string",
441
- "enum": [
442
- "required",
443
- "recommended",
444
- "info",
445
- "reminder"
446
- ],
447
- "description": "Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"
957
+ "permission_index": {
958
+ "description": "Permission index when kind='permission_index'. Example: 1000",
959
+ "type": "integer",
960
+ "minimum": -9007199254740991,
961
+ "maximum": 9007199254740991
448
962
  },
449
- "message": {
450
- "type": "string",
451
- "description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
963
+ "role_name": {
964
+ "description": "Resolved role display name. Example: 'merchant (permission 1000)' / 'order holder (customer)'",
965
+ "type": "string"
452
966
  },
453
- "action": {
454
- "type": "string",
455
- "description": "Suggested next action. Example: 'require merchant to bind Arbitration before ordering'"
967
+ "account_name": {
968
+ "description": "Resolved local account/mark name when the operator maps to a concrete account. Example: 'london_guide'",
969
+ "type": "string"
970
+ },
971
+ "named_operator": {
972
+ "description": "NamedOperator namespace when kind='named_operator'. Example: 'delivery_team'",
973
+ "type": "string"
456
974
  }
457
975
  },
458
976
  "required": [
459
- "id",
460
- "stage",
461
- "priority",
462
- "message"
977
+ "kind"
463
978
  ],
464
979
  "additionalProperties": false,
465
- "description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
980
+ "description": "Who can execute this forward (which account + which permission)."
466
981
  },
467
- "description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
468
- },
469
- "preference_match": {
470
- "type": "object",
471
- "properties": {
472
- "score": {
473
- "type": "number",
474
- "minimum": 0,
475
- "maximum": 100,
476
- "description": "Match score 0-100 (higher = better fit). Example: 75"
477
- },
478
- "matches": {
479
- "type": "array",
480
- "items": {
481
- "type": "string"
482
- },
483
- "description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
484
- },
485
- "mismatches": {
486
- "type": "array",
487
- "items": {
488
- "type": "string"
489
- },
490
- "description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
982
+ "guard": {
983
+ "description": "Guard bound to the forward — acceptance condition verified BEFORE the transition. Example: 'guard_payout'",
984
+ "type": "string"
985
+ },
986
+ "business_meaning": {
987
+ "type": "string",
988
+ "description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
989
+ },
990
+ "gains": {
991
+ "description": "Gains for the caller if this option is chosen (K3 Game G1 收益分离). Example: ['Settlement triggered — funds released to provider']",
992
+ "type": "array",
993
+ "items": {
994
+ "type": "string"
491
995
  }
492
996
  },
493
- "required": [
494
- "score",
495
- "matches",
496
- "mismatches"
497
- ],
498
- "additionalProperties": false,
499
- "description": "Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}"
500
- }
997
+ "risks": {
998
+ "description": "Risks for the caller if this option is chosen (K3 Game G1 风险分离). Example: ['Refund leverage lost after confirmation']",
999
+ "type": "array",
1000
+ "items": {
1001
+ "type": "string"
1002
+ }
1003
+ },
1004
+ "consistency": {
1005
+ "description": "Consistency 0-100 between this option's business semantics and the caller's interests (K3 Game optimality). Higher = more aligned.",
1006
+ "type": "number",
1007
+ "minimum": 0,
1008
+ "maximum": 100
1009
+ },
1010
+ "recommended": {
1011
+ "description": "Whether this is the recommended option (highest consistency).",
1012
+ "type": "boolean"
1013
+ }
1014
+ },
1015
+ "required": [
1016
+ "next_node",
1017
+ "forward",
1018
+ "weight",
1019
+ "operator",
1020
+ "business_meaning"
1021
+ ],
1022
+ "additionalProperties": false,
1023
+ "description": "A reachable next-node option with its operator/permission, guard, business meaning, and K3-style gains/risks/consistency."
501
1024
  },
502
- "required": [
503
- "recommendations",
504
- "reminders"
505
- ],
506
- "additionalProperties": false,
507
- "description": "Buyer-side advice (Phase 3 C-3.3). Populated when customer_intelligence service is enabled AND operation is order/query on a Service. Contains risk_score, recommendations, reminders, and preference_match."
1025
+ "description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
508
1026
  },
509
- "evolution_context": {
1027
+ "recommendation": {
1028
+ "description": "Recommended option with rationale (K3 Game 意图/博弈/利益).",
510
1029
  "type": "object",
511
1030
  "properties": {
512
- "industry_signal": {
513
- "type": "string",
514
- "description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'"
1031
+ "best": {
1032
+ "description": "Recommended action in '<forward> → <next_node>' form. Example: 'StartService → serving'",
1033
+ "type": "string"
515
1034
  },
516
- "evolution_advice": {
517
- "type": "string",
518
- "description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'"
519
- },
520
- "confidence": {
521
- "type": "number",
522
- "minimum": 0,
523
- "maximum": 1,
524
- "description": "Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"
525
- },
526
- "health_score": {
527
- "type": "number",
528
- "minimum": 0,
529
- "maximum": 100,
530
- "description": "Industry health score 0-100 if available. Example: 82"
531
- },
532
- "pending_suggestions": {
533
- "type": "integer",
534
- "minimum": 0,
535
- "description": "Count of pending industry update suggestions (filtered by role if role is set). Example: 3"
536
- },
537
- "intent": {
538
- "type": "string",
539
- "enum": [
540
- "default",
541
- "growth",
542
- "retention",
543
- "compliance",
544
- "efficiency",
545
- "trust_building",
546
- "custom"
547
- ],
548
- "description": "Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'"
1035
+ "rationale": {
1036
+ "description": "Why this option is recommended (framed at the caller's value: gains/risks). Example: 'For the guide, advancing to serving triggers the delivery flow'",
1037
+ "type": "string"
549
1038
  },
550
- "role_advice": {
551
- "type": "array",
552
- "items": {
553
- "type": "string"
554
- },
555
- "description": "Phase 4 P4-6.C: Role-targeted advice strings (merchant/customer/prospect/supplier/collaborator/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']"
556
- },
557
- "role": {
558
- "type": "string",
559
- "enum": [
560
- "merchant",
561
- "customer",
562
- "prospect",
563
- "supplier",
564
- "collaborator",
565
- "arbitrator"
566
- ],
567
- "description": "Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'"
1039
+ "caveat": {
1040
+ "description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 机会成本). Example: 'Choosing cancelled forfeits this order's settlement'",
1041
+ "type": "string"
568
1042
  }
569
1043
  },
570
- "required": [
571
- "confidence"
572
- ],
573
- "additionalProperties": false,
574
- "description": "Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice."
1044
+ "additionalProperties": false
575
1045
  },
576
- "guard_advice": {
577
- "type": "object",
578
- "properties": {
579
- "current_round": {
580
- "type": "string",
581
- "enum": [
582
- "R1",
583
- "R2",
584
- "R3",
585
- "R4",
586
- "R5",
587
- "R6",
588
- "R7",
589
- "R8",
590
- "R9",
591
- "R10"
592
- ],
593
- "description": "Current R1-R10 dialogue round. R1=intent, R2=table, R3=tree, R4=rely, R5=binding, R6=review, R7=CREATE, R8=test, R9=bind, R10=verify. Example: 'R3'"
594
- },
595
- "puzzle_status": {
596
- "type": "object",
597
- "properties": {
598
- "intent": {
599
- "type": "boolean",
600
- "description": "Intent dimension complete (action + rule + failure conditions)"
601
- },
602
- "binding": {
603
- "type": "boolean",
604
- "description": "Binding dimension complete (host object + field + circular ref)"
605
- },
606
- "data": {
607
- "type": "boolean",
608
- "description": "Data dimension complete (table entries + witnesses)"
609
- },
610
- "query": {
611
- "type": "boolean",
612
- "description": "Query dimension complete (query instructions if needed)"
613
- },
614
- "logic": {
615
- "type": "boolean",
616
- "description": "Logic dimension complete (root node returns Bool)"
617
- },
618
- "constraints": {
619
- "type": "boolean",
620
- "description": "Constraints dimension complete (10 Pitfalls checked)"
621
- }
1046
+ "note": {
1047
+ "description": "Additional note (e.g. wait for the other party, entry/terminal hint).",
1048
+ "type": "string"
1049
+ }
1050
+ },
1051
+ "required": [
1052
+ "current_node",
1053
+ "options"
1054
+ ],
1055
+ "additionalProperties": false
1056
+ },
1057
+ "workflow_receipt": {
1058
+ "description": "K3 operate receipt: which account did what, whether the node migrated, and threshold/weight cooperation status when it did not. AI must relay this to the user after every progress operation.",
1059
+ "type": "object",
1060
+ "properties": {
1061
+ "account": {
1062
+ "type": "string",
1063
+ "description": "The account that executed the operation (env.account). Example: 'london_guide'"
1064
+ },
1065
+ "action": {
1066
+ "type": "string",
1067
+ "description": "What was done. Example: 'london_guide executed StartService (paid → serving)'"
1068
+ },
1069
+ "forward": {
1070
+ "type": "string",
1071
+ "description": "Forward name executed. Example: 'StartService'"
1072
+ },
1073
+ "target_node": {
1074
+ "type": "string",
1075
+ "description": "Target node of the executed forward. Example: 'serving'"
1076
+ },
1077
+ "op": {
1078
+ "description": "Operation type executed.",
1079
+ "type": "string",
1080
+ "enum": [
1081
+ "next",
1082
+ "hold",
1083
+ "unhold",
1084
+ "adminUnhold"
1085
+ ]
1086
+ },
1087
+ "migrated": {
1088
+ "type": "boolean",
1089
+ "description": "Whether the Progress migrated to the target node (true) or stayed (false — weights still accumulating toward threshold)."
1090
+ },
1091
+ "current_node": {
1092
+ "type": "string",
1093
+ "description": "Progress.current after the operation."
1094
+ },
1095
+ "threshold": {
1096
+ "description": "Pair threshold when NOT migrated (threshold > 0).",
1097
+ "type": "number"
1098
+ },
1099
+ "accumulated_weight": {
1100
+ "description": "Accumulated forward weight in the current session when NOT migrated.",
1101
+ "type": "number"
1102
+ },
1103
+ "remaining": {
1104
+ "description": "threshold - accumulated_weight when NOT migrated.",
1105
+ "type": "number"
1106
+ },
1107
+ "waiting_on": {
1108
+ "description": "Pending forwards + their operators when NOT migrated (K3 Game G4 — who must cooperate next).",
1109
+ "type": "array",
1110
+ "items": {
1111
+ "type": "object",
1112
+ "properties": {
1113
+ "forward": {
1114
+ "type": "string",
1115
+ "description": "Forward still required to reach the threshold. Example: 'GuideConfirm'"
622
1116
  },
623
- "required": [
624
- "intent",
625
- "binding",
626
- "data",
627
- "query",
628
- "logic",
629
- "constraints"
630
- ],
631
- "additionalProperties": false,
632
- "description": "Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE."
633
- },
634
- "matched_scene": {
635
- "type": "string",
636
- "description": "Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'"
1117
+ "operator": {
1118
+ "type": "object",
1119
+ "properties": {
1120
+ "kind": {
1121
+ "type": "string",
1122
+ "enum": [
1123
+ "order_holder",
1124
+ "permission_index",
1125
+ "named_operator"
1126
+ ],
1127
+ "description": "Who can execute this forward (K3 feasibility). 'order_holder' = the Order owner (customer; forward namedOperator=''), 'permission_index' = a permission role, 'named_operator' = a specific Progress namespace operator."
1128
+ },
1129
+ "permission_index": {
1130
+ "description": "Permission index when kind='permission_index'. Example: 1000",
1131
+ "type": "integer",
1132
+ "minimum": -9007199254740991,
1133
+ "maximum": 9007199254740991
1134
+ },
1135
+ "role_name": {
1136
+ "description": "Resolved role display name. Example: 'merchant (permission 1000)' / 'order holder (customer)'",
1137
+ "type": "string"
1138
+ },
1139
+ "account_name": {
1140
+ "description": "Resolved local account/mark name when the operator maps to a concrete account. Example: 'london_guide'",
1141
+ "type": "string"
1142
+ },
1143
+ "named_operator": {
1144
+ "description": "NamedOperator namespace when kind='named_operator'. Example: 'delivery_team'",
1145
+ "type": "string"
1146
+ }
1147
+ },
1148
+ "required": [
1149
+ "kind"
1150
+ ],
1151
+ "additionalProperties": false,
1152
+ "description": "Who must execute this forward next."
1153
+ }
637
1154
  },
638
- "scene_description": {
1155
+ "required": [
1156
+ "forward",
1157
+ "operator"
1158
+ ],
1159
+ "additionalProperties": false,
1160
+ "description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4 阈值配合)."
1161
+ }
1162
+ },
1163
+ "next_guidance": {
1164
+ "description": "Next-node guidance from the resulting current node.",
1165
+ "type": "object",
1166
+ "properties": {
1167
+ "current_node": {
639
1168
  "type": "string",
640
- "description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"
641
- },
642
- "scene_constraints": {
643
- "type": "array",
644
- "items": {
645
- "type": "string"
646
- },
647
- "description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"
1169
+ "description": "Current node of the Progress. Example: 'serving'"
648
1170
  },
649
- "suggested_patterns": {
650
- "type": "array",
651
- "items": {
652
- "type": "string"
653
- },
654
- "description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"
1171
+ "caller": {
1172
+ "description": "The account (name/address) this guidance is framed for (env.account). Example: 'london_guide'",
1173
+ "type": "string"
655
1174
  },
656
- "available_queries": {
1175
+ "options": {
657
1176
  "type": "array",
658
1177
  "items": {
659
1178
  "type": "object",
660
1179
  "properties": {
661
- "id": {
662
- "type": "integer",
663
- "description": "Query instruction ID. Example: 1253"
664
- },
665
- "name": {
1180
+ "next_node": {
666
1181
  "type": "string",
667
- "description": "Query instruction name. Example: 'progress.current'"
1182
+ "description": "Target node this forward advances INTO. Example: 'serving'"
668
1183
  },
669
- "objectType": {
1184
+ "forward": {
670
1185
  "type": "string",
671
- "description": "Target object type. Example: 'Progress'"
1186
+ "description": "Forward (operation) name. Example: 'StartService'"
672
1187
  },
673
- "returnType": {
674
- "type": "string",
675
- "description": "Return value type. Example: 'String'"
1188
+ "weight": {
1189
+ "type": "number",
1190
+ "description": "Forward weight contributed toward the pair threshold. Example: 1"
1191
+ },
1192
+ "operator": {
1193
+ "type": "object",
1194
+ "properties": {
1195
+ "kind": {
1196
+ "type": "string",
1197
+ "enum": [
1198
+ "order_holder",
1199
+ "permission_index",
1200
+ "named_operator"
1201
+ ],
1202
+ "description": "Who can execute this forward (K3 feasibility). 'order_holder' = the Order owner (customer; forward namedOperator=''), 'permission_index' = a permission role, 'named_operator' = a specific Progress namespace operator."
1203
+ },
1204
+ "permission_index": {
1205
+ "description": "Permission index when kind='permission_index'. Example: 1000",
1206
+ "type": "integer",
1207
+ "minimum": -9007199254740991,
1208
+ "maximum": 9007199254740991
1209
+ },
1210
+ "role_name": {
1211
+ "description": "Resolved role display name. Example: 'merchant (permission 1000)' / 'order holder (customer)'",
1212
+ "type": "string"
1213
+ },
1214
+ "account_name": {
1215
+ "description": "Resolved local account/mark name when the operator maps to a concrete account. Example: 'london_guide'",
1216
+ "type": "string"
1217
+ },
1218
+ "named_operator": {
1219
+ "description": "NamedOperator namespace when kind='named_operator'. Example: 'delivery_team'",
1220
+ "type": "string"
1221
+ }
1222
+ },
1223
+ "required": [
1224
+ "kind"
1225
+ ],
1226
+ "additionalProperties": false,
1227
+ "description": "Who can execute this forward (which account + which permission)."
1228
+ },
1229
+ "guard": {
1230
+ "description": "Guard bound to the forward — acceptance condition verified BEFORE the transition. Example: 'guard_payout'",
1231
+ "type": "string"
676
1232
  },
677
- "description": {
1233
+ "business_meaning": {
678
1234
  "type": "string",
679
- "description": "Query description"
1235
+ "description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
1236
+ },
1237
+ "gains": {
1238
+ "description": "Gains for the caller if this option is chosen (K3 Game G1 收益分离). Example: ['Settlement triggered — funds released to provider']",
1239
+ "type": "array",
1240
+ "items": {
1241
+ "type": "string"
1242
+ }
1243
+ },
1244
+ "risks": {
1245
+ "description": "Risks for the caller if this option is chosen (K3 Game G1 风险分离). Example: ['Refund leverage lost after confirmation']",
1246
+ "type": "array",
1247
+ "items": {
1248
+ "type": "string"
1249
+ }
1250
+ },
1251
+ "consistency": {
1252
+ "description": "Consistency 0-100 between this option's business semantics and the caller's interests (K3 Game optimality). Higher = more aligned.",
1253
+ "type": "number",
1254
+ "minimum": 0,
1255
+ "maximum": 100
1256
+ },
1257
+ "recommended": {
1258
+ "description": "Whether this is the recommended option (highest consistency).",
1259
+ "type": "boolean"
680
1260
  }
681
1261
  },
682
1262
  "required": [
683
- "id",
684
- "name",
685
- "objectType",
686
- "returnType"
1263
+ "next_node",
1264
+ "forward",
1265
+ "weight",
1266
+ "operator",
1267
+ "business_meaning"
687
1268
  ],
688
1269
  "additionalProperties": false,
689
- "description": "A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries)."
690
- },
691
- "description": "Available query instructions for the current context (subset of 375 GUARDQUERY entries)"
692
- },
693
- "risk_warnings": {
694
- "type": "array",
695
- "items": {
696
- "type": "string"
697
- },
698
- "description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"
699
- },
700
- "pending_questions": {
701
- "type": "array",
702
- "items": {
703
- "type": "string"
1270
+ "description": "A reachable next-node option with its operator/permission, guard, business meaning, and K3-style gains/risks/consistency."
704
1271
  },
705
- "description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"
706
- },
707
- "confirmation_text": {
708
- "type": "string",
709
- "description": "Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE."
1272
+ "description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
710
1273
  },
711
- "test_result": {
1274
+ "recommendation": {
1275
+ "description": "Recommended option with rationale (K3 Game 意图/博弈/利益).",
712
1276
  "type": "object",
713
1277
  "properties": {
714
- "status": {
715
- "type": "string",
716
- "enum": [
717
- "pass",
718
- "fail",
719
- "not_tested"
720
- ]
1278
+ "best": {
1279
+ "description": "Recommended action in '<forward> → <next_node>' form. Example: 'StartService → serving'",
1280
+ "type": "string"
721
1281
  },
722
- "failure_node": {
723
- "type": "string",
724
- "description": "Node that caused failure (if fail)"
1282
+ "rationale": {
1283
+ "description": "Why this option is recommended (framed at the caller's value: gains/risks). Example: 'For the guide, advancing to serving triggers the delivery flow'",
1284
+ "type": "string"
725
1285
  },
726
- "passport_id": {
727
- "type": "string",
728
- "description": "Generated Passport ID (if pass)"
1286
+ "caveat": {
1287
+ "description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 机会成本). Example: 'Choosing cancelled forfeits this order's settlement'",
1288
+ "type": "string"
729
1289
  }
730
1290
  },
731
- "required": [
732
- "status"
733
- ],
734
- "additionalProperties": false,
735
- "description": "gen_passport static test result. Must pass before CREATE."
1291
+ "additionalProperties": false
736
1292
  },
737
- "risk_assessment": {
738
- "type": "object",
739
- "properties": {
740
- "overall_risk": {
741
- "type": "string",
742
- "enum": [
743
- "critical",
744
- "high",
745
- "medium",
746
- "low",
747
- "info"
748
- ],
749
- "description": "Overall risk level (highest from all risks)"
750
- },
751
- "risk_count": {
752
- "type": "integer",
753
- "description": "Total number of detected risks"
754
- },
755
- "critical_count": {
756
- "type": "integer",
757
- "description": "Number of critical risks"
758
- },
759
- "high_count": {
760
- "type": "integer",
761
- "description": "Number of high risks"
762
- },
763
- "needs_human_review": {
764
- "type": "boolean",
765
- "description": "Whether human review is required (critical or 2+ high risks)"
766
- },
767
- "top_risks": {
768
- "type": "array",
769
- "items": {
770
- "type": "string"
771
- },
772
- "description": "Top risk titles (critical and high, max 3)"
773
- },
774
- "stakeholder_advice": {
775
- "type": "object",
776
- "additionalProperties": {
777
- "type": "array",
778
- "items": {
779
- "type": "string"
780
- }
781
- },
782
- "description": "Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list"
783
- }
784
- },
785
- "required": [
786
- "overall_risk",
787
- "risk_count",
788
- "critical_count",
789
- "high_count",
790
- "needs_human_review",
791
- "top_risks"
792
- ],
793
- "additionalProperties": false,
794
- "description": "Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax."
1293
+ "note": {
1294
+ "description": "Additional note (e.g. wait for the other party, entry/terminal hint).",
1295
+ "type": "string"
795
1296
  }
796
1297
  },
797
- "additionalProperties": false,
798
- "description": "Phase 5 Guard capability advice (populated when user intent involves Guard). Provides puzzle status, scene matching, suggested patterns, available queries, risk warnings, and confirmation text. AI uses this to guide Guard design dialogue (R1-R10)."
1298
+ "required": [
1299
+ "current_node",
1300
+ "options"
1301
+ ],
1302
+ "additionalProperties": false
1303
+ },
1304
+ "note": {
1305
+ "description": "Additional note.",
1306
+ "type": "string"
799
1307
  }
800
1308
  },
801
1309
  "required": [
802
- "intent",
803
- "status",
804
- "summary"
1310
+ "account",
1311
+ "action",
1312
+ "forward",
1313
+ "target_node",
1314
+ "migrated",
1315
+ "current_node"
805
1316
  ],
806
- "additionalProperties": false,
807
- "description": "Business semantic summary for bridge operation"
1317
+ "additionalProperties": false
808
1318
  }
809
1319
  },
810
1320
  "required": [
811
- "result"
1321
+ "intent",
1322
+ "status",
1323
+ "summary"
812
1324
  ],
813
- "additionalProperties": false,
814
- "description": "Bridge operation output (matches CallOutput structure returned by the handler)"
1325
+ "additionalProperties": false
815
1326
  }
816
- }
1327
+ },
1328
+ "required": [
1329
+ "result"
1330
+ ],
1331
+ "additionalProperties": false
817
1332
  }