@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,1438 +0,0 @@
1
-
2
- # Permission Component (🔑 Permission Management)
3
-
4
- ---
5
-
6
- ## Component Overview
7
-
8
- The Permission component is used to manage access control permissions for WoWok objects. Through the Permission object, you can define who (entities) can perform which operations (permission indexes), making it the core of the WoWok permission system.
9
-
10
- ---
11
-
12
- ## Object Type Permission Range Overview
13
-
14
- **Note**: Use the `wowok_buildin_info` tool to view all built-in permission numbers and their detailed descriptions.
15
-
16
- WoWok organizes built-in permissions by object type. Each object type has a dedicated permission index range:
17
-
18
- | Object Type | Permission Range | Description | Permission Count |
19
- |-------------|-------------------|-------------|------------------|
20
- | **Repository** | 100-109 | Consensus data storage repositories for storing shared state data | 6 |
21
- | **Reward** | 150-159 | Incentive pools for distributing rewards and bonuses | 8 |
22
- | **Machine** | 200-209 | Workflow templates defining automated service delivery processes | 9 |
23
- | **Progress** | 220-229 | Active workflow executions (instances of Machine templates) | 6 |
24
- | **Treasury** | 250-260 | Team funds management for holding and distributing team assets | 11 |
25
- | **Service** | 300-320 | Service marketplace listings for offering and selling services | 21 |
26
- | **Arbitration** | 350-368 | Dispute resolution system for resolving service conflicts | 19 |
27
- | **Demand** | 400-408 | Service requests for seeking service providers | 9 |
28
- | **Contact** | 450-454 | Encrypted messenger for secure communication | 5 |
29
- | **User-defined** | 1000-65535 | Custom permissions for your specific business needs | 64536 |
30
-
31
- ### Detailed Permission Index List
32
-
33
- All built-in permissions are listed below:
34
-
35
- | Index | Object Type | Name | Description |
36
- |-------|-------------|------|-------------|
37
- | **100** | Repository | REPOSITORY_NEW | Create new Repository object |
38
- | **101** | Repository | REPOSITORY_DESCRIPTION | Set Repository description |
39
- | **102** | Repository | REPOSITORY_POLICY | Manage Repository policies |
40
- | **103** | Repository | REPOSITORY_REWARD | Manage Repository rewards |
41
- | **104** | Repository | REPOSITORY_OWNER_RECEIVE | Receive objects/payments for Repository |
42
- | **105** | Repository | REPOSITORY_UM | Manage Repository UM (User Manager) |
43
- | **150** | Reward | REWARD_NEW | Create new Reward object |
44
- | **151** | Reward | REWARD_DESCRIPTION | Set Reward description |
45
- | **152** | Reward | REWARD_GUARD | Manage Reward guards |
46
- | **153** | Reward | REWARD_COIN_ADD | Add coin to Reward |
47
- | **154** | Reward | REWARD_RECEIVE | Receive payment for Reward |
48
- | **155** | Reward | REWARD_GUARD_EXPIRATION_TIME_ADD | Add guard expiration time |
49
- | **156** | Reward | REWARD_OWNER_RECEIVE | Receive objects/payments for Reward |
50
- | **157** | Reward | REWARD_UM | Manage Reward UM (User Manager) |
51
- | **200** | Machine | MACHINE_NEW | Create new Machine object |
52
- | **201** | Machine | MACHINE_DESCRIPTION | Set Machine description |
53
- | **203** | Machine | MACHINE_CONSENSUS_REPOSITORIES | Manage Machine consensus repositories |
54
- | **204** | Machine | MACHINE_PAUSE | Pause or resume Machine |
55
- | **205** | Machine | MACHINE_PUBLISH | Publish Machine |
56
- | **206** | Machine | MACHINE_NODE | Manage Machine nodes |
57
- | **207** | Machine | MACHINE_OWNER_RECEIVE | Receive objects/payments for Machine |
58
- | **208** | Machine | MACHINE_UM | Manage Machine UM (User Manager) |
59
- | **220** | Progress | PROGRESS_NEW | Create new Progress object |
60
- | **221** | Progress | PROGRESS_NAMED_OPERATOR | Manage Progress named operators |
61
- | **222** | Progress | PROGRESS_TASK | Set Progress task |
62
- | **223** | Progress | PROGRESS_CONTEXT_REPOSITORY | Manage Progress context repositories |
63
- | **224** | Progress | PROGRESS_UNHOLD | Unhold Progress |
64
- | **225** | Progress | PROGRESS_OWNER_RECEIVE | Receive objects/payments for Progress |
65
- | **250** | Treasury | TREASURY_NEW | Create new Treasury object |
66
- | **251** | Treasury | TREASURY_DESCRIPTION | Set Treasury description |
67
- | **252** | Treasury | TREASURY_DEPOSIT | Deposit coins to Treasury |
68
- | **253** | Treasury | TREASURY_RECEIVE | Receive payment for Treasury |
69
- | **254** | Treasury | TREASURY_WITHDRAW | Withdraw coins from Treasury |
70
- | **255** | Treasury | TREASURY_EXTERNAL_DEPOSIT | External deposit to Treasury |
71
- | **256** | Treasury | TREASURY_EXTERNAL_WITHDRAW | External withdraw from Treasury |
72
- | **257** | Treasury | TREASURY_EXTERNAL_DEPOSIT_GUARD | Manage external deposit guards |
73
- | **258** | Treasury | TREASURY_EXTERNAL_WITHDRAW_GUARD | Manage external withdraw guards |
74
- | **259** | Treasury | TREASURY_OWNER_RECEIVE | Receive objects/payments for Treasury |
75
- | **260** | Treasury | TREASURY_UM | Manage Treasury UM (User Manager) |
76
- | **300** | Service | SERVICE_NEW | Create new Service object |
77
- | **301** | Service | SERVICE_DESCRIPTION | Set Service description |
78
- | **303** | Service | SERVICE_LOCATION | Set Service location |
79
- | **304** | Service | SERVICE_REPOSITORY | Manage Service repositories |
80
- | **305** | Service | SERVICE_SALES | Manage Service sales |
81
- | **306** | Service | SERVICE_MACHINE | Manage Service machines |
82
- | **307** | Service | SERVICE_BUY_GUARD | Manage Service buy guards |
83
- | **308** | Service | SERVICE_ARBITRATION | Manage Service arbitrations |
84
- | **309** | Service | SERVICE_CUSTOMER_INFO_REQUIRED | Manage customer info requirements |
85
- | **310** | Service | SERVICE_PAUSE | Pause or resume Service |
86
- | **311** | Service | SERVICE_PUBLISH | Publish Service |
87
- | **312** | Service | SERVICE_DISCOUNT | Manage Service discounts |
88
- | **313** | Service | SERVICE_ORDER_ALLOCATOR | Manage Service order allocators |
89
- | **314** | Service | SERVICE_COMPENSATION_FUND_WITHDRAW | Withdraw from compensation fund |
90
- | **315** | Service | SERVICE_COMPENSATION_FUND_DEPOSIT | Deposit to compensation fund |
91
- | **316** | Service | SERVICE_COMPENSATION_FUND_RECEIVE | Receive payments for compensation fund |
92
- | **317** | Service | SERVICE_COMPENSATION_LOCKED_TIME_ADD | Add locked time to compensation |
93
- | **318** | Service | SERVICE_REWARD | Manage Service rewards |
94
- | **319** | Service | SERVICE_OWNER_RECEIVE | Receive objects/payments for Service |
95
- | **320** | Service | SERVICE_UM | Manage Service UM (User Manager) |
96
- | **350** | Arbitration | ARBITRATION_NEW | Create new Arbitration object |
97
- | **351** | Arbitration | ARBITRATION_DESCRIPTION | Set Arbitration description |
98
- | **353** | Arbitration | ARBITRATION_LOCATION | Set Arbitration location |
99
- | **354** | Arbitration | ARBITRATION_VOTING_GUARD | Manage voting guards |
100
- | **355** | Arbitration | ARBITRATION_USAGE_GUARD | Set usage guard |
101
- | **356** | Arbitration | ARBITRATION_PAUSE | Pause or resume Arbitration |
102
- | **357** | Arbitration | ARBITRATION_FEE | Set Arbitration fee |
103
- | **358** | Arbitration | ARBITRATION_VOTE | Vote on Arbitration |
104
- | **359** | Arbitration | ARBITRATION_ARBITRATION | Perform Arbitration |
105
- | **360** | Arbitration | ARBITRATION_FEEDBACK | Provide Arbitration feedback |
106
- | **361** | Arbitration | ARBITRATION_CONFIRM | Confirm Arbitration |
107
- | **362** | Arbitration | ARBITRATION_VOTING_DEADLINE_CHANGE | Change voting deadline |
108
- | **363** | Arbitration | ARBITRATION_RESET | Reset Arbitration |
109
- | **364** | Arbitration | ARBITRATION_ARB_WITHDRAW | Withdraw Arbitration |
110
- | **365** | Arbitration | ARBITRATION_FEES_ALLOC | Allocate Arbitration fees |
111
- | **366** | Arbitration | ARBITRATION_FEES_TRANSFER | Transfer Arbitration fees |
112
- | **367** | Arbitration | ARBITRATION_OWNER_RECEIVE | Receive objects/payments for Arbitration |
113
- | **368** | Arbitration | ARBITRATION_UM | Manage Arbitration UM (User Manager) |
114
- | **400** | Demand | DEMAND_NEW | Create new Demand object |
115
- | **401** | Demand | DEMAND_DESCRIPTION | Set Demand description |
116
- | **402** | Demand | DEMAND_LOCATION | Set Demand location |
117
- | **404** | Demand | DEMAND_GUARD | Manage Demand guards |
118
- | **405** | Demand | DEMAND_REWARD | Manage Demand rewards |
119
- | **406** | Demand | DEMAND_FEEDBACK | Provide Demand feedback |
120
- | **407** | Demand | DEMAND_OWNER_RECEIVE | Receive objects for Demand |
121
- | **408** | Demand | DEMAND_UM | Manage Demand UM (User Manager) |
122
- | **450** | Contact | MESSNGER_NEW | Create new Messenger (Contact) object |
123
- | **451** | Contact | MESSNGER_DESCRIPTION | Set Messenger description |
124
- | **452** | Contact | MESSNGER_LOCATION | Set Messenger location |
125
- | **453** | Contact | MESSNGER_IM | Manage IM address |
126
- | **454** | Contact | MESSNGER_OWNER_RECEIVE | Receive objects/payments for Messenger |
127
- | **1000+** | User-defined | Custom | Custom business permissions defined by you |
128
-
129
- ---
130
-
131
- ## Function List
132
-
133
- | Function Name | Purpose | Usage Scenario | Significance |
134
- |---------------|---------|----------------|-------------|
135
- | **Create Permission** | Establish new permission object with access controls | Set up team access control, define role permissions | Creates secure on-chain permission system with admin management |
136
- | **Manage Admins** | Add/remove/set permission administrators | Manage who can modify permissions, delegate authority | Controls who has full access to the permission system |
137
- | **Manage Permissions by Index** | Grant/revoke permissions by permission ID | Give one permission to many users, revoke access | Permission-centric approach for mass permission assignment |
138
- | **Manage Permissions by Entity** | Grant/revoke permissions by user/Guard | Give many permissions to one user, define role access | Entity-centric approach for role-based access control |
139
- | **Manage Remarks** | Add descriptive remarks to custom permissions | Document custom permission purposes, improve clarity | Makes custom permissions easier to understand and maintain |
140
- | **Advanced Entity Operations** | Swap/replace/copy/delete entity permissions | Transfer roles, duplicate permissions, clean up access | Streamlines complex permission management workflows |
141
- | **Apply to Objects** | Apply permission set to other WoWok objects | Share permission scheme across multiple objects | Standardizes access control across your organization |
142
- | **Transfer Ownership** | Change permission object owner | Hand over management, pass responsibility to new owner | Transfers full control of the permission system |
143
- | **Owner Receive** | Unwrap and send received assets to owner | Forward received tokens, process payments | Delivers received assets to permission owner |
144
-
145
- ---
146
-
147
- ## Complete Tool Call Structure
148
-
149
- Permission operations use the following top-level structure:
150
-
151
- ```json
152
- {
153
- "operation_type": "permission",
154
- "data": { ... }, // Permission data definition
155
- "env": { ... }, // Execution environment (optional)
156
- "submission": { ... } // Submission data (optional)
157
- }
158
- ```
159
-
160
- ---
161
-
162
- ## Schema Tree
163
-
164
- ```
165
- permission (Permission Object)
166
- ├── operation_type: "permission" (fixed value)
167
- ├── data
168
- │ ├── object (optional) - string for reference, object for creation
169
- │ │ ├── string: name or address (reference existing Permission)
170
- │ │ └── object: { name?, tags?, onChain?, replaceExistName? } (create new Permission)
171
- │ ├── description (string, optional)
172
- │ ├── remark (object, optional)
173
- │ │ ├── op: "set", index: number, remark: string
174
- │ │ ├── op: "remove", index: number
175
- │ │ └── op: "clear"
176
- │ ├── table (object, optional) - Permission table operations (requires admin)
177
- │ │ ├── op: "add perm by index" | "set perm by index" | "remove perm by index"
178
- │ │ │ ├── index: number (permission index, 0-65535)
179
- │ │ │ └── entity: { entities: [{ name_or_address, local_mark_first? }], check_all_founded? }
180
- │ │ └── op: "add perm by entity" | "set perm by entity" | "remove perm by entity"
181
- │ │ ├── entity: { name_or_address, local_mark_first? }
182
- │ │ └── index: number[] (permission index array)
183
- │ ├── entity (object, optional) - Advanced entity operations (requires admin)
184
- │ │ ├── op: "swap" | "replace" | "copy"
185
- │ │ │ ├── entity1: { name_or_address, local_mark_first? }
186
- │ │ │ └── entity2: { name_or_address, local_mark_first? }
187
- │ │ └── op: "del"
188
- │ │ └── entity: { name_or_address, local_mark_first? }
189
- │ ├── admin (object, optional) - only builder can manage
190
- │ │ ├── op: "add" | "remove" | "set"
191
- │ │ └── addresses: { entities: [{ name_or_address, local_mark_first? }], check_all_founded? }
192
- │ ├── apply (array of strings, optional) - Object IDs or names to apply Permission to
193
- │ ├── builder (object, optional) - { name_or_address, local_mark_first? }, transfer ownership
194
- │ ├── owner_receive (optional) - Unwrap received objects to builder
195
- │ │ ├── "recently" - receive all recent objects
196
- │ │ ├── [{ id: string, type: string, content_raw?: any }] - specific normal objects
197
- │ │ └── { balance, token_type, received: [{ id, amount }] } - specific balance objects
198
- │ └── um (string | null, optional) - Contact object name/ID, or null to unbind
199
- ├── env (optional)
200
- │ ├── account (string, optional) - account name or address, default: ""
201
- │ ├── network (string, optional) - "localnet" or "testnet"
202
- │ ├── permission_guard (array of strings, optional) - permission guard IDs
203
- │ ├── no_cache (boolean, optional) - disable cache
204
- │ └── referrer (string, optional) - referrer ID
205
- └── submission (optional)
206
- ├── type: "submission" (fixed value)
207
- ├── guard: [{ object: string, impack: boolean }]
208
- └── submission: [{ guard: string, submission: [{ identifier, b_submission, value_type, value, name }] }]
209
- ```
210
-
211
- ---
212
-
213
- ### ⚠️ Important Note About Submission
214
-
215
- If the execution returns a `submission` field in the response, it indicates that additional Guard verification data is required. You must:
216
-
217
- 1. Complete all required submission data within the `submission` structure
218
- 2. Resubmit the operation with the completed submission data
219
- 3. **Do not modify any other parts of the structure** - only fill in the required submission values
220
-
221
- The submission structure will specify which Guard objects need verification and what data needs to be provided for each Guard table item.
222
-
223
- **Query Value Types**: Use the `wowok_buildin_info` tool with `{ "info": "value types" }` to query all supported value types with their numeric and string representations. This helps you understand what `value_type` values are valid for submission data.
224
-
225
- ---
226
-
227
- ## Sub-feature 1: Create Permission Object
228
-
229
- ### Feature Description
230
-
231
- Create a new Permission object. You can set the name, description, and tags. The creator automatically becomes the owner (builder) and administrator.
232
-
233
- ### Parameter Description
234
-
235
- | Parameter Path | Type | Required | Description | Constraints |
236
- |----------|------|------|------|------|
237
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
238
- | `data.object` | object/string | Yes | Object reference | Provide object configuration when creating a new object |
239
- | `data.object.name` | string | No | Object name | Max 64 bcs characters |
240
- | `data.object.tags` | array | No | Object tags | String array for classification |
241
- | `data.description` | string | No | Permission object description | Explain the purpose and management scope |
242
-
243
- ### Important Notes
244
-
245
- ⚠️ **Built-in permissions (0-999)**: Reserved for WoWok core system objects.
246
-
247
- ⚠️ **User-defined permissions (1000-65535)**: For your custom business needs.
248
-
249
- ---
250
-
251
- ### Examples
252
-
253
- #### Example 1.1: Create Minimal Permission Object
254
-
255
- **Prompt**: Create a basic Permission object named "my_permission", use default account and network, no other configuration specified.
256
-
257
- ```json
258
- {
259
- "operation_type": "permission",
260
- "data": {
261
- "object": {
262
- "name": "my_permission"
263
- }
264
- },
265
- "env": {
266
- "account": "",
267
- "network": "testnet"
268
- }
269
- }
270
- ```
271
-
272
- **Execution Result**:
273
- ```json
274
- {
275
- "status": "success",
276
- "object": "0x414d0d...88eb0c",
277
- "type": "Permission",
278
- "version": "10316068",
279
- "change": "created"
280
- }
281
- ```
282
-
283
- ---
284
-
285
- #### Example 1.2: Create Permission with Description
286
-
287
- **Prompt**: Create a Permission named "service_team_permission", add description "Service team permission management - responsible for service creation, sales, and customer operations".
288
-
289
- ```json
290
- {
291
- "operation_type": "permission",
292
- "data": {
293
- "object": {
294
- "name": "service_team_permission"
295
- },
296
- "description": "Service team permission management - responsible for service creation, sales, and customer operations"
297
- },
298
- "env": {
299
- "account": "",
300
- "network": "testnet"
301
- }
302
- }
303
- ```
304
-
305
- **Execution Result**:
306
- ```json
307
- {
308
- "status": "success",
309
- "object": "0x43f904...0df93",
310
- "type": "Permission",
311
- "version": "10316069",
312
- "change": "created"
313
- }
314
- ```
315
-
316
- ---
317
-
318
- #### Example 1.3: Create Permission with Tags
319
-
320
- **Prompt**: Create a Permission named "design_team_permission", add tags "design", "team", "internal", "creative" for better categorization.
321
-
322
- ```json
323
- {
324
- "operation_type": "permission",
325
- "data": {
326
- "object": {
327
- "name": "design_team_permission",
328
- "tags": ["design", "team", "internal", "creative"]
329
- }
330
- },
331
- "env": {
332
- "account": "",
333
- "network": "testnet"
334
- }
335
- }
336
- ```
337
-
338
- **Execution Result**:
339
- ```json
340
- {
341
- "status": "success",
342
- "object": "0x0bfbcf...c8295",
343
- "type": "Permission",
344
- "version": "10316070",
345
- "change": "created"
346
- }
347
- ```
348
-
349
- ---
350
-
351
- ## Sub-feature 2: Admin Management
352
-
353
- ### Feature Description
354
-
355
- Add, remove, or set administrators for the Permission object. Only the object owner (builder) can perform this operation. Administrators can manage permissions, entities, etc.
356
-
357
- ### Parameter Description
358
-
359
- | Parameter Path | Type | Required | Description | Constraints |
360
- |----------|------|------|------|------|
361
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
362
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
363
- | `data.admin.op` | string | Yes | Operation type | "add" / "remove" / "set" |
364
- | `data.admin.addresses` | object | Yes | Administrator addresses | ManyAccountOrMark_Address |
365
-
366
- ---
367
-
368
- ### Examples
369
-
370
- #### Example 2.1: Add Administrators
371
-
372
- **Prompt**: Add "product_manager" and "team_lead" as administrators to the "my_permission" Permission object.
373
-
374
- ```json
375
- {
376
- "operation_type": "permission",
377
- "data": {
378
- "object": "my_permission",
379
- "admin": {
380
- "op": "add",
381
- "addresses": {
382
- "entities": [
383
- { "name_or_address": "product_manager" },
384
- { "name_or_address": "team_lead" }
385
- ]
386
- }
387
- }
388
- },
389
- "env": {
390
- "account": "",
391
- "network": "testnet"
392
- }
393
- }
394
- ```
395
-
396
- **Execution Result**:
397
- ```json
398
- {
399
- "status": "success",
400
- "object": "0x414d0d...88eb0c",
401
- "type": "Permission",
402
- "version": "10316071",
403
- "change": "mutated"
404
- }
405
- ```
406
-
407
- ---
408
-
409
- #### Example 2.2: Remove Administrator
410
-
411
- **Prompt**: Remove "former_lead" from the administrators of "my_permission".
412
-
413
- ```json
414
- {
415
- "operation_type": "permission",
416
- "data": {
417
- "object": "my_permission",
418
- "admin": {
419
- "op": "remove",
420
- "addresses": {
421
- "entities": [
422
- { "name_or_address": "former_lead" }
423
- ]
424
- }
425
- }
426
- },
427
- "env": {
428
- "account": "",
429
- "network": "testnet"
430
- }
431
- }
432
- ```
433
-
434
- **Execution Result**:
435
- ```json
436
- {
437
- "status": "success",
438
- "object": "0x414d0d...88eb0c",
439
- "type": "Permission",
440
- "version": "10316072",
441
- "change": "mutated"
442
- }
443
- ```
444
-
445
- ---
446
-
447
- #### Example 2.3: Set Complete Administrator List (Overwrite)
448
-
449
- **Prompt**: Set the complete administrator list for "my_permission" to ["product_manager", "tech_lead"], overwriting any existing administrators.
450
-
451
- ```json
452
- {
453
- "operation_type": "permission",
454
- "data": {
455
- "object": "my_permission",
456
- "admin": {
457
- "op": "set",
458
- "addresses": {
459
- "entities": [
460
- { "name_or_address": "product_manager" },
461
- { "name_or_address": "tech_lead" }
462
- ]
463
- }
464
- }
465
- },
466
- "env": {
467
- "account": "",
468
- "network": "testnet"
469
- }
470
- }
471
- ```
472
-
473
- **Execution Result**:
474
- ```json
475
- {
476
- "status": "success",
477
- "object": "0x414d0d...88eb0c",
478
- "type": "Permission",
479
- "version": "10316073",
480
- "change": "mutated"
481
- }
482
- ```
483
-
484
- ---
485
-
486
- ## Sub-feature 3: Manage Permissions by Permission Index
487
-
488
- ### Feature Description
489
-
490
- Add, set, or remove entities (accounts or Guard IDs) for a specific permission index. This is the permission-centric approach. **Requires administrator permission**.
491
-
492
- ### Parameter Description
493
-
494
- | Parameter Path | Type | Required | Description | Constraints |
495
- |----------|------|------|------|------|
496
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
497
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
498
- | `data.table.op` | string | Yes | Operation type | "add perm by index" / "set perm by index" / "remove perm by index" |
499
- | `data.table.index` | number | Yes | Permission index | Built-in index (e.g., 300) or 1000-65535 (custom) |
500
- | `data.table.entity` | object | Yes | Entities | ManyAccountOrMark_Address |
501
-
502
- ---
503
-
504
- ### Examples
505
-
506
- #### Example 3.1: Add Single Entity to Permission Index
507
-
508
- **Prompt**: Add "marketing_specialist" to the service creation permission (index 300) of "my_permission".
509
-
510
- ```json
511
- {
512
- "operation_type": "permission",
513
- "data": {
514
- "object": "my_permission",
515
- "table": {
516
- "op": "add perm by index",
517
- "index": 300,
518
- "entity": {
519
- "entities": [
520
- { "name_or_address": "marketing_specialist" }
521
- ]
522
- }
523
- }
524
- },
525
- "env": {
526
- "account": "",
527
- "network": "testnet"
528
- }
529
- }
530
- ```
531
-
532
- **Execution Result**:
533
- ```json
534
- {
535
- "status": "success",
536
- "object": "0x9233e7...1699de",
537
- "type": "Permission",
538
- "version": "10318774",
539
- "change": "mutated"
540
- }
541
- ```
542
-
543
- ---
544
-
545
- #### Example 3.2: Add Multiple Entities to Permission Index
546
-
547
- **Prompt**: Add "marketing_specialist_1", "marketing_specialist_2", and "marketing_specialist_3" to permission index 300 of "my_permission".
548
-
549
- ```json
550
- {
551
- "operation_type": "permission",
552
- "data": {
553
- "object": "my_permission",
554
- "table": {
555
- "op": "add perm by index",
556
- "index": 300,
557
- "entity": {
558
- "entities": [
559
- { "name_or_address": "marketing_specialist_1" },
560
- { "name_or_address": "marketing_specialist_2" },
561
- { "name_or_address": "marketing_specialist_3" }
562
- ]
563
- }
564
- }
565
- },
566
- "env": {
567
- "account": "",
568
- "network": "testnet"
569
- }
570
- }
571
- ```
572
-
573
- **Execution Result**:
574
- ```json
575
- {
576
- "status": "success",
577
- "object": "0x9233e7...1699de",
578
- "type": "Permission",
579
- "version": "10319086",
580
- "change": "mutated"
581
- }
582
- ```
583
-
584
- ---
585
-
586
- #### Example 3.3: Remove Entity from Permission Index
587
-
588
- **Prompt**: Remove "former_team_member" from permission index 300 of "my_permission".
589
-
590
- ```json
591
- {
592
- "operation_type": "permission",
593
- "data": {
594
- "object": "my_permission",
595
- "table": {
596
- "op": "remove perm by index",
597
- "index": 300,
598
- "entity": {
599
- "entities": [
600
- { "name_or_address": "former_team_member" }
601
- ]
602
- }
603
- }
604
- },
605
- "env": {
606
- "account": "",
607
- "network": "testnet"
608
- }
609
- }
610
- ```
611
-
612
- **Execution Result**:
613
- ```json
614
- {
615
- "status": "success",
616
- "object": "0x9233e7...1699de",
617
- "type": "Permission",
618
- "version": "10319087",
619
- "change": "mutated"
620
- }
621
- ```
622
-
623
- ---
624
-
625
- ## Sub-feature 4: Manage Permissions by Entity
626
-
627
- ### Feature Description
628
-
629
- Add, set, or remove permission indexes for a specific entity. This is the entity-centric approach. **Requires administrator permission**.
630
-
631
- ### Parameter Description
632
-
633
- | Parameter Path | Type | Required | Description | Constraints |
634
- |----------|------|------|------|------|
635
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
636
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
637
- | `data.table.op` | string | Yes | Operation type | "add perm by entity" / "set perm by entity" / "remove perm by entity" |
638
- | `data.table.entity` | object | Yes | Entity | AccountOrMark_Address |
639
- | `data.table.index` | array | Yes | Permission index array | number[] |
640
-
641
- ---
642
-
643
- ### Examples
644
-
645
- #### Example 4.1: Add Single Permission to Entity
646
-
647
- **Prompt**: Add permission index 300 to the "product_manager" entity of "my_permission".
648
-
649
- ```json
650
- {
651
- "operation_type": "permission",
652
- "data": {
653
- "object": "my_permission",
654
- "table": {
655
- "op": "add perm by entity",
656
- "entity": { "name_or_address": "product_manager" },
657
- "index": [300]
658
- }
659
- },
660
- "env": {
661
- "account": "",
662
- "network": "testnet"
663
- }
664
- }
665
- ```
666
-
667
- **Execution Result**:
668
- ```json
669
- {
670
- "status": "success",
671
- "object": "0x9233e7...1699de",
672
- "type": "Permission",
673
- "version": "10319645",
674
- "change": "mutated"
675
- }
676
- ```
677
-
678
- ---
679
-
680
- #### Example 4.2: Add Multiple Permissions to Entity
681
-
682
- **Prompt**: Add permission indexes 300, 301, and 305 to "marketing_manager" in "my_permission".
683
-
684
- ```json
685
- {
686
- "operation_type": "permission",
687
- "data": {
688
- "object": "my_permission",
689
- "table": {
690
- "op": "add perm by entity",
691
- "entity": { "name_or_address": "marketing_manager" },
692
- "index": [300, 301, 305]
693
- }
694
- },
695
- "env": {
696
- "account": "",
697
- "network": "testnet"
698
- }
699
- }
700
- ```
701
-
702
- **Execution Result**:
703
- ```json
704
- {
705
- "status": "success",
706
- "object": "0x9233e7...1699de",
707
- "type": "Permission",
708
- "version": "10319887",
709
- "change": "mutated"
710
- }
711
- ```
712
-
713
- ---
714
-
715
- #### Example 4.3: Remove Some Permissions from Entity
716
-
717
- **Prompt**: Remove permission index 305 from "marketing_manager" in "my_permission" while keeping other permissions.
718
-
719
- ```json
720
- {
721
- "operation_type": "permission",
722
- "data": {
723
- "object": "my_permission",
724
- "table": {
725
- "op": "remove perm by entity",
726
- "entity": { "name_or_address": "marketing_manager" },
727
- "index": [305]
728
- }
729
- },
730
- "env": {
731
- "account": "",
732
- "network": "testnet"
733
- }
734
- }
735
- ```
736
-
737
- **Execution Result**:
738
- ```json
739
- {
740
- "status": "success",
741
- "object": "0x9233e7...1699de",
742
- "type": "Permission",
743
- "version": "10319888",
744
- "change": "mutated"
745
- }
746
- ```
747
-
748
- ---
749
-
750
- ## Sub-feature 5: Permission Remark Management
751
-
752
- ### Feature Description
753
-
754
- Set, remove, or clear remarks for permission indexes (custom permissions with index >= 1000), making it easier to manage and identify permission purposes.
755
-
756
- ### Parameter Description
757
-
758
- | Parameter Path | Type | Required | Description | Constraints |
759
- |----------|------|------|------|------|
760
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
761
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
762
- | `data.remark.op` | string | Yes | Operation type | "set" / "remove" / "clear" |
763
- | `data.remark.index` | number | Conditional | Permission index | Required when op is "set"/"remove" |
764
- | `data.remark.remark` | string | Conditional | Remark text | Required when op is "set" |
765
-
766
- ---
767
-
768
- ### Examples
769
-
770
- #### Example 5.1: Set Permission Remark
771
-
772
- **Prompt**: Add a remark "Machine Node 'order confirm': confirm operation" to permission index 1001 of "my_permission".
773
-
774
- ```json
775
- {
776
- "operation_type": "permission",
777
- "data": {
778
- "object": "my_permission",
779
- "remark": {
780
- "op": "set",
781
- "index": 1001,
782
- "remark": "Machine Node 'order confirm': confirm operation"
783
- }
784
- },
785
- "env": {
786
- "account": "",
787
- "network": "testnet"
788
- }
789
- }
790
- ```
791
-
792
- **Execution Result**:
793
- ```json
794
- {
795
- "status": "success",
796
- "object": "0x030c79...9b5faa",
797
- "type": "Permission",
798
- "version": "10319890",
799
- "change": "mutated"
800
- }
801
- ```
802
-
803
- ---
804
-
805
- #### Example 5.2: Remove Permission Remark
806
-
807
- **Prompt**: Remove the remark from permission index 1001 of "my_permission".
808
-
809
- ```json
810
- {
811
- "operation_type": "permission",
812
- "data": {
813
- "object": "my_permission",
814
- "remark": {
815
- "op": "remove",
816
- "index": 1001
817
- }
818
- },
819
- "env": {
820
- "account": "",
821
- "network": "testnet"
822
- }
823
- }
824
- ```
825
-
826
- **Execution Result**:
827
- ```json
828
- {
829
- "status": "success",
830
- "object": "0x030c79...9b5faa",
831
- "type": "Permission",
832
- "version": "10319891",
833
- "change": "mutated"
834
- }
835
- ```
836
-
837
- ---
838
-
839
- #### Example 5.3: Clear All Remarks
840
-
841
- **Prompt**: Clear all permission remarks from "my_permission".
842
-
843
- ```json
844
- {
845
- "operation_type": "permission",
846
- "data": {
847
- "object": "my_permission",
848
- "remark": {
849
- "op": "clear"
850
- }
851
- },
852
- "env": {
853
- "account": "",
854
- "network": "testnet"
855
- }
856
- }
857
- ```
858
-
859
- **Execution Result**:
860
- ```json
861
- {
862
- "status": "success",
863
- "object": "0x030c79...9b5faa",
864
- "type": "Permission",
865
- "version": "10319892",
866
- "change": "mutated"
867
- }
868
- ```
869
-
870
- ---
871
-
872
- ## Sub-feature 6: Advanced Entity Operations
873
-
874
- ### Feature Description
875
-
876
- Perform advanced operations on entity permissions, including swapping permissions between two entities, replacing permissions, copying permissions, and deleting all permissions of an entity. **Requires administrator permission**.
877
-
878
- ### Parameter Description
879
-
880
- | Parameter Path | Type | Required | Description | Constraints |
881
- |----------|------|------|------|------|
882
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
883
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
884
- | `data.entity.op` | string | Yes | Operation type | "swap" / "replace" / "copy" / "del" |
885
- | `data.entity.entity1` | object | Conditional | First entity | Required for swap/replace/copy |
886
- | `data.entity.entity2` | object | Conditional | Second entity | Required for swap/replace/copy |
887
- | `data.entity.entity` | object | Conditional | Entity | Required for del |
888
-
889
- ---
890
-
891
- ### Examples
892
-
893
- #### Example 6.1: Copy Entity Permissions
894
-
895
- **Prompt**: Copy all permissions from "senior_marketer" to "junior_marketer" in "my_permission".
896
-
897
- ```json
898
- {
899
- "operation_type": "permission",
900
- "data": {
901
- "object": "my_permission",
902
- "entity": {
903
- "op": "copy",
904
- "entity1": { "name_or_address": "senior_marketer" },
905
- "entity2": { "name_or_address": "junior_marketer" }
906
- }
907
- },
908
- "env": {
909
- "account": "",
910
- "network": "testnet"
911
- }
912
- }
913
- ```
914
-
915
- **Execution Result**:
916
- ```json
917
- {
918
- "status": "success",
919
- "object": "0x9233e7...1699de",
920
- "type": "Permission",
921
- "version": "10321162",
922
- "change": "mutated"
923
- }
924
- ```
925
-
926
- ---
927
-
928
- #### Example 6.2: Swap Permissions Between Two Entities
929
-
930
- **Prompt**: Swap all permissions between "role_a" and "role_b" in "my_permission".
931
-
932
- ```json
933
- {
934
- "operation_type": "permission",
935
- "data": {
936
- "object": "my_permission",
937
- "entity": {
938
- "op": "swap",
939
- "entity1": { "name_or_address": "role_a" },
940
- "entity2": { "name_or_address": "role_b" }
941
- }
942
- },
943
- "env": {
944
- "account": "",
945
- "network": "testnet"
946
- }
947
- }
948
- ```
949
-
950
- **Execution Result**:
951
- ```json
952
- {
953
- "status": "success",
954
- "object": "0x9233e7...1699de",
955
- "type": "Permission",
956
- "version": "10321754",
957
- "change": "mutated"
958
- }
959
- ```
960
-
961
- ---
962
-
963
- #### Example 6.3: Replace Entity Permissions
964
-
965
- **Prompt**: Transfer all permissions from "old_manager" to "new_manager" in "my_permission" (old_manager loses permissions).
966
-
967
- ```json
968
- {
969
- "operation_type": "permission",
970
- "data": {
971
- "object": "my_permission",
972
- "entity": {
973
- "op": "replace",
974
- "entity1": { "name_or_address": "old_manager" },
975
- "entity2": { "name_or_address": "new_manager" }
976
- }
977
- },
978
- "env": {
979
- "account": "",
980
- "network": "testnet"
981
- }
982
- }
983
- ```
984
-
985
- **Execution Result**:
986
- ```json
987
- {
988
- "status": "success",
989
- "object": "0x9233e7...1699de",
990
- "type": "Permission",
991
- "version": "10322233",
992
- "change": "mutated"
993
- }
994
- ```
995
-
996
- ---
997
-
998
- #### Example 6.4: Delete All Permissions of an Entity
999
-
1000
- **Prompt**: Delete all permissions from "former_employee" in "my_permission".
1001
-
1002
- ```json
1003
- {
1004
- "operation_type": "permission",
1005
- "data": {
1006
- "object": "my_permission",
1007
- "entity": {
1008
- "op": "del",
1009
- "entity": { "name_or_address": "former_employee" }
1010
- }
1011
- },
1012
- "env": {
1013
- "account": "",
1014
- "network": "testnet"
1015
- }
1016
- }
1017
- ```
1018
-
1019
- **Execution Result**:
1020
- ```json
1021
- {
1022
- "status": "success",
1023
- "object": "0x9233e7...1699de",
1024
- "type": "Permission",
1025
- "version": "10322234",
1026
- "change": "mutated"
1027
- }
1028
- ```
1029
-
1030
- ---
1031
-
1032
- ## Sub-feature 7: Apply to Other Objects
1033
-
1034
- ### Feature Description
1035
-
1036
- Apply the current Permission object to other WoWok objects so that these objects use this permission control. **Only the object owner (builder) can perform this operation**.
1037
-
1038
- ### Parameter Description
1039
-
1040
- | Parameter Path | Type | Required | Description | Constraints |
1041
- |----------|------|------|------|------|
1042
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
1043
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
1044
- | `data.apply` | array | Yes | Object ID or name array | String array, can be Machine, Service, Repository, etc. |
1045
-
1046
- ---
1047
-
1048
- ### Examples
1049
-
1050
- #### Example 7.1: Apply to Single Object
1051
-
1052
- **Prompt**: Apply "marketing_team_permission" to the "service_marketing_workflow" Machine object.
1053
-
1054
- ```json
1055
- {
1056
- "operation_type": "permission",
1057
- "data": {
1058
- "object": "marketing_team_permission",
1059
- "apply": ["service_marketing_workflow"]
1060
- },
1061
- "env": {
1062
- "account": "",
1063
- "network": "testnet"
1064
- }
1065
- }
1066
- ```
1067
-
1068
- **Execution Result**:
1069
- ```json
1070
- {
1071
- "status": "success",
1072
- "object": "0x40cfa6...35e653",
1073
- "type": "Repository",
1074
- "version": "10322920",
1075
- "change": "mutated"
1076
- }
1077
- ```
1078
-
1079
- ---
1080
-
1081
- #### Example 7.2: Apply to Multiple Objects
1082
-
1083
- **Prompt**: Apply "marketing_team_permission" to "service_marketing_workflow", "customer_service_workflow", and "campaign_management_repo".
1084
-
1085
- ```json
1086
- {
1087
- "operation_type": "permission",
1088
- "data": {
1089
- "object": "marketing_team_permission",
1090
- "apply": ["service_marketing_workflow", "customer_service_workflow", "campaign_management_repo"]
1091
- },
1092
- "env": {
1093
- "account": "",
1094
- "network": "testnet"
1095
- }
1096
- }
1097
- ```
1098
-
1099
- **Execution Result**:
1100
- ```json
1101
- {
1102
- "status": "success",
1103
- "objects": [
1104
- { "object": "0x40cfa6...35e653", "type": "Repository", "change": "mutated" },
1105
- { "object": "0xc44fbd...c2046", "type": "Repository", "change": "mutated" }
1106
- ]
1107
- }
1108
- ```
1109
-
1110
- ---
1111
-
1112
- ## Sub-feature 8: Transfer Ownership
1113
-
1114
- ### Feature Description
1115
-
1116
- Transfer ownership of the Permission object to another user. Only the current owner can perform this operation. **After transfer, the original owner no longer has management permissions for this object, please operate with caution!**
1117
-
1118
- ### Parameter Description
1119
-
1120
- | Parameter Path | Type | Required | Description | Constraints |
1121
- |----------|------|------|------|------|
1122
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
1123
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
1124
- | `data.builder` | object | Yes | Set or transfer ownership of the Permission object to the specified user ID. The creator automatically becomes the builder; only the builder can transfer ownership to other users. | AccountOrMark_Address |
1125
-
1126
- ---
1127
-
1128
- ### Examples
1129
-
1130
- #### Example 8.1: Transfer Ownership to Specified Account
1131
-
1132
- **Prompt**: Transfer ownership of "my_permission" to "new_owner" using the local mark name.
1133
-
1134
- ```json
1135
- {
1136
- "operation_type": "permission",
1137
- "data": {
1138
- "object": "my_permission",
1139
- "builder": { "name_or_address": "new_owner" }
1140
- },
1141
- "env": {
1142
- "account": "",
1143
- "network": "testnet"
1144
- }
1145
- }
1146
- ```
1147
-
1148
- **Execution Result**:
1149
- ```json
1150
- {
1151
- "status": "success",
1152
- "object": "0x030c79...9b5faa",
1153
- "type": "Permission",
1154
- "version": "10323203",
1155
- "change": "mutated"
1156
- }
1157
- ```
1158
-
1159
- ---
1160
-
1161
- ## Sub-feature 9: Set Contact Object (um)
1162
-
1163
- ### Feature Description
1164
-
1165
- Bind a Contact object to the Permission object. The Contact object is used for instant messaging and communication. **Only the object owner (builder) can perform this operation**.
1166
-
1167
- ### Parameter Description
1168
-
1169
- | Parameter Path | Type | Required | Description | Constraints |
1170
- |----------|------|------|------|------|
1171
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
1172
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
1173
- | `data.um` | string/null | Yes | Contact object name or ID | Set to `null` to unbind |
1174
-
1175
- ---
1176
-
1177
- ### Examples
1178
-
1179
- #### Example 9.1: Bind Contact Object
1180
-
1181
- **Prerequisites**: Before binding a Contact object, you need to create a Contact object first.
1182
-
1183
- **Step 1: Create Contact Object**
1184
-
1185
- See [Contact Documentation](contact.md) for more details.
1186
-
1187
- ```json
1188
- {
1189
- "operation_type": "contact",
1190
- "data": {
1191
- "object": {
1192
- "name": "test_contact_um"
1193
- }
1194
- },
1195
- "env": {
1196
- "account": "",
1197
- "network": "testnet"
1198
- }
1199
- }
1200
- ```
1201
-
1202
- **Step 2: Bind Contact to Permission**
1203
-
1204
- **Prompt**: Bind Contact object "test_contact_um" to Permission object "test_permission_for_table".
1205
-
1206
- ```json
1207
- {
1208
- "operation_type": "permission",
1209
- "data": {
1210
- "object": "test_permission_for_table",
1211
- "um": "test_contact_um"
1212
- },
1213
- "env": {
1214
- "account": "",
1215
- "network": "testnet"
1216
- }
1217
- }
1218
- ```
1219
-
1220
- **Execution Result**:
1221
- ```json
1222
- {
1223
- "status": "success",
1224
- "object": "0x9233e7...1699de",
1225
- "type": "Permission",
1226
- "version": "10355080",
1227
- "change": "mutated"
1228
- }
1229
- ```
1230
-
1231
- ---
1232
-
1233
- ## Sub-feature 10: Receive Objects (owner_receive)
1234
-
1235
- ### Feature Description
1236
-
1237
- Receive objects (such as CoinWrapper) sent to the Permission object and unwrap them to transfer to the Permission owner (builder). This is typically used to collect payments or funds sent to the Permission object. **Only the object owner (builder) can perform this operation**.
1238
-
1239
- ### Parameter Description
1240
-
1241
- | Parameter Path | Type | Required | Description | Constraints |
1242
- |----------|------|------|------|------|
1243
- | `operation_type` | string | Yes | Operation type | Fixed value "permission" |
1244
- | `data.object` | string/object | Yes | Existing Permission object name or ID | |
1245
- | `data.owner_receive` | string/array/object | Yes | Objects to receive | `"recently"` for all recent objects, or array of specific objects |
1246
-
1247
- ---
1248
-
1249
- ### Examples
1250
-
1251
- #### Example 10.1: Receive All Recent Objects
1252
-
1253
- **Prerequisites**: Before using `owner_receive`, you need to create a Payment object to send funds to the Permission object.
1254
-
1255
- **Step 1: Create Payment Object**
1256
-
1257
- See [Payment Documentation](payment.md) for more details.
1258
-
1259
- ```json
1260
- {
1261
- "operation_type": "payment",
1262
- "data": {
1263
- "object": {
1264
- "name": "test_payment_for_perm"
1265
- },
1266
- "revenue": [
1267
- {
1268
- "recipient": {
1269
- "name_or_address": "test_permission_for_table"
1270
- },
1271
- "amount": {
1272
- "balance": 1000000
1273
- }
1274
- }
1275
- ],
1276
- "info": {
1277
- "remark": "Test payment",
1278
- "index": 1
1279
- }
1280
- },
1281
- "env": {
1282
- "account": "",
1283
- "network": "testnet"
1284
- }
1285
- }
1286
- ```
1287
-
1288
- **Step 2: Receive Objects**
1289
-
1290
- **Prompt**: Receive all recently sent objects to Permission object "test_permission_for_table" and transfer them to the owner.
1291
-
1292
- ```json
1293
- {
1294
- "operation_type": "permission",
1295
- "data": {
1296
- "object": "test_permission_for_table",
1297
- "owner_receive": "recently"
1298
- },
1299
- "env": {
1300
- "account": "",
1301
- "network": "testnet"
1302
- }
1303
- }
1304
- ```
1305
-
1306
- **Execution Result**:
1307
- ```json
1308
- {
1309
- "status": "success",
1310
- "object": "0x9233e7...1699de",
1311
- "type": "Permission",
1312
- "version": "10356781",
1313
- "change": "mutated"
1314
- }
1315
- ```
1316
-
1317
- ---
1318
-
1319
- ## Sub-feature 11: Combined Operations
1320
-
1321
- ### Feature Description
1322
-
1323
- Perform multiple operations in a single call, such as creating an object while configuring permissions, administrators, etc. This can reduce the number of transactions and improve efficiency.
1324
-
1325
- ---
1326
-
1327
- ### Example
1328
-
1329
- #### Example 9.1: Create Permission and Configure Complete Permissions
1330
-
1331
- **Prompt**: Create a complete marketing department permission configuration: 1) Create a Permission named "full_marketing_permission", 2) Add description and tags, 3) Add "marketing_director" as administrator, 4) Add service creation permission (300) to "marketing_specialist_1" and "marketing_specialist_2", 5) Add a remark to permission 1001: "Machine Node 'order confirm': confirm operation".
1332
-
1333
- ```json
1334
- {
1335
- "operation_type": "permission",
1336
- "data": {
1337
- "object": {
1338
- "name": "full_marketing_permission",
1339
- "tags": ["marketing", "team", "complete-setup"]
1340
- },
1341
- "description": "Complete marketing department permission configuration - includes administrator, service creation, sales management, and other permissions",
1342
- "admin": {
1343
- "op": "add",
1344
- "addresses": {
1345
- "entities": [
1346
- { "name_or_address": "marketing_director" }
1347
- ]
1348
- }
1349
- },
1350
- "table": {
1351
- "op": "add perm by index",
1352
- "index": 300,
1353
- "entity": {
1354
- "entities": [
1355
- { "name_or_address": "marketing_specialist_1" },
1356
- { "name_or_address": "marketing_specialist_2" }
1357
- ]
1358
- }
1359
- },
1360
- "remark": {
1361
- "op": "set",
1362
- "index": 1001,
1363
- "remark": "Machine Node 'order confirm': confirm operation"
1364
- }
1365
- },
1366
- "env": {
1367
- "account": "",
1368
- "network": "testnet"
1369
- }
1370
- }
1371
- ```
1372
-
1373
- **Execution Result**:
1374
- ```json
1375
- {
1376
- "status": "success",
1377
- "object": "0x19f825...e7eb5",
1378
- "type": "Permission",
1379
- "version": "10323983",
1380
- "change": "created"
1381
- }
1382
- ```
1383
-
1384
- ---
1385
-
1386
- ## Important Notes
1387
-
1388
- ### ⚠️ Network and Account Configuration
1389
-
1390
- All examples in this document use the **testnet** network and **default account** (empty string `""`). When using in production, please configure according to your actual environment:
1391
-
1392
- ```json
1393
- {
1394
- "operation_type": "permission",
1395
- "data": { ... },
1396
- "env": {
1397
- "account": "", // Empty string for default account, or use account name/address
1398
- "network": "testnet" // Options: "localnet" | "testnet"
1399
- }
1400
- }
1401
- ```
1402
-
1403
- **Note**: If the `env` field is not specified, the operation will use the **default account** and the **last used network** for execution.
1404
- ```
1405
-
1406
- ### ⚠️ Permission Index Ranges
1407
-
1408
- - **Built-in permissions (0-999)**: Reserved for WoWok core system objects.
1409
- - **User-defined permissions (1000-65535)**: For your custom business needs.
1410
-
1411
- ### ⚠️ Permission Requirements
1412
-
1413
- - **table and entity operations require administrator permission!**
1414
- - **Only the object owner (builder) can manage admin!**
1415
- - **After transferring ownership, the original owner no longer has permissions!**
1416
-
1417
- ### ⚠️ Data Format Notes
1418
-
1419
- - `addresses` field must use object format: `{"entities": [{"name_or_address": "..."}]}`
1420
- - `entity`, `entity1`, `entity2`, `builder` fields must use object format: `{"name_or_address": "..."}`
1421
- - `table.op` must use full operation names: `"add perm by index"`, `"remove perm by entity"`, etc.
1422
- - `index` field in entity-centric operations must be an array: `[300, 301]`
1423
-
1424
- ### ⚠️ Tool Reference
1425
-
1426
- - Use `wowok_buildin_info` tool to query the most up-to-date permission list and detailed descriptions.
1427
- ---
1428
-
1429
- ## Related Components
1430
-
1431
- | Component | Description |
1432
- |-----------|-------------|
1433
- | **[Guard](guard.md)** | Trust verification engine - can be used as Permission entities for complex validation |
1434
- | **[Service](service.md)** | WYSIWYG product trading - commonly managed by Permission |
1435
- | **[Machine](machine.md)** | Workflow template - requires permission control |
1436
- | **[Repository](repository.md)** | Data ownership and usage rights - can be controlled via Permission |
1437
- | **[Treasury](treasury.md)** | Team fund management - permissions control who can deposit/withdraw |
1438
-