wowok_agent 1.6.6 → 2.1.8

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.

Potentially problematic release.


This version of wowok_agent might be problematic. Click here for more details.

Files changed (181) hide show
  1. package/README.md +20 -40
  2. package/dist/index.d.ts +13528 -27
  3. package/dist/index.js +1026 -27
  4. package/dist/schema/call/allocation.d.ts +1370 -0
  5. package/dist/schema/call/allocation.js +27 -0
  6. package/dist/schema/call/arbitration.d.ts +1902 -0
  7. package/dist/schema/call/arbitration.js +106 -0
  8. package/dist/schema/call/base.d.ts +6381 -0
  9. package/dist/schema/call/base.js +152 -0
  10. package/dist/schema/call/contact.d.ts +898 -0
  11. package/dist/schema/call/contact.js +41 -0
  12. package/dist/schema/call/demand.d.ts +1193 -0
  13. package/dist/schema/call/demand.js +51 -0
  14. package/dist/schema/call/guard.d.ts +819 -0
  15. package/dist/schema/call/guard.js +67 -0
  16. package/dist/schema/call/handler.d.ts +80 -0
  17. package/dist/schema/call/handler.js +177 -0
  18. package/dist/schema/call/index.d.ts +18 -0
  19. package/dist/schema/call/index.js +19 -0
  20. package/dist/schema/call/machine.d.ts +3906 -0
  21. package/dist/schema/call/machine.js +164 -0
  22. package/dist/schema/call/order.d.ts +994 -0
  23. package/dist/schema/call/order.js +39 -0
  24. package/dist/schema/call/payment.d.ts +408 -0
  25. package/dist/schema/call/payment.js +20 -0
  26. package/dist/schema/call/permission.d.ts +2945 -0
  27. package/dist/schema/call/permission.js +118 -0
  28. package/dist/schema/call/personal.d.ts +1498 -0
  29. package/dist/schema/call/personal.js +81 -0
  30. package/dist/schema/call/progress.d.ts +847 -0
  31. package/dist/schema/call/progress.js +37 -0
  32. package/dist/schema/call/proof.d.ts +328 -0
  33. package/dist/schema/call/proof.js +27 -0
  34. package/dist/schema/call/repository.d.ts +2220 -0
  35. package/dist/schema/call/repository.js +85 -0
  36. package/dist/schema/call/reward.d.ts +1178 -0
  37. package/dist/schema/call/reward.js +46 -0
  38. package/dist/schema/call/service.d.ts +3534 -0
  39. package/dist/schema/call/service.js +87 -0
  40. package/dist/schema/call/treasury.d.ts +2399 -0
  41. package/dist/schema/call/treasury.js +76 -0
  42. package/dist/schema/common/index.d.ts +623 -0
  43. package/dist/schema/common/index.js +331 -0
  44. package/dist/schema/index.d.ts +7 -0
  45. package/dist/schema/index.js +8 -0
  46. package/dist/schema/local/index.d.ts +7824 -0
  47. package/dist/schema/local/index.js +913 -0
  48. package/dist/schema/local/wip.d.ts +781 -0
  49. package/dist/schema/local/wip.js +229 -0
  50. package/dist/schema/messenger/index.d.ts +3624 -0
  51. package/dist/schema/messenger/index.js +407 -0
  52. package/dist/schema/query/index.d.ts +27176 -0
  53. package/dist/schema/query/index.js +1313 -0
  54. package/dist/schema/utils/guard-parser.d.ts +20 -0
  55. package/dist/schema/utils/guard-parser.js +410 -0
  56. package/dist/schema/utils/guard-query-utils.d.ts +5 -0
  57. package/dist/schema/utils/guard-query-utils.js +22 -0
  58. package/dist/schema/utils/node-parser.d.ts +59 -0
  59. package/dist/schema/utils/node-parser.js +382 -0
  60. package/dist/schema/utils/permission-index-utils.d.ts +2 -0
  61. package/dist/schema/utils/permission-index-utils.js +10 -0
  62. package/package.json +31 -49
  63. package/LICENSE +0 -201
  64. package/dist/call/arbitration.d.ts +0 -57
  65. package/dist/call/arbitration.d.ts.map +0 -1
  66. package/dist/call/arbitration.js +0 -245
  67. package/dist/call/arbitration.js.map +0 -1
  68. package/dist/call/base.d.ts +0 -85
  69. package/dist/call/base.d.ts.map +0 -1
  70. package/dist/call/base.js +0 -231
  71. package/dist/call/base.js.map +0 -1
  72. package/dist/call/call.d.ts +0 -95
  73. package/dist/call/call.d.ts.map +0 -1
  74. package/dist/call/call.js +0 -149
  75. package/dist/call/call.js.map +0 -1
  76. package/dist/call/demand.d.ts +0 -46
  77. package/dist/call/demand.d.ts.map +0 -1
  78. package/dist/call/demand.js +0 -201
  79. package/dist/call/demand.js.map +0 -1
  80. package/dist/call/guard.d.ts +0 -53
  81. package/dist/call/guard.d.ts.map +0 -1
  82. package/dist/call/guard.js +0 -386
  83. package/dist/call/guard.js.map +0 -1
  84. package/dist/call/machine.d.ts +0 -97
  85. package/dist/call/machine.d.ts.map +0 -1
  86. package/dist/call/machine.js +0 -342
  87. package/dist/call/machine.js.map +0 -1
  88. package/dist/call/object_permission.d.ts +0 -14
  89. package/dist/call/object_permission.d.ts.map +0 -1
  90. package/dist/call/object_permission.js +0 -59
  91. package/dist/call/object_permission.js.map +0 -1
  92. package/dist/call/permission.d.ts +0 -63
  93. package/dist/call/permission.d.ts.map +0 -1
  94. package/dist/call/permission.js +0 -137
  95. package/dist/call/permission.js.map +0 -1
  96. package/dist/call/personal.d.ts +0 -47
  97. package/dist/call/personal.d.ts.map +0 -1
  98. package/dist/call/personal.js +0 -119
  99. package/dist/call/personal.js.map +0 -1
  100. package/dist/call/repository.d.ts +0 -117
  101. package/dist/call/repository.d.ts.map +0 -1
  102. package/dist/call/repository.js +0 -408
  103. package/dist/call/repository.js.map +0 -1
  104. package/dist/call/service.d.ts +0 -115
  105. package/dist/call/service.d.ts.map +0 -1
  106. package/dist/call/service.js +0 -550
  107. package/dist/call/service.js.map +0 -1
  108. package/dist/call/treasury.d.ts +0 -46
  109. package/dist/call/treasury.d.ts.map +0 -1
  110. package/dist/call/treasury.js +0 -222
  111. package/dist/call/treasury.js.map +0 -1
  112. package/dist/common.d.ts +0 -12
  113. package/dist/common.d.ts.map +0 -1
  114. package/dist/common.js +0 -71
  115. package/dist/common.js.map +0 -1
  116. package/dist/index.d.ts.map +0 -1
  117. package/dist/index.js.map +0 -1
  118. package/dist/local/.d.ts +0 -20
  119. package/dist/local/.d.ts.map +0 -1
  120. package/dist/local/.js +0 -76
  121. package/dist/local/.js.map +0 -1
  122. package/dist/local/account.d.ts +0 -42
  123. package/dist/local/account.d.ts.map +0 -1
  124. package/dist/local/account.js +0 -335
  125. package/dist/local/account.js.map +0 -1
  126. package/dist/local/cache.d.ts +0 -32
  127. package/dist/local/cache.d.ts.map +0 -1
  128. package/dist/local/cache.js +0 -77
  129. package/dist/local/cache.js.map +0 -1
  130. package/dist/local/coin.d.ts +0 -22
  131. package/dist/local/coin.d.ts.map +0 -1
  132. package/dist/local/coin.js +0 -123
  133. package/dist/local/coin.js.map +0 -1
  134. package/dist/local/config.d.ts +0 -20
  135. package/dist/local/config.d.ts.map +0 -1
  136. package/dist/local/config.js +0 -75
  137. package/dist/local/config.js.map +0 -1
  138. package/dist/local/index.d.ts +0 -110
  139. package/dist/local/index.d.ts.map +0 -1
  140. package/dist/local/index.js +0 -122
  141. package/dist/local/index.js.map +0 -1
  142. package/dist/local/local.d.ts +0 -55
  143. package/dist/local/local.d.ts.map +0 -1
  144. package/dist/local/local.js +0 -248
  145. package/dist/local/local.js.map +0 -1
  146. package/dist/query/events.d.ts +0 -65
  147. package/dist/query/events.d.ts.map +0 -1
  148. package/dist/query/events.js +0 -75
  149. package/dist/query/events.js.map +0 -1
  150. package/dist/query/objects.d.ts +0 -346
  151. package/dist/query/objects.d.ts.map +0 -1
  152. package/dist/query/objects.js +0 -472
  153. package/dist/query/objects.js.map +0 -1
  154. package/dist/query/permission.d.ts +0 -15
  155. package/dist/query/permission.d.ts.map +0 -1
  156. package/dist/query/permission.js +0 -45
  157. package/dist/query/permission.js.map +0 -1
  158. package/dist/query/received.d.ts +0 -16
  159. package/dist/query/received.d.ts.map +0 -1
  160. package/dist/query/received.js +0 -16
  161. package/dist/query/received.js.map +0 -1
  162. package/dist/schema/call.d.ts +0 -13005
  163. package/dist/schema/call.d.ts.map +0 -1
  164. package/dist/schema/call.js +0 -997
  165. package/dist/schema/call.js.map +0 -1
  166. package/dist/schema/const.d.ts +0 -254
  167. package/dist/schema/const.d.ts.map +0 -1
  168. package/dist/schema/const.js +0 -305
  169. package/dist/schema/const.js.map +0 -1
  170. package/dist/schema/local.d.ts +0 -702
  171. package/dist/schema/local.d.ts.map +0 -1
  172. package/dist/schema/local.js +0 -150
  173. package/dist/schema/local.js.map +0 -1
  174. package/dist/schema/query.d.ts +0 -1465
  175. package/dist/schema/query.d.ts.map +0 -1
  176. package/dist/schema/query.js +0 -224
  177. package/dist/schema/query.js.map +0 -1
  178. package/dist/schema/util.d.ts +0 -71
  179. package/dist/schema/util.d.ts.map +0 -1
  180. package/dist/schema/util.js +0 -139
  181. package/dist/schema/util.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
3
+ import { AllocatorsSchema, DiscountTypeSchema, ServiceSaleSchema } from "../query/index.js";
4
+ import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NotEmptyNameSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
5
+ import { BalanceTypeSchema } from "../common/index.js";
6
+ // ServiceBuyItem 接口
7
+ export const ServiceBuyItemSchema = z.object({
8
+ name: LongNameSchema.describe("Name of the product or service to purchase"),
9
+ stock: BalanceTypeSchema.describe("Quantity of the product or service to purchase"),
10
+ wip_hash: z.string().describe("WIP file hash of the item"),
11
+ }).strict();
12
+ // Buy 接口
13
+ export const BuySchema = z.object({
14
+ items: z.array(ServiceBuyItemSchema).describe("List of products or services to purchase"),
15
+ total_pay: CoinParamSchema.describe("Actual payment amount"),
16
+ discount: z.string().optional().describe("Discount object ID or name"),
17
+ payment_remark: z.string().optional().describe("Payment remark"),
18
+ payment_index: z.number().optional().describe("Payment index"),
19
+ }).strict();
20
+ // Discount 接口
21
+ export const DiscountSchema = z.object({
22
+ name: z.string().describe("Discount name"),
23
+ discount_type: DiscountTypeSchema.describe("Discount type"),
24
+ discount_value: BalanceTypeSchema.describe("Discount value"),
25
+ benchmark: z.union([z.number(), z.string()]).optional().describe("Discount benchmark value. Discount is only applied if the amount exceeds this value"),
26
+ time_ms_start: z.number().optional().describe("Discount start time (milliseconds)"),
27
+ time_ms_end: z.number().optional().describe("Discount end time (milliseconds)"),
28
+ count: z.number().optional().describe("Discount usage count"),
29
+ recipient: ManyAccountOrMark_AddressSchema.describe("Discount recipient"),
30
+ transferable: z.boolean().optional().describe("Whether the discount object recipient can transfer the discount object"),
31
+ }).strict();
32
+ // OrderNew 接口
33
+ export const OrderNewSchema = z.object({
34
+ buy: BuySchema,
35
+ agents: ManyAccountOrMark_AddressSchema.optional().describe("Order agents. Agents can operate the order, such as canceling the order, modifying the order status, etc.; but cannot receive the funds received by the order."),
36
+ order_required_info: z.string().describe("Contact object ID or WTS Proof object"),
37
+ transfer: AccountOrMark_AddressSchema.optional().describe("Set the new owner of the order. Requires order owner permission to set."),
38
+ namedNewOrder: NamedObjectSchema.optional().describe("Set the local name of the order object."),
39
+ namedNewAllocation: NamedObjectSchema.optional().describe("Set the local name of the order's Allocation object."),
40
+ namedNewProgress: NamedObjectSchema.optional().describe("Set the local name of the order's Progress object."),
41
+ }).strict();
42
+ // Sales 操作类型
43
+ export const SalesSchema = z.discriminatedUnion("op", [
44
+ z.object({
45
+ op: z.literal("add"),
46
+ sales: z.array(ServiceSaleSchema),
47
+ }).strict().describe("Add new sales products or services."),
48
+ z.object({
49
+ op: z.literal("set"),
50
+ sales: z.array(ServiceSaleSchema),
51
+ }).strict().describe("Set sales products or services."),
52
+ z.object({
53
+ op: z.literal("remove"),
54
+ sales_name: z.array(LongNameSchema.describe("Sales name")),
55
+ }).strict().describe("Remove existing sales products or services."),
56
+ z.object({
57
+ op: z.literal("clear"),
58
+ }).strict().describe("Clear all sales products or services."),
59
+ ]);
60
+ // CallService_Data 接口
61
+ export const CallService_DataSchema = z.object({
62
+ object: TypedPermissionObjectSchema,
63
+ order_new: OrderNewSchema.optional().describe("Create new order."),
64
+ description: DescriptionSchema.optional(),
65
+ location: LongNameSchema.optional().describe("Location of the Service"),
66
+ sales: SalesSchema.optional().describe("Service sales products or services list."),
67
+ repositories: ObjectsSchema.optional().describe("Service Repository object list."),
68
+ rewards: ObjectsSchema.optional().describe("Service Reward object list."),
69
+ arbitrations: ObjectsSchema.optional().describe("Service Arbitration object list."),
70
+ machine: z.union([NamedObjectSchema, z.null()]).optional().describe("Service Machine object ID or name. The Machine object must be in published state."),
71
+ discount: DiscountSchema.optional().describe("Issue discount."),
72
+ discount_destroy: z.array(NamedObjectSchema).optional().describe("Destroy existing discount object ID list."),
73
+ customer_required: z.array(NotEmptyNameSchema).optional().describe("Customer required information. Such as phone, email, etc."),
74
+ order_allocators: z.union([AllocatorsSchema, z.null()]).optional().describe("Order fund allocator."),
75
+ compensation_fund_add: CoinParamSchema.optional().describe("Compensation fund. Used to claim compensation based on the arbitration result of the Arb object when resolving order disputes."),
76
+ compensation_locked_time_add: z.number().optional().describe("Lock time for compensation funds added to orders (milliseconds)."),
77
+ compensation_fund_receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive order compensation funds."),
78
+ owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."),
79
+ um: z.union([NamedObjectSchema, z.null()]).optional().describe("Contact object."),
80
+ pause: z.boolean().optional().describe("Whether to pause accepting new orders."),
81
+ publish: z.boolean().optional().describe("Whether to publish the Service. After publishing, customers can place orders; at the same time, service commitments such as machine, order_allocators, arbitrations, etc. will be immutable."),
82
+ }).strict().describe("On-chain Service operations. USAGE: (1) CREATE NEW: Set 'object' field with {name, type, permission, ...} to create a Service. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with object ID or name. The 'object' field is CRITICAL and REQUIRED in both cases.");
83
+ export const CallService_InputSchema = z.object({
84
+ data: CallService_DataSchema,
85
+ env: CallEnvSchema.optional(),
86
+ submission: SubmissionCallSchema.optional(),
87
+ }).strict();