@wowok/agent-mcp 2.2.13 → 2.2.15

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/README.md +19 -11
  2. package/dist/index.js +44 -100
  3. package/dist/schema/query/index.js +1 -1
  4. package/dist/schema-query/index.d.ts +29 -0
  5. package/dist/schema-query/index.js +149 -0
  6. package/dist/schemas/account_operation.schema.json +255 -0
  7. package/dist/schemas/guard2file.schema.json +71 -0
  8. package/dist/schemas/index.json +139 -0
  9. package/dist/schemas/local_info_operation.schema.json +142 -0
  10. package/dist/schemas/local_mark_operation.schema.json +119 -0
  11. package/dist/schemas/machineNode2file.schema.json +71 -0
  12. package/dist/schemas/messenger_operation.schema.json +1393 -0
  13. package/dist/schemas/onchain_events.schema.json +113 -0
  14. package/dist/schemas/onchain_operations.schema.json +376 -0
  15. package/dist/schemas/onchain_operations_allocation.schema.json +914 -0
  16. package/dist/schemas/onchain_operations_arbitration.schema.json +1166 -0
  17. package/dist/schemas/onchain_operations_contact.schema.json +853 -0
  18. package/dist/schemas/onchain_operations_demand.schema.json +984 -0
  19. package/dist/schemas/onchain_operations_gen_passport.schema.json +1141 -0
  20. package/dist/schemas/onchain_operations_guard.schema.json +713 -0
  21. package/dist/schemas/onchain_operations_machine.schema.json +1347 -0
  22. package/dist/schemas/onchain_operations_order.schema.json +830 -0
  23. package/dist/schemas/onchain_operations_payment.schema.json +717 -0
  24. package/dist/schemas/onchain_operations_permission.schema.json +1088 -0
  25. package/dist/schemas/onchain_operations_personal.schema.json +1282 -0
  26. package/dist/schemas/onchain_operations_progress.schema.json +751 -0
  27. package/dist/schemas/onchain_operations_repository.schema.json +1572 -0
  28. package/dist/schemas/onchain_operations_reward.schema.json +955 -0
  29. package/dist/schemas/onchain_operations_service.schema.json +1411 -0
  30. package/dist/schemas/onchain_operations_treasury.schema.json +1155 -0
  31. package/dist/schemas/onchain_table_data.schema.json +35 -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,467 +0,0 @@
1
- # WatchQuery Component (🔍 Data Query)
2
-
3
- ---
4
-
5
- ## Component Overview
6
-
7
- The WatchQuery component (`query_toolkit`) is WoWok's core data query tool. It queries both **LOCAL** data (stored only on your device, never published to blockchain) and **ONCHAIN** data (published on the blockchain). Supports 9 query types across accounts, balances, objects, profiles, and received assets.
8
-
9
- **LOCAL queries** (device-only): `local_mark_list` | `account_list` | `local_info_list` | `token_list` | `account_balance` | `local_names`
10
-
11
- **ONCHAIN queries** (blockchain): `onchain_personal_profile` | `onchain_objects` | `onchain_received`
12
-
13
- Use local queries for account management and address book lookups. Use onchain queries for blockchain data exploration, user profiles, object inspection, and payment tracking.
14
-
15
- > **Note**: Dynamic table data queries (`onchain_table`, `onchain_table_item_*`) have been moved to the dedicated **[onchain_table_data](query.md#onchain_table_data-tool)** tool. See the [onchain_table_data section](#onchain_table_data-tool) below for details.
16
-
17
- ---
18
-
19
- ## Function List
20
-
21
- | # | query_type | Description | Returns |
22
- |---|-----------|-------------|---------|
23
- | 1 | `local_mark_list` | Query your LOCAL address book — maps human-readable names to blockchain addresses with optional tags. Use to resolve names→addresses or find addresses by tag. | `MarkData[]` (name, address, tags, timestamps) |
24
- | 2 | `account_list` | Query your LOCAL accounts — view all accounts stored on this device (addresses, public keys, messenger status, suspension state). Use to discover available accounts before operations. | `AccountData[]` (name, address, pubkey, suspended, messenger, timestamps) |
25
- | 3 | `local_info_list` | Query your LOCAL private info — sensitive data like delivery addresses, phone numbers, contacts stored ONLY on this device. Use to retrieve saved contact/delivery details. | `InfoData[]` (name, default value, contents, timestamps) |
26
- | 4 | `token_list` | Query cached token metadata — symbol, decimals, icon URL, description for tokens previously fetched from chain. Use to look up token info without an on-chain query. | `TokenTypeInfo[]` (type, alias, name, symbol, decimals, iconUrl) |
27
- | 5 | `account_balance` | Query an account's coin balance OR paginated coin objects. Use `balance=true` for total amount, or `coin={cursor,limit}` to list individual coin objects. | `{ address, balance? \| coin? }` |
28
- | 6 | `local_names` | Query local names by blockchain addresses — resolves addresses back to human-readable names. Use to find account/service names from their address. | `Record<string, string>` (address → name mapping) |
29
- | 6a | `onchain_personal_profile` | Query any user's PUBLIC on-chain profile — social links, reputation (likes/dislikes), personal info records, voting history, referrer. Use to look up a user's public identity and reputation. | `ObjectPersonal \| undefined` |
30
- | 7 | `onchain_objects` | Batch query on-chain WOWOK objects by ID — supports Service, Machine, Order, Treasury, Reward, Arb, Personal, Contact, and more. Use to inspect one or more objects in a single call. | `{ objects: ObjectBase[] }` |
31
- | 8 | `onchain_received` | Query objects (payments, tokens, NFTs) received by an on-chain object. Use to track incoming payments or items sent to an on-chain object. Supports pagination and all_type filter. | `ReceivedBalance \| ReceivedNormal[]` |
32
-
33
- ---
34
-
35
- ## Schema Tree
36
-
37
- ```
38
- query_toolkit (Query Operations)
39
- ├── query_type (discriminator, required)
40
- │ ├── "local_mark_list"
41
- │ │ └── filter (optional, LocalMarkFilter)
42
- │ ├── "account_list"
43
- │ │ └── filter (optional, AccountFilter)
44
- │ ├── "local_info_list"
45
- │ │ └── filter (optional, LocalInfoFilter)
46
- │ ├── "token_list"
47
- │ │ └── filter (optional, TokenDataFilter)
48
- │ ├── "account_balance"
49
- │ │ ├── name_or_address (optional, NameOrAddress)
50
- │ │ ├── balance (optional, boolean)
51
- │ │ ├── coin (optional, { cursor?, limit? })
52
- │ │ ├── token_type (optional, TokenType)
53
- │ │ └── network (optional, "localnet" | "testnet")
54
- │ ├── "onchain_personal_profile"
55
- │ │ ├── account (optional, NameOrAddress)
56
- │ │ ├── no_cache (optional, boolean)
57
- │ │ └── network (optional, "localnet" | "testnet")
58
- │ ├── "local_names"
59
- │ │ └── addresses (required, string[])
60
- │ ├── "onchain_objects"
61
- │ │ ├── objects (required, NameOrAddress[])
62
- │ │ ├── no_cache (optional, boolean)
63
- │ │ └── network (optional, "localnet" | "testnet")
64
- │ └── "onchain_received"
65
- │ ├── name_or_address (required, AccountOrMark_Address)
66
- │ ├── all_type (optional, boolean) — Set to true to query all token types; defaults to the object's Token type '0x2::payment::CoinWrapper<TOKEN>' (Coins wrapper sent via Payment). Fails if object has no Token type.
67
- │ ├── cursor (optional, string | null)
68
- │ ├── limit (optional, number | null)
69
- │ ├── no_cache (optional, boolean)
70
- │ └── network (optional, "localnet" | "testnet")
71
- └── (no other top-level fields)
72
- ```
73
-
74
- ---
75
-
76
- ## Common Parameters
77
-
78
- | Parameter | Type | Applies To | Description |
79
- |-----------|------|-----------|-------------|
80
- | `no_cache` | `boolean` (optional) | All onchain queries | Set to `true` to bypass cache and fetch fresh on-chain data |
81
- | `network` | `"localnet" \| "testnet"` (optional) | All onchain + account_balance | Network to query; defaults to the configured default network |
82
- | `cursor` | `string \| null` (optional) | onchain_received, account_balance.coin | Pagination cursor from previous page's `nextCursor` |
83
- | `limit` | `number \| null` (optional) | onchain_received, account_balance.coin | Max items per page for paginated results |
84
-
85
- ---
86
-
87
- ## Example 1: Query Local Mark List
88
-
89
- ### 📝 Natural Language Prompt
90
-
91
- Please help me query my local mark list, filtering for marks tagged with 'friend'.
92
-
93
- ### 📋 Generated Function JSON
94
-
95
- ```json
96
- {
97
- "query_type": "local_mark_list",
98
- "filter": {
99
- "tags": ["friend"]
100
- }
101
- }
102
- ```
103
-
104
- ---
105
-
106
- ## Example 2: Query Account List
107
-
108
- ### 📝 Natural Language Prompt
109
-
110
- Please help me query all my local accounts.
111
-
112
- ### 📋 Generated Function JSON
113
-
114
- ```json
115
- {
116
- "query_type": "account_list"
117
- }
118
- ```
119
-
120
- ---
121
-
122
- ## Example 3: Query Local Info List
123
-
124
- ### 📝 Natural Language Prompt
125
-
126
- Please help me query all my locally saved information entries.
127
-
128
- ### 📋 Generated Function JSON
129
-
130
- ```json
131
- {
132
- "query_type": "local_info_list"
133
- }
134
- ```
135
-
136
- ---
137
-
138
- ## Example 4: Query Token List
139
-
140
- ### 📝 Natural Language Prompt
141
-
142
- Please help me query the list of available token types.
143
-
144
- ### 📋 Generated Function JSON
145
-
146
- ```json
147
- {
148
- "query_type": "token_list"
149
- }
150
- ```
151
-
152
- ---
153
-
154
- ## Example 5: Query Account Balance (Total)
155
-
156
- ### 📝 Natural Language Prompt
157
-
158
- Please help me query the WOW token balance for my account named 'alice'.
159
-
160
- ### 📋 Generated Function JSON
161
-
162
- ```json
163
- {
164
- "query_type": "account_balance",
165
- "name_or_address": "alice",
166
- "balance": true,
167
- "token_type": "0x2::wow::WOW"
168
- }
169
- ```
170
-
171
- ---
172
-
173
- ## Example 5b: Query Account Coin Objects (Paginated)
174
-
175
- ### 📝 Natural Language Prompt
176
-
177
- Please help me list the individual WOW coin objects for my default account, first page.
178
-
179
- ### 📋 Generated Function JSON
180
-
181
- ```json
182
- {
183
- "query_type": "account_balance",
184
- "name_or_address": "",
185
- "coin": {
186
- "cursor": null,
187
- "limit": 10
188
- },
189
- "token_type": "0x2::wow::WOW"
190
- }
191
- ```
192
-
193
- ---
194
-
195
- ## Example 6: Query Personal Profile
196
-
197
- ### 📝 Natural Language Prompt
198
-
199
- Please help me query the public on-chain personal profile for the account named 'bob' on testnet, bypassing cache.
200
-
201
- ### 📋 Generated Function JSON
202
-
203
- ```json
204
- {
205
- "query_type": "onchain_personal_profile",
206
- "account": "bob",
207
- "no_cache": true,
208
- "network": "testnet"
209
- }
210
- ```
211
-
212
- ---
213
-
214
- ## Example 7: Query Multiple Objects
215
-
216
- ### 📝 Natural Language Prompt
217
-
218
- Please help me query the on-chain objects with IDs 'service_marketplace' and 'treasury_main'.
219
-
220
- ### 📋 Generated Function JSON
221
-
222
- ```json
223
- {
224
- "query_type": "onchain_objects",
225
- "objects": ["service_marketplace", "treasury_main"]
226
- }
227
- ```
228
-
229
- ---
230
-
231
- ## Example 8: Query Received Objects
232
-
233
- ### 📝 Natural Language Prompt
234
-
235
- Please help me query all types of received objects for the treasury 'service_wallet', first page with 50 items.
236
-
237
- ### 📋 Generated Function JSON
238
-
239
- ```json
240
- {
241
- "query_type": "onchain_received",
242
- "name_or_address": "service_wallet",
243
- "all_type": true,
244
- "cursor": null,
245
- "limit": 50
246
- }
247
- ```
248
-
249
- ---
250
-
251
- ## Best Practices
252
-
253
- ### 1. Use Filters Reasonably
254
- Use filters to narrow query scope and improve efficiency. Local queries support `name`, `address`, `tags`, `createdAt`, `updatedAt` filters.
255
-
256
- ### 2. Batch Query Objects
257
- Use `onchain_objects` to query multiple objects at once, reducing network requests.
258
-
259
- ### 3. Use Pagination for Large Results
260
- For `onchain_received` and `account_balance.coin`, use `cursor`/`limit` to paginate through large result sets. For table queries, use the `onchain_table_data` tool which also supports pagination.
261
-
262
- ### 4. Control Cache with no_cache
263
- Set `no_cache: true` when you need the latest on-chain data. Leave it unset (default) for faster cached responses.
264
-
265
- ### 5. Specify Network Explicitly
266
- Always specify `network` when you need results from a specific network (`localnet` or `testnet`).
267
-
268
- ### 6. Query Balance vs Coin Objects
269
- Use `balance: true` for a quick total balance check. Use `coin: { cursor, limit }` when you need to inspect individual coin objects.
270
-
271
- ---
272
-
273
- ## Important Notes
274
-
275
- ⚠️ **On-chain queries require network connection!**
276
-
277
- ⚠️ **Local queries are only on local device — data is NEVER published to blockchain!**
278
-
279
- ⚠️ **Querying large amounts of data may take longer — use pagination!**
280
-
281
- ⚠️ **`no_cache: true` fetches fresh data but is slower than cached queries!**
282
-
283
- ---
284
-
285
- ## onchain_table_data Tool
286
-
287
- The `onchain_table_data` tool is a dedicated tool for querying dynamic table data of on-chain objects. It was split from `query_toolkit` to handle the unique characteristics of dynamic table queries — objects have fixed size, but their table data can grow dynamically.
288
-
289
- ### Why a Separate Tool?
290
-
291
- - **Different data model**: Table queries operate on dynamic fields (key-value stores) attached to objects, not the objects themselves
292
- - **Parent-child relationships**: Each table item belongs to a specific parent object type with well-defined semantics
293
- - **Independent pagination**: Table queries have their own cursor/limit pagination separate from object queries
294
-
295
- ### Supported Query Types (11 total)
296
-
297
- | # | query_type | Parent Object | Key | Meaning |
298
- |---|-----------|--------------|-----|---------|
299
- | 1 | `onchain_table` | Any object | — | Paginated query of ANY object's dynamic fields table. Returns all entries with keys, types, and object IDs. Use to explore all sub-items of an object. |
300
- | 2 | `onchain_table_item_repository_data` | Repository | name + entity (address or number) | Query a record from a Repository's on-chain key-value database. Returns the stored data record with typed value. |
301
- | 3 | `onchain_table_item_permission_perm` | Permission | user address or Guard ID | Query a permission entry from a Permission object's access control table. Returns the permission list (perm[]) granted to that user/guard. |
302
- | 4 | `onchain_table_item_entity_registrar` | System EntityRegistrar | user address | Query an entity's registration record from the GLOBAL EntityRegistrar. Returns registration info: description, referrer, records, mark_object. |
303
- | 5 | `onchain_table_item_entity_linker` | System EntityLinker | entity address | Query community votes/endorsements for an entity from the GLOBAL EntityLinker. Returns vote records (likes/dislikes) showing community trust. |
304
- | 6 | `onchain_table_item_reward_record` | Reward | recipient address | Query a reward claim record from a Reward object's distribution table. Returns claim history: guard used, total claimed, per-claim details. |
305
- | 7 | `onchain_table_item_demand_presenter` | Demand | presenter address | Query a demand submission from a Demand object's presenter table. Returns submission details: recommendation, service, feedback, acceptance score. |
306
- | 8 | `onchain_table_item_treasury_history` | Treasury | payment ID (address) | Query a payment record from a Treasury's history table. Returns payment details: operation type, signer, amount, external guard. |
307
- | 9 | `onchain_table_item_machine_node` | Machine | node name (string) | Query a workflow node definition from a Machine object's node table. Returns node configuration: pairs, forwards, guards, thresholds. |
308
- | 10 | `onchain_table_item_progress_history` | Progress | sequence number (u64) | Query a progress step record from a Progress object's history table. Returns step details: node, next_node, session state, time. |
309
- | 11 | `onchain_table_item_address_mark` | AddressMark | address | Query a PUBLIC on-chain name/tag mark from an AddressMark object's table. Unlike local marks, these are published on-chain. Returns public labels: entity, name, tags[]. |
310
- | 12 | `onchain_table_item_generic` | Generic | key_type + key_value | Query a generic record by key from any object's on-chain data table. Use when the object type is unknown or unsupported. Returns the raw table item with typed key and object reference. |
311
-
312
- ### Schema Tree
313
-
314
- ```
315
- onchain_table_data (Table Data Query)
316
- ├── query_type (discriminator, required)
317
- │ ├── "onchain_table"
318
- │ │ ├── parent (required, NameOrAddress)
319
- │ │ ├── cursor (optional, string | null)
320
- │ │ ├── limit (optional, number | null)
321
- │ │ ├── no_cache (optional, boolean)
322
- │ │ └── network (optional, "localnet" | "testnet")
323
- │ ├── "onchain_table_item_repository_data"
324
- │ │ ├── parent (required, NameOrAddress)
325
- │ │ ├── name (required, string)
326
- │ │ ├── entity (required, Address | number)
327
- │ │ ├── no_cache (optional, boolean)
328
- │ │ └── network (optional, "localnet" | "testnet")
329
- │ ├── "onchain_table_item_permission_perm"
330
- │ │ ├── parent (required, NameOrAddress)
331
- │ │ ├── address (required, Address | string)
332
- │ │ ├── no_cache (optional, boolean)
333
- │ │ └── network (optional, "localnet" | "testnet")
334
- │ ├── "onchain_table_item_entity_registrar"
335
- │ │ ├── address (required, Address | string)
336
- │ │ ├── no_cache (optional, boolean)
337
- │ │ └── network (optional, "localnet" | "testnet")
338
- │ ├── "onchain_table_item_entity_linker"
339
- │ │ ├── address (required, Address | string)
340
- │ │ ├── no_cache (optional, boolean)
341
- │ │ └── network (optional, "localnet" | "testnet")
342
- │ ├── "onchain_table_item_reward_record"
343
- │ │ ├── parent (required, NameOrAddress)
344
- │ │ ├── address (required, Address)
345
- │ │ ├── no_cache (optional, boolean)
346
- │ │ └── network (optional, "localnet" | "testnet")
347
- │ ├── "onchain_table_item_demand_presenter"
348
- │ │ ├── parent (required, NameOrAddress)
349
- │ │ ├── address (required, Address)
350
- │ │ ├── no_cache (optional, boolean)
351
- │ │ └── network (optional, "localnet" | "testnet")
352
- │ ├── "onchain_table_item_treasury_history"
353
- │ │ ├── parent (required, NameOrAddress)
354
- │ │ ├── address (required, Address)
355
- │ │ ├── no_cache (optional, boolean)
356
- │ │ └── network (optional, "localnet" | "testnet")
357
- │ ├── "onchain_table_item_machine_node"
358
- │ │ ├── parent (required, NameOrAddress)
359
- │ │ ├── key (required, string)
360
- │ │ ├── no_cache (optional, boolean)
361
- │ │ └── network (optional, "localnet" | "testnet")
362
- │ ├── "onchain_table_item_progress_history"
363
- │ │ ├── parent (required, NameOrAddress)
364
- │ │ ├── u64 (required, number | string)
365
- │ │ ├── no_cache (optional, boolean)
366
- │ │ └── network (optional, "localnet" | "testnet")
367
- │ ├── "onchain_table_item_address_mark"
368
- │ ├── parent (required, NameOrAddress)
369
- │ ├── address (required, Address)
370
- │ ├── no_cache (optional, boolean)
371
- │ └── network (optional, "localnet" | "testnet")
372
- │ └── "onchain_table_item_generic"
373
- │ ├── parent (required, NameOrAddress)
374
- │ ├── key_type (required, string)
375
- │ └── key_value (required, any)
376
- ```
377
-
378
- ### Output Schema
379
-
380
- All queries return results wrapped in a unified `z.object({ result: ... })` structure:
381
-
382
- ```typescript
383
- OnchainTableDataResult {
384
- result: {
385
- query_type: string; // Echoes the requested query_type
386
- result: TableAnswer | TableItem_* | undefined; // Query-specific result
387
- }
388
- }
389
- ```
390
-
391
- ### Examples
392
-
393
- #### Example: Query Table Data (Paginated)
394
-
395
- ```json
396
- {
397
- "query_type": "onchain_table",
398
- "parent": "my_service",
399
- "cursor": null,
400
- "limit": 20
401
- }
402
- ```
403
-
404
- #### Example: Query Permission Perm Item
405
-
406
- ```json
407
- {
408
- "query_type": "onchain_table_item_permission_perm",
409
- "parent": "perm_admin",
410
- "address": "alice"
411
- }
412
- ```
413
-
414
- #### Example: Query Repository Data Item
415
-
416
- ```json
417
- {
418
- "query_type": "onchain_table_item_repository_data",
419
- "parent": "repo_main",
420
- "name": "user_settings",
421
- "entity": "alice"
422
- }
423
- ```
424
-
425
- #### Example: Query Entity Registrar Item
426
-
427
- ```json
428
- {
429
- "query_type": "onchain_table_item_entity_registrar",
430
- "address": "service_provider"
431
- }
432
- ```
433
-
434
- #### Example: Query Machine Node Item
435
-
436
- ```json
437
- {
438
- "query_type": "onchain_table_item_machine_node",
439
- "parent": "workflow_v1",
440
- "key": "validation_step"
441
- }
442
- ```
443
-
444
- #### Example: Query Progress History Item
445
-
446
- ```json
447
- {
448
- "query_type": "onchain_table_item_progress_history",
449
- "parent": "order_456",
450
- "u64": 1
451
- }
452
- ```
453
-
454
- ---
455
-
456
- ## Related Components
457
-
458
- | Component | Description |
459
- |-----------|-------------|
460
- | **[Account](account.md)** | Local wallet management |
461
- | **[LocalMark](localmark.md)** | User/Object naming and categorization |
462
- | **[LocalInfo](localinfo.md)** | Private information management |
463
- | **[Personal](personal.md)** | Personal on-chain portal |
464
- | **[On-chain Events](onchain_events.md)** | Watch and query on-chain events |
465
- | **[WoWok Build-in Info](wowok_buildin_info.md)** | Query protocol constants and info |
466
- | **[Schema: query_toolkit](../skills/schema-query_toolkit.md)** | query_toolkit input/output schema reference |
467
- | **[Schema: onchain_table_data](../skills/schema-onchain_table_data.md)** | onchain_table_data input/output schema reference |