@wowok/agent-mcp 2.2.13 → 2.2.14

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 (126) hide show
  1. package/dist/index.js +42 -98
  2. package/dist/schema-query/index.d.ts +29 -0
  3. package/dist/schema-query/index.js +149 -0
  4. package/dist/schemas/account_operation.schema.json +255 -0
  5. package/dist/schemas/guard2file.schema.json +71 -0
  6. package/dist/schemas/index.json +139 -0
  7. package/dist/schemas/local_info_operation.schema.json +142 -0
  8. package/dist/schemas/local_mark_operation.schema.json +119 -0
  9. package/dist/schemas/machineNode2file.schema.json +71 -0
  10. package/dist/schemas/messenger_operation.schema.json +1393 -0
  11. package/dist/schemas/onchain_events.schema.json +113 -0
  12. package/dist/schemas/onchain_operations.schema.json +376 -0
  13. package/dist/schemas/onchain_operations_allocation.schema.json +914 -0
  14. package/dist/schemas/onchain_operations_arbitration.schema.json +1166 -0
  15. package/dist/schemas/onchain_operations_contact.schema.json +853 -0
  16. package/dist/schemas/onchain_operations_demand.schema.json +984 -0
  17. package/dist/schemas/onchain_operations_gen_passport.schema.json +1141 -0
  18. package/dist/schemas/onchain_operations_guard.schema.json +713 -0
  19. package/dist/schemas/onchain_operations_machine.schema.json +1347 -0
  20. package/dist/schemas/onchain_operations_order.schema.json +830 -0
  21. package/dist/schemas/onchain_operations_payment.schema.json +717 -0
  22. package/dist/schemas/onchain_operations_permission.schema.json +1088 -0
  23. package/dist/schemas/onchain_operations_personal.schema.json +1282 -0
  24. package/dist/schemas/onchain_operations_progress.schema.json +751 -0
  25. package/dist/schemas/onchain_operations_repository.schema.json +1572 -0
  26. package/dist/schemas/onchain_operations_reward.schema.json +955 -0
  27. package/dist/schemas/onchain_operations_service.schema.json +1411 -0
  28. package/dist/schemas/onchain_operations_treasury.schema.json +1155 -0
  29. package/dist/schemas/onchain_table_data.schema.json +35 -0
  30. package/dist/schemas/operations/guard.json +163 -0
  31. package/dist/schemas/operations/permission.json +22 -0
  32. package/dist/schemas/query_toolkit.schema.json +32 -0
  33. package/dist/schemas/schema_query.schema.json +33 -0
  34. package/dist/schemas/wip_file.schema.json +27 -0
  35. package/dist/schemas/wowok_buildin_info.schema.json +487 -0
  36. package/package.json +7 -5
  37. package/dist/docs/index.d.ts +0 -3
  38. package/dist/docs/index.js +0 -2
  39. package/dist/docs/loader.d.ts +0 -12
  40. package/dist/docs/loader.js +0 -177
  41. package/dist/docs/search.d.ts +0 -17
  42. package/dist/docs/search.js +0 -325
  43. package/dist/docs/types.d.ts +0 -55
  44. package/dist/docs/types.js +0 -1
  45. package/docs/README.md +0 -249
  46. package/docs/WIP.md +0 -388
  47. package/docs/WTS.md +0 -536
  48. package/docs/docs/account.md +0 -914
  49. package/docs/docs/allocation.md +0 -635
  50. package/docs/docs/arbitration.md +0 -1804
  51. package/docs/docs/arbitration_state_machine.md +0 -270
  52. package/docs/docs/contact.md +0 -709
  53. package/docs/docs/demand.md +0 -948
  54. package/docs/docs/guard.md +0 -1465
  55. package/docs/docs/localinfo.md +0 -432
  56. package/docs/docs/localmark.md +0 -583
  57. package/docs/docs/machine.md +0 -2490
  58. package/docs/docs/messenger.md +0 -2098
  59. package/docs/docs/onchain_events.md +0 -267
  60. package/docs/docs/order.md +0 -1001
  61. package/docs/docs/payment.md +0 -512
  62. package/docs/docs/permission.md +0 -1438
  63. package/docs/docs/personal.md +0 -742
  64. package/docs/docs/progress.md +0 -1748
  65. package/docs/docs/query.md +0 -467
  66. package/docs/docs/repository.md +0 -1043
  67. package/docs/docs/reward.md +0 -833
  68. package/docs/docs/service.md +0 -2130
  69. package/docs/docs/stage-01-introduction.md +0 -243
  70. package/docs/docs/stage-02-trust.md +0 -302
  71. package/docs/docs/stage-03-collaboration.md +0 -337
  72. package/docs/docs/stage-04-transaction.md +0 -277
  73. package/docs/docs/stage-05-business.md +0 -151
  74. package/docs/docs/stage-06-personal.md +0 -203
  75. package/docs/docs/stage-07-query.md +0 -572
  76. package/docs/docs/stage-08-examples.md +0 -184
  77. package/docs/docs/treasury.md +0 -1149
  78. package/docs/docs/wowok_buildin_info.md +0 -740
  79. package/docs/examples/Insurance/Insurance.md +0 -594
  80. package/docs/examples/Insurance/Insurance_TestResults.md +0 -481
  81. package/docs/examples/Insurance/insurance_complete_guard_v1.json +0 -50
  82. package/docs/examples/MyShop/MyShop.md +0 -1353
  83. package/docs/examples/MyShop/MyShop_TestResults.md +0 -1003
  84. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +0 -1898
  85. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +0 -1297
  86. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +0 -743
  87. package/docs/examples/MyShop_Advanced/machine_nodes.json +0 -222
  88. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +0 -776
  89. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +0 -599
  90. package/docs/examples/Travel/Travel.md +0 -1157
  91. package/docs/examples/Travel/Travel_TestResults.md +0 -743
  92. package/docs/examples/Travel/calc-weather-timestamps.js +0 -8
  93. package/docs/examples/Travel/travel_machine_v2_export.json +0 -104
  94. package/docs/examples/Travel/weather_check_guard_v1.json +0 -51
  95. package/docs/skills/WOWOK.md +0 -650
  96. package/docs/skills/onchain_operations/_common.md +0 -406
  97. package/docs/skills/onchain_operations/_index.md +0 -196
  98. package/docs/skills/onchain_operations/allocation.md +0 -28
  99. package/docs/skills/onchain_operations/arbitration.md +0 -106
  100. package/docs/skills/onchain_operations/contact.md +0 -40
  101. package/docs/skills/onchain_operations/demand.md +0 -53
  102. package/docs/skills/onchain_operations/gen_passport.md +0 -23
  103. package/docs/skills/onchain_operations/guard.md +0 -56
  104. package/docs/skills/onchain_operations/machine.md +0 -89
  105. package/docs/skills/onchain_operations/order.md +0 -56
  106. package/docs/skills/onchain_operations/payment.md +0 -24
  107. package/docs/skills/onchain_operations/permission.md +0 -68
  108. package/docs/skills/onchain_operations/personal.md +0 -58
  109. package/docs/skills/onchain_operations/progress.md +0 -38
  110. package/docs/skills/onchain_operations/repository.md +0 -70
  111. package/docs/skills/onchain_operations/reward.md +0 -38
  112. package/docs/skills/onchain_operations/service.md +0 -78
  113. package/docs/skills/onchain_operations/treasury.md +0 -68
  114. package/docs/skills/schema-account_operation.md +0 -402
  115. package/docs/skills/schema-guard2file.md +0 -153
  116. package/docs/skills/schema-local_info_operation.md +0 -160
  117. package/docs/skills/schema-local_mark_operation.md +0 -148
  118. package/docs/skills/schema-machineNode2file.md +0 -155
  119. package/docs/skills/schema-messenger_operation.md +0 -547
  120. package/docs/skills/schema-onchain_events.md +0 -201
  121. package/docs/skills/schema-onchain_table_data.md +0 -334
  122. package/docs/skills/schema-query_toolkit.md +0 -395
  123. package/docs/skills/schema-wip_file.md +0 -240
  124. package/docs/skills/schema-wowok_buildin_info.md +0 -296
  125. package/docs/wip-examples/three_body.html +0 -57
  126. package/docs/wip-examples/three_body.wip +0 -30
@@ -1,270 +0,0 @@
1
- ## Arbitration State Machine
2
-
3
- The arbitration process follows a strict state machine with defined transitions, time constraints, and financial flows.
4
-
5
- ### State Diagram
6
-
7
- ```mermaid
8
- stateDiagram-v2
9
- [*] --> PrincipalConfirming : create dispute
10
- PrincipalConfirming --> ArbitratorConfirming : principal_confirm
11
- ArbitratorConfirming --> Voting : arbitrator_confirm
12
- Voting --> Arbitrated : arbitration
13
- Arbitrated --> Finished : arb_claim_compensation
14
- Arbitrated --> Objectionable : objection
15
- Objectionable --> PrincipalConfirming : reset
16
-
17
- note right of PrincipalConfirming
18
- Status: PrincipalConfirming
19
- Buyer confirms dispute
20
- end note
21
-
22
- note right of ArbitratorConfirming
23
- Status: ArbitratorConfirming
24
- Arbitrator reviews case
25
- end note
26
-
27
- note right of Voting
28
- Status: Voting
29
- Voting period active
30
- voting_deadline must pass
31
- end note
32
-
33
- note right of Arbitrated
34
- Status: Arbitrated
35
- Ruling issued
36
- indemnity set
37
- end note
38
-
39
- note right of Objectionable
40
- Status: Objectionable
41
- Appeal window open
42
- end note
43
-
44
- note right of Finished
45
- Status: Finished
46
- Compensation transferred
47
- end note
48
- ```
49
-
50
- ### State Descriptions
51
-
52
- | Status | Description | Entry Condition | Exit Actions |
53
- |--------|-------------|-----------------|--------------|
54
- | PrincipalConfirming | Buyer confirms dispute | Dispute created by buyer | Confirm or reject dispute |
55
- | ArbitratorConfirming | Arbitrator reviews case | Buyer confirmed dispute | Arbitrator accepts case |
56
- | Voting | Voting period active | Arbitrator accepted case | Wait for voting_deadline |
57
- | Arbitrated | Ruling issued | voting_deadline passed | Compensation set, can claim |
58
- | Objectionable | Appeal window open | Objection filed | Reset to review or finalize |
59
- | Finished | Process completed | Compensation claimed | Final state |
60
-
61
- ### State Transition Rules
62
-
63
- 1. **PrincipalConfirming**
64
- - Entry: Buyer calls `dispute` to create arbitration
65
- - Exit: Buyer calls `principal_confirm` to proceed or cancel
66
-
67
- 2. **ArbitratorConfirming**
68
- - Entry: Buyer confirmed dispute
69
- - Exit: Arbitrator calls `arbitrator_confirm` to accept case
70
-
71
- 3. **Voting**
72
- - Entry: Arbitrator accepted case
73
- - Constraint: Must wait until `voting_deadline` timestamp passes
74
- - Exit: Arbitrator calls `arbitration` after deadline
75
-
76
- 4. **Arbitrated**
77
- - Entry: Arbitrator issued ruling with `indemnity` amount
78
- - Exit: Buyer calls `arb_claim_compensation` to receive payment, or `objection` to appeal
79
-
80
- 5. **Objectionable**
81
- - Entry: Buyer filed objection within appeal window
82
- - Exit: System resets to PrincipalConfirming for re-review
83
-
84
- 6. **Finished**
85
- - Entry: Compensation successfully transferred to buyer
86
- - Final state - no further transitions
87
-
88
- ---
89
-
90
- ## Financial Flow Diagram
91
-
92
- ```mermaid
93
- flowchart LR
94
- subgraph BuyerAction["Buyer Actions"]
95
- B1[Pay Dispute Fee]
96
- B2[Submit Evidence]
97
- B3[Claim Compensation]
98
- end
99
-
100
- subgraph ArbProcess["Arbitration Process"]
101
- A1[Arb Object<br/>Fee Locked]
102
- A2[Voting Period]
103
- A3[Ruling Issued<br/>Indemnity Set]
104
- end
105
-
106
- subgraph ServiceFund["Service Compensation"]
107
- S1[Compensation Fund]
108
- S2[Deduct Indemnity]
109
- end
110
-
111
- B1 --> A1
112
- A1 --> A2
113
- A2 --> A3
114
- A3 --> S2
115
- S2 --> B3
116
-
117
- style B1 fill:#ffcccc
118
- style B3 fill:#ccffcc
119
- style S2 fill:#ffffcc
120
- ```
121
-
122
- ### Financial Flow Steps
123
-
124
- 1. **Buyer Pays Dispute Fee**
125
- - Amount: Specified in arbitration `fee` parameter
126
- - Destination: Locked in Arb object
127
- - Purpose: Prevents spam disputes, compensates arbitrators
128
-
129
- 2. **Evidence Submission**
130
- - Buyer and service provider submit evidence
131
- - Can use WoWok Messenger for encrypted communication
132
- - Evidence referenced via `feedback` parameter
133
-
134
- 3. **Voting Period**
135
- - Time window for voting on propositions
136
- - Duration controlled by `voting_deadline` parameter
137
- - No financial transactions during this phase
138
-
139
- 4. **Ruling Issued**
140
- - Arbitrator determines `indemnity` amount
141
- - Amount deducted from Service compensation fund
142
- - Ruling recorded on-chain with timestamp
143
-
144
- 5. **Compensation Claimed**
145
- - Buyer receives `indemnity` amount
146
- - Transaction completes arbitration process
147
- - Arb object status changes to Finished (5)
148
-
149
- ---
150
-
151
- ## Evidence Submission Sequence
152
-
153
- ```mermaid
154
- sequenceDiagram
155
- participant Buyer as Buyer
156
- participant Messenger as WoWok Messenger
157
- participant Arb as Arb Object
158
- participant Arbitrator as Arbitrator
159
-
160
- Buyer->>Messenger: Send encrypted evidence
161
- Messenger-->>Buyer: Return message hash
162
- Buyer->>Arb: dispute(feedback=hash)
163
- Arb-->>Buyer: Dispute created (Status 0)
164
-
165
- Buyer->>Arb: principal_confirm(true)
166
- Arb-->>Arb: Status 0→1
167
-
168
- Arbitrator->>Arb: arbitrator_confirm()
169
- Arb-->>Arb: Status 1→2
170
-
171
- Note over Arb: Wait for voting_deadline
172
-
173
- Arbitrator->>Arb: arbitration(feedback, indemnity)
174
- Arb-->>Arb: Status 2→3<br/>Indemnity locked
175
-
176
- Buyer->>Arb: arb_claim_compensation()
177
- Arb-->>Buyer: Transfer indemnity
178
- Arb-->>Arb: Status 3→5
179
- ```
180
-
181
- ### Evidence Submission Methods
182
-
183
- | Method | Description | Use Case |
184
- |--------|-------------|----------|
185
- | **Plain Text** | Direct string in `feedback` parameter | Simple disputes, public resolution |
186
- | **IPFS Hash** | Content-addressed storage reference | Large files, documents, images |
187
- | **WoWok Messenger** | Encrypted on-chain messaging | Sensitive information, private disputes |
188
- | **External Link** | URL with verification hash | Third-party evidence, timestamps |
189
-
190
- ---
191
-
192
- ## Time Constraints
193
-
194
- ```mermaid
195
- gantt
196
- title Arbitration Timeline Example
197
- dateFormat X
198
- axisFormat %s
199
-
200
- section Dispute
201
- Create Dispute :a1, 0, 1s
202
- Principal Confirm :a2, after a1, 1s
203
- Arbitrator Confirm :a3, after a2, 1s
204
-
205
- section Voting
206
- Voting Period :crit, a4, after a3, 10s
207
-
208
- section Ruling
209
- Issue Arbitration :a5, after a4, 1s
210
- Claim Compensation :a6, after a5, 5s
211
-
212
- section Complete
213
- Finished :milestone, after a6, 0s
214
- ```
215
-
216
- ### Time Parameter Guidelines
217
-
218
- | Parameter | Typical Value | Minimum | Purpose |
219
- |-----------|---------------|---------|---------|
220
- | `voting_deadline` | 7 days | 10 seconds | Allow time for evidence review |
221
- | Appeal window | 3 days | 1 hour | Time to file objections |
222
- | Evidence submission | Before voting_deadline | - | Ensure evidence is available |
223
-
224
- ---
225
-
226
- ## Permission Requirements by State
227
-
228
- ```mermaid
229
- flowchart TB
230
- subgraph State0["Status 0: PrincipalConfirming"]
231
- P0[principal_confirm] -->|Buyer| C0{Confirm?}
232
- C0 -->|true| S1[Status 1]
233
- C0 -->|false| Cancel[Cancel Dispute]
234
- end
235
-
236
- subgraph State1["Status 1: ArbitratorConfirming"]
237
- P1[arbitrator_confirm] -->|Arbitrator| S2[Status 2]
238
- end
239
-
240
- subgraph State2["Status 2: Voting"]
241
- P2[arbitration] -->|Arbitrator +<br/>voting_deadline passed| S3[Status 3]
242
- end
243
-
244
- subgraph State3["Status 3: Arbitrated"]
245
- P3a[arb_claim_compensation] -->|Buyer| S5[Status 5]
246
- P3b[objection] -->|Buyer| S4[Status 4]
247
- end
248
-
249
- subgraph State4["Status 4: Objectionable"]
250
- P4[reset] -->|System| S0[Status 0]
251
- end
252
-
253
- S1 --> State1
254
- S2 --> State2
255
- S3 --> State3
256
- S4 --> State4
257
- S5 --> Finished[Finished]
258
- ```
259
-
260
- ### Permission Matrix
261
-
262
- | Operation | Status Required | Actor | Additional Requirements |
263
- |-----------|-----------------|-------|------------------------|
264
- | `dispute` | - | Buyer | Order owner, arbitration unpaused |
265
- | `principal_confirm` | 0 | Buyer | Must be dispute initiator |
266
- | `arbitrator_confirm` | 1 | Arbitrator | Must be designated arbitrator |
267
- | `arbitration` | 2 | Arbitrator | `voting_deadline` must pass |
268
- | `arb_claim_compensation` | 3 | Buyer | Order owner, indemnity > 0 |
269
- | `objection` | 3 | Buyer | Within appeal window |
270
- | `reset` | 4 | System | Automatic on objection |