@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,956 +1,1076 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://wowok.net/schemas/messenger_operation.json",
3
+ "$id": "https://wowok.net/schemas/messenger_operation.output.json",
4
4
  "title": "Messenger Operations",
5
- "description": "WoWok encrypted messenger operations",
6
- "$ref": "#/definitions/messenger_operation",
7
- "definitions": {
8
- "messenger_operation": {
9
- "type": "object",
10
- "properties": {
11
- "result": {
12
- "anyOf": [
13
- {
14
- "type": "object",
15
- "properties": {
16
- "operation": {
17
- "type": "string",
18
- "const": "watch_conversations"
19
- },
20
- "result": {
21
- "type": "array",
22
- "items": {
23
- "type": "object",
24
- "properties": {
25
- "peerAddress": {
26
- "type": "string",
27
- "description": "Peer address"
28
- },
29
- "lastMessageAt": {
30
- "type": "number",
31
- "description": "Last message time"
32
- },
33
- "messageCount": {
34
- "type": "number",
35
- "description": "Total message count"
36
- },
37
- "unreadCount": {
38
- "type": "number",
39
- "description": "Unread message count - count of received messages that have not been viewed (viewedAt is undefined)"
40
- },
41
- "lastMessagePreview": {
42
- "type": "string",
43
- "description": "Last message preview text"
44
- },
45
- "previewMessages": {
46
- "type": "array",
47
- "items": {
5
+ "description": "Messenger operation output schema",
6
+ "type": "object",
7
+ "properties": {
8
+ "result": {
9
+ "oneOf": [
10
+ {
11
+ "type": "object",
12
+ "properties": {
13
+ "operation": {
14
+ "type": "string",
15
+ "const": "watch_conversations"
16
+ },
17
+ "result": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "properties": {
22
+ "peerAddress": {
23
+ "type": "string",
24
+ "description": "Peer address"
25
+ },
26
+ "lastMessageAt": {
27
+ "type": "number",
28
+ "description": "Last message time"
29
+ },
30
+ "messageCount": {
31
+ "type": "number",
32
+ "description": "Total message count"
33
+ },
34
+ "unreadCount": {
35
+ "type": "number",
36
+ "description": "Unread message count - count of received messages that have not been viewed (viewedAt is undefined)"
37
+ },
38
+ "lastMessagePreview": {
39
+ "description": "Last message preview text",
40
+ "type": "string"
41
+ },
42
+ "previewMessages": {
43
+ "description": "Preview messages for this conversation (default 2 messages, sorted by time descending)",
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "properties": {
48
+ "messageId": {
49
+ "type": "string",
50
+ "description": "Message ID"
51
+ },
52
+ "fromAddress": {
53
+ "type": "string",
54
+ "description": "Sender address"
55
+ },
56
+ "toAddress": {
57
+ "type": "string",
58
+ "description": "Recipient address"
59
+ },
60
+ "plaintextHash": {
61
+ "type": "string",
62
+ "description": "Plaintext hash"
63
+ },
64
+ "plaintext": {
65
+ "description": "Decrypted plaintext (optional)",
66
+ "type": "string"
67
+ },
68
+ "replyTo": {
69
+ "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
48
70
  "type": "object",
49
71
  "properties": {
50
72
  "messageId": {
51
73
  "type": "string",
52
- "description": "Message ID"
53
- },
54
- "fromAddress": {
55
- "type": "string",
56
- "description": "Sender address"
57
- },
58
- "toAddress": {
59
- "type": "string",
60
- "description": "Recipient address"
61
- },
62
- "plaintextHash": {
63
- "type": "string",
64
- "description": "Plaintext hash"
65
- },
66
- "plaintext": {
67
- "type": "string",
68
- "description": "Decrypted plaintext (optional)"
69
- },
70
- "replyTo": {
71
- "type": "object",
72
- "properties": {
73
- "messageId": {
74
- "type": "string",
75
- "description": "Replied-to message ID (unique within the conversation)"
76
- }
77
- },
78
- "required": [
79
- "messageId"
80
- ],
81
- "additionalProperties": false,
82
- "description": "Quoted (replied-to) message reference, if this message replies to a previous one"
83
- },
84
- "guardAddress": {
85
- "type": "string",
86
- "description": "Guard address"
87
- },
88
- "passportAddress": {
89
- "type": "string",
90
- "description": "Passport address"
91
- },
92
- "lastReceivedLeafIndex": {
93
- "type": "number",
94
- "description": "Last received leaf index"
95
- },
96
- "direction": {
97
- "type": "string",
98
- "enum": [
99
- "sent",
100
- "received"
101
- ],
102
- "description": "Message direction"
103
- },
104
- "status": {
105
- "type": "string",
106
- "enum": [
107
- "pending",
108
- "confirmed",
109
- "read",
110
- "failed",
111
- "rejected",
112
- "decrypted",
113
- "decrypt_failed"
114
- ],
115
- "description": "Message status"
116
- },
117
- "msgType": {
74
+ "description": "Replied-to message ID (unique within the conversation)"
75
+ }
76
+ },
77
+ "required": [
78
+ "messageId"
79
+ ],
80
+ "additionalProperties": false
81
+ },
82
+ "guardAddress": {
83
+ "description": "Guard address",
84
+ "type": "string"
85
+ },
86
+ "passportAddress": {
87
+ "description": "Passport address",
88
+ "type": "string"
89
+ },
90
+ "lastReceivedLeafIndex": {
91
+ "description": "Last received leaf index",
92
+ "type": "number"
93
+ },
94
+ "direction": {
95
+ "type": "string",
96
+ "enum": [
97
+ "sent",
98
+ "received"
99
+ ],
100
+ "description": "Message direction"
101
+ },
102
+ "status": {
103
+ "type": "string",
104
+ "enum": [
105
+ "pending",
106
+ "confirmed",
107
+ "read",
108
+ "failed",
109
+ "rejected",
110
+ "decrypted",
111
+ "decrypt_failed"
112
+ ],
113
+ "description": "Message status"
114
+ },
115
+ "msgType": {
116
+ "anyOf": [
117
+ {
118
118
  "type": "number",
119
- "enum": [
120
- 1,
121
- 3
122
- ],
123
- "description": "Message type"
119
+ "const": 1
124
120
  },
125
- "leafIndex": {
121
+ {
126
122
  "type": "number",
127
- "description": "Leaf index"
128
- },
129
- "prevRoot": {
123
+ "const": 3
124
+ }
125
+ ],
126
+ "description": "Message type"
127
+ },
128
+ "leafIndex": {
129
+ "description": "Leaf index",
130
+ "type": "number"
131
+ },
132
+ "prevRoot": {
133
+ "description": "Previous Merkle Root",
134
+ "type": "string"
135
+ },
136
+ "newRoot": {
137
+ "description": "Current Merkle Root",
138
+ "type": "string"
139
+ },
140
+ "serverSignature": {
141
+ "description": "Server signature",
142
+ "type": "string"
143
+ },
144
+ "serverTimestamp": {
145
+ "description": "Server confirmation timestamp",
146
+ "type": "number"
147
+ },
148
+ "serverPublicKey": {
149
+ "description": "Server public key",
150
+ "type": "string"
151
+ },
152
+ "arkConfirmed": {
153
+ "description": "ARK confirmation",
154
+ "type": "object",
155
+ "properties": {
156
+ "recipient": {
130
157
  "type": "string",
131
- "description": "Previous Merkle Root"
158
+ "description": "Recipient address"
132
159
  },
133
- "newRoot": {
160
+ "recipientPublicKey": {
134
161
  "type": "string",
135
- "description": "Current Merkle Root"
162
+ "description": "Recipient public key"
136
163
  },
137
- "serverSignature": {
164
+ "signature": {
138
165
  "type": "string",
139
- "description": "Server signature"
166
+ "description": "Recipient signature"
140
167
  },
141
- "serverTimestamp": {
168
+ "timestamp": {
142
169
  "type": "number",
143
- "description": "Server confirmation timestamp"
144
- },
145
- "serverPublicKey": {
170
+ "description": "ARK confirmation time"
171
+ }
172
+ },
173
+ "required": [
174
+ "recipient",
175
+ "recipientPublicKey",
176
+ "signature",
177
+ "timestamp"
178
+ ],
179
+ "additionalProperties": false
180
+ },
181
+ "createdAt": {
182
+ "type": "number",
183
+ "description": "Message creation time (client)"
184
+ },
185
+ "receivedAt": {
186
+ "description": "Local reception time",
187
+ "type": "number"
188
+ },
189
+ "zipMetadata": {
190
+ "description": "ZIP file metadata",
191
+ "type": "object",
192
+ "properties": {
193
+ "fileName": {
146
194
  "type": "string",
147
- "description": "Server public key"
148
- },
149
- "arkConfirmed": {
150
- "type": "object",
151
- "properties": {
152
- "recipient": {
153
- "type": "string",
154
- "description": "Recipient address"
155
- },
156
- "recipientPublicKey": {
157
- "type": "string",
158
- "description": "Recipient public key"
159
- },
160
- "signature": {
161
- "type": "string",
162
- "description": "Recipient signature"
163
- },
164
- "timestamp": {
165
- "type": "number",
166
- "description": "ARK confirmation time"
167
- }
168
- },
169
- "required": [
170
- "recipient",
171
- "recipientPublicKey",
172
- "signature",
173
- "timestamp"
174
- ],
175
- "additionalProperties": false,
176
- "description": "ARK confirmation"
177
- },
178
- "createdAt": {
179
- "type": "number",
180
- "description": "Message creation time (client)"
195
+ "description": "ZIP filename"
181
196
  },
182
- "receivedAt": {
197
+ "fileSize": {
183
198
  "type": "number",
184
- "description": "Local reception time"
185
- },
186
- "zipMetadata": {
187
- "type": "object",
188
- "properties": {
189
- "fileName": {
190
- "type": "string",
191
- "description": "ZIP filename"
192
- },
193
- "fileSize": {
194
- "type": "number",
195
- "description": "File size in bytes"
196
- },
197
- "fileHash": {
198
- "type": "string",
199
- "description": "File SHA256 hash"
200
- },
201
- "contentType": {
202
- "type": "string",
203
- "enum": [
204
- "text",
205
- "zip",
206
- "wts",
207
- "wip"
208
- ],
209
- "description": "Content type"
210
- },
211
- "localCachePath": {
212
- "type": "string",
213
- "description": "Local cache path"
214
- },
215
- "downloadedAt": {
216
- "type": "number",
217
- "description": "Download timestamp"
218
- }
219
- },
220
- "required": [
221
- "fileName",
222
- "fileSize",
223
- "fileHash",
224
- "contentType"
225
- ],
226
- "additionalProperties": false,
227
- "description": "ZIP file metadata"
199
+ "description": "File size in bytes"
228
200
  },
229
- "proof": {
201
+ "fileHash": {
230
202
  "type": "string",
231
- "description": "On-chain proof object address"
203
+ "description": "File SHA256 hash"
232
204
  },
233
- "decryptError": {
205
+ "contentType": {
234
206
  "type": "string",
235
- "description": "Decryption failure reason"
236
- },
237
- "decryptAttempts": {
238
- "type": "number",
239
- "description": "Number of decryption attempts"
207
+ "enum": [
208
+ "text",
209
+ "zip",
210
+ "wts",
211
+ "wip"
212
+ ],
213
+ "description": "Content type"
240
214
  },
241
- "lastDecryptAttemptAt": {
242
- "type": "number",
243
- "description": "Last decryption attempt timestamp"
215
+ "localCachePath": {
216
+ "description": "Local cache path",
217
+ "type": "string"
244
218
  },
245
- "viewedAt": {
246
- "type": "number",
247
- "description": "Timestamp when the current user viewed this message (local storage). If present, indicates the message has been viewed by the user. Only applicable to received messages (direction === 'received')"
219
+ "downloadedAt": {
220
+ "description": "Download timestamp",
221
+ "type": "number"
248
222
  }
249
223
  },
250
224
  "required": [
251
- "messageId",
252
- "fromAddress",
253
- "toAddress",
254
- "plaintextHash",
255
- "direction",
256
- "status",
257
- "msgType",
258
- "createdAt"
225
+ "fileName",
226
+ "fileSize",
227
+ "fileHash",
228
+ "contentType"
259
229
  ],
260
- "additionalProperties": false,
261
- "description": "Message object"
230
+ "additionalProperties": false
262
231
  },
263
- "description": "Preview messages for this conversation (default 2 messages, sorted by time descending)"
264
- }
265
- },
266
- "required": [
267
- "peerAddress",
268
- "lastMessageAt",
269
- "messageCount",
270
- "unreadCount"
271
- ],
272
- "additionalProperties": false,
273
- "description": "Conversation info with unread count and preview messages"
274
- },
275
- "description": "List of conversations"
276
- }
232
+ "proof": {
233
+ "description": "On-chain proof object address",
234
+ "type": "string"
235
+ },
236
+ "decryptError": {
237
+ "description": "Decryption failure reason",
238
+ "type": "string"
239
+ },
240
+ "decryptAttempts": {
241
+ "description": "Number of decryption attempts",
242
+ "type": "number"
243
+ },
244
+ "lastDecryptAttemptAt": {
245
+ "description": "Last decryption attempt timestamp",
246
+ "type": "number"
247
+ },
248
+ "viewedAt": {
249
+ "description": "Timestamp when the current user viewed this message (local storage). If present, indicates the message has been viewed by the user. Only applicable to received messages (direction === 'received')",
250
+ "type": "number"
251
+ }
252
+ },
253
+ "required": [
254
+ "messageId",
255
+ "fromAddress",
256
+ "toAddress",
257
+ "plaintextHash",
258
+ "direction",
259
+ "status",
260
+ "msgType",
261
+ "createdAt"
262
+ ],
263
+ "additionalProperties": false,
264
+ "description": "Message object"
265
+ }
266
+ }
267
+ },
268
+ "required": [
269
+ "peerAddress",
270
+ "lastMessageAt",
271
+ "messageCount",
272
+ "unreadCount"
273
+ ],
274
+ "additionalProperties": false,
275
+ "description": "Conversation info with unread count and preview messages"
277
276
  },
278
- "required": [
279
- "operation",
280
- "result"
281
- ],
282
- "additionalProperties": false
277
+ "description": "List of conversations"
278
+ }
279
+ },
280
+ "required": [
281
+ "operation",
282
+ "result"
283
+ ],
284
+ "additionalProperties": false
285
+ },
286
+ {
287
+ "type": "object",
288
+ "properties": {
289
+ "operation": {
290
+ "type": "string",
291
+ "const": "send_message"
283
292
  },
284
- {
293
+ "result": {
285
294
  "type": "object",
286
295
  "properties": {
287
- "operation": {
296
+ "messageId": {
297
+ "type": "string",
298
+ "description": "Message ID"
299
+ },
300
+ "status": {
288
301
  "type": "string",
289
- "const": "send_message"
302
+ "enum": [
303
+ "pending",
304
+ "confirmed",
305
+ "read",
306
+ "failed",
307
+ "rejected",
308
+ "decrypted",
309
+ "decrypt_failed"
310
+ ],
311
+ "description": "Message status"
290
312
  },
291
- "result": {
313
+ "merkleData": {
314
+ "description": "Merkle Tree proof data",
292
315
  "type": "object",
293
316
  "properties": {
294
- "messageId": {
295
- "type": "string",
296
- "description": "Message ID"
317
+ "leafIndex": {
318
+ "type": "number",
319
+ "description": "Leaf index"
297
320
  },
298
- "status": {
321
+ "prevRoot": {
299
322
  "type": "string",
300
- "enum": [
301
- "pending",
302
- "confirmed",
303
- "read",
304
- "failed",
305
- "rejected",
306
- "decrypted",
307
- "decrypt_failed"
308
- ],
309
- "description": "Message status"
323
+ "description": "Previous Merkle Root"
310
324
  },
311
- "merkleData": {
312
- "type": "object",
313
- "properties": {
314
- "leafIndex": {
315
- "type": "number",
316
- "description": "Leaf index"
317
- },
318
- "prevRoot": {
319
- "type": "string",
320
- "description": "Previous Merkle Root"
321
- },
322
- "newRoot": {
323
- "type": "string",
324
- "description": "Current Merkle Root"
325
- },
326
- "serverSignature": {
327
- "type": "string",
328
- "description": "Server signature"
329
- },
330
- "serverTimestamp": {
331
- "type": "number",
332
- "description": "Server confirmation timestamp"
333
- },
334
- "serverPublicKey": {
335
- "type": "string",
336
- "description": "Server public key"
337
- }
338
- },
339
- "required": [
340
- "leafIndex",
341
- "prevRoot",
342
- "newRoot",
343
- "serverSignature",
344
- "serverTimestamp",
345
- "serverPublicKey"
346
- ],
347
- "additionalProperties": false,
348
- "description": "Merkle Tree proof data"
325
+ "newRoot": {
326
+ "type": "string",
327
+ "description": "Current Merkle Root"
349
328
  },
350
- "guardList": {
351
- "type": "array",
352
- "items": {
353
- "type": "string"
354
- },
355
- "description": "Guard list (only returned on error)"
329
+ "serverSignature": {
330
+ "type": "string",
331
+ "description": "Server signature"
356
332
  },
357
- "lastReceivedLeafIndex": {
333
+ "serverTimestamp": {
358
334
  "type": "number",
359
- "description": "Last received leaf index (for message confirmation)"
335
+ "description": "Server confirmation timestamp"
336
+ },
337
+ "serverPublicKey": {
338
+ "type": "string",
339
+ "description": "Server public key"
360
340
  }
361
341
  },
362
342
  "required": [
363
- "messageId",
364
- "status"
343
+ "leafIndex",
344
+ "prevRoot",
345
+ "newRoot",
346
+ "serverSignature",
347
+ "serverTimestamp",
348
+ "serverPublicKey"
365
349
  ],
366
- "additionalProperties": false,
367
- "description": "Send message result"
350
+ "additionalProperties": false
351
+ },
352
+ "guardList": {
353
+ "description": "Guard list (only returned on error)",
354
+ "type": "array",
355
+ "items": {
356
+ "type": "string"
357
+ }
358
+ },
359
+ "lastReceivedLeafIndex": {
360
+ "description": "Last received leaf index (for message confirmation)",
361
+ "type": "number"
368
362
  }
369
363
  },
370
364
  "required": [
371
- "operation",
372
- "result"
365
+ "messageId",
366
+ "status"
373
367
  ],
374
- "additionalProperties": false
368
+ "additionalProperties": false,
369
+ "description": "Send message result"
370
+ }
371
+ },
372
+ "required": [
373
+ "operation",
374
+ "result"
375
+ ],
376
+ "additionalProperties": false
377
+ },
378
+ {
379
+ "type": "object",
380
+ "properties": {
381
+ "operation": {
382
+ "type": "string",
383
+ "const": "send_file"
375
384
  },
376
- {
385
+ "result": {
377
386
  "type": "object",
378
387
  "properties": {
379
- "operation": {
388
+ "messageId": {
389
+ "type": "string",
390
+ "description": "Message ID"
391
+ },
392
+ "status": {
380
393
  "type": "string",
381
- "const": "send_file"
394
+ "enum": [
395
+ "pending",
396
+ "confirmed",
397
+ "read",
398
+ "failed",
399
+ "rejected",
400
+ "decrypted",
401
+ "decrypt_failed"
402
+ ],
403
+ "description": "Message status"
382
404
  },
383
- "result": {
405
+ "merkleData": {
406
+ "description": "Merkle Tree proof data",
384
407
  "type": "object",
385
408
  "properties": {
386
- "messageId": {
387
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/1/properties/result/properties/messageId"
409
+ "leafIndex": {
410
+ "type": "number",
411
+ "description": "Leaf index"
412
+ },
413
+ "prevRoot": {
414
+ "type": "string",
415
+ "description": "Previous Merkle Root"
388
416
  },
389
- "status": {
390
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/1/properties/result/properties/status"
417
+ "newRoot": {
418
+ "type": "string",
419
+ "description": "Current Merkle Root"
391
420
  },
392
- "merkleData": {
393
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/1/properties/result/properties/merkleData"
421
+ "serverSignature": {
422
+ "type": "string",
423
+ "description": "Server signature"
394
424
  },
395
- "guardList": {
396
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/1/properties/result/properties/guardList"
425
+ "serverTimestamp": {
426
+ "type": "number",
427
+ "description": "Server confirmation timestamp"
397
428
  },
398
- "lastReceivedLeafIndex": {
399
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/1/properties/result/properties/lastReceivedLeafIndex"
429
+ "serverPublicKey": {
430
+ "type": "string",
431
+ "description": "Server public key"
400
432
  }
401
433
  },
402
434
  "required": [
403
- "messageId",
404
- "status"
435
+ "leafIndex",
436
+ "prevRoot",
437
+ "newRoot",
438
+ "serverSignature",
439
+ "serverTimestamp",
440
+ "serverPublicKey"
405
441
  ],
406
- "additionalProperties": false,
407
- "description": "Send file result"
408
- }
409
- },
410
- "required": [
411
- "operation",
412
- "result"
413
- ],
414
- "additionalProperties": false
415
- },
416
- {
417
- "type": "object",
418
- "properties": {
419
- "operation": {
420
- "type": "string",
421
- "const": "watch_messages"
442
+ "additionalProperties": false
422
443
  },
423
- "result": {
444
+ "guardList": {
445
+ "description": "Guard list (only returned on error)",
424
446
  "type": "array",
425
447
  "items": {
426
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/0/properties/result/items/properties/previewMessages/items"
427
- },
428
- "description": "List of messages"
448
+ "type": "string"
449
+ }
450
+ },
451
+ "lastReceivedLeafIndex": {
452
+ "description": "Last received leaf index (for message confirmation)",
453
+ "type": "number"
429
454
  }
430
455
  },
431
456
  "required": [
432
- "operation",
433
- "result"
457
+ "messageId",
458
+ "status"
434
459
  ],
435
- "additionalProperties": false
460
+ "additionalProperties": false,
461
+ "description": "Send file result"
462
+ }
463
+ },
464
+ "required": [
465
+ "operation",
466
+ "result"
467
+ ],
468
+ "additionalProperties": false
469
+ },
470
+ {
471
+ "type": "object",
472
+ "properties": {
473
+ "operation": {
474
+ "type": "string",
475
+ "const": "watch_messages"
436
476
  },
437
- {
438
- "type": "object",
439
- "properties": {
440
- "operation": {
441
- "type": "string",
442
- "const": "extract_zip_messages"
443
- },
444
- "result": {
445
- "type": "array",
446
- "items": {
477
+ "result": {
478
+ "type": "array",
479
+ "items": {
480
+ "type": "object",
481
+ "properties": {
482
+ "messageId": {
483
+ "type": "string",
484
+ "description": "Message ID"
485
+ },
486
+ "fromAddress": {
487
+ "type": "string",
488
+ "description": "Sender address"
489
+ },
490
+ "toAddress": {
491
+ "type": "string",
492
+ "description": "Recipient address"
493
+ },
494
+ "plaintextHash": {
495
+ "type": "string",
496
+ "description": "Plaintext hash"
497
+ },
498
+ "plaintext": {
499
+ "description": "Decrypted plaintext (optional)",
447
500
  "type": "string"
448
501
  },
449
- "description": "Extracted file paths"
450
- }
451
- },
452
- "required": [
453
- "operation",
454
- "result"
455
- ],
456
- "additionalProperties": false
457
- },
458
- {
459
- "type": "object",
460
- "properties": {
461
- "operation": {
462
- "type": "string",
463
- "const": "generate_wts"
464
- },
465
- "result": {
466
- "type": "object",
467
- "properties": {
468
- "files": {
469
- "type": "array",
470
- "items": {
471
- "type": "string"
472
- },
473
- "description": "Generated WTS file paths"
502
+ "replyTo": {
503
+ "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
504
+ "type": "object",
505
+ "properties": {
506
+ "messageId": {
507
+ "type": "string",
508
+ "description": "Replied-to message ID (unique within the conversation)"
509
+ }
474
510
  },
475
- "totalMessageCount": {
476
- "type": "number",
477
- "description": "Total message count"
511
+ "required": [
512
+ "messageId"
513
+ ],
514
+ "additionalProperties": false
515
+ },
516
+ "guardAddress": {
517
+ "description": "Guard address",
518
+ "type": "string"
519
+ },
520
+ "passportAddress": {
521
+ "description": "Passport address",
522
+ "type": "string"
523
+ },
524
+ "lastReceivedLeafIndex": {
525
+ "description": "Last received leaf index",
526
+ "type": "number"
527
+ },
528
+ "direction": {
529
+ "type": "string",
530
+ "enum": [
531
+ "sent",
532
+ "received"
533
+ ],
534
+ "description": "Message direction"
535
+ },
536
+ "status": {
537
+ "type": "string",
538
+ "enum": [
539
+ "pending",
540
+ "confirmed",
541
+ "read",
542
+ "failed",
543
+ "rejected",
544
+ "decrypted",
545
+ "decrypt_failed"
546
+ ],
547
+ "description": "Message status"
548
+ },
549
+ "msgType": {
550
+ "anyOf": [
551
+ {
552
+ "type": "number",
553
+ "const": 1
554
+ },
555
+ {
556
+ "type": "number",
557
+ "const": 3
558
+ }
559
+ ],
560
+ "description": "Message type"
561
+ },
562
+ "leafIndex": {
563
+ "description": "Leaf index",
564
+ "type": "number"
565
+ },
566
+ "prevRoot": {
567
+ "description": "Previous Merkle Root",
568
+ "type": "string"
569
+ },
570
+ "newRoot": {
571
+ "description": "Current Merkle Root",
572
+ "type": "string"
573
+ },
574
+ "serverSignature": {
575
+ "description": "Server signature",
576
+ "type": "string"
577
+ },
578
+ "serverTimestamp": {
579
+ "description": "Server confirmation timestamp",
580
+ "type": "number"
581
+ },
582
+ "serverPublicKey": {
583
+ "description": "Server public key",
584
+ "type": "string"
585
+ },
586
+ "arkConfirmed": {
587
+ "description": "ARK confirmation",
588
+ "type": "object",
589
+ "properties": {
590
+ "recipient": {
591
+ "type": "string",
592
+ "description": "Recipient address"
593
+ },
594
+ "recipientPublicKey": {
595
+ "type": "string",
596
+ "description": "Recipient public key"
597
+ },
598
+ "signature": {
599
+ "type": "string",
600
+ "description": "Recipient signature"
601
+ },
602
+ "timestamp": {
603
+ "type": "number",
604
+ "description": "ARK confirmation time"
605
+ }
478
606
  },
479
- "timeRange": {
480
- "type": "object",
481
- "properties": {
482
- "start": {
483
- "type": "number",
484
- "description": "Start time"
485
- },
486
- "end": {
487
- "type": "number",
488
- "description": "End time"
489
- }
607
+ "required": [
608
+ "recipient",
609
+ "recipientPublicKey",
610
+ "signature",
611
+ "timestamp"
612
+ ],
613
+ "additionalProperties": false
614
+ },
615
+ "createdAt": {
616
+ "type": "number",
617
+ "description": "Message creation time (client)"
618
+ },
619
+ "receivedAt": {
620
+ "description": "Local reception time",
621
+ "type": "number"
622
+ },
623
+ "zipMetadata": {
624
+ "description": "ZIP file metadata",
625
+ "type": "object",
626
+ "properties": {
627
+ "fileName": {
628
+ "type": "string",
629
+ "description": "ZIP filename"
490
630
  },
491
- "required": [
492
- "start",
493
- "end"
494
- ],
495
- "additionalProperties": false,
496
- "description": "Time range"
497
- }
631
+ "fileSize": {
632
+ "type": "number",
633
+ "description": "File size in bytes"
634
+ },
635
+ "fileHash": {
636
+ "type": "string",
637
+ "description": "File SHA256 hash"
638
+ },
639
+ "contentType": {
640
+ "type": "string",
641
+ "enum": [
642
+ "text",
643
+ "zip",
644
+ "wts",
645
+ "wip"
646
+ ],
647
+ "description": "Content type"
648
+ },
649
+ "localCachePath": {
650
+ "description": "Local cache path",
651
+ "type": "string"
652
+ },
653
+ "downloadedAt": {
654
+ "description": "Download timestamp",
655
+ "type": "number"
656
+ }
657
+ },
658
+ "required": [
659
+ "fileName",
660
+ "fileSize",
661
+ "fileHash",
662
+ "contentType"
663
+ ],
664
+ "additionalProperties": false
498
665
  },
499
- "required": [
500
- "files",
501
- "totalMessageCount",
502
- "timeRange"
503
- ],
504
- "additionalProperties": false,
505
- "description": "Generate WTS result"
506
- }
666
+ "proof": {
667
+ "description": "On-chain proof object address",
668
+ "type": "string"
669
+ },
670
+ "decryptError": {
671
+ "description": "Decryption failure reason",
672
+ "type": "string"
673
+ },
674
+ "decryptAttempts": {
675
+ "description": "Number of decryption attempts",
676
+ "type": "number"
677
+ },
678
+ "lastDecryptAttemptAt": {
679
+ "description": "Last decryption attempt timestamp",
680
+ "type": "number"
681
+ },
682
+ "viewedAt": {
683
+ "description": "Timestamp when the current user viewed this message (local storage). If present, indicates the message has been viewed by the user. Only applicable to received messages (direction === 'received')",
684
+ "type": "number"
685
+ }
686
+ },
687
+ "required": [
688
+ "messageId",
689
+ "fromAddress",
690
+ "toAddress",
691
+ "plaintextHash",
692
+ "direction",
693
+ "status",
694
+ "msgType",
695
+ "createdAt"
696
+ ],
697
+ "additionalProperties": false,
698
+ "description": "Message object"
507
699
  },
508
- "required": [
509
- "operation",
510
- "result"
511
- ],
512
- "additionalProperties": false
700
+ "description": "List of messages"
701
+ }
702
+ },
703
+ "required": [
704
+ "operation",
705
+ "result"
706
+ ],
707
+ "additionalProperties": false
708
+ },
709
+ {
710
+ "type": "object",
711
+ "properties": {
712
+ "operation": {
713
+ "type": "string",
714
+ "const": "extract_zip_messages"
715
+ },
716
+ "result": {
717
+ "type": "array",
718
+ "items": {
719
+ "type": "string"
720
+ },
721
+ "description": "Extracted file paths"
722
+ }
723
+ },
724
+ "required": [
725
+ "operation",
726
+ "result"
727
+ ],
728
+ "additionalProperties": false
729
+ },
730
+ {
731
+ "type": "object",
732
+ "properties": {
733
+ "operation": {
734
+ "type": "string",
735
+ "const": "generate_wts"
513
736
  },
514
- {
737
+ "result": {
515
738
  "type": "object",
516
739
  "properties": {
517
- "operation": {
518
- "type": "string",
519
- "const": "verify_wts"
740
+ "files": {
741
+ "type": "array",
742
+ "items": {
743
+ "type": "string"
744
+ },
745
+ "description": "Generated WTS file paths"
746
+ },
747
+ "totalMessageCount": {
748
+ "type": "number",
749
+ "description": "Total message count"
520
750
  },
521
- "result": {
751
+ "timeRange": {
522
752
  "type": "object",
523
753
  "properties": {
524
- "valid": {
525
- "type": "boolean",
526
- "description": "Whether verification succeeded"
527
- },
528
- "error": {
529
- "type": "string",
530
- "description": "Error message if verification failed"
531
- },
532
- "hashValid": {
533
- "type": "boolean",
534
- "description": "Whether hash validation passed"
535
- },
536
- "hasSignature": {
537
- "type": "boolean",
538
- "description": "Whether WTS has signatures"
539
- },
540
- "signatureValid": {
541
- "type": "boolean",
542
- "description": "Whether signature validation passed"
754
+ "start": {
755
+ "type": "number",
756
+ "description": "Start time"
543
757
  },
544
- "signatures": {
545
- "type": "array",
546
- "items": {
547
- "type": "object",
548
- "properties": {
549
- "publicKey": {
550
- "type": "string",
551
- "description": "Signer public key"
552
- },
553
- "address": {
554
- "type": "string",
555
- "description": "Signer address"
556
- },
557
- "valid": {
558
- "type": "boolean",
559
- "description": "Whether signature is valid"
560
- }
561
- },
562
- "required": [
563
- "publicKey",
564
- "valid"
565
- ],
566
- "additionalProperties": false,
567
- "description": "WTS signature verification details"
568
- },
569
- "description": "Signature verification details"
758
+ "end": {
759
+ "type": "number",
760
+ "description": "End time"
570
761
  }
571
762
  },
572
763
  "required": [
573
- "valid",
574
- "hashValid",
575
- "hasSignature"
764
+ "start",
765
+ "end"
576
766
  ],
577
767
  "additionalProperties": false,
578
- "description": "WTS verification result"
768
+ "description": "Time range"
579
769
  }
580
770
  },
581
771
  "required": [
582
- "operation",
583
- "result"
772
+ "files",
773
+ "totalMessageCount",
774
+ "timeRange"
584
775
  ],
585
- "additionalProperties": false
776
+ "additionalProperties": false,
777
+ "description": "Generate WTS result"
778
+ }
779
+ },
780
+ "required": [
781
+ "operation",
782
+ "result"
783
+ ],
784
+ "additionalProperties": false
785
+ },
786
+ {
787
+ "type": "object",
788
+ "properties": {
789
+ "operation": {
790
+ "type": "string",
791
+ "const": "verify_wts"
586
792
  },
587
- {
793
+ "result": {
588
794
  "type": "object",
589
795
  "properties": {
590
- "operation": {
591
- "type": "string",
592
- "const": "sign_wts"
796
+ "valid": {
797
+ "type": "boolean",
798
+ "description": "Whether verification succeeded"
593
799
  },
594
- "result": {
595
- "type": "string",
596
- "description": "Signed WTS file path"
800
+ "error": {
801
+ "description": "Error message if verification failed",
802
+ "type": "string"
803
+ },
804
+ "hashValid": {
805
+ "type": "boolean",
806
+ "description": "Whether hash validation passed"
807
+ },
808
+ "hasSignature": {
809
+ "type": "boolean",
810
+ "description": "Whether WTS has signatures"
811
+ },
812
+ "signatureValid": {
813
+ "description": "Whether signature validation passed",
814
+ "type": "boolean"
815
+ },
816
+ "signatures": {
817
+ "description": "Signature verification details",
818
+ "type": "array",
819
+ "items": {
820
+ "type": "object",
821
+ "properties": {
822
+ "publicKey": {
823
+ "type": "string",
824
+ "description": "Signer public key"
825
+ },
826
+ "address": {
827
+ "description": "Signer address",
828
+ "type": "string"
829
+ },
830
+ "valid": {
831
+ "type": "boolean",
832
+ "description": "Whether signature is valid"
833
+ }
834
+ },
835
+ "required": [
836
+ "publicKey",
837
+ "valid"
838
+ ],
839
+ "additionalProperties": false,
840
+ "description": "WTS signature verification details"
841
+ }
597
842
  }
598
843
  },
599
844
  "required": [
600
- "operation",
601
- "result"
845
+ "valid",
846
+ "hashValid",
847
+ "hasSignature"
602
848
  ],
603
- "additionalProperties": false
604
- },
605
- {
606
- "type": "object",
607
- "properties": {
608
- "operation": {
609
- "type": "string",
610
- "const": "wts2html"
611
- },
612
- "result": {
613
- "anyOf": [
614
- {
615
- "type": "string"
616
- },
617
- {
618
- "type": "array",
619
- "items": {
620
- "type": "string"
621
- }
622
- }
623
- ],
624
- "description": "HTML string or file path(s)"
625
- }
626
- },
627
- "required": [
628
- "operation",
629
- "result"
630
- ],
631
- "additionalProperties": false
849
+ "additionalProperties": false,
850
+ "description": "WTS verification result"
851
+ }
852
+ },
853
+ "required": [
854
+ "operation",
855
+ "result"
856
+ ],
857
+ "additionalProperties": false
858
+ },
859
+ {
860
+ "type": "object",
861
+ "properties": {
862
+ "operation": {
863
+ "type": "string",
864
+ "const": "sign_wts"
632
865
  },
633
- {
634
- "type": "object",
635
- "properties": {
636
- "operation": {
637
- "type": "string",
638
- "const": "proof_message"
866
+ "result": {
867
+ "type": "string",
868
+ "description": "Signed WTS file path"
869
+ }
870
+ },
871
+ "required": [
872
+ "operation",
873
+ "result"
874
+ ],
875
+ "additionalProperties": false
876
+ },
877
+ {
878
+ "type": "object",
879
+ "properties": {
880
+ "operation": {
881
+ "type": "string",
882
+ "const": "wts2html"
883
+ },
884
+ "result": {
885
+ "anyOf": [
886
+ {
887
+ "type": "string"
639
888
  },
640
- "result": {
641
- "type": "object",
642
- "properties": {
643
- "proofAddress": {
644
- "type": "string",
645
- "description": "Proof object address on blockchain"
646
- }
647
- },
648
- "required": [
649
- "proofAddress"
650
- ],
651
- "additionalProperties": false,
652
- "description": "Proof message result"
889
+ {
890
+ "type": "array",
891
+ "items": {
892
+ "type": "string"
893
+ }
653
894
  }
654
- },
655
- "required": [
656
- "operation",
657
- "result"
658
895
  ],
659
- "additionalProperties": false
896
+ "description": "Output file path(s) (always writes files; never returns raw HTML)"
897
+ }
898
+ },
899
+ "required": [
900
+ "operation",
901
+ "result"
902
+ ],
903
+ "additionalProperties": false
904
+ },
905
+ {
906
+ "type": "object",
907
+ "properties": {
908
+ "operation": {
909
+ "type": "string",
910
+ "const": "proof_message"
660
911
  },
661
- {
912
+ "result": {
662
913
  "type": "object",
663
914
  "properties": {
664
- "operation": {
665
- "type": "string",
666
- "const": "blacklist"
667
- },
668
- "op": {
915
+ "proofAddress": {
669
916
  "type": "string",
670
- "enum": [
671
- "add",
672
- "remove",
673
- "clear",
674
- "get",
675
- "exist"
676
- ],
677
- "description": "Operation type"
678
- },
679
- "result": {
680
- "anyOf": [
681
- {
682
- "type": "object",
683
- "properties": {
684
- "success": {
685
- "type": "boolean",
686
- "description": "Whether operation succeeded"
687
- },
688
- "operation": {
689
- "type": "string",
690
- "description": "Operation performed"
691
- },
692
- "modifiedCount": {
693
- "type": "number",
694
- "description": "Number of items modified"
695
- },
696
- "currentCount": {
697
- "type": "number",
698
- "description": "Current list size"
699
- },
700
- "maxCount": {
701
- "type": "number",
702
- "description": "Maximum list size"
703
- },
704
- "invalidAddresses": {
705
- "anyOf": [
706
- {
707
- "anyOf": [
708
- {
709
- "not": {}
710
- },
711
- {
712
- "type": "array",
713
- "items": {
714
- "type": "string"
715
- }
716
- }
717
- ]
718
- },
719
- {
720
- "type": "null"
721
- }
722
- ],
723
- "description": "Invalid addresses"
724
- },
725
- "existResults": {
726
- "anyOf": [
727
- {
728
- "anyOf": [
729
- {
730
- "not": {}
731
- },
732
- {
733
- "type": "array",
734
- "items": {
735
- "type": "object",
736
- "properties": {
737
- "address": {
738
- "type": "string",
739
- "description": "Address"
740
- },
741
- "exists": {
742
- "type": "boolean",
743
- "description": "Whether address exists in list"
744
- }
745
- },
746
- "required": [
747
- "address",
748
- "exists"
749
- ],
750
- "additionalProperties": false,
751
- "description": "Address existence check result"
752
- }
753
- }
754
- ]
755
- },
756
- {
757
- "type": "null"
758
- }
759
- ],
760
- "description": "Existence check results"
761
- },
762
- "message": {
763
- "anyOf": [
764
- {
765
- "anyOf": [
766
- {
767
- "not": {}
768
- },
769
- {
770
- "type": "string"
771
- }
772
- ]
773
- },
774
- {
775
- "type": "null"
776
- }
777
- ],
778
- "description": "Operation message"
779
- },
780
- "currentList": {
781
- "anyOf": [
782
- {
783
- "anyOf": [
784
- {
785
- "not": {}
786
- },
787
- {
788
- "type": "array",
789
- "items": {
790
- "type": "string"
791
- }
792
- }
793
- ]
794
- },
795
- {
796
- "type": "null"
797
- }
798
- ],
799
- "description": "Current list content"
800
- },
801
- "currentGuardList": {
802
- "anyOf": [
803
- {
804
- "anyOf": [
805
- {
806
- "not": {}
807
- },
808
- {
809
- "type": "array",
810
- "items": {
811
- "type": "object",
812
- "properties": {
813
- "guardAddress": {
814
- "type": "string",
815
- "description": "Guard address"
816
- },
817
- "passportValiditySeconds": {
818
- "type": "number",
819
- "description": "Passport validity in seconds"
820
- }
821
- },
822
- "required": [
823
- "guardAddress",
824
- "passportValiditySeconds"
825
- ],
826
- "additionalProperties": false,
827
- "description": "Guard list item"
828
- }
829
- }
830
- ]
831
- },
832
- {
833
- "type": "null"
834
- }
835
- ],
836
- "description": "Current guard list content"
837
- }
838
- },
839
- "required": [
840
- "success",
841
- "operation",
842
- "modifiedCount",
843
- "currentCount",
844
- "maxCount"
845
- ],
846
- "additionalProperties": false,
847
- "description": "List operation response"
848
- },
849
- {
850
- "type": "array",
851
- "items": {
852
- "type": "string"
853
- }
854
- }
855
- ],
856
- "description": "Blacklist operation result"
917
+ "description": "Proof object address on blockchain"
857
918
  }
858
919
  },
859
920
  "required": [
860
- "operation",
861
- "op",
862
- "result"
921
+ "proofAddress"
863
922
  ],
864
- "additionalProperties": false
923
+ "additionalProperties": false,
924
+ "description": "Proof message result"
925
+ }
926
+ },
927
+ "required": [
928
+ "operation",
929
+ "result"
930
+ ],
931
+ "additionalProperties": false
932
+ },
933
+ {
934
+ "type": "object",
935
+ "properties": {
936
+ "operation": {
937
+ "type": "string",
938
+ "const": "blacklist"
865
939
  },
866
- {
867
- "type": "object",
868
- "properties": {
869
- "operation": {
870
- "type": "string",
871
- "const": "friendslist"
872
- },
873
- "op": {
874
- "type": "string",
875
- "enum": [
876
- "add",
877
- "remove",
878
- "clear",
879
- "get",
880
- "exist"
881
- ],
882
- "description": "Operation type"
883
- },
884
- "result": {
885
- "anyOf": [
886
- {
887
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0"
888
- },
889
- {
890
- "type": "array",
891
- "items": {
892
- "type": "string"
893
- }
894
- }
895
- ],
896
- "description": "Friends list operation result"
897
- }
898
- },
899
- "required": [
900
- "operation",
901
- "op",
902
- "result"
940
+ "op": {
941
+ "type": "string",
942
+ "enum": [
943
+ "add",
944
+ "remove",
945
+ "clear",
946
+ "get",
947
+ "exist"
903
948
  ],
904
- "additionalProperties": false
949
+ "description": "Operation type"
905
950
  },
906
- {
907
- "type": "object",
908
- "properties": {
909
- "operation": {
910
- "type": "string",
911
- "const": "guardlist"
912
- },
913
- "op": {
914
- "type": "string",
915
- "enum": [
916
- "add",
917
- "remove",
918
- "get"
919
- ],
920
- "description": "Operation type"
921
- },
922
- "result": {
951
+ "result": {
952
+ "anyOf": [
953
+ {
923
954
  "type": "object",
924
955
  "properties": {
925
956
  "success": {
926
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/success"
957
+ "type": "boolean",
958
+ "description": "Whether operation succeeded"
927
959
  },
928
960
  "operation": {
929
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/operation"
961
+ "type": "string",
962
+ "description": "Operation performed"
930
963
  },
931
964
  "modifiedCount": {
932
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/modifiedCount"
965
+ "type": "number",
966
+ "description": "Number of items modified"
933
967
  },
934
968
  "currentCount": {
935
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/currentCount"
969
+ "type": "number",
970
+ "description": "Current list size"
936
971
  },
937
972
  "maxCount": {
938
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/maxCount"
973
+ "type": "number",
974
+ "description": "Maximum list size"
939
975
  },
940
976
  "invalidAddresses": {
941
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/invalidAddresses"
977
+ "anyOf": [
978
+ {
979
+ "type": "array",
980
+ "items": {
981
+ "type": "string"
982
+ }
983
+ },
984
+ {
985
+ "type": "null"
986
+ }
987
+ ],
988
+ "description": "Invalid addresses"
942
989
  },
943
990
  "existResults": {
944
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/existResults"
991
+ "anyOf": [
992
+ {
993
+ "type": "array",
994
+ "items": {
995
+ "type": "object",
996
+ "properties": {
997
+ "address": {
998
+ "type": "string",
999
+ "description": "Address"
1000
+ },
1001
+ "exists": {
1002
+ "type": "boolean",
1003
+ "description": "Whether address exists in list"
1004
+ }
1005
+ },
1006
+ "required": [
1007
+ "address",
1008
+ "exists"
1009
+ ],
1010
+ "additionalProperties": false,
1011
+ "description": "Address existence check result"
1012
+ }
1013
+ },
1014
+ {
1015
+ "type": "null"
1016
+ }
1017
+ ],
1018
+ "description": "Existence check results"
945
1019
  },
946
1020
  "message": {
947
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/message"
1021
+ "anyOf": [
1022
+ {
1023
+ "type": "string"
1024
+ },
1025
+ {
1026
+ "type": "null"
1027
+ }
1028
+ ],
1029
+ "description": "Operation message"
948
1030
  },
949
1031
  "currentList": {
950
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/currentList"
1032
+ "anyOf": [
1033
+ {
1034
+ "type": "array",
1035
+ "items": {
1036
+ "type": "string"
1037
+ }
1038
+ },
1039
+ {
1040
+ "type": "null"
1041
+ }
1042
+ ],
1043
+ "description": "Current list content"
951
1044
  },
952
1045
  "currentGuardList": {
953
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/10/properties/result/anyOf/0/properties/currentGuardList"
1046
+ "anyOf": [
1047
+ {
1048
+ "type": "array",
1049
+ "items": {
1050
+ "type": "object",
1051
+ "properties": {
1052
+ "guardAddress": {
1053
+ "type": "string",
1054
+ "description": "Guard address"
1055
+ },
1056
+ "passportValiditySeconds": {
1057
+ "type": "number",
1058
+ "description": "Passport validity in seconds"
1059
+ }
1060
+ },
1061
+ "required": [
1062
+ "guardAddress",
1063
+ "passportValiditySeconds"
1064
+ ],
1065
+ "additionalProperties": false,
1066
+ "description": "Guard list item"
1067
+ }
1068
+ },
1069
+ {
1070
+ "type": "null"
1071
+ }
1072
+ ],
1073
+ "description": "Current guard list content"
954
1074
  }
955
1075
  },
956
1076
  "required": [
@@ -961,900 +1081,1971 @@
961
1081
  "maxCount"
962
1082
  ],
963
1083
  "additionalProperties": false,
964
- "description": "Guard list operation result"
965
- }
966
- },
967
- "required": [
968
- "operation",
969
- "op",
970
- "result"
971
- ],
972
- "additionalProperties": false
973
- },
974
- {
975
- "type": "object",
976
- "properties": {
977
- "operation": {
978
- "type": "string",
979
- "const": "settings"
980
- },
981
- "op": {
982
- "type": "string",
983
- "enum": [
984
- "get",
985
- "set"
986
- ],
987
- "description": "Operation type"
1084
+ "description": "List operation response"
988
1085
  },
989
- "result": {
990
- "anyOf": [
991
- {
992
- "type": "object",
993
- "properties": {
994
- "allowStrangerMessages": {
995
- "type": "boolean",
996
- "description": "Whether messages from strangers are allowed"
997
- },
998
- "maxInboxSize": {
999
- "type": "number",
1000
- "description": "Current maximum inbox size"
1001
- },
1002
- "minUserInboxSize": {
1003
- "type": "number",
1004
- "description": "Server minimum allowed inbox size limit"
1005
- },
1006
- "maxUserInboxSize": {
1007
- "type": "number",
1008
- "description": "Server maximum allowed inbox size limit"
1009
- },
1010
- "defaultAllowStrangerMessages": {
1011
- "type": "boolean",
1012
- "description": "Server default setting for allowing stranger messages"
1013
- }
1014
- },
1015
- "required": [
1016
- "minUserInboxSize",
1017
- "maxUserInboxSize",
1018
- "defaultAllowStrangerMessages"
1019
- ],
1020
- "additionalProperties": false,
1021
- "description": "Get settings response"
1022
- },
1023
- {
1024
- "type": "boolean"
1025
- }
1026
- ],
1027
- "description": "Settings operation result - GetSettingsResponse for 'get' operation, boolean for 'set' operation"
1086
+ {
1087
+ "type": "array",
1088
+ "items": {
1089
+ "type": "string"
1090
+ }
1028
1091
  }
1029
- },
1030
- "required": [
1031
- "operation",
1032
- "op",
1033
- "result"
1034
1092
  ],
1035
- "additionalProperties": false
1036
- },
1037
- {
1038
- "type": "object",
1039
- "properties": {
1040
- "operation": {
1041
- "type": "string",
1042
- "const": "mark_messages_as_viewed"
1093
+ "description": "Blacklist operation result"
1094
+ }
1095
+ },
1096
+ "required": [
1097
+ "operation",
1098
+ "op",
1099
+ "result"
1100
+ ],
1101
+ "additionalProperties": false
1102
+ },
1103
+ {
1104
+ "type": "object",
1105
+ "properties": {
1106
+ "operation": {
1107
+ "type": "string",
1108
+ "const": "friendslist"
1109
+ },
1110
+ "op": {
1111
+ "type": "string",
1112
+ "enum": [
1113
+ "add",
1114
+ "remove",
1115
+ "clear",
1116
+ "get",
1117
+ "exist"
1118
+ ],
1119
+ "description": "Operation type"
1120
+ },
1121
+ "result": {
1122
+ "anyOf": [
1123
+ {
1124
+ "type": "object",
1125
+ "properties": {
1126
+ "success": {
1127
+ "type": "boolean",
1128
+ "description": "Whether operation succeeded"
1129
+ },
1130
+ "operation": {
1131
+ "type": "string",
1132
+ "description": "Operation performed"
1133
+ },
1134
+ "modifiedCount": {
1135
+ "type": "number",
1136
+ "description": "Number of items modified"
1137
+ },
1138
+ "currentCount": {
1139
+ "type": "number",
1140
+ "description": "Current list size"
1141
+ },
1142
+ "maxCount": {
1143
+ "type": "number",
1144
+ "description": "Maximum list size"
1145
+ },
1146
+ "invalidAddresses": {
1147
+ "anyOf": [
1148
+ {
1149
+ "type": "array",
1150
+ "items": {
1151
+ "type": "string"
1152
+ }
1153
+ },
1154
+ {
1155
+ "type": "null"
1156
+ }
1157
+ ],
1158
+ "description": "Invalid addresses"
1159
+ },
1160
+ "existResults": {
1161
+ "anyOf": [
1162
+ {
1163
+ "type": "array",
1164
+ "items": {
1165
+ "type": "object",
1166
+ "properties": {
1167
+ "address": {
1168
+ "type": "string",
1169
+ "description": "Address"
1170
+ },
1171
+ "exists": {
1172
+ "type": "boolean",
1173
+ "description": "Whether address exists in list"
1174
+ }
1175
+ },
1176
+ "required": [
1177
+ "address",
1178
+ "exists"
1179
+ ],
1180
+ "additionalProperties": false,
1181
+ "description": "Address existence check result"
1182
+ }
1183
+ },
1184
+ {
1185
+ "type": "null"
1186
+ }
1187
+ ],
1188
+ "description": "Existence check results"
1189
+ },
1190
+ "message": {
1191
+ "anyOf": [
1192
+ {
1193
+ "type": "string"
1194
+ },
1195
+ {
1196
+ "type": "null"
1197
+ }
1198
+ ],
1199
+ "description": "Operation message"
1200
+ },
1201
+ "currentList": {
1202
+ "anyOf": [
1203
+ {
1204
+ "type": "array",
1205
+ "items": {
1206
+ "type": "string"
1207
+ }
1208
+ },
1209
+ {
1210
+ "type": "null"
1211
+ }
1212
+ ],
1213
+ "description": "Current list content"
1214
+ },
1215
+ "currentGuardList": {
1216
+ "anyOf": [
1217
+ {
1218
+ "type": "array",
1219
+ "items": {
1220
+ "type": "object",
1221
+ "properties": {
1222
+ "guardAddress": {
1223
+ "type": "string",
1224
+ "description": "Guard address"
1225
+ },
1226
+ "passportValiditySeconds": {
1227
+ "type": "number",
1228
+ "description": "Passport validity in seconds"
1229
+ }
1230
+ },
1231
+ "required": [
1232
+ "guardAddress",
1233
+ "passportValiditySeconds"
1234
+ ],
1235
+ "additionalProperties": false,
1236
+ "description": "Guard list item"
1237
+ }
1238
+ },
1239
+ {
1240
+ "type": "null"
1241
+ }
1242
+ ],
1243
+ "description": "Current guard list content"
1244
+ }
1245
+ },
1246
+ "required": [
1247
+ "success",
1248
+ "operation",
1249
+ "modifiedCount",
1250
+ "currentCount",
1251
+ "maxCount"
1252
+ ],
1253
+ "additionalProperties": false,
1254
+ "description": "List operation response"
1043
1255
  },
1044
- "result": {
1045
- "type": "number",
1046
- "description": "Number of messages successfully marked as viewed. Only messages that were previously unviewed are counted"
1256
+ {
1257
+ "type": "array",
1258
+ "items": {
1259
+ "type": "string"
1260
+ }
1047
1261
  }
1048
- },
1049
- "required": [
1050
- "operation",
1051
- "result"
1052
1262
  ],
1053
- "additionalProperties": false
1263
+ "description": "Friends list operation result"
1264
+ }
1265
+ },
1266
+ "required": [
1267
+ "operation",
1268
+ "op",
1269
+ "result"
1270
+ ],
1271
+ "additionalProperties": false
1272
+ },
1273
+ {
1274
+ "type": "object",
1275
+ "properties": {
1276
+ "operation": {
1277
+ "type": "string",
1278
+ "const": "guardlist"
1054
1279
  },
1055
- {
1280
+ "op": {
1281
+ "type": "string",
1282
+ "enum": [
1283
+ "add",
1284
+ "remove",
1285
+ "get"
1286
+ ],
1287
+ "description": "Operation type"
1288
+ },
1289
+ "result": {
1056
1290
  "type": "object",
1057
1291
  "properties": {
1292
+ "success": {
1293
+ "type": "boolean",
1294
+ "description": "Whether operation succeeded"
1295
+ },
1058
1296
  "operation": {
1059
1297
  "type": "string",
1060
- "const": "mark_conversation_as_viewed"
1298
+ "description": "Operation performed"
1061
1299
  },
1062
- "result": {
1300
+ "modifiedCount": {
1063
1301
  "type": "number",
1064
- "description": "Number of messages successfully marked as viewed in the conversation. Only received messages that were previously unviewed are counted"
1302
+ "description": "Number of items modified"
1303
+ },
1304
+ "currentCount": {
1305
+ "type": "number",
1306
+ "description": "Current list size"
1307
+ },
1308
+ "maxCount": {
1309
+ "type": "number",
1310
+ "description": "Maximum list size"
1311
+ },
1312
+ "invalidAddresses": {
1313
+ "anyOf": [
1314
+ {
1315
+ "type": "array",
1316
+ "items": {
1317
+ "type": "string"
1318
+ }
1319
+ },
1320
+ {
1321
+ "type": "null"
1322
+ }
1323
+ ],
1324
+ "description": "Invalid addresses"
1325
+ },
1326
+ "existResults": {
1327
+ "anyOf": [
1328
+ {
1329
+ "type": "array",
1330
+ "items": {
1331
+ "type": "object",
1332
+ "properties": {
1333
+ "address": {
1334
+ "type": "string",
1335
+ "description": "Address"
1336
+ },
1337
+ "exists": {
1338
+ "type": "boolean",
1339
+ "description": "Whether address exists in list"
1340
+ }
1341
+ },
1342
+ "required": [
1343
+ "address",
1344
+ "exists"
1345
+ ],
1346
+ "additionalProperties": false,
1347
+ "description": "Address existence check result"
1348
+ }
1349
+ },
1350
+ {
1351
+ "type": "null"
1352
+ }
1353
+ ],
1354
+ "description": "Existence check results"
1355
+ },
1356
+ "message": {
1357
+ "anyOf": [
1358
+ {
1359
+ "type": "string"
1360
+ },
1361
+ {
1362
+ "type": "null"
1363
+ }
1364
+ ],
1365
+ "description": "Operation message"
1366
+ },
1367
+ "currentList": {
1368
+ "anyOf": [
1369
+ {
1370
+ "type": "array",
1371
+ "items": {
1372
+ "type": "string"
1373
+ }
1374
+ },
1375
+ {
1376
+ "type": "null"
1377
+ }
1378
+ ],
1379
+ "description": "Current list content"
1380
+ },
1381
+ "currentGuardList": {
1382
+ "anyOf": [
1383
+ {
1384
+ "type": "array",
1385
+ "items": {
1386
+ "type": "object",
1387
+ "properties": {
1388
+ "guardAddress": {
1389
+ "type": "string",
1390
+ "description": "Guard address"
1391
+ },
1392
+ "passportValiditySeconds": {
1393
+ "type": "number",
1394
+ "description": "Passport validity in seconds"
1395
+ }
1396
+ },
1397
+ "required": [
1398
+ "guardAddress",
1399
+ "passportValiditySeconds"
1400
+ ],
1401
+ "additionalProperties": false,
1402
+ "description": "Guard list item"
1403
+ }
1404
+ },
1405
+ {
1406
+ "type": "null"
1407
+ }
1408
+ ],
1409
+ "description": "Current guard list content"
1065
1410
  }
1066
1411
  },
1067
1412
  "required": [
1413
+ "success",
1068
1414
  "operation",
1069
- "result"
1415
+ "modifiedCount",
1416
+ "currentCount",
1417
+ "maxCount"
1070
1418
  ],
1071
- "additionalProperties": false
1419
+ "additionalProperties": false,
1420
+ "description": "Guard list operation result"
1421
+ }
1422
+ },
1423
+ "required": [
1424
+ "operation",
1425
+ "op",
1426
+ "result"
1427
+ ],
1428
+ "additionalProperties": false
1429
+ },
1430
+ {
1431
+ "type": "object",
1432
+ "properties": {
1433
+ "operation": {
1434
+ "type": "string",
1435
+ "const": "settings"
1072
1436
  },
1073
- {
1074
- "type": "object",
1075
- "properties": {
1076
- "operation": {
1077
- "type": "string",
1078
- "const": "pull_messages"
1079
- },
1080
- "result": {
1081
- "type": "array",
1082
- "items": {
1083
- "$ref": "#/definitions/messenger_operation/properties/result/anyOf/0/properties/result/items/properties/previewMessages/items"
1437
+ "op": {
1438
+ "type": "string",
1439
+ "enum": [
1440
+ "get",
1441
+ "set"
1442
+ ],
1443
+ "description": "Operation type"
1444
+ },
1445
+ "result": {
1446
+ "anyOf": [
1447
+ {
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "allowStrangerMessages": {
1451
+ "description": "Whether messages from strangers are allowed",
1452
+ "type": "boolean"
1453
+ },
1454
+ "maxInboxSize": {
1455
+ "description": "Current maximum inbox size",
1456
+ "type": "number"
1457
+ },
1458
+ "minUserInboxSize": {
1459
+ "type": "number",
1460
+ "description": "Server minimum allowed inbox size limit"
1461
+ },
1462
+ "maxUserInboxSize": {
1463
+ "type": "number",
1464
+ "description": "Server maximum allowed inbox size limit"
1465
+ },
1466
+ "defaultAllowStrangerMessages": {
1467
+ "type": "boolean",
1468
+ "description": "Server default setting for allowing stranger messages"
1469
+ }
1084
1470
  },
1085
- "description": "List of messages pulled from server"
1471
+ "required": [
1472
+ "minUserInboxSize",
1473
+ "maxUserInboxSize",
1474
+ "defaultAllowStrangerMessages"
1475
+ ],
1476
+ "additionalProperties": false,
1477
+ "description": "Get settings response"
1478
+ },
1479
+ {
1480
+ "type": "boolean"
1086
1481
  }
1087
- },
1088
- "required": [
1089
- "operation",
1090
- "result"
1091
1482
  ],
1092
- "additionalProperties": false
1483
+ "description": "Settings operation result - GetSettingsResponse for 'get' operation, boolean for 'set' operation"
1484
+ }
1485
+ },
1486
+ "required": [
1487
+ "operation",
1488
+ "op",
1489
+ "result"
1490
+ ],
1491
+ "additionalProperties": false
1492
+ },
1493
+ {
1494
+ "type": "object",
1495
+ "properties": {
1496
+ "operation": {
1497
+ "type": "string",
1498
+ "const": "mark_messages_as_viewed"
1499
+ },
1500
+ "result": {
1501
+ "type": "number",
1502
+ "description": "Number of messages successfully marked as viewed. Only messages that were previously unviewed are counted"
1503
+ }
1504
+ },
1505
+ "required": [
1506
+ "operation",
1507
+ "result"
1508
+ ],
1509
+ "additionalProperties": false
1510
+ },
1511
+ {
1512
+ "type": "object",
1513
+ "properties": {
1514
+ "operation": {
1515
+ "type": "string",
1516
+ "const": "mark_conversation_as_viewed"
1517
+ },
1518
+ "result": {
1519
+ "type": "number",
1520
+ "description": "Number of messages successfully marked as viewed in the conversation. Only received messages that were previously unviewed are counted"
1521
+ }
1522
+ },
1523
+ "required": [
1524
+ "operation",
1525
+ "result"
1526
+ ],
1527
+ "additionalProperties": false
1528
+ },
1529
+ {
1530
+ "type": "object",
1531
+ "properties": {
1532
+ "operation": {
1533
+ "type": "string",
1534
+ "const": "pull_messages"
1535
+ },
1536
+ "result": {
1537
+ "type": "array",
1538
+ "items": {
1539
+ "type": "object",
1540
+ "properties": {
1541
+ "messageId": {
1542
+ "type": "string",
1543
+ "description": "Message ID"
1544
+ },
1545
+ "fromAddress": {
1546
+ "type": "string",
1547
+ "description": "Sender address"
1548
+ },
1549
+ "toAddress": {
1550
+ "type": "string",
1551
+ "description": "Recipient address"
1552
+ },
1553
+ "plaintextHash": {
1554
+ "type": "string",
1555
+ "description": "Plaintext hash"
1556
+ },
1557
+ "plaintext": {
1558
+ "description": "Decrypted plaintext (optional)",
1559
+ "type": "string"
1560
+ },
1561
+ "replyTo": {
1562
+ "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
1563
+ "type": "object",
1564
+ "properties": {
1565
+ "messageId": {
1566
+ "type": "string",
1567
+ "description": "Replied-to message ID (unique within the conversation)"
1568
+ }
1569
+ },
1570
+ "required": [
1571
+ "messageId"
1572
+ ],
1573
+ "additionalProperties": false
1574
+ },
1575
+ "guardAddress": {
1576
+ "description": "Guard address",
1577
+ "type": "string"
1578
+ },
1579
+ "passportAddress": {
1580
+ "description": "Passport address",
1581
+ "type": "string"
1582
+ },
1583
+ "lastReceivedLeafIndex": {
1584
+ "description": "Last received leaf index",
1585
+ "type": "number"
1586
+ },
1587
+ "direction": {
1588
+ "type": "string",
1589
+ "enum": [
1590
+ "sent",
1591
+ "received"
1592
+ ],
1593
+ "description": "Message direction"
1594
+ },
1595
+ "status": {
1596
+ "type": "string",
1597
+ "enum": [
1598
+ "pending",
1599
+ "confirmed",
1600
+ "read",
1601
+ "failed",
1602
+ "rejected",
1603
+ "decrypted",
1604
+ "decrypt_failed"
1605
+ ],
1606
+ "description": "Message status"
1607
+ },
1608
+ "msgType": {
1609
+ "anyOf": [
1610
+ {
1611
+ "type": "number",
1612
+ "const": 1
1613
+ },
1614
+ {
1615
+ "type": "number",
1616
+ "const": 3
1617
+ }
1618
+ ],
1619
+ "description": "Message type"
1620
+ },
1621
+ "leafIndex": {
1622
+ "description": "Leaf index",
1623
+ "type": "number"
1624
+ },
1625
+ "prevRoot": {
1626
+ "description": "Previous Merkle Root",
1627
+ "type": "string"
1628
+ },
1629
+ "newRoot": {
1630
+ "description": "Current Merkle Root",
1631
+ "type": "string"
1632
+ },
1633
+ "serverSignature": {
1634
+ "description": "Server signature",
1635
+ "type": "string"
1636
+ },
1637
+ "serverTimestamp": {
1638
+ "description": "Server confirmation timestamp",
1639
+ "type": "number"
1640
+ },
1641
+ "serverPublicKey": {
1642
+ "description": "Server public key",
1643
+ "type": "string"
1644
+ },
1645
+ "arkConfirmed": {
1646
+ "description": "ARK confirmation",
1647
+ "type": "object",
1648
+ "properties": {
1649
+ "recipient": {
1650
+ "type": "string",
1651
+ "description": "Recipient address"
1652
+ },
1653
+ "recipientPublicKey": {
1654
+ "type": "string",
1655
+ "description": "Recipient public key"
1656
+ },
1657
+ "signature": {
1658
+ "type": "string",
1659
+ "description": "Recipient signature"
1660
+ },
1661
+ "timestamp": {
1662
+ "type": "number",
1663
+ "description": "ARK confirmation time"
1664
+ }
1665
+ },
1666
+ "required": [
1667
+ "recipient",
1668
+ "recipientPublicKey",
1669
+ "signature",
1670
+ "timestamp"
1671
+ ],
1672
+ "additionalProperties": false
1673
+ },
1674
+ "createdAt": {
1675
+ "type": "number",
1676
+ "description": "Message creation time (client)"
1677
+ },
1678
+ "receivedAt": {
1679
+ "description": "Local reception time",
1680
+ "type": "number"
1681
+ },
1682
+ "zipMetadata": {
1683
+ "description": "ZIP file metadata",
1684
+ "type": "object",
1685
+ "properties": {
1686
+ "fileName": {
1687
+ "type": "string",
1688
+ "description": "ZIP filename"
1689
+ },
1690
+ "fileSize": {
1691
+ "type": "number",
1692
+ "description": "File size in bytes"
1693
+ },
1694
+ "fileHash": {
1695
+ "type": "string",
1696
+ "description": "File SHA256 hash"
1697
+ },
1698
+ "contentType": {
1699
+ "type": "string",
1700
+ "enum": [
1701
+ "text",
1702
+ "zip",
1703
+ "wts",
1704
+ "wip"
1705
+ ],
1706
+ "description": "Content type"
1707
+ },
1708
+ "localCachePath": {
1709
+ "description": "Local cache path",
1710
+ "type": "string"
1711
+ },
1712
+ "downloadedAt": {
1713
+ "description": "Download timestamp",
1714
+ "type": "number"
1715
+ }
1716
+ },
1717
+ "required": [
1718
+ "fileName",
1719
+ "fileSize",
1720
+ "fileHash",
1721
+ "contentType"
1722
+ ],
1723
+ "additionalProperties": false
1724
+ },
1725
+ "proof": {
1726
+ "description": "On-chain proof object address",
1727
+ "type": "string"
1728
+ },
1729
+ "decryptError": {
1730
+ "description": "Decryption failure reason",
1731
+ "type": "string"
1732
+ },
1733
+ "decryptAttempts": {
1734
+ "description": "Number of decryption attempts",
1735
+ "type": "number"
1736
+ },
1737
+ "lastDecryptAttemptAt": {
1738
+ "description": "Last decryption attempt timestamp",
1739
+ "type": "number"
1740
+ },
1741
+ "viewedAt": {
1742
+ "description": "Timestamp when the current user viewed this message (local storage). If present, indicates the message has been viewed by the user. Only applicable to received messages (direction === 'received')",
1743
+ "type": "number"
1744
+ }
1745
+ },
1746
+ "required": [
1747
+ "messageId",
1748
+ "fromAddress",
1749
+ "toAddress",
1750
+ "plaintextHash",
1751
+ "direction",
1752
+ "status",
1753
+ "msgType",
1754
+ "createdAt"
1755
+ ],
1756
+ "additionalProperties": false,
1757
+ "description": "Message object"
1758
+ },
1759
+ "description": "List of messages pulled from server"
1760
+ }
1761
+ },
1762
+ "required": [
1763
+ "operation",
1764
+ "result"
1765
+ ],
1766
+ "additionalProperties": false
1767
+ },
1768
+ {
1769
+ "type": "object",
1770
+ "properties": {
1771
+ "operation": {
1772
+ "type": "string",
1773
+ "const": "error"
1774
+ },
1775
+ "error": {
1776
+ "type": "string",
1777
+ "description": "Error message"
1778
+ },
1779
+ "error_code": {
1780
+ "description": "Error code",
1781
+ "type": "string"
1782
+ },
1783
+ "retryable": {
1784
+ "description": "Whether the operation is retryable",
1785
+ "type": "boolean"
1786
+ },
1787
+ "recovery_hint": {
1788
+ "description": "Recovery hint",
1789
+ "type": "string"
1790
+ }
1791
+ },
1792
+ "required": [
1793
+ "operation",
1794
+ "error"
1795
+ ],
1796
+ "additionalProperties": false,
1797
+ "description": "Error response"
1798
+ }
1799
+ ],
1800
+ "description": "Messenger operation result discriminated union"
1801
+ },
1802
+ "semantic": {
1803
+ "description": "Business semantic summary for messenger operation",
1804
+ "type": "object",
1805
+ "properties": {
1806
+ "intent": {
1807
+ "type": "string",
1808
+ "description": "Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"
1809
+ },
1810
+ "status": {
1811
+ "type": "string",
1812
+ "enum": [
1813
+ "success",
1814
+ "partial",
1815
+ "failed",
1816
+ "pending_input"
1817
+ ],
1818
+ "description": "Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"
1819
+ },
1820
+ "summary": {
1821
+ "type": "string",
1822
+ "description": "One-sentence human-readable summary of what happened. AI should read this first. Example: 'Successfully published Service my-shop with Machine bound'"
1823
+ },
1824
+ "created": {
1825
+ "description": "Objects newly created in this operation, tagged with roles",
1826
+ "type": "array",
1827
+ "items": {
1828
+ "type": "object",
1829
+ "properties": {
1830
+ "id": {
1831
+ "type": "string",
1832
+ "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
1833
+ },
1834
+ "name": {
1835
+ "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null",
1836
+ "anyOf": [
1837
+ {
1838
+ "type": "string"
1839
+ },
1840
+ {
1841
+ "type": "null"
1842
+ }
1843
+ ]
1844
+ },
1845
+ "role": {
1846
+ "type": "string",
1847
+ "enum": [
1848
+ "Permission",
1849
+ "Guard",
1850
+ "Machine",
1851
+ "Progress",
1852
+ "Service",
1853
+ "Order",
1854
+ "Allocation",
1855
+ "Arbitration",
1856
+ "ArbCase",
1857
+ "Messenger",
1858
+ "Contact",
1859
+ "Demand",
1860
+ "Reward",
1861
+ "Personal",
1862
+ "Repository",
1863
+ "Treasury",
1864
+ "Discount",
1865
+ "Payment",
1866
+ "Passport",
1867
+ "Proof",
1868
+ "Other"
1869
+ ],
1870
+ "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'"
1871
+ },
1872
+ "relation": {
1873
+ "description": "Relationship to another object in the dependency graph",
1874
+ "type": "object",
1875
+ "properties": {
1876
+ "parent": {
1877
+ "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null",
1878
+ "anyOf": [
1879
+ {
1880
+ "type": "string"
1881
+ },
1882
+ {
1883
+ "type": "null"
1884
+ }
1885
+ ]
1886
+ },
1887
+ "relation_type": {
1888
+ "description": "How this object relates to its parent. Example: 'machine_of'",
1889
+ "type": "string",
1890
+ "enum": [
1891
+ "machine_of",
1892
+ "guard_of",
1893
+ "allocator_of",
1894
+ "permission_of",
1895
+ "progress_of",
1896
+ "allocation_of",
1897
+ "arb_of",
1898
+ "other"
1899
+ ]
1900
+ }
1901
+ },
1902
+ "additionalProperties": false
1903
+ },
1904
+ "immutable": {
1905
+ "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true",
1906
+ "type": "boolean"
1907
+ }
1908
+ },
1909
+ "required": [
1910
+ "id",
1911
+ "role"
1912
+ ],
1913
+ "additionalProperties": false,
1914
+ "description": "An object tagged with its business role and relationship within the object dependency graph"
1915
+ }
1916
+ },
1917
+ "modified": {
1918
+ "description": "Objects mutated in this operation, tagged with roles",
1919
+ "type": "array",
1920
+ "items": {
1921
+ "type": "object",
1922
+ "properties": {
1923
+ "id": {
1924
+ "type": "string",
1925
+ "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
1926
+ },
1927
+ "name": {
1928
+ "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null",
1929
+ "anyOf": [
1930
+ {
1931
+ "type": "string"
1932
+ },
1933
+ {
1934
+ "type": "null"
1935
+ }
1936
+ ]
1937
+ },
1938
+ "role": {
1939
+ "type": "string",
1940
+ "enum": [
1941
+ "Permission",
1942
+ "Guard",
1943
+ "Machine",
1944
+ "Progress",
1945
+ "Service",
1946
+ "Order",
1947
+ "Allocation",
1948
+ "Arbitration",
1949
+ "ArbCase",
1950
+ "Messenger",
1951
+ "Contact",
1952
+ "Demand",
1953
+ "Reward",
1954
+ "Personal",
1955
+ "Repository",
1956
+ "Treasury",
1957
+ "Discount",
1958
+ "Payment",
1959
+ "Passport",
1960
+ "Proof",
1961
+ "Other"
1962
+ ],
1963
+ "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'"
1964
+ },
1965
+ "relation": {
1966
+ "description": "Relationship to another object in the dependency graph",
1967
+ "type": "object",
1968
+ "properties": {
1969
+ "parent": {
1970
+ "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null",
1971
+ "anyOf": [
1972
+ {
1973
+ "type": "string"
1974
+ },
1975
+ {
1976
+ "type": "null"
1977
+ }
1978
+ ]
1979
+ },
1980
+ "relation_type": {
1981
+ "description": "How this object relates to its parent. Example: 'machine_of'",
1982
+ "type": "string",
1983
+ "enum": [
1984
+ "machine_of",
1985
+ "guard_of",
1986
+ "allocator_of",
1987
+ "permission_of",
1988
+ "progress_of",
1989
+ "allocation_of",
1990
+ "arb_of",
1991
+ "other"
1992
+ ]
1993
+ }
1994
+ },
1995
+ "additionalProperties": false
1996
+ },
1997
+ "immutable": {
1998
+ "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true",
1999
+ "type": "boolean"
2000
+ }
2001
+ },
2002
+ "required": [
2003
+ "id",
2004
+ "role"
2005
+ ],
2006
+ "additionalProperties": false,
2007
+ "description": "An object tagged with its business role and relationship within the object dependency graph"
2008
+ }
2009
+ },
2010
+ "released": {
2011
+ "description": "Fund movements in this operation, tagged with roles",
2012
+ "type": "array",
2013
+ "items": {
2014
+ "type": "object",
2015
+ "properties": {
2016
+ "amount": {
2017
+ "type": "string",
2018
+ "description": "Amount change as stringified integer (smallest unit). Negative=spend, positive=receive. Example: '-10000000000'"
2019
+ },
2020
+ "coinType": {
2021
+ "type": "string",
2022
+ "description": "Coin type tag (format: {address}::{module}::{struct}). Example: '0x2::wow::WOW'"
2023
+ },
2024
+ "role": {
2025
+ "type": "string",
2026
+ "enum": [
2027
+ "payment",
2028
+ "refund",
2029
+ "change",
2030
+ "compensation",
2031
+ "reward",
2032
+ "gas",
2033
+ "deposit",
2034
+ "release",
2035
+ "other"
2036
+ ],
2037
+ "description": "Business role of this fund movement. Constraint: enum of 9 values. Relation: derived from operation context. Example: 'payment'"
2038
+ },
2039
+ "from": {
2040
+ "description": "Sender address if known. Example: '0xabc...' or null",
2041
+ "anyOf": [
2042
+ {
2043
+ "type": "string"
2044
+ },
2045
+ {
2046
+ "type": "null"
2047
+ }
2048
+ ]
2049
+ },
2050
+ "to": {
2051
+ "description": "Recipient address if known. Example: '0xdef...' or null",
2052
+ "anyOf": [
2053
+ {
2054
+ "type": "string"
2055
+ },
2056
+ {
2057
+ "type": "null"
2058
+ }
2059
+ ]
2060
+ }
2061
+ },
2062
+ "required": [
2063
+ "amount",
2064
+ "coinType",
2065
+ "role"
2066
+ ],
2067
+ "additionalProperties": false,
2068
+ "description": "A fund movement tagged with its business role"
2069
+ }
2070
+ },
2071
+ "events": {
2072
+ "description": "On-chain events annotated with business semantics (S-8)",
2073
+ "type": "array",
2074
+ "items": {
2075
+ "type": "object",
2076
+ "properties": {
2077
+ "event_type": {
2078
+ "type": "string",
2079
+ "description": "Raw on-chain event type tag. Example: '0x2::service::ServicePublishedEvent'"
2080
+ },
2081
+ "business_meaning": {
2082
+ "type": "string",
2083
+ "description": "Human-readable business meaning. Example: 'Service has been published and is now immutable'"
2084
+ },
2085
+ "category": {
2086
+ "type": "string",
2087
+ "enum": [
2088
+ "lifecycle",
2089
+ "state_change",
2090
+ "fund_flow",
2091
+ "permission",
2092
+ "guard",
2093
+ "other"
2094
+ ],
2095
+ "description": "Business category. Constraint: enum of 6 values. Example: 'lifecycle'"
2096
+ },
2097
+ "related_object": {
2098
+ "description": "Object ID the event relates to, if extractable. Example: '0x123...'",
2099
+ "type": "string"
2100
+ },
2101
+ "side_effect": {
2102
+ "description": "Side effect description for AI. Example: 'Customers can now place orders against this Service'",
2103
+ "type": "string"
2104
+ }
2105
+ },
2106
+ "required": [
2107
+ "event_type",
2108
+ "business_meaning",
2109
+ "category"
2110
+ ],
2111
+ "additionalProperties": false,
2112
+ "description": "An on-chain event annotated with business semantics"
2113
+ }
2114
+ },
2115
+ "next_actions": {
2116
+ "description": "Recommended next actions to drive the workflow forward",
2117
+ "type": "array",
2118
+ "items": {
2119
+ "type": "object",
2120
+ "properties": {
2121
+ "action": {
2122
+ "type": "string",
2123
+ "description": "Recommended next action. Example: 'add sales products'"
2124
+ },
2125
+ "reason": {
2126
+ "type": "string",
2127
+ "description": "Why this action is recommended. Example: 'Service has no products; customers cannot order'"
2128
+ },
2129
+ "tool": {
2130
+ "description": "MCP tool to use, if applicable. Example: 'onchain_operations'",
2131
+ "type": "string"
2132
+ },
2133
+ "prerequisite": {
2134
+ "description": "Condition that must hold before this action. Example: 'Service must be created first'",
2135
+ "type": "string"
2136
+ },
2137
+ "priority": {
2138
+ "type": "string",
2139
+ "enum": [
2140
+ "required",
2141
+ "recommended",
2142
+ "optional"
2143
+ ],
2144
+ "description": "Priority. Constraint: enum. Example: 'required'"
2145
+ }
2146
+ },
2147
+ "required": [
2148
+ "action",
2149
+ "reason",
2150
+ "priority"
2151
+ ],
2152
+ "additionalProperties": false,
2153
+ "description": "A recommended next action with priority and rationale"
2154
+ }
2155
+ },
2156
+ "warnings": {
2157
+ "description": "Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'",
2158
+ "type": "array",
2159
+ "items": {
2160
+ "type": "string"
2161
+ }
2162
+ },
2163
+ "experience": {
2164
+ "description": "Experience layer feedback from past operations (Phase 2 Topic 2)",
2165
+ "type": "object",
2166
+ "properties": {
2167
+ "advice": {
2168
+ "description": "Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'",
2169
+ "type": "string"
2170
+ },
2171
+ "avoid": {
2172
+ "description": "Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']",
2173
+ "type": "array",
2174
+ "items": {
2175
+ "type": "string"
2176
+ }
1093
2177
  },
1094
- {
1095
- "type": "object",
1096
- "properties": {
1097
- "operation": {
1098
- "type": "string",
1099
- "const": "error"
1100
- },
1101
- "error": {
1102
- "type": "string",
1103
- "description": "Error message"
1104
- },
1105
- "error_code": {
1106
- "type": "string",
1107
- "description": "Error code"
1108
- },
1109
- "retryable": {
1110
- "type": "boolean",
1111
- "description": "Whether the operation is retryable"
1112
- },
1113
- "recovery_hint": {
1114
- "type": "string",
1115
- "description": "Recovery hint"
1116
- }
2178
+ "relevance": {
2179
+ "description": "Relevance score 0-1 of the matched experience. Example: 0.85",
2180
+ "type": "number",
2181
+ "minimum": 0,
2182
+ "maximum": 1
2183
+ },
2184
+ "matched_scenario": {
2185
+ "description": "Matched historical scenario. Example: 'publish_service_freelance'",
2186
+ "type": "string"
2187
+ }
2188
+ },
2189
+ "additionalProperties": false
2190
+ },
2191
+ "service_status": {
2192
+ "description": "Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response.",
2193
+ "type": "object",
2194
+ "properties": {
2195
+ "active": {
2196
+ "type": "array",
2197
+ "items": {
2198
+ "type": "string"
1117
2199
  },
1118
- "required": [
1119
- "operation",
1120
- "error"
1121
- ],
1122
- "additionalProperties": false,
1123
- "description": "Error response"
2200
+ "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
2201
+ },
2202
+ "inactive": {
2203
+ "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']",
2204
+ "type": "array",
2205
+ "items": {
2206
+ "type": "string"
2207
+ }
1124
2208
  }
2209
+ },
2210
+ "required": [
2211
+ "active"
1125
2212
  ],
1126
- "description": "Messenger operation result discriminated union"
2213
+ "additionalProperties": false
1127
2214
  },
1128
- "semantic": {
2215
+ "customer_advice": {
2216
+ "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.",
1129
2217
  "type": "object",
1130
2218
  "properties": {
1131
- "intent": {
1132
- "type": "string",
1133
- "description": "Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"
2219
+ "risk_score": {
2220
+ "description": "Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75",
2221
+ "type": "number",
2222
+ "minimum": 0,
2223
+ "maximum": 100
1134
2224
  },
1135
- "status": {
2225
+ "risk_level": {
2226
+ "description": "Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'",
1136
2227
  "type": "string",
1137
2228
  "enum": [
1138
- "success",
1139
- "partial",
1140
- "failed",
1141
- "pending_input"
1142
- ],
1143
- "description": "Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"
2229
+ "low",
2230
+ "medium_low",
2231
+ "medium_high",
2232
+ "high"
2233
+ ]
1144
2234
  },
1145
- "summary": {
1146
- "type": "string",
1147
- "description": "One-sentence human-readable summary of what happened. AI should read this first. Example: 'Successfully published Service my-shop with Machine bound'"
2235
+ "recommendations": {
2236
+ "type": "array",
2237
+ "items": {
2238
+ "type": "string"
2239
+ },
2240
+ "description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
1148
2241
  },
1149
- "created": {
2242
+ "reminders": {
1150
2243
  "type": "array",
1151
2244
  "items": {
1152
2245
  "type": "object",
1153
2246
  "properties": {
1154
2247
  "id": {
1155
2248
  "type": "string",
1156
- "description": "Object ID (64-hex with 0x prefix). Identifies the on-chain object. Example: '0xa1d4...'"
2249
+ "description": "Reminder rule id. Example: 'high_risk_score'"
1157
2250
  },
1158
- "name": {
1159
- "type": [
1160
- "string",
1161
- "null"
2251
+ "stage": {
2252
+ "type": "string",
2253
+ "enum": [
2254
+ "browse",
2255
+ "evaluate",
2256
+ "preorder",
2257
+ "in_progress",
2258
+ "complete",
2259
+ "after_sale"
1162
2260
  ],
1163
- "description": "Local mark name if assigned, else null. Relation: resolved via local_mark_operation. Example: 'my-shop' or null"
2261
+ "description": "Order lifecycle stage when this reminder fires. Example: 'evaluate'"
1164
2262
  },
1165
- "role": {
2263
+ "priority": {
1166
2264
  "type": "string",
1167
2265
  "enum": [
1168
- "Permission",
1169
- "Guard",
1170
- "Machine",
1171
- "Progress",
1172
- "Service",
1173
- "Order",
1174
- "Allocation",
1175
- "Arbitration",
1176
- "ArbCase",
1177
- "Messenger",
1178
- "Contact",
1179
- "Demand",
1180
- "Reward",
1181
- "Personal",
1182
- "Repository",
1183
- "Treasury",
1184
- "Discount",
1185
- "Other"
2266
+ "required",
2267
+ "recommended",
2268
+ "info",
2269
+ "reminder"
1186
2270
  ],
1187
- "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'"
2271
+ "description": "Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"
1188
2272
  },
1189
- "relation": {
1190
- "type": "object",
1191
- "properties": {
1192
- "parent": {
1193
- "type": [
1194
- "string",
1195
- "null"
1196
- ],
1197
- "description": "Parent object ID, if this object belongs to another (e.g. Machine belongs to Service). Example: '0x123...' or null"
1198
- },
1199
- "relation_type": {
1200
- "type": "string",
1201
- "enum": [
1202
- "machine_of",
1203
- "guard_of",
1204
- "allocator_of",
1205
- "permission_of",
1206
- "progress_of",
1207
- "allocation_of",
1208
- "arb_of",
1209
- "other"
1210
- ],
1211
- "description": "How this object relates to its parent. Example: 'machine_of'"
1212
- }
1213
- },
1214
- "additionalProperties": false,
1215
- "description": "Relationship to another object in the dependency graph"
2273
+ "message": {
2274
+ "type": "string",
2275
+ "description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
1216
2276
  },
1217
- "immutable": {
1218
- "type": "boolean",
1219
- "description": "Whether the object has entered an immutable state (e.g. Service published). Constraint: true after publish. Example: true"
2277
+ "action": {
2278
+ "description": "Suggested next action. Example: 'require merchant to bind Arbitration before ordering'",
2279
+ "type": "string"
1220
2280
  }
1221
2281
  },
1222
2282
  "required": [
1223
2283
  "id",
1224
- "role"
2284
+ "stage",
2285
+ "priority",
2286
+ "message"
1225
2287
  ],
1226
2288
  "additionalProperties": false,
1227
- "description": "An object tagged with its business role and relationship within the object dependency graph"
2289
+ "description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
1228
2290
  },
1229
- "description": "Objects newly created in this operation, tagged with roles"
2291
+ "description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
1230
2292
  },
1231
- "modified": {
1232
- "type": "array",
1233
- "items": {
1234
- "$ref": "#/definitions/messenger_operation/properties/semantic/properties/created/items"
2293
+ "preference_match": {
2294
+ "description": "Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}",
2295
+ "type": "object",
2296
+ "properties": {
2297
+ "score": {
2298
+ "type": "number",
2299
+ "minimum": 0,
2300
+ "maximum": 100,
2301
+ "description": "Match score 0-100 (higher = better fit). Example: 75"
2302
+ },
2303
+ "matches": {
2304
+ "type": "array",
2305
+ "items": {
2306
+ "type": "string"
2307
+ },
2308
+ "description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
2309
+ },
2310
+ "mismatches": {
2311
+ "type": "array",
2312
+ "items": {
2313
+ "type": "string"
2314
+ },
2315
+ "description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
2316
+ }
1235
2317
  },
1236
- "description": "Objects mutated in this operation, tagged with roles"
2318
+ "required": [
2319
+ "score",
2320
+ "matches",
2321
+ "mismatches"
2322
+ ],
2323
+ "additionalProperties": false
2324
+ }
2325
+ },
2326
+ "required": [
2327
+ "recommendations",
2328
+ "reminders"
2329
+ ],
2330
+ "additionalProperties": false
2331
+ },
2332
+ "evolution_context": {
2333
+ "description": "Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice.",
2334
+ "type": "object",
2335
+ "properties": {
2336
+ "industry_signal": {
2337
+ "description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'",
2338
+ "type": "string"
2339
+ },
2340
+ "evolution_advice": {
2341
+ "description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'",
2342
+ "type": "string"
2343
+ },
2344
+ "confidence": {
2345
+ "type": "number",
2346
+ "minimum": 0,
2347
+ "maximum": 1,
2348
+ "description": "Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"
2349
+ },
2350
+ "health_score": {
2351
+ "description": "Industry health score 0-100 if available. Example: 82",
2352
+ "type": "number",
2353
+ "minimum": 0,
2354
+ "maximum": 100
2355
+ },
2356
+ "pending_suggestions": {
2357
+ "description": "Count of pending industry update suggestions (filtered by role if role is set). Example: 3",
2358
+ "type": "integer",
2359
+ "minimum": 0,
2360
+ "maximum": 9007199254740991
1237
2361
  },
1238
- "released": {
2362
+ "intent": {
2363
+ "description": "Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'",
2364
+ "type": "string",
2365
+ "enum": [
2366
+ "default",
2367
+ "growth",
2368
+ "retention",
2369
+ "compliance",
2370
+ "efficiency",
2371
+ "trust_building",
2372
+ "custom"
2373
+ ]
2374
+ },
2375
+ "role_advice": {
2376
+ "description": "Phase 4 P4-6.C: Role-targeted advice strings (merchant/customer/prospect/supplier/collaborator/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']",
1239
2377
  "type": "array",
1240
2378
  "items": {
1241
- "type": "object",
1242
- "properties": {
1243
- "amount": {
1244
- "type": "string",
1245
- "description": "Amount change as stringified integer (smallest unit). Negative=spend, positive=receive. Example: '-10000000000'"
1246
- },
1247
- "coinType": {
1248
- "type": "string",
1249
- "description": "Coin type tag (format: {address}::{module}::{struct}). Example: '0x2::wow::WOW'"
1250
- },
1251
- "role": {
1252
- "type": "string",
1253
- "enum": [
1254
- "payment",
1255
- "refund",
1256
- "change",
1257
- "compensation",
1258
- "reward",
1259
- "gas",
1260
- "deposit",
1261
- "release",
1262
- "other"
1263
- ],
1264
- "description": "Business role of this fund movement. Constraint: enum of 9 values. Relation: derived from operation context. Example: 'payment'"
1265
- },
1266
- "from": {
1267
- "type": [
1268
- "string",
1269
- "null"
1270
- ],
1271
- "description": "Sender address if known. Example: '0xabc...' or null"
1272
- },
1273
- "to": {
1274
- "type": [
1275
- "string",
1276
- "null"
1277
- ],
1278
- "description": "Recipient address if known. Example: '0xdef...' or null"
1279
- }
2379
+ "type": "string"
2380
+ }
2381
+ },
2382
+ "role": {
2383
+ "description": "Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'",
2384
+ "type": "string",
2385
+ "enum": [
2386
+ "merchant",
2387
+ "customer",
2388
+ "prospect",
2389
+ "supplier",
2390
+ "collaborator",
2391
+ "arbitrator"
2392
+ ]
2393
+ }
2394
+ },
2395
+ "required": [
2396
+ "confidence"
2397
+ ],
2398
+ "additionalProperties": false
2399
+ },
2400
+ "guard_advice": {
2401
+ "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).",
2402
+ "type": "object",
2403
+ "properties": {
2404
+ "current_round": {
2405
+ "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'",
2406
+ "type": "string",
2407
+ "enum": [
2408
+ "R1",
2409
+ "R2",
2410
+ "R3",
2411
+ "R4",
2412
+ "R5",
2413
+ "R6",
2414
+ "R7",
2415
+ "R8",
2416
+ "R9",
2417
+ "R10"
2418
+ ]
2419
+ },
2420
+ "puzzle_status": {
2421
+ "description": "Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE.",
2422
+ "type": "object",
2423
+ "properties": {
2424
+ "intent": {
2425
+ "type": "boolean",
2426
+ "description": "Intent dimension complete (action + rule + failure conditions)"
1280
2427
  },
1281
- "required": [
1282
- "amount",
1283
- "coinType",
1284
- "role"
1285
- ],
1286
- "additionalProperties": false,
1287
- "description": "A fund movement tagged with its business role"
2428
+ "binding": {
2429
+ "type": "boolean",
2430
+ "description": "Binding dimension complete (host object + field + circular ref)"
2431
+ },
2432
+ "data": {
2433
+ "type": "boolean",
2434
+ "description": "Data dimension complete (table entries + witnesses)"
2435
+ },
2436
+ "query": {
2437
+ "type": "boolean",
2438
+ "description": "Query dimension complete (query instructions if needed)"
2439
+ },
2440
+ "logic": {
2441
+ "type": "boolean",
2442
+ "description": "Logic dimension complete (root node returns Bool)"
2443
+ },
2444
+ "constraints": {
2445
+ "type": "boolean",
2446
+ "description": "Constraints dimension complete (10 Pitfalls checked)"
2447
+ }
1288
2448
  },
1289
- "description": "Fund movements in this operation, tagged with roles"
2449
+ "required": [
2450
+ "intent",
2451
+ "binding",
2452
+ "data",
2453
+ "query",
2454
+ "logic",
2455
+ "constraints"
2456
+ ],
2457
+ "additionalProperties": false
2458
+ },
2459
+ "matched_scene": {
2460
+ "description": "Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'",
2461
+ "type": "string"
1290
2462
  },
1291
- "events": {
2463
+ "scene_description": {
2464
+ "description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'",
2465
+ "type": "string"
2466
+ },
2467
+ "scene_constraints": {
2468
+ "description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']",
1292
2469
  "type": "array",
1293
2470
  "items": {
1294
- "type": "object",
1295
- "properties": {
1296
- "event_type": {
1297
- "type": "string",
1298
- "description": "Raw on-chain event type tag. Example: '0x2::service::ServicePublishedEvent'"
1299
- },
1300
- "business_meaning": {
1301
- "type": "string",
1302
- "description": "Human-readable business meaning. Example: 'Service has been published and is now immutable'"
1303
- },
1304
- "category": {
1305
- "type": "string",
1306
- "enum": [
1307
- "lifecycle",
1308
- "state_change",
1309
- "fund_flow",
1310
- "permission",
1311
- "guard",
1312
- "other"
1313
- ],
1314
- "description": "Business category. Constraint: enum of 6 values. Example: 'lifecycle'"
1315
- },
1316
- "related_object": {
1317
- "type": "string",
1318
- "description": "Object ID the event relates to, if extractable. Example: '0x123...'"
1319
- },
1320
- "side_effect": {
1321
- "type": "string",
1322
- "description": "Side effect description for AI. Example: 'Customers can now place orders against this Service'"
1323
- }
1324
- },
1325
- "required": [
1326
- "event_type",
1327
- "business_meaning",
1328
- "category"
1329
- ],
1330
- "additionalProperties": false,
1331
- "description": "An on-chain event annotated with business semantics"
1332
- },
1333
- "description": "On-chain events annotated with business semantics (S-8)"
2471
+ "type": "string"
2472
+ }
2473
+ },
2474
+ "suggested_patterns": {
2475
+ "description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']",
2476
+ "type": "array",
2477
+ "items": {
2478
+ "type": "string"
2479
+ }
1334
2480
  },
1335
- "next_actions": {
2481
+ "available_queries": {
2482
+ "description": "Available query instructions for the current context (subset of 375 GUARDQUERY entries)",
1336
2483
  "type": "array",
1337
2484
  "items": {
1338
2485
  "type": "object",
1339
2486
  "properties": {
1340
- "action": {
1341
- "type": "string",
1342
- "description": "Recommended next action. Example: 'add sales products'"
2487
+ "id": {
2488
+ "type": "integer",
2489
+ "minimum": -9007199254740991,
2490
+ "maximum": 9007199254740991,
2491
+ "description": "Query instruction ID. Example: 1253"
1343
2492
  },
1344
- "reason": {
2493
+ "name": {
1345
2494
  "type": "string",
1346
- "description": "Why this action is recommended. Example: 'Service has no products; customers cannot order'"
2495
+ "description": "Query instruction name. Example: 'progress.current'"
1347
2496
  },
1348
- "tool": {
2497
+ "objectType": {
1349
2498
  "type": "string",
1350
- "description": "MCP tool to use, if applicable. Example: 'onchain_operations'"
2499
+ "description": "Target object type. Example: 'Progress'"
1351
2500
  },
1352
- "prerequisite": {
2501
+ "returnType": {
1353
2502
  "type": "string",
1354
- "description": "Condition that must hold before this action. Example: 'Service must be created first'"
2503
+ "description": "Return value type. Example: 'String'"
1355
2504
  },
1356
- "priority": {
1357
- "type": "string",
1358
- "enum": [
1359
- "required",
1360
- "recommended",
1361
- "optional"
1362
- ],
1363
- "description": "Priority. Constraint: enum. Example: 'required'"
2505
+ "description": {
2506
+ "description": "Query description",
2507
+ "type": "string"
1364
2508
  }
1365
2509
  },
1366
2510
  "required": [
1367
- "action",
1368
- "reason",
1369
- "priority"
2511
+ "id",
2512
+ "name",
2513
+ "objectType",
2514
+ "returnType"
1370
2515
  ],
1371
2516
  "additionalProperties": false,
1372
- "description": "A recommended next action with priority and rationale"
1373
- },
1374
- "description": "Recommended next actions to drive the workflow forward"
2517
+ "description": "A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries)."
2518
+ }
1375
2519
  },
1376
- "warnings": {
2520
+ "risk_warnings": {
2521
+ "description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']",
1377
2522
  "type": "array",
1378
2523
  "items": {
1379
2524
  "type": "string"
1380
- },
1381
- "description": "Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'"
2525
+ }
2526
+ },
2527
+ "pending_questions": {
2528
+ "description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']",
2529
+ "type": "array",
2530
+ "items": {
2531
+ "type": "string"
2532
+ }
2533
+ },
2534
+ "confirmation_text": {
2535
+ "description": "Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE.",
2536
+ "type": "string"
1382
2537
  },
1383
- "experience": {
2538
+ "test_result": {
2539
+ "description": "gen_passport static test result. Must pass before CREATE.",
1384
2540
  "type": "object",
1385
2541
  "properties": {
1386
- "advice": {
2542
+ "status": {
1387
2543
  "type": "string",
1388
- "description": "Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'"
1389
- },
1390
- "avoid": {
1391
- "type": "array",
1392
- "items": {
1393
- "type": "string"
1394
- },
1395
- "description": "Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']"
2544
+ "enum": [
2545
+ "pass",
2546
+ "fail",
2547
+ "not_tested"
2548
+ ]
1396
2549
  },
1397
- "relevance": {
1398
- "type": "number",
1399
- "minimum": 0,
1400
- "maximum": 1,
1401
- "description": "Relevance score 0-1 of the matched experience. Example: 0.85"
2550
+ "failure_node": {
2551
+ "description": "Node that caused failure (if fail)",
2552
+ "type": "string"
1402
2553
  },
1403
- "matched_scenario": {
1404
- "type": "string",
1405
- "description": "Matched historical scenario. Example: 'publish_service_freelance'"
2554
+ "passport_id": {
2555
+ "description": "Generated Passport ID (if pass)",
2556
+ "type": "string"
1406
2557
  }
1407
2558
  },
1408
- "additionalProperties": false,
1409
- "description": "Experience layer feedback from past operations (Phase 2 Topic 2)"
2559
+ "required": [
2560
+ "status"
2561
+ ],
2562
+ "additionalProperties": false
1410
2563
  },
1411
- "service_status": {
2564
+ "risk_assessment": {
2565
+ "description": "Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax.",
1412
2566
  "type": "object",
1413
2567
  "properties": {
1414
- "active": {
2568
+ "overall_risk": {
2569
+ "type": "string",
2570
+ "enum": [
2571
+ "critical",
2572
+ "high",
2573
+ "medium",
2574
+ "low",
2575
+ "info"
2576
+ ],
2577
+ "description": "Overall risk level (highest from all risks)"
2578
+ },
2579
+ "risk_count": {
2580
+ "type": "integer",
2581
+ "minimum": -9007199254740991,
2582
+ "maximum": 9007199254740991,
2583
+ "description": "Total number of detected risks"
2584
+ },
2585
+ "critical_count": {
2586
+ "type": "integer",
2587
+ "minimum": -9007199254740991,
2588
+ "maximum": 9007199254740991,
2589
+ "description": "Number of critical risks"
2590
+ },
2591
+ "high_count": {
2592
+ "type": "integer",
2593
+ "minimum": -9007199254740991,
2594
+ "maximum": 9007199254740991,
2595
+ "description": "Number of high risks"
2596
+ },
2597
+ "needs_human_review": {
2598
+ "type": "boolean",
2599
+ "description": "Whether human review is required (critical or 2+ high risks)"
2600
+ },
2601
+ "top_risks": {
1415
2602
  "type": "array",
1416
2603
  "items": {
1417
2604
  "type": "string"
1418
2605
  },
1419
- "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
2606
+ "description": "Top risk titles (critical and high, max 3)"
1420
2607
  },
1421
- "inactive": {
1422
- "type": "array",
1423
- "items": {
2608
+ "stakeholder_advice": {
2609
+ "description": "Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list",
2610
+ "type": "object",
2611
+ "propertyNames": {
1424
2612
  "type": "string"
1425
2613
  },
1426
- "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']"
2614
+ "additionalProperties": {
2615
+ "type": "array",
2616
+ "items": {
2617
+ "type": "string"
2618
+ }
2619
+ }
1427
2620
  }
1428
2621
  },
1429
2622
  "required": [
1430
- "active"
2623
+ "overall_risk",
2624
+ "risk_count",
2625
+ "critical_count",
2626
+ "high_count",
2627
+ "needs_human_review",
2628
+ "top_risks"
1431
2629
  ],
1432
- "additionalProperties": false,
1433
- "description": "Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response."
2630
+ "additionalProperties": false
2631
+ }
2632
+ },
2633
+ "additionalProperties": false
2634
+ },
2635
+ "workflow_guidance": {
2636
+ "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.",
2637
+ "type": "object",
2638
+ "properties": {
2639
+ "current_node": {
2640
+ "type": "string",
2641
+ "description": "Current node of the Progress. Example: 'serving'"
1434
2642
  },
1435
- "customer_advice": {
1436
- "type": "object",
1437
- "properties": {
1438
- "risk_score": {
1439
- "type": "number",
1440
- "minimum": 0,
1441
- "maximum": 100,
1442
- "description": "Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75"
1443
- },
1444
- "risk_level": {
1445
- "type": "string",
1446
- "enum": [
1447
- "low",
1448
- "medium_low",
1449
- "medium_high",
1450
- "high"
1451
- ],
1452
- "description": "Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'"
1453
- },
1454
- "recommendations": {
1455
- "type": "array",
1456
- "items": {
1457
- "type": "string"
2643
+ "caller": {
2644
+ "description": "The account (name/address) this guidance is framed for (env.account). Example: 'london_guide'",
2645
+ "type": "string"
2646
+ },
2647
+ "options": {
2648
+ "type": "array",
2649
+ "items": {
2650
+ "type": "object",
2651
+ "properties": {
2652
+ "next_node": {
2653
+ "type": "string",
2654
+ "description": "Target node this forward advances INTO. Example: 'serving'"
1458
2655
  },
1459
- "description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
1460
- },
1461
- "reminders": {
1462
- "type": "array",
1463
- "items": {
2656
+ "forward": {
2657
+ "type": "string",
2658
+ "description": "Forward (operation) name. Example: 'StartService'"
2659
+ },
2660
+ "weight": {
2661
+ "type": "number",
2662
+ "description": "Forward weight contributed toward the pair threshold. Example: 1"
2663
+ },
2664
+ "operator": {
1464
2665
  "type": "object",
1465
2666
  "properties": {
1466
- "id": {
1467
- "type": "string",
1468
- "description": "Reminder rule id. Example: 'high_risk_score'"
1469
- },
1470
- "stage": {
2667
+ "kind": {
1471
2668
  "type": "string",
1472
2669
  "enum": [
1473
- "browse",
1474
- "evaluate",
1475
- "preorder",
1476
- "in_progress",
1477
- "complete",
1478
- "after_sale"
2670
+ "order_holder",
2671
+ "permission_index",
2672
+ "named_operator"
1479
2673
  ],
1480
- "description": "Order lifecycle stage when this reminder fires. Example: 'evaluate'"
2674
+ "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."
1481
2675
  },
1482
- "priority": {
1483
- "type": "string",
1484
- "enum": [
1485
- "required",
1486
- "recommended",
1487
- "info",
1488
- "reminder"
1489
- ],
1490
- "description": "Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"
2676
+ "permission_index": {
2677
+ "description": "Permission index when kind='permission_index'. Example: 1000",
2678
+ "type": "integer",
2679
+ "minimum": -9007199254740991,
2680
+ "maximum": 9007199254740991
1491
2681
  },
1492
- "message": {
1493
- "type": "string",
1494
- "description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
2682
+ "role_name": {
2683
+ "description": "Resolved role display name. Example: 'merchant (permission 1000)' / 'order holder (customer)'",
2684
+ "type": "string"
1495
2685
  },
1496
- "action": {
1497
- "type": "string",
1498
- "description": "Suggested next action. Example: 'require merchant to bind Arbitration before ordering'"
2686
+ "account_name": {
2687
+ "description": "Resolved local account/mark name when the operator maps to a concrete account. Example: 'london_guide'",
2688
+ "type": "string"
2689
+ },
2690
+ "named_operator": {
2691
+ "description": "NamedOperator namespace when kind='named_operator'. Example: 'delivery_team'",
2692
+ "type": "string"
1499
2693
  }
1500
2694
  },
1501
2695
  "required": [
1502
- "id",
1503
- "stage",
1504
- "priority",
1505
- "message"
2696
+ "kind"
1506
2697
  ],
1507
2698
  "additionalProperties": false,
1508
- "description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
2699
+ "description": "Who can execute this forward (which account + which permission)."
1509
2700
  },
1510
- "description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
1511
- },
1512
- "preference_match": {
1513
- "type": "object",
1514
- "properties": {
1515
- "score": {
1516
- "type": "number",
1517
- "minimum": 0,
1518
- "maximum": 100,
1519
- "description": "Match score 0-100 (higher = better fit). Example: 75"
1520
- },
1521
- "matches": {
1522
- "type": "array",
1523
- "items": {
1524
- "type": "string"
1525
- },
1526
- "description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
1527
- },
1528
- "mismatches": {
1529
- "type": "array",
1530
- "items": {
1531
- "type": "string"
1532
- },
1533
- "description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
2701
+ "guard": {
2702
+ "description": "Guard bound to the forward — acceptance condition verified BEFORE the transition. Example: 'guard_payout'",
2703
+ "type": "string"
2704
+ },
2705
+ "business_meaning": {
2706
+ "type": "string",
2707
+ "description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
2708
+ },
2709
+ "gains": {
2710
+ "description": "Gains for the caller if this option is chosen (K3 Game G1 收益分离). Example: ['Settlement triggered — funds released to provider']",
2711
+ "type": "array",
2712
+ "items": {
2713
+ "type": "string"
1534
2714
  }
1535
2715
  },
1536
- "required": [
1537
- "score",
1538
- "matches",
1539
- "mismatches"
1540
- ],
1541
- "additionalProperties": false,
1542
- "description": "Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}"
1543
- }
2716
+ "risks": {
2717
+ "description": "Risks for the caller if this option is chosen (K3 Game G1 风险分离). Example: ['Refund leverage lost after confirmation']",
2718
+ "type": "array",
2719
+ "items": {
2720
+ "type": "string"
2721
+ }
2722
+ },
2723
+ "consistency": {
2724
+ "description": "Consistency 0-100 between this option's business semantics and the caller's interests (K3 Game optimality). Higher = more aligned.",
2725
+ "type": "number",
2726
+ "minimum": 0,
2727
+ "maximum": 100
2728
+ },
2729
+ "recommended": {
2730
+ "description": "Whether this is the recommended option (highest consistency).",
2731
+ "type": "boolean"
2732
+ }
2733
+ },
2734
+ "required": [
2735
+ "next_node",
2736
+ "forward",
2737
+ "weight",
2738
+ "operator",
2739
+ "business_meaning"
2740
+ ],
2741
+ "additionalProperties": false,
2742
+ "description": "A reachable next-node option with its operator/permission, guard, business meaning, and K3-style gains/risks/consistency."
1544
2743
  },
1545
- "required": [
1546
- "recommendations",
1547
- "reminders"
1548
- ],
1549
- "additionalProperties": false,
1550
- "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."
2744
+ "description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
1551
2745
  },
1552
- "evolution_context": {
2746
+ "recommendation": {
2747
+ "description": "Recommended option with rationale (K3 Game 意图/博弈/利益).",
1553
2748
  "type": "object",
1554
2749
  "properties": {
1555
- "industry_signal": {
1556
- "type": "string",
1557
- "description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'"
1558
- },
1559
- "evolution_advice": {
1560
- "type": "string",
1561
- "description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'"
1562
- },
1563
- "confidence": {
1564
- "type": "number",
1565
- "minimum": 0,
1566
- "maximum": 1,
1567
- "description": "Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"
1568
- },
1569
- "health_score": {
1570
- "type": "number",
1571
- "minimum": 0,
1572
- "maximum": 100,
1573
- "description": "Industry health score 0-100 if available. Example: 82"
2750
+ "best": {
2751
+ "description": "Recommended action in '<forward> → <next_node>' form. Example: 'StartService → serving'",
2752
+ "type": "string"
1574
2753
  },
1575
- "pending_suggestions": {
1576
- "type": "integer",
1577
- "minimum": 0,
1578
- "description": "Count of pending industry update suggestions (filtered by role if role is set). Example: 3"
1579
- },
1580
- "intent": {
1581
- "type": "string",
1582
- "enum": [
1583
- "default",
1584
- "growth",
1585
- "retention",
1586
- "compliance",
1587
- "efficiency",
1588
- "trust_building",
1589
- "custom"
1590
- ],
1591
- "description": "Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'"
1592
- },
1593
- "role_advice": {
1594
- "type": "array",
1595
- "items": {
1596
- "type": "string"
1597
- },
1598
- "description": "Phase 4 P4-6.C: Role-targeted advice strings (merchant/customer/prospect/supplier/collaborator/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']"
2754
+ "rationale": {
2755
+ "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'",
2756
+ "type": "string"
1599
2757
  },
1600
- "role": {
1601
- "type": "string",
1602
- "enum": [
1603
- "merchant",
1604
- "customer",
1605
- "prospect",
1606
- "supplier",
1607
- "collaborator",
1608
- "arbitrator"
1609
- ],
1610
- "description": "Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'"
2758
+ "caveat": {
2759
+ "description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 机会成本). Example: 'Choosing cancelled forfeits this order's settlement'",
2760
+ "type": "string"
1611
2761
  }
1612
2762
  },
1613
- "required": [
1614
- "confidence"
1615
- ],
1616
- "additionalProperties": false,
1617
- "description": "Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice."
2763
+ "additionalProperties": false
1618
2764
  },
1619
- "guard_advice": {
1620
- "type": "object",
1621
- "properties": {
1622
- "current_round": {
1623
- "type": "string",
1624
- "enum": [
1625
- "R1",
1626
- "R2",
1627
- "R3",
1628
- "R4",
1629
- "R5",
1630
- "R6",
1631
- "R7",
1632
- "R8",
1633
- "R9",
1634
- "R10"
1635
- ],
1636
- "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'"
1637
- },
1638
- "puzzle_status": {
1639
- "type": "object",
1640
- "properties": {
1641
- "intent": {
1642
- "type": "boolean",
1643
- "description": "Intent dimension complete (action + rule + failure conditions)"
1644
- },
1645
- "binding": {
1646
- "type": "boolean",
1647
- "description": "Binding dimension complete (host object + field + circular ref)"
1648
- },
1649
- "data": {
1650
- "type": "boolean",
1651
- "description": "Data dimension complete (table entries + witnesses)"
1652
- },
1653
- "query": {
1654
- "type": "boolean",
1655
- "description": "Query dimension complete (query instructions if needed)"
1656
- },
1657
- "logic": {
1658
- "type": "boolean",
1659
- "description": "Logic dimension complete (root node returns Bool)"
1660
- },
1661
- "constraints": {
1662
- "type": "boolean",
1663
- "description": "Constraints dimension complete (10 Pitfalls checked)"
1664
- }
2765
+ "note": {
2766
+ "description": "Additional note (e.g. wait for the other party, entry/terminal hint).",
2767
+ "type": "string"
2768
+ }
2769
+ },
2770
+ "required": [
2771
+ "current_node",
2772
+ "options"
2773
+ ],
2774
+ "additionalProperties": false
2775
+ },
2776
+ "workflow_receipt": {
2777
+ "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.",
2778
+ "type": "object",
2779
+ "properties": {
2780
+ "account": {
2781
+ "type": "string",
2782
+ "description": "The account that executed the operation (env.account). Example: 'london_guide'"
2783
+ },
2784
+ "action": {
2785
+ "type": "string",
2786
+ "description": "What was done. Example: 'london_guide executed StartService (paid → serving)'"
2787
+ },
2788
+ "forward": {
2789
+ "type": "string",
2790
+ "description": "Forward name executed. Example: 'StartService'"
2791
+ },
2792
+ "target_node": {
2793
+ "type": "string",
2794
+ "description": "Target node of the executed forward. Example: 'serving'"
2795
+ },
2796
+ "op": {
2797
+ "description": "Operation type executed.",
2798
+ "type": "string",
2799
+ "enum": [
2800
+ "next",
2801
+ "hold",
2802
+ "unhold",
2803
+ "adminUnhold"
2804
+ ]
2805
+ },
2806
+ "migrated": {
2807
+ "type": "boolean",
2808
+ "description": "Whether the Progress migrated to the target node (true) or stayed (false — weights still accumulating toward threshold)."
2809
+ },
2810
+ "current_node": {
2811
+ "type": "string",
2812
+ "description": "Progress.current after the operation."
2813
+ },
2814
+ "threshold": {
2815
+ "description": "Pair threshold when NOT migrated (threshold > 0).",
2816
+ "type": "number"
2817
+ },
2818
+ "accumulated_weight": {
2819
+ "description": "Accumulated forward weight in the current session when NOT migrated.",
2820
+ "type": "number"
2821
+ },
2822
+ "remaining": {
2823
+ "description": "threshold - accumulated_weight when NOT migrated.",
2824
+ "type": "number"
2825
+ },
2826
+ "waiting_on": {
2827
+ "description": "Pending forwards + their operators when NOT migrated (K3 Game G4 — who must cooperate next).",
2828
+ "type": "array",
2829
+ "items": {
2830
+ "type": "object",
2831
+ "properties": {
2832
+ "forward": {
2833
+ "type": "string",
2834
+ "description": "Forward still required to reach the threshold. Example: 'GuideConfirm'"
1665
2835
  },
1666
- "required": [
1667
- "intent",
1668
- "binding",
1669
- "data",
1670
- "query",
1671
- "logic",
1672
- "constraints"
1673
- ],
1674
- "additionalProperties": false,
1675
- "description": "Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE."
1676
- },
1677
- "matched_scene": {
1678
- "type": "string",
1679
- "description": "Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'"
2836
+ "operator": {
2837
+ "type": "object",
2838
+ "properties": {
2839
+ "kind": {
2840
+ "type": "string",
2841
+ "enum": [
2842
+ "order_holder",
2843
+ "permission_index",
2844
+ "named_operator"
2845
+ ],
2846
+ "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."
2847
+ },
2848
+ "permission_index": {
2849
+ "description": "Permission index when kind='permission_index'. Example: 1000",
2850
+ "type": "integer",
2851
+ "minimum": -9007199254740991,
2852
+ "maximum": 9007199254740991
2853
+ },
2854
+ "role_name": {
2855
+ "description": "Resolved role display name. Example: 'merchant (permission 1000)' / 'order holder (customer)'",
2856
+ "type": "string"
2857
+ },
2858
+ "account_name": {
2859
+ "description": "Resolved local account/mark name when the operator maps to a concrete account. Example: 'london_guide'",
2860
+ "type": "string"
2861
+ },
2862
+ "named_operator": {
2863
+ "description": "NamedOperator namespace when kind='named_operator'. Example: 'delivery_team'",
2864
+ "type": "string"
2865
+ }
2866
+ },
2867
+ "required": [
2868
+ "kind"
2869
+ ],
2870
+ "additionalProperties": false,
2871
+ "description": "Who must execute this forward next."
2872
+ }
1680
2873
  },
1681
- "scene_description": {
2874
+ "required": [
2875
+ "forward",
2876
+ "operator"
2877
+ ],
2878
+ "additionalProperties": false,
2879
+ "description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4 阈值配合)."
2880
+ }
2881
+ },
2882
+ "next_guidance": {
2883
+ "description": "Next-node guidance from the resulting current node.",
2884
+ "type": "object",
2885
+ "properties": {
2886
+ "current_node": {
1682
2887
  "type": "string",
1683
- "description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"
1684
- },
1685
- "scene_constraints": {
1686
- "type": "array",
1687
- "items": {
1688
- "type": "string"
1689
- },
1690
- "description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"
2888
+ "description": "Current node of the Progress. Example: 'serving'"
1691
2889
  },
1692
- "suggested_patterns": {
1693
- "type": "array",
1694
- "items": {
1695
- "type": "string"
1696
- },
1697
- "description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"
2890
+ "caller": {
2891
+ "description": "The account (name/address) this guidance is framed for (env.account). Example: 'london_guide'",
2892
+ "type": "string"
1698
2893
  },
1699
- "available_queries": {
2894
+ "options": {
1700
2895
  "type": "array",
1701
2896
  "items": {
1702
2897
  "type": "object",
1703
2898
  "properties": {
1704
- "id": {
1705
- "type": "integer",
1706
- "description": "Query instruction ID. Example: 1253"
1707
- },
1708
- "name": {
2899
+ "next_node": {
1709
2900
  "type": "string",
1710
- "description": "Query instruction name. Example: 'progress.current'"
2901
+ "description": "Target node this forward advances INTO. Example: 'serving'"
1711
2902
  },
1712
- "objectType": {
2903
+ "forward": {
1713
2904
  "type": "string",
1714
- "description": "Target object type. Example: 'Progress'"
2905
+ "description": "Forward (operation) name. Example: 'StartService'"
1715
2906
  },
1716
- "returnType": {
1717
- "type": "string",
1718
- "description": "Return value type. Example: 'String'"
2907
+ "weight": {
2908
+ "type": "number",
2909
+ "description": "Forward weight contributed toward the pair threshold. Example: 1"
2910
+ },
2911
+ "operator": {
2912
+ "type": "object",
2913
+ "properties": {
2914
+ "kind": {
2915
+ "type": "string",
2916
+ "enum": [
2917
+ "order_holder",
2918
+ "permission_index",
2919
+ "named_operator"
2920
+ ],
2921
+ "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."
2922
+ },
2923
+ "permission_index": {
2924
+ "description": "Permission index when kind='permission_index'. Example: 1000",
2925
+ "type": "integer",
2926
+ "minimum": -9007199254740991,
2927
+ "maximum": 9007199254740991
2928
+ },
2929
+ "role_name": {
2930
+ "description": "Resolved role display name. Example: 'merchant (permission 1000)' / 'order holder (customer)'",
2931
+ "type": "string"
2932
+ },
2933
+ "account_name": {
2934
+ "description": "Resolved local account/mark name when the operator maps to a concrete account. Example: 'london_guide'",
2935
+ "type": "string"
2936
+ },
2937
+ "named_operator": {
2938
+ "description": "NamedOperator namespace when kind='named_operator'. Example: 'delivery_team'",
2939
+ "type": "string"
2940
+ }
2941
+ },
2942
+ "required": [
2943
+ "kind"
2944
+ ],
2945
+ "additionalProperties": false,
2946
+ "description": "Who can execute this forward (which account + which permission)."
1719
2947
  },
1720
- "description": {
2948
+ "guard": {
2949
+ "description": "Guard bound to the forward — acceptance condition verified BEFORE the transition. Example: 'guard_payout'",
2950
+ "type": "string"
2951
+ },
2952
+ "business_meaning": {
1721
2953
  "type": "string",
1722
- "description": "Query description"
2954
+ "description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
2955
+ },
2956
+ "gains": {
2957
+ "description": "Gains for the caller if this option is chosen (K3 Game G1 收益分离). Example: ['Settlement triggered — funds released to provider']",
2958
+ "type": "array",
2959
+ "items": {
2960
+ "type": "string"
2961
+ }
2962
+ },
2963
+ "risks": {
2964
+ "description": "Risks for the caller if this option is chosen (K3 Game G1 风险分离). Example: ['Refund leverage lost after confirmation']",
2965
+ "type": "array",
2966
+ "items": {
2967
+ "type": "string"
2968
+ }
2969
+ },
2970
+ "consistency": {
2971
+ "description": "Consistency 0-100 between this option's business semantics and the caller's interests (K3 Game optimality). Higher = more aligned.",
2972
+ "type": "number",
2973
+ "minimum": 0,
2974
+ "maximum": 100
2975
+ },
2976
+ "recommended": {
2977
+ "description": "Whether this is the recommended option (highest consistency).",
2978
+ "type": "boolean"
1723
2979
  }
1724
2980
  },
1725
2981
  "required": [
1726
- "id",
1727
- "name",
1728
- "objectType",
1729
- "returnType"
2982
+ "next_node",
2983
+ "forward",
2984
+ "weight",
2985
+ "operator",
2986
+ "business_meaning"
1730
2987
  ],
1731
2988
  "additionalProperties": false,
1732
- "description": "A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries)."
1733
- },
1734
- "description": "Available query instructions for the current context (subset of 375 GUARDQUERY entries)"
1735
- },
1736
- "risk_warnings": {
1737
- "type": "array",
1738
- "items": {
1739
- "type": "string"
2989
+ "description": "A reachable next-node option with its operator/permission, guard, business meaning, and K3-style gains/risks/consistency."
1740
2990
  },
1741
- "description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"
2991
+ "description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
1742
2992
  },
1743
- "pending_questions": {
1744
- "type": "array",
1745
- "items": {
1746
- "type": "string"
1747
- },
1748
- "description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"
1749
- },
1750
- "confirmation_text": {
1751
- "type": "string",
1752
- "description": "Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE."
1753
- },
1754
- "test_result": {
2993
+ "recommendation": {
2994
+ "description": "Recommended option with rationale (K3 Game 意图/博弈/利益).",
1755
2995
  "type": "object",
1756
2996
  "properties": {
1757
- "status": {
1758
- "type": "string",
1759
- "enum": [
1760
- "pass",
1761
- "fail",
1762
- "not_tested"
1763
- ]
2997
+ "best": {
2998
+ "description": "Recommended action in '<forward> → <next_node>' form. Example: 'StartService → serving'",
2999
+ "type": "string"
1764
3000
  },
1765
- "failure_node": {
1766
- "type": "string",
1767
- "description": "Node that caused failure (if fail)"
3001
+ "rationale": {
3002
+ "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'",
3003
+ "type": "string"
1768
3004
  },
1769
- "passport_id": {
1770
- "type": "string",
1771
- "description": "Generated Passport ID (if pass)"
3005
+ "caveat": {
3006
+ "description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 机会成本). Example: 'Choosing cancelled forfeits this order's settlement'",
3007
+ "type": "string"
1772
3008
  }
1773
3009
  },
1774
- "required": [
1775
- "status"
1776
- ],
1777
- "additionalProperties": false,
1778
- "description": "gen_passport static test result. Must pass before CREATE."
3010
+ "additionalProperties": false
1779
3011
  },
1780
- "risk_assessment": {
1781
- "type": "object",
1782
- "properties": {
1783
- "overall_risk": {
1784
- "type": "string",
1785
- "enum": [
1786
- "critical",
1787
- "high",
1788
- "medium",
1789
- "low",
1790
- "info"
1791
- ],
1792
- "description": "Overall risk level (highest from all risks)"
1793
- },
1794
- "risk_count": {
1795
- "type": "integer",
1796
- "description": "Total number of detected risks"
1797
- },
1798
- "critical_count": {
1799
- "type": "integer",
1800
- "description": "Number of critical risks"
1801
- },
1802
- "high_count": {
1803
- "type": "integer",
1804
- "description": "Number of high risks"
1805
- },
1806
- "needs_human_review": {
1807
- "type": "boolean",
1808
- "description": "Whether human review is required (critical or 2+ high risks)"
1809
- },
1810
- "top_risks": {
1811
- "type": "array",
1812
- "items": {
1813
- "type": "string"
1814
- },
1815
- "description": "Top risk titles (critical and high, max 3)"
1816
- },
1817
- "stakeholder_advice": {
1818
- "type": "object",
1819
- "additionalProperties": {
1820
- "type": "array",
1821
- "items": {
1822
- "type": "string"
1823
- }
1824
- },
1825
- "description": "Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list"
1826
- }
1827
- },
1828
- "required": [
1829
- "overall_risk",
1830
- "risk_count",
1831
- "critical_count",
1832
- "high_count",
1833
- "needs_human_review",
1834
- "top_risks"
1835
- ],
1836
- "additionalProperties": false,
1837
- "description": "Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax."
3012
+ "note": {
3013
+ "description": "Additional note (e.g. wait for the other party, entry/terminal hint).",
3014
+ "type": "string"
1838
3015
  }
1839
3016
  },
1840
- "additionalProperties": false,
1841
- "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)."
3017
+ "required": [
3018
+ "current_node",
3019
+ "options"
3020
+ ],
3021
+ "additionalProperties": false
3022
+ },
3023
+ "note": {
3024
+ "description": "Additional note.",
3025
+ "type": "string"
1842
3026
  }
1843
3027
  },
1844
3028
  "required": [
1845
- "intent",
1846
- "status",
1847
- "summary"
3029
+ "account",
3030
+ "action",
3031
+ "forward",
3032
+ "target_node",
3033
+ "migrated",
3034
+ "current_node"
1848
3035
  ],
1849
- "additionalProperties": false,
1850
- "description": "Business semantic summary for messenger operation"
3036
+ "additionalProperties": false
1851
3037
  }
1852
3038
  },
1853
3039
  "required": [
1854
- "result"
3040
+ "intent",
3041
+ "status",
3042
+ "summary"
1855
3043
  ],
1856
- "additionalProperties": false,
1857
- "description": "Messenger operation output schema"
3044
+ "additionalProperties": false
1858
3045
  }
1859
- }
3046
+ },
3047
+ "required": [
3048
+ "result"
3049
+ ],
3050
+ "additionalProperties": false
1860
3051
  }