@wowok/agent-mcp 3.0.4 → 3.0.5

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 (248) hide show
  1. package/dist/evaluation/path-reasoning.d.ts +4 -2
  2. package/dist/evaluation/path-reasoning.js +1 -1
  3. package/dist/extensions/constraint-registry.d.ts +2 -2
  4. package/dist/extensions/constraint-registry.js +1 -1
  5. package/dist/extensions/custom-registry-file.d.ts +22 -0
  6. package/dist/extensions/custom-registry-file.js +1 -0
  7. package/dist/extensions/index.d.ts +2 -1
  8. package/dist/extensions/index.js +1 -1
  9. package/dist/extensions/industry-pack.d.ts +7 -0
  10. package/dist/extensions/industry-pack.js +1 -1
  11. package/dist/extensions/metric-registry.d.ts +2 -2
  12. package/dist/extensions/metric-registry.js +1 -1
  13. package/dist/extensions/modes.js +1 -1
  14. package/dist/extensions/registry.d.ts +2 -2
  15. package/dist/extensions/registry.js +1 -1
  16. package/dist/extensions/types.d.ts +4 -0
  17. package/dist/goal/GoalEngine.d.ts +13 -1
  18. package/dist/goal/GoalEngine.js +1 -1
  19. package/dist/goal/next-steps.d.ts +12 -0
  20. package/dist/goal/next-steps.js +1 -0
  21. package/dist/goal/pursue.d.ts +18 -0
  22. package/dist/goal/pursue.js +1 -0
  23. package/dist/goal/types.d.ts +72 -0
  24. package/dist/goal/types.js +1 -1
  25. package/dist/graph/onchain/analyze.d.ts +44 -0
  26. package/dist/graph/onchain/analyze.js +1 -0
  27. package/dist/graph/onchain/analyze.spec.d.ts +1 -0
  28. package/dist/graph/onchain/analyze.spec.js +1 -0
  29. package/dist/graph/onchain/anti-cheat.d.ts +39 -0
  30. package/dist/graph/onchain/anti-cheat.js +1 -0
  31. package/dist/graph/onchain/anti-cheat.spec.d.ts +1 -0
  32. package/dist/graph/onchain/anti-cheat.spec.js +1 -0
  33. package/dist/graph/onchain/dataplane.d.ts +44 -0
  34. package/dist/graph/onchain/dataplane.js +1 -0
  35. package/dist/graph/onchain/edge-schema.d.ts +60 -0
  36. package/dist/graph/onchain/edge-schema.js +1 -0
  37. package/dist/graph/onchain/expand.d.ts +4 -0
  38. package/dist/graph/onchain/expand.js +1 -0
  39. package/dist/graph/onchain/extract.d.ts +21 -0
  40. package/dist/graph/onchain/extract.js +1 -0
  41. package/dist/graph/onchain/index.d.ts +17 -0
  42. package/dist/graph/onchain/index.js +1 -0
  43. package/dist/graph/onchain/interest.d.ts +10 -0
  44. package/dist/graph/onchain/interest.js +1 -0
  45. package/dist/graph/onchain/interest.spec.d.ts +1 -0
  46. package/dist/graph/onchain/interest.spec.js +1 -0
  47. package/dist/graph/onchain/onchain.spec.d.ts +1 -0
  48. package/dist/graph/onchain/onchain.spec.js +1 -0
  49. package/dist/graph/onchain/order-status.d.ts +53 -0
  50. package/dist/graph/onchain/order-status.js +1 -0
  51. package/dist/graph/onchain/project-relationship.d.ts +3 -0
  52. package/dist/graph/onchain/project-relationship.js +1 -0
  53. package/dist/graph/onchain/sdk-batch.d.ts +117 -0
  54. package/dist/graph/onchain/sdk-batch.js +1 -0
  55. package/dist/graph/onchain/sdk-dataplane.d.ts +40 -0
  56. package/dist/graph/onchain/sdk-dataplane.js +1 -0
  57. package/dist/graph/onchain/strategy.d.ts +54 -0
  58. package/dist/graph/onchain/strategy.js +1 -0
  59. package/dist/graph/onchain/strategy.spec.d.ts +1 -0
  60. package/dist/graph/onchain/strategy.spec.js +1 -0
  61. package/dist/graph/onchain/types.d.ts +238 -0
  62. package/dist/graph/onchain/types.js +1 -0
  63. package/dist/graph/onchain/viewport.d.ts +5 -0
  64. package/dist/graph/onchain/viewport.js +1 -0
  65. package/dist/harness/recover.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/intent/enrich.js +1 -1
  68. package/dist/keeper/detectors.d.ts +1 -1
  69. package/dist/keeper/detectors.js +1 -1
  70. package/dist/knowledge/account-marks.js +1 -1
  71. package/dist/knowledge/anti-cheat.d.ts +2 -37
  72. package/dist/knowledge/anti-cheat.js +1 -1
  73. package/dist/knowledge/contract-invariants.js +1 -1
  74. package/dist/knowledge/getting-started.d.ts +37 -0
  75. package/dist/knowledge/getting-started.js +1 -0
  76. package/dist/knowledge/goal-completion.js +1 -1
  77. package/dist/knowledge/guard-render.d.ts +1 -0
  78. package/dist/knowledge/guard-render.js +1 -1
  79. package/dist/knowledge/guard-submission-brief.d.ts +83 -0
  80. package/dist/knowledge/guard-submission-brief.js +1 -0
  81. package/dist/knowledge/guard-submission-prompt.d.ts +13 -0
  82. package/dist/knowledge/guard-submission-prompt.js +1 -1
  83. package/dist/knowledge/index.d.ts +6 -4
  84. package/dist/knowledge/index.js +1 -1
  85. package/dist/knowledge/industry-registry.js +1 -1
  86. package/dist/knowledge/industry-strategy.d.ts +91 -0
  87. package/dist/knowledge/industry-strategy.js +1 -0
  88. package/dist/knowledge/jsonrpc-enum.js +1 -1
  89. package/dist/knowledge/market-metrics.d.ts +14 -3
  90. package/dist/knowledge/market-metrics.js +1 -1
  91. package/dist/knowledge/migration-preflight.js +1 -1
  92. package/dist/knowledge/operation-dictionary.d.ts +1 -1
  93. package/dist/knowledge/safety-rules.js +1 -1
  94. package/dist/knowledge/scenario-topology.d.ts +6 -1
  95. package/dist/knowledge/scenario-topology.js +1 -1
  96. package/dist/knowledge/service-risk-node.d.ts +3 -0
  97. package/dist/knowledge/service-risk-node.js +1 -0
  98. package/dist/knowledge/service-risk.d.ts +2 -0
  99. package/dist/knowledge/service-risk.js +1 -1
  100. package/dist/knowledge/service-templates.d.ts +2 -0
  101. package/dist/knowledge/service-templates.js +1 -1
  102. package/dist/knowledge/strategy-manuals.d.ts +17 -0
  103. package/dist/knowledge/strategy-manuals.js +1 -0
  104. package/dist/knowledge/supply-chain.d.ts +3 -1
  105. package/dist/knowledge/supply-chain.js +1 -1
  106. package/dist/knowledge/template-registry.js +1 -1
  107. package/dist/knowledge/tools-reference.js +1 -1
  108. package/dist/knowledge/workflow-guidance.d.ts +3 -118
  109. package/dist/knowledge/workflow-guidance.js +1 -1
  110. package/dist/knowledge/workspace-lists.js +1 -1
  111. package/dist/monitor/MonitorLoop.js +1 -1
  112. package/dist/monitor/ScopeResolver.js +1 -1
  113. package/dist/participation/radar-core.d.ts +15 -15
  114. package/dist/participation/radar-core.js +1 -1
  115. package/dist/persona/analyzer.d.ts +2 -1
  116. package/dist/persona/bridge.d.ts +5 -1
  117. package/dist/persona/bridge.js +1 -1
  118. package/dist/persona/defaults.js +1 -1
  119. package/dist/persona/distill-goal.d.ts +7 -1
  120. package/dist/persona/distill-goal.js +1 -1
  121. package/dist/persona/index.d.ts +13 -3
  122. package/dist/persona/index.js +1 -1
  123. package/dist/persona/model.d.ts +12 -2
  124. package/dist/persona/model.js +1 -1
  125. package/dist/persona/overrides.d.ts +1 -0
  126. package/dist/persona/overrides.js +1 -1
  127. package/dist/persona/topology-focus.d.ts +29 -0
  128. package/dist/persona/topology-focus.js +1 -0
  129. package/dist/persona/types.d.ts +81 -0
  130. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  131. package/dist/playbooks/service-build/context-assembly.js +1 -1
  132. package/dist/playbooks/service-build/machine-nodes.js +1 -1
  133. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  134. package/dist/playbooks/service-build/object-panorama.js +1 -1
  135. package/dist/playbooks/service-build/participation-radar.js +1 -1
  136. package/dist/playbooks/service-build/relationship-profile.d.ts +1 -0
  137. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  138. package/dist/playbooks/service-build/service-panorama.d.ts +4 -0
  139. package/dist/playbooks/service-build/service-panorama.js +1 -1
  140. package/dist/playbooks/service-build/topology-query.d.ts +14 -0
  141. package/dist/playbooks/service-build/topology-query.js +1 -0
  142. package/dist/role/index.d.ts +1 -0
  143. package/dist/role/index.js +1 -1
  144. package/dist/role/profiles.d.ts +26 -0
  145. package/dist/role/profiles.js +1 -0
  146. package/dist/safety/confirm-gate.d.ts +4 -1
  147. package/dist/safety/confirm-gate.js +1 -1
  148. package/dist/schema/call/allocation.d.ts +6 -6
  149. package/dist/schema/call/bridge.d.ts +1 -1
  150. package/dist/schema/call/guard.d.ts +20 -20
  151. package/dist/schema/call/repository.js +1 -1
  152. package/dist/schema/call/semantic.js +1 -1
  153. package/dist/schema/call/service.d.ts +4 -4
  154. package/dist/schema/common/index.js +1 -1
  155. package/dist/schema/employee/index.d.ts +7 -7
  156. package/dist/schema/evaluation/index.d.ts +22 -9
  157. package/dist/schema/evaluation/index.js +1 -1
  158. package/dist/schema/goal/index.d.ts +37 -1
  159. package/dist/schema/goal/index.js +1 -1
  160. package/dist/schema/goal/planning.d.ts +1 -1
  161. package/dist/schema/index.d.ts +1 -0
  162. package/dist/schema/index.js +1 -1
  163. package/dist/schema/industry-pack/index.d.ts +7 -0
  164. package/dist/schema/industry-pack/index.js +1 -1
  165. package/dist/schema/local/index.d.ts +8 -4
  166. package/dist/schema/local/index.js +1 -1
  167. package/dist/schema/messenger/index.d.ts +318 -64
  168. package/dist/schema/messenger/index.js +1 -1
  169. package/dist/schema/operations.d.ts +146 -11
  170. package/dist/schema/operations.js +1 -1
  171. package/dist/schema/persona/index.d.ts +15743 -0
  172. package/dist/schema/persona/index.js +1 -1
  173. package/dist/schema/query/bi.d.ts +869 -2
  174. package/dist/schema/query/bi.js +1 -1
  175. package/dist/schema/query/index.d.ts +163 -41
  176. package/dist/schema/query/index.js +1 -1
  177. package/dist/schema/schema-query/index.d.ts +16 -0
  178. package/dist/schema/schema-query/index.js +1 -1
  179. package/dist/schema/schema-version.js +1 -1
  180. package/dist/schema/strategy-review/index.d.ts +137 -0
  181. package/dist/schema/strategy-review/index.js +1 -0
  182. package/dist/schema/trust/index.d.ts +6 -6
  183. package/dist/schema/workflow/index.d.ts +2 -2
  184. package/dist/schema-query-impl/index.js +1 -1
  185. package/dist/schemas/account_operation.output.json +8 -4
  186. package/dist/schemas/account_operation.schema.json +6 -2
  187. package/dist/schemas/evaluation_operation.output.json +24 -0
  188. package/dist/schemas/goal_operation.schema.json +124 -0
  189. package/dist/schemas/index.json +7 -1
  190. package/dist/schemas/industry_pack_operation.output.json +39 -0
  191. package/dist/schemas/local_mark_operation.schema.json +2 -2
  192. package/dist/schemas/messenger_operation.output.json +670 -200
  193. package/dist/schemas/messenger_operation.schema.json +66 -239
  194. package/dist/schemas/onchain_operations.schema.json +3 -3
  195. package/dist/schemas/onchain_operations_repository.schema.json +3 -3
  196. package/dist/schemas/onchain_table_data.output.json +184 -0
  197. package/dist/schemas/onchain_table_data.schema.json +43 -43
  198. package/dist/schemas/persona_operation.output.json +37778 -262
  199. package/dist/schemas/persona_operation.schema.json +5960 -1
  200. package/dist/schemas/query_toolkit.output.json +1580 -2
  201. package/dist/schemas/query_toolkit.schema.json +194 -32
  202. package/dist/schemas/schema_query.schema.json +25 -1
  203. package/dist/schemas/strategy_review_operation.output.json +532 -0
  204. package/dist/schemas/strategy_review_operation.schema.json +66 -0
  205. package/dist/schemas/wowok_buildin_info.output.json +188 -6
  206. package/dist/schemas/wowok_buildin_info.schema.json +14 -0
  207. package/dist/strategy/collectors.d.ts +66 -0
  208. package/dist/strategy/collectors.js +1 -0
  209. package/dist/strategy/collectors.spec.d.ts +1 -0
  210. package/dist/strategy/collectors.spec.js +1 -0
  211. package/dist/strategy/index.d.ts +5 -0
  212. package/dist/strategy/index.js +1 -0
  213. package/dist/strategy/metrics.d.ts +20 -0
  214. package/dist/strategy/metrics.js +1 -0
  215. package/dist/strategy/review.d.ts +48 -0
  216. package/dist/strategy/review.js +1 -0
  217. package/dist/strategy/scorecard.d.ts +32 -0
  218. package/dist/strategy/scorecard.js +1 -0
  219. package/dist/strategy/store.d.ts +26 -0
  220. package/dist/strategy/store.js +1 -0
  221. package/dist/tools/handlers/config.js +1 -1
  222. package/dist/tools/handlers/evaluation.js +1 -1
  223. package/dist/tools/handlers/goal.js +1 -1
  224. package/dist/tools/handlers/industry-pack.js +1 -1
  225. package/dist/tools/handlers/local.js +1 -1
  226. package/dist/tools/handlers/messenger.js +1 -1
  227. package/dist/tools/handlers/onchain.js +1 -1
  228. package/dist/tools/handlers/permission.js +1 -1
  229. package/dist/tools/handlers/persona.js +1 -1
  230. package/dist/tools/handlers/query.d.ts +6 -0
  231. package/dist/tools/handlers/query.js +1 -1
  232. package/dist/tools/handlers/schema-query.js +1 -1
  233. package/dist/tools/handlers/strategy-review.d.ts +2 -0
  234. package/dist/tools/handlers/strategy-review.js +1 -0
  235. package/dist/tools/handlers/watch.js +1 -1
  236. package/dist/tools/handlers/workflow.js +1 -1
  237. package/dist/tools/index.d.ts +3 -0
  238. package/dist/tools/index.js +1 -1
  239. package/dist/tools/registry/agent.js +1 -1
  240. package/dist/tools/registry/business.js +1 -1
  241. package/dist/tools/registry/local.js +1 -1
  242. package/dist/tools/registry/messenger.js +1 -1
  243. package/dist/tools/registry/query.js +1 -1
  244. package/dist/tools/rules-hook.js +1 -1
  245. package/dist/tools/shared.d.ts +2 -1
  246. package/dist/tools/shared.js +1 -1
  247. package/dist/tools/wrap.js +1 -1
  248. package/package.json +2 -2
@@ -62,9 +62,63 @@
62
62
  "description": "Plaintext hash"
63
63
  },
64
64
  "plaintext": {
65
- "description": "Decrypted plaintext (optional)",
65
+ "description": "Decrypted plaintext text. UNDEFINED for attachment messages (zipMetadata present) — their base64 envelope is stripped at the read boundary; read msg.attachment for metadata and use save_attachment for bytes",
66
66
  "type": "string"
67
67
  },
68
+ "attachment": {
69
+ "description": "Present when this message is an attachment (zipMetadata present). Byte-free descriptor; payload never embedded",
70
+ "type": "object",
71
+ "properties": {
72
+ "kind": {
73
+ "type": "string",
74
+ "enum": [
75
+ "image",
76
+ "video",
77
+ "audio",
78
+ "voice",
79
+ "file",
80
+ "wts",
81
+ "wip"
82
+ ],
83
+ "description": "Attachment business type: image/video/audio are inline-renderable media; 'voice' is an explicit voice message (webm cannot be auto-distinguished from video); 'file' is a generic document; wts/wip are evidence files"
84
+ },
85
+ "fileName": {
86
+ "type": "string",
87
+ "description": "Original file name (transport .zip suffix stripped)"
88
+ },
89
+ "mimeType": {
90
+ "type": "string",
91
+ "description": "MIME type inferred from extension or sender-provided"
92
+ },
93
+ "size": {
94
+ "type": "number",
95
+ "description": "Payload size in bytes (uncompressed)"
96
+ },
97
+ "caption": {
98
+ "description": "Sender-provided caption (E2EE, inside the encrypted envelope)",
99
+ "type": "string"
100
+ },
101
+ "durationMs": {
102
+ "description": "Audio/video duration in milliseconds",
103
+ "type": "number"
104
+ },
105
+ "width": {
106
+ "description": "Media width in pixels",
107
+ "type": "number"
108
+ },
109
+ "height": {
110
+ "description": "Media height in pixels",
111
+ "type": "number"
112
+ }
113
+ },
114
+ "required": [
115
+ "kind",
116
+ "fileName",
117
+ "mimeType",
118
+ "size"
119
+ ],
120
+ "additionalProperties": false
121
+ },
68
122
  "replyTo": {
69
123
  "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
70
124
  "type": "object",
@@ -596,9 +650,63 @@
596
650
  "description": "Plaintext hash"
597
651
  },
598
652
  "plaintext": {
599
- "description": "Decrypted plaintext (optional)",
653
+ "description": "Decrypted plaintext text. UNDEFINED for attachment messages (zipMetadata present) — their base64 envelope is stripped at the read boundary; read msg.attachment for metadata and use save_attachment for bytes",
600
654
  "type": "string"
601
655
  },
656
+ "attachment": {
657
+ "description": "Present when this message is an attachment (zipMetadata present). Byte-free descriptor; payload never embedded",
658
+ "type": "object",
659
+ "properties": {
660
+ "kind": {
661
+ "type": "string",
662
+ "enum": [
663
+ "image",
664
+ "video",
665
+ "audio",
666
+ "voice",
667
+ "file",
668
+ "wts",
669
+ "wip"
670
+ ],
671
+ "description": "Attachment business type: image/video/audio are inline-renderable media; 'voice' is an explicit voice message (webm cannot be auto-distinguished from video); 'file' is a generic document; wts/wip are evidence files"
672
+ },
673
+ "fileName": {
674
+ "type": "string",
675
+ "description": "Original file name (transport .zip suffix stripped)"
676
+ },
677
+ "mimeType": {
678
+ "type": "string",
679
+ "description": "MIME type inferred from extension or sender-provided"
680
+ },
681
+ "size": {
682
+ "type": "number",
683
+ "description": "Payload size in bytes (uncompressed)"
684
+ },
685
+ "caption": {
686
+ "description": "Sender-provided caption (E2EE, inside the encrypted envelope)",
687
+ "type": "string"
688
+ },
689
+ "durationMs": {
690
+ "description": "Audio/video duration in milliseconds",
691
+ "type": "number"
692
+ },
693
+ "width": {
694
+ "description": "Media width in pixels",
695
+ "type": "number"
696
+ },
697
+ "height": {
698
+ "description": "Media height in pixels",
699
+ "type": "number"
700
+ }
701
+ },
702
+ "required": [
703
+ "kind",
704
+ "fileName",
705
+ "mimeType",
706
+ "size"
707
+ ],
708
+ "additionalProperties": false
709
+ },
602
710
  "replyTo": {
603
711
  "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
604
712
  "type": "object",
@@ -811,14 +919,11 @@
811
919
  "properties": {
812
920
  "operation": {
813
921
  "type": "string",
814
- "const": "extract_zip_messages"
922
+ "const": "save_attachment"
815
923
  },
816
924
  "result": {
817
- "type": "array",
818
- "items": {
819
- "type": "string"
820
- },
821
- "description": "Extracted file paths"
925
+ "type": "string",
926
+ "description": "Absolute path of the saved attachment file"
822
927
  }
823
928
  },
824
929
  "required": [
@@ -1642,229 +1747,594 @@
1642
1747
  "const": "pull_messages"
1643
1748
  },
1644
1749
  "result": {
1645
- "type": "array",
1646
- "items": {
1647
- "type": "object",
1648
- "properties": {
1649
- "messageId": {
1650
- "type": "string",
1651
- "description": "Message ID"
1652
- },
1653
- "fromAddress": {
1654
- "type": "string",
1655
- "description": "Sender address"
1656
- },
1657
- "toAddress": {
1658
- "type": "string",
1659
- "description": "Recipient address"
1660
- },
1661
- "plaintextHash": {
1662
- "type": "string",
1663
- "description": "Plaintext hash"
1664
- },
1665
- "plaintext": {
1666
- "description": "Decrypted plaintext (optional)",
1667
- "type": "string"
1668
- },
1669
- "replyTo": {
1670
- "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
1750
+ "anyOf": [
1751
+ {
1752
+ "type": "array",
1753
+ "items": {
1671
1754
  "type": "object",
1672
1755
  "properties": {
1673
1756
  "messageId": {
1674
1757
  "type": "string",
1675
- "description": "Replied-to message ID (unique within the conversation)"
1676
- }
1677
- },
1678
- "required": [
1679
- "messageId"
1680
- ],
1681
- "additionalProperties": false
1682
- },
1683
- "guardAddress": {
1684
- "description": "Guard address",
1685
- "type": "string"
1686
- },
1687
- "passportAddress": {
1688
- "description": "Passport address",
1689
- "type": "string"
1690
- },
1691
- "lastReceivedLeafIndex": {
1692
- "description": "Last received leaf index",
1693
- "type": "number"
1694
- },
1695
- "direction": {
1696
- "type": "string",
1697
- "enum": [
1698
- "sent",
1699
- "received"
1700
- ],
1701
- "description": "Message direction"
1702
- },
1703
- "status": {
1704
- "type": "string",
1705
- "enum": [
1706
- "pending",
1707
- "confirmed",
1708
- "read",
1709
- "failed",
1710
- "rejected",
1711
- "decrypted",
1712
- "decrypt_failed"
1713
- ],
1714
- "description": "Message status"
1715
- },
1716
- "msgType": {
1717
- "anyOf": [
1718
- {
1719
- "type": "number",
1720
- "const": 1
1758
+ "description": "Message ID"
1721
1759
  },
1722
- {
1723
- "type": "number",
1724
- "const": 3
1725
- }
1726
- ],
1727
- "description": "Message type"
1728
- },
1729
- "leafIndex": {
1730
- "description": "Leaf index",
1731
- "type": "number"
1732
- },
1733
- "prevRoot": {
1734
- "description": "Previous Merkle Root",
1735
- "type": "string"
1736
- },
1737
- "newRoot": {
1738
- "description": "Current Merkle Root",
1739
- "type": "string"
1740
- },
1741
- "serverSignature": {
1742
- "description": "Server signature",
1743
- "type": "string"
1744
- },
1745
- "serverTimestamp": {
1746
- "description": "Server confirmation timestamp",
1747
- "type": "number"
1748
- },
1749
- "serverPublicKey": {
1750
- "description": "Server public key",
1751
- "type": "string"
1752
- },
1753
- "arkConfirmed": {
1754
- "description": "ARK confirmation",
1755
- "type": "object",
1756
- "properties": {
1757
- "recipient": {
1760
+ "fromAddress": {
1761
+ "type": "string",
1762
+ "description": "Sender address"
1763
+ },
1764
+ "toAddress": {
1758
1765
  "type": "string",
1759
1766
  "description": "Recipient address"
1760
1767
  },
1761
- "recipientPublicKey": {
1768
+ "plaintextHash": {
1762
1769
  "type": "string",
1763
- "description": "Recipient public key"
1770
+ "description": "Plaintext hash"
1764
1771
  },
1765
- "signature": {
1772
+ "plaintext": {
1773
+ "description": "Decrypted plaintext text. UNDEFINED for attachment messages (zipMetadata present) — their base64 envelope is stripped at the read boundary; read msg.attachment for metadata and use save_attachment for bytes",
1774
+ "type": "string"
1775
+ },
1776
+ "attachment": {
1777
+ "description": "Present when this message is an attachment (zipMetadata present). Byte-free descriptor; payload never embedded",
1778
+ "type": "object",
1779
+ "properties": {
1780
+ "kind": {
1781
+ "type": "string",
1782
+ "enum": [
1783
+ "image",
1784
+ "video",
1785
+ "audio",
1786
+ "voice",
1787
+ "file",
1788
+ "wts",
1789
+ "wip"
1790
+ ],
1791
+ "description": "Attachment business type: image/video/audio are inline-renderable media; 'voice' is an explicit voice message (webm cannot be auto-distinguished from video); 'file' is a generic document; wts/wip are evidence files"
1792
+ },
1793
+ "fileName": {
1794
+ "type": "string",
1795
+ "description": "Original file name (transport .zip suffix stripped)"
1796
+ },
1797
+ "mimeType": {
1798
+ "type": "string",
1799
+ "description": "MIME type inferred from extension or sender-provided"
1800
+ },
1801
+ "size": {
1802
+ "type": "number",
1803
+ "description": "Payload size in bytes (uncompressed)"
1804
+ },
1805
+ "caption": {
1806
+ "description": "Sender-provided caption (E2EE, inside the encrypted envelope)",
1807
+ "type": "string"
1808
+ },
1809
+ "durationMs": {
1810
+ "description": "Audio/video duration in milliseconds",
1811
+ "type": "number"
1812
+ },
1813
+ "width": {
1814
+ "description": "Media width in pixels",
1815
+ "type": "number"
1816
+ },
1817
+ "height": {
1818
+ "description": "Media height in pixels",
1819
+ "type": "number"
1820
+ }
1821
+ },
1822
+ "required": [
1823
+ "kind",
1824
+ "fileName",
1825
+ "mimeType",
1826
+ "size"
1827
+ ],
1828
+ "additionalProperties": false
1829
+ },
1830
+ "replyTo": {
1831
+ "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
1832
+ "type": "object",
1833
+ "properties": {
1834
+ "messageId": {
1835
+ "type": "string",
1836
+ "description": "Replied-to message ID (unique within the conversation)"
1837
+ }
1838
+ },
1839
+ "required": [
1840
+ "messageId"
1841
+ ],
1842
+ "additionalProperties": false
1843
+ },
1844
+ "guardAddress": {
1845
+ "description": "Guard address",
1846
+ "type": "string"
1847
+ },
1848
+ "passportAddress": {
1849
+ "description": "Passport address",
1850
+ "type": "string"
1851
+ },
1852
+ "lastReceivedLeafIndex": {
1853
+ "description": "Last received leaf index",
1854
+ "type": "number"
1855
+ },
1856
+ "direction": {
1766
1857
  "type": "string",
1767
- "description": "Recipient signature"
1858
+ "enum": [
1859
+ "sent",
1860
+ "received"
1861
+ ],
1862
+ "description": "Message direction"
1768
1863
  },
1769
- "timestamp": {
1864
+ "status": {
1865
+ "type": "string",
1866
+ "enum": [
1867
+ "pending",
1868
+ "confirmed",
1869
+ "read",
1870
+ "failed",
1871
+ "rejected",
1872
+ "decrypted",
1873
+ "decrypt_failed"
1874
+ ],
1875
+ "description": "Message status"
1876
+ },
1877
+ "msgType": {
1878
+ "anyOf": [
1879
+ {
1880
+ "type": "number",
1881
+ "const": 1
1882
+ },
1883
+ {
1884
+ "type": "number",
1885
+ "const": 3
1886
+ }
1887
+ ],
1888
+ "description": "Message type"
1889
+ },
1890
+ "leafIndex": {
1891
+ "description": "Leaf index",
1892
+ "type": "number"
1893
+ },
1894
+ "prevRoot": {
1895
+ "description": "Previous Merkle Root",
1896
+ "type": "string"
1897
+ },
1898
+ "newRoot": {
1899
+ "description": "Current Merkle Root",
1900
+ "type": "string"
1901
+ },
1902
+ "serverSignature": {
1903
+ "description": "Server signature",
1904
+ "type": "string"
1905
+ },
1906
+ "serverTimestamp": {
1907
+ "description": "Server confirmation timestamp",
1908
+ "type": "number"
1909
+ },
1910
+ "serverPublicKey": {
1911
+ "description": "Server public key",
1912
+ "type": "string"
1913
+ },
1914
+ "arkConfirmed": {
1915
+ "description": "ARK confirmation",
1916
+ "type": "object",
1917
+ "properties": {
1918
+ "recipient": {
1919
+ "type": "string",
1920
+ "description": "Recipient address"
1921
+ },
1922
+ "recipientPublicKey": {
1923
+ "type": "string",
1924
+ "description": "Recipient public key"
1925
+ },
1926
+ "signature": {
1927
+ "type": "string",
1928
+ "description": "Recipient signature"
1929
+ },
1930
+ "timestamp": {
1931
+ "type": "number",
1932
+ "description": "ARK confirmation time"
1933
+ }
1934
+ },
1935
+ "required": [
1936
+ "recipient",
1937
+ "recipientPublicKey",
1938
+ "signature",
1939
+ "timestamp"
1940
+ ],
1941
+ "additionalProperties": false
1942
+ },
1943
+ "createdAt": {
1770
1944
  "type": "number",
1771
- "description": "ARK confirmation time"
1945
+ "description": "Message creation time (client)"
1946
+ },
1947
+ "receivedAt": {
1948
+ "description": "Local reception time",
1949
+ "type": "number"
1950
+ },
1951
+ "zipMetadata": {
1952
+ "description": "ZIP file metadata",
1953
+ "type": "object",
1954
+ "properties": {
1955
+ "fileName": {
1956
+ "type": "string",
1957
+ "description": "ZIP filename"
1958
+ },
1959
+ "fileSize": {
1960
+ "type": "number",
1961
+ "description": "File size in bytes"
1962
+ },
1963
+ "fileHash": {
1964
+ "type": "string",
1965
+ "description": "File SHA256 hash"
1966
+ },
1967
+ "contentType": {
1968
+ "type": "string",
1969
+ "enum": [
1970
+ "text",
1971
+ "zip",
1972
+ "wts",
1973
+ "wip"
1974
+ ],
1975
+ "description": "Content type"
1976
+ },
1977
+ "localCachePath": {
1978
+ "description": "Local cache path",
1979
+ "type": "string"
1980
+ },
1981
+ "downloadedAt": {
1982
+ "description": "Download timestamp",
1983
+ "type": "number"
1984
+ }
1985
+ },
1986
+ "required": [
1987
+ "fileName",
1988
+ "fileSize",
1989
+ "fileHash",
1990
+ "contentType"
1991
+ ],
1992
+ "additionalProperties": false
1993
+ },
1994
+ "proof": {
1995
+ "description": "On-chain proof object address",
1996
+ "type": "string"
1997
+ },
1998
+ "decryptError": {
1999
+ "description": "Decryption failure reason",
2000
+ "type": "string"
2001
+ },
2002
+ "decryptAttempts": {
2003
+ "description": "Number of decryption attempts",
2004
+ "type": "number"
2005
+ },
2006
+ "lastDecryptAttemptAt": {
2007
+ "description": "Last decryption attempt timestamp",
2008
+ "type": "number"
2009
+ },
2010
+ "viewedAt": {
2011
+ "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')",
2012
+ "type": "number"
1772
2013
  }
1773
2014
  },
1774
2015
  "required": [
1775
- "recipient",
1776
- "recipientPublicKey",
1777
- "signature",
1778
- "timestamp"
2016
+ "messageId",
2017
+ "fromAddress",
2018
+ "toAddress",
2019
+ "plaintextHash",
2020
+ "direction",
2021
+ "status",
2022
+ "msgType",
2023
+ "createdAt"
1779
2024
  ],
1780
- "additionalProperties": false
1781
- },
1782
- "createdAt": {
1783
- "type": "number",
1784
- "description": "Message creation time (client)"
1785
- },
1786
- "receivedAt": {
1787
- "description": "Local reception time",
1788
- "type": "number"
2025
+ "additionalProperties": false,
2026
+ "description": "Message object"
1789
2027
  },
1790
- "zipMetadata": {
1791
- "description": "ZIP file metadata",
2028
+ "description": "Single-account mode: messages pulled from server"
2029
+ },
2030
+ {
2031
+ "type": "array",
2032
+ "items": {
1792
2033
  "type": "object",
1793
2034
  "properties": {
1794
- "fileName": {
2035
+ "account": {
1795
2036
  "type": "string",
1796
- "description": "ZIP filename"
2037
+ "description": "Account address"
1797
2038
  },
1798
- "fileSize": {
2039
+ "pulled": {
1799
2040
  "type": "number",
1800
- "description": "File size in bytes"
1801
- },
1802
- "fileHash": {
1803
- "type": "string",
1804
- "description": "File SHA256 hash"
2041
+ "description": "Number of messages pulled and decrypted in this round"
1805
2042
  },
1806
- "contentType": {
1807
- "type": "string",
1808
- "enum": [
1809
- "text",
1810
- "zip",
1811
- "wts",
1812
- "wip"
1813
- ],
1814
- "description": "Content type"
2043
+ "messages": {
2044
+ "type": "array",
2045
+ "items": {
2046
+ "type": "object",
2047
+ "properties": {
2048
+ "messageId": {
2049
+ "type": "string",
2050
+ "description": "Message ID"
2051
+ },
2052
+ "fromAddress": {
2053
+ "type": "string",
2054
+ "description": "Sender address"
2055
+ },
2056
+ "toAddress": {
2057
+ "type": "string",
2058
+ "description": "Recipient address"
2059
+ },
2060
+ "plaintextHash": {
2061
+ "type": "string",
2062
+ "description": "Plaintext hash"
2063
+ },
2064
+ "plaintext": {
2065
+ "description": "Decrypted plaintext text. UNDEFINED for attachment messages (zipMetadata present) — their base64 envelope is stripped at the read boundary; read msg.attachment for metadata and use save_attachment for bytes",
2066
+ "type": "string"
2067
+ },
2068
+ "attachment": {
2069
+ "description": "Present when this message is an attachment (zipMetadata present). Byte-free descriptor; payload never embedded",
2070
+ "type": "object",
2071
+ "properties": {
2072
+ "kind": {
2073
+ "type": "string",
2074
+ "enum": [
2075
+ "image",
2076
+ "video",
2077
+ "audio",
2078
+ "voice",
2079
+ "file",
2080
+ "wts",
2081
+ "wip"
2082
+ ],
2083
+ "description": "Attachment business type: image/video/audio are inline-renderable media; 'voice' is an explicit voice message (webm cannot be auto-distinguished from video); 'file' is a generic document; wts/wip are evidence files"
2084
+ },
2085
+ "fileName": {
2086
+ "type": "string",
2087
+ "description": "Original file name (transport .zip suffix stripped)"
2088
+ },
2089
+ "mimeType": {
2090
+ "type": "string",
2091
+ "description": "MIME type inferred from extension or sender-provided"
2092
+ },
2093
+ "size": {
2094
+ "type": "number",
2095
+ "description": "Payload size in bytes (uncompressed)"
2096
+ },
2097
+ "caption": {
2098
+ "description": "Sender-provided caption (E2EE, inside the encrypted envelope)",
2099
+ "type": "string"
2100
+ },
2101
+ "durationMs": {
2102
+ "description": "Audio/video duration in milliseconds",
2103
+ "type": "number"
2104
+ },
2105
+ "width": {
2106
+ "description": "Media width in pixels",
2107
+ "type": "number"
2108
+ },
2109
+ "height": {
2110
+ "description": "Media height in pixels",
2111
+ "type": "number"
2112
+ }
2113
+ },
2114
+ "required": [
2115
+ "kind",
2116
+ "fileName",
2117
+ "mimeType",
2118
+ "size"
2119
+ ],
2120
+ "additionalProperties": false
2121
+ },
2122
+ "replyTo": {
2123
+ "description": "Quoted (replied-to) message reference, if this message replies to a previous one",
2124
+ "type": "object",
2125
+ "properties": {
2126
+ "messageId": {
2127
+ "type": "string",
2128
+ "description": "Replied-to message ID (unique within the conversation)"
2129
+ }
2130
+ },
2131
+ "required": [
2132
+ "messageId"
2133
+ ],
2134
+ "additionalProperties": false
2135
+ },
2136
+ "guardAddress": {
2137
+ "description": "Guard address",
2138
+ "type": "string"
2139
+ },
2140
+ "passportAddress": {
2141
+ "description": "Passport address",
2142
+ "type": "string"
2143
+ },
2144
+ "lastReceivedLeafIndex": {
2145
+ "description": "Last received leaf index",
2146
+ "type": "number"
2147
+ },
2148
+ "direction": {
2149
+ "type": "string",
2150
+ "enum": [
2151
+ "sent",
2152
+ "received"
2153
+ ],
2154
+ "description": "Message direction"
2155
+ },
2156
+ "status": {
2157
+ "type": "string",
2158
+ "enum": [
2159
+ "pending",
2160
+ "confirmed",
2161
+ "read",
2162
+ "failed",
2163
+ "rejected",
2164
+ "decrypted",
2165
+ "decrypt_failed"
2166
+ ],
2167
+ "description": "Message status"
2168
+ },
2169
+ "msgType": {
2170
+ "anyOf": [
2171
+ {
2172
+ "type": "number",
2173
+ "const": 1
2174
+ },
2175
+ {
2176
+ "type": "number",
2177
+ "const": 3
2178
+ }
2179
+ ],
2180
+ "description": "Message type"
2181
+ },
2182
+ "leafIndex": {
2183
+ "description": "Leaf index",
2184
+ "type": "number"
2185
+ },
2186
+ "prevRoot": {
2187
+ "description": "Previous Merkle Root",
2188
+ "type": "string"
2189
+ },
2190
+ "newRoot": {
2191
+ "description": "Current Merkle Root",
2192
+ "type": "string"
2193
+ },
2194
+ "serverSignature": {
2195
+ "description": "Server signature",
2196
+ "type": "string"
2197
+ },
2198
+ "serverTimestamp": {
2199
+ "description": "Server confirmation timestamp",
2200
+ "type": "number"
2201
+ },
2202
+ "serverPublicKey": {
2203
+ "description": "Server public key",
2204
+ "type": "string"
2205
+ },
2206
+ "arkConfirmed": {
2207
+ "description": "ARK confirmation",
2208
+ "type": "object",
2209
+ "properties": {
2210
+ "recipient": {
2211
+ "type": "string",
2212
+ "description": "Recipient address"
2213
+ },
2214
+ "recipientPublicKey": {
2215
+ "type": "string",
2216
+ "description": "Recipient public key"
2217
+ },
2218
+ "signature": {
2219
+ "type": "string",
2220
+ "description": "Recipient signature"
2221
+ },
2222
+ "timestamp": {
2223
+ "type": "number",
2224
+ "description": "ARK confirmation time"
2225
+ }
2226
+ },
2227
+ "required": [
2228
+ "recipient",
2229
+ "recipientPublicKey",
2230
+ "signature",
2231
+ "timestamp"
2232
+ ],
2233
+ "additionalProperties": false
2234
+ },
2235
+ "createdAt": {
2236
+ "type": "number",
2237
+ "description": "Message creation time (client)"
2238
+ },
2239
+ "receivedAt": {
2240
+ "description": "Local reception time",
2241
+ "type": "number"
2242
+ },
2243
+ "zipMetadata": {
2244
+ "description": "ZIP file metadata",
2245
+ "type": "object",
2246
+ "properties": {
2247
+ "fileName": {
2248
+ "type": "string",
2249
+ "description": "ZIP filename"
2250
+ },
2251
+ "fileSize": {
2252
+ "type": "number",
2253
+ "description": "File size in bytes"
2254
+ },
2255
+ "fileHash": {
2256
+ "type": "string",
2257
+ "description": "File SHA256 hash"
2258
+ },
2259
+ "contentType": {
2260
+ "type": "string",
2261
+ "enum": [
2262
+ "text",
2263
+ "zip",
2264
+ "wts",
2265
+ "wip"
2266
+ ],
2267
+ "description": "Content type"
2268
+ },
2269
+ "localCachePath": {
2270
+ "description": "Local cache path",
2271
+ "type": "string"
2272
+ },
2273
+ "downloadedAt": {
2274
+ "description": "Download timestamp",
2275
+ "type": "number"
2276
+ }
2277
+ },
2278
+ "required": [
2279
+ "fileName",
2280
+ "fileSize",
2281
+ "fileHash",
2282
+ "contentType"
2283
+ ],
2284
+ "additionalProperties": false
2285
+ },
2286
+ "proof": {
2287
+ "description": "On-chain proof object address",
2288
+ "type": "string"
2289
+ },
2290
+ "decryptError": {
2291
+ "description": "Decryption failure reason",
2292
+ "type": "string"
2293
+ },
2294
+ "decryptAttempts": {
2295
+ "description": "Number of decryption attempts",
2296
+ "type": "number"
2297
+ },
2298
+ "lastDecryptAttemptAt": {
2299
+ "description": "Last decryption attempt timestamp",
2300
+ "type": "number"
2301
+ },
2302
+ "viewedAt": {
2303
+ "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')",
2304
+ "type": "number"
2305
+ }
2306
+ },
2307
+ "required": [
2308
+ "messageId",
2309
+ "fromAddress",
2310
+ "toAddress",
2311
+ "plaintextHash",
2312
+ "direction",
2313
+ "status",
2314
+ "msgType",
2315
+ "createdAt"
2316
+ ],
2317
+ "additionalProperties": false,
2318
+ "description": "Message object"
2319
+ },
2320
+ "description": "Newly pulled messages (read boundary applied: attachment payloads stripped into descriptors)"
1815
2321
  },
1816
- "localCachePath": {
1817
- "description": "Local cache path",
2322
+ "error": {
2323
+ "description": "Per-account pull error; absent on success. Other accounts are unaffected",
1818
2324
  "type": "string"
1819
- },
1820
- "downloadedAt": {
1821
- "description": "Download timestamp",
1822
- "type": "number"
1823
2325
  }
1824
2326
  },
1825
2327
  "required": [
1826
- "fileName",
1827
- "fileSize",
1828
- "fileHash",
1829
- "contentType"
2328
+ "account",
2329
+ "pulled",
2330
+ "messages"
1830
2331
  ],
1831
- "additionalProperties": false
1832
- },
1833
- "proof": {
1834
- "description": "On-chain proof object address",
1835
- "type": "string"
1836
- },
1837
- "decryptError": {
1838
- "description": "Decryption failure reason",
1839
- "type": "string"
1840
- },
1841
- "decryptAttempts": {
1842
- "description": "Number of decryption attempts",
1843
- "type": "number"
1844
- },
1845
- "lastDecryptAttemptAt": {
1846
- "description": "Last decryption attempt timestamp",
1847
- "type": "number"
2332
+ "additionalProperties": false,
2333
+ "description": "Per-account fan-out pull result"
1848
2334
  },
1849
- "viewedAt": {
1850
- "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')",
1851
- "type": "number"
1852
- }
1853
- },
1854
- "required": [
1855
- "messageId",
1856
- "fromAddress",
1857
- "toAddress",
1858
- "plaintextHash",
1859
- "direction",
1860
- "status",
1861
- "msgType",
1862
- "createdAt"
1863
- ],
1864
- "additionalProperties": false,
1865
- "description": "Message object"
1866
- },
1867
- "description": "List of messages pulled from server"
2335
+ "description": "Fan-out mode (allAccounts/accounts set): one entry per account with isolated errors"
2336
+ }
2337
+ ]
1868
2338
  }
1869
2339
  },
1870
2340
  "required": [