wowok_agent 1.6.6 → 2.1.9

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 (181) hide show
  1. package/README.md +20 -40
  2. package/dist/index.d.ts +6 -27
  3. package/dist/index.js +1026 -27
  4. package/dist/schema/call/allocation.d.ts +8 -0
  5. package/dist/schema/call/allocation.js +27 -0
  6. package/dist/schema/call/arbitration.d.ts +27 -0
  7. package/dist/schema/call/arbitration.js +106 -0
  8. package/dist/schema/call/base.d.ts +41 -0
  9. package/dist/schema/call/base.js +152 -0
  10. package/dist/schema/call/contact.d.ts +9 -0
  11. package/dist/schema/call/contact.js +41 -0
  12. package/dist/schema/call/demand.d.ts +10 -0
  13. package/dist/schema/call/demand.js +51 -0
  14. package/dist/schema/call/guard.d.ts +15 -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 +23 -0
  21. package/dist/schema/call/machine.js +164 -0
  22. package/dist/schema/call/order.d.ts +11 -0
  23. package/dist/schema/call/order.js +39 -0
  24. package/dist/schema/call/payment.d.ts +7 -0
  25. package/dist/schema/call/payment.js +20 -0
  26. package/dist/schema/call/permission.d.ts +27 -0
  27. package/dist/schema/call/permission.js +118 -0
  28. package/dist/schema/call/personal.d.ts +27 -0
  29. package/dist/schema/call/personal.js +81 -0
  30. package/dist/schema/call/progress.d.ts +6 -0
  31. package/dist/schema/call/progress.js +37 -0
  32. package/dist/schema/call/proof.d.ts +7 -0
  33. package/dist/schema/call/proof.js +27 -0
  34. package/dist/schema/call/repository.d.ts +15 -0
  35. package/dist/schema/call/repository.js +85 -0
  36. package/dist/schema/call/reward.d.ts +7 -0
  37. package/dist/schema/call/reward.js +46 -0
  38. package/dist/schema/call/service.d.ts +7 -0
  39. package/dist/schema/call/service.js +87 -0
  40. package/dist/schema/call/treasury.d.ts +6 -0
  41. package/dist/schema/call/treasury.js +76 -0
  42. package/dist/schema/common/index.d.ts +57 -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 +120 -0
  47. package/dist/schema/local/index.js +913 -0
  48. package/dist/schema/local/wip.d.ts +33 -0
  49. package/dist/schema/local/wip.js +229 -0
  50. package/dist/schema/messenger/index.d.ts +34 -0
  51. package/dist/schema/messenger/index.js +407 -0
  52. package/dist/schema/query/index.d.ts +240 -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
@@ -1 +0,0 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/schema/query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,mCAAmC,sCAAsC,CAAC;AAEvF,eAAO,MAAM,uBAAuB;;;;;;EAEwC,CAAC;AAE7E,eAAO,MAAM,4BAA4B;;;;;CAExC,CAAA;AAED,eAAO,MAAM,0BAA0B;;;;;CAEtC,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;EAEmC,CAAC;AAEtE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;EAI1B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAM/B,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUzC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;CAEzC,CAAA;AACD,eAAO,MAAM,oCAAoC;;;;;CAEhD,CAAA;AAED,eAAO,MAAM,iCAAiC,6gDAW6E,CAAC;AAE5H,eAAO,MAAM,yBAAyB,6PACqH,CAAC;AAC5J,eAAO,MAAM,4BAA4B,8UACsL,CAAC;AAChO,eAAO,MAAM,6BAA6B,mTACuK,CAAC;AAClN,eAAO,MAAM,kCAAkC,mbAEiJ,CAAC;AACjM,eAAO,MAAM,gC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;CAErC,CAAA"}
@@ -1,224 +0,0 @@
1
- import { z } from "zod";
2
- import { GetMarkNameSchema, AccountOrMarkNameSchema, SessionSchema } from "./call.js";
3
- import { zodToJsonSchema } from "zod-to-json-schema";
4
- import { GuardQueryModules, PermissionModules } from "./util.js";
5
- export const QueryWowokProtocolSchemaDescription = `Retrieves the Wowok protocol data`;
6
- export const BuiltInPermissionSchema = z.object({
7
- module: z.union([z.array(z.enum(PermissionModules())).describe("Modules of the built-in permissions"), z.literal('all').describe('All modules')]),
8
- }).describe("Built-in permissions within the modules of the Wowok protocol");
9
- export const BuiltInPermissionSchemaInput = () => {
10
- return zodToJsonSchema(BuiltInPermissionSchema);
11
- };
12
- export const QueriesForGuardSchemaInput = () => {
13
- return zodToJsonSchema(QueriesForGuardSchema);
14
- };
15
- export const QueriesForGuardSchema = z.object({
16
- module: z.union([z.array(z.enum(GuardQueryModules())).describe("Modules of the Guard queries"), z.literal('all').describe('All modules')]),
17
- }).describe("Guard queries within the modules of the Wowok protocol");
18
- export const QueryWowokProtocolSchema = z.object({
19
- built_in_permissions: BuiltInPermissionSchema.optional(),
20
- queries_for_guard: QueriesForGuardSchema.optional(),
21
- });
22
- export const ValueTypeSchema = z.object({
23
- name: z.string().describe("Name of the value type"),
24
- type: z.number().int().describe("Value type of the Wowok protocol"),
25
- description: z.string().optional().describe("Description of the value type"),
26
- });
27
- export const PermissionItemSchema = z.object({
28
- index: z.number().int().describe("Index of the built-in permission"),
29
- name: z.string().describe("Name of the built-in permission"),
30
- description: z.string().describe("Description of the built-in permission"),
31
- module: z.string().describe("Module of the built-in permission"),
32
- guard: z.string().optional().describe("Additional Guard verification"),
33
- });
34
- export const QueryWowokProtocolResultSchema = z.object({
35
- built_in_permissions: z.array(PermissionItemSchema).describe("Built-in permissions of the Wowok protocol"),
36
- queries_for_guard: z.array(z.object({
37
- module: z.string().describe("Module of the Guard query"),
38
- query_name: z.string().describe("Name of the Guard query"),
39
- query_id: z.number().int().describe("ID of the Guard query"),
40
- parameters: z.array(ValueTypeSchema).describe("Parameters of the Guard query"),
41
- return: ValueTypeSchema.describe("Return type of the Guard query"),
42
- description: z.string().describe("Description of the Guard query"),
43
- }))
44
- });
45
- export const QueryWowokProtocolSchemaInput = () => {
46
- return zodToJsonSchema(QueryWowokProtocolSchema);
47
- };
48
- export const QueryWowokProtocolResultSchemaOutput = () => {
49
- return zodToJsonSchema(QueryWowokProtocolResultSchema);
50
- };
51
- export const Query_TableItems_List_Description = `Retrieves paginated table data records from a Wowok on-chain object, where the table data represents dynamically extensible structured information specific to the object type.
52
- The query automatically identifies the object type (one of Permission, Machine, Treasury, Repository, Service, Progress, Arb, PersonalMark, or Demand) and returns data structured according to that specific type's table schema. This enables flexible data retrieval even when the object type of the provided address/name is unknown, with the query result metadata including the identified object type.
53
- Key details by object type:
54
- - **Demand**: Records with timestamps, transaction digests, and associated entity details.
55
- - **Arb**: Arbitration vote entries containing voter addresses, voting weights, and claim lists.
56
- - **Machine**: Node entries with names, operation paths from previous nodes, and metadata.
57
- - **PersonalMark**: Address entries with human-readable names and categorical tags.
58
- - **Permission**: Entries including entity addresses, permission lists (Wowok-defined + custom), and optional Guard constraints.
59
- - **Repository**: Stored data entries with type-coded fields, searchable addresses, and policy-defined names.
60
- - **Progress**: Workflow node entries with previous/next node names, timestamps, and operator session logs.
61
- - **Service**: Product items with names, optional info endpoints, prices, and stock quantities.
62
- - **Treasury**: Financial transaction records with operation codes, operators, Payment addresses, amounts, and timestamps.`;
63
- export const Arb_TableItem_Description = `Retrieves detailed voting information for a specific address within an on-chain Arb object.
64
- Returns voting details such as voter address, voting weight, and list of voting claims, facilitating transparent tracking of arbitration voting processes.`;
65
- export const Demand_TableItem_Description = `Retrieves detailed service recommendation data for a specified address within an on-chain Demand object.
66
- Returns recommendation details such as service name, recommendation rationale, service provider address, and recommendation timestamp, enabling users to review tailored service suggestions for specific demand requirements.`;
67
- export const Machine_TableItem_Description = `Retrieves detailed node information for a specified node within an on-chain Machine object.
68
- Returns node details such as node name, list of all operation paths from the previous node to the current node, and associated metadata, enabling comprehensive tracking and analysis of machine workflow nodes.`;
69
- export const PersonalMark_TableItem_Description = `Retrieves the assigned name and associated tags for a specified address from an on-chain PersonalMark object.
70
- Input parameters include the parent PersonalMark object's address or name, the target address to query, and a no-cache flag.
71
- Returns detailed information such as the human-readable name assigned to the address and an array of categorical tags, enabling clear address labeling and efficient organizational management.`;
72
- export const Permission_TableItem_Description = `Retrieves the permission list for a specified entity address from an on-chain Permission object.
73
- Input parameters include the parent Permission object's address or name, the target entity address to query, and a no-cache flag.
74
- Returns detailed permission data such as the entity address, its associated permission list (including both wowok-defined and custom permissions), and optional additional Guard verification constraints.`;
75
- export const Repository_TableItem_Description = `Retrieves specific stored data entries from an on-chain Repository object.
76
- Returns detailed data information such as data fields (with Wowok-defined base type codes), searchable data address, and field name (as specified by the Repository's policy, ensuring consistent field interpretation across systems).`;
77
- export const Progress_TableItem_Description = `Retrieves historical session data for specific workflow nodes within an on-chain Progress object.
78
- Returns detailed session records such as operation timestamps, operator addresses, and operation behavior logs, enabling comprehensive tracking and analysis of workflow progression across sequential nodes.`;
79
- export const Service_TableItem_Description = `Retrieves current information for a specific on-sale product within an on-chain Service object.
80
- Returns detailed product data such as product name, optional info endpoint URL, price, and stock quantity, enabling users to access up-to-date sales information for specific products to support display or transaction decisions.`;
81
- export const Treasury_TableItem_Description = `Retrieves specific financial transaction records from an on-chain Treasury object by sequential flow number.
82
- Returns a detailed transaction entry containing: operation code (e.g., 'DEPOSIT' or 'WITHDRAW'), operator address, Payment address (bill details), total amount (in Wowok-defined currency units), and transaction timestamp.`;
83
- export const ReceivedObject_Description = `Retrieves the list of ReceivedObject objects received by the Treasury or Order. The query results can be used to deposit the coins within the ReceivedObject objects into the Treasury or Order.`;
84
- export const QueryObjectsSchemaDescription = `Retrieves the on-chain content of specified wowok objects.
85
- Returns detailed on-chain content data(excluding table data) for each queried object, enabling accurate and up-to-date data retrieval.`;
86
- export const QueryObjectsSchema = z.object({
87
- objects: z.array(GetMarkNameSchema()).describe("Wowok object addresses."),
88
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
89
- session: SessionSchema,
90
- });
91
- export const QueryObjectsSchemaInput = () => {
92
- return zodToJsonSchema(QueryObjectsSchema);
93
- };
94
- export const QueryPersonalSchemaDescription = `Query the on-chain personal data by its name, account or address.
95
- The Personal object contains public information such as the user's homepage URL, social media accounts, avatar, likes and favorites, and object naming tags.`;
96
- export const QueryPersonalSchema = z.object({
97
- address: AccountOrMarkNameSchema.describe("Personal address to query."),
98
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
99
- session: SessionSchema,
100
- });
101
- export const QueryPersonalSchemaInput = () => {
102
- return zodToJsonSchema(QueryPersonalSchema);
103
- };
104
- export const QueryTableItemsSchema = z.object({
105
- parent: z.string().describe("The address or name of the on-chain object that owns the table."),
106
- cursor: z.string().optional().nullable().describe("An optional paging cursor. " +
107
- "If provided, the query will start from the next item after the specified cursor. " +
108
- "Default to start from the first item if not specified."),
109
- limit: z.number().optional().nullable().describe("Maximum item returned per page, default to 50 if not specified."),
110
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
111
- session: SessionSchema,
112
- });
113
- export const QueryTableItemsSchemaInput = () => {
114
- return zodToJsonSchema(QueryTableItemsSchema);
115
- };
116
- export const TableItemSchema = z.object({
117
- parent: z.string().describe("The address or name of the on-chain object that owns the table."),
118
- key: z.object({
119
- type: z.string().describe("Type of the value."),
120
- value: z.unknown().describe('Value.')
121
- }).describe('The query key'),
122
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
123
- session: SessionSchema,
124
- }).describe("Query the table item by key from the on-chain object.");
125
- export const QueryPermissionSchemaDescription = `Query the permission list corresponding to a specific address from the on-chain Permission object.`;
126
- export const QueryPermissionSchema = z.object({
127
- permission_object: GetMarkNameSchema('Permission'),
128
- address: AccountOrMarkNameSchema,
129
- session: SessionSchema,
130
- });
131
- export const QueryPermissionResultSchema = z.object({
132
- who: z.string().describe('Address to query permissions'),
133
- owner: z.boolean().optional().describe('Is the owner? Note:The owner has the permission to set the admin'),
134
- admin: z.boolean().optional().describe('Is an admin? Note:Admin has all the permissions.'),
135
- items: z.array(PermissionItemSchema).optional().describe('Permissions of the address'),
136
- object: z.string().describe('permission object'),
137
- });
138
- export const QueryPermissionSchemaInput = () => {
139
- return zodToJsonSchema(QueryPermissionSchema);
140
- };
141
- export const QueryPermissionResultSchemaOutput = () => {
142
- return zodToJsonSchema(QueryPermissionResultSchema);
143
- };
144
- export const EventCursorSchema = z.object({
145
- eventSeq: z.string().describe('Event sequence.'),
146
- txDigest: z.string().describe('Transaction Digest.'),
147
- }).describe('Event retrieval cursor');
148
- export const QueryEventSchemaDescription = `Retrieves paginated on-chain event data using an optional cursor, including event type, timestamp, transaction digest, and associated entity details. Supports no-cache flag for fresh data retrieval. Event type definitions: - OnNewArb: Triggered when a new arbitration request (corresponding to a new Arb object) is created in the Wowok protocol. - OnPresentService: Triggered when a new service is recommended to a Demand object in the Wowok protocol. - OnNewProgress: Triggered when a new task progress record (corresponding to a new Progress object) is created in the Wowok protocol. - OnNewOrder: Triggered when a new order (corresponding to a new Order object) is created in the Wowok protocol. These events are global to the Wowok protocol. For querying events specific to a certain object, directly use the table items list query for that object (refer to the table items list query documentation for details). Event generation and querying do not replace actual operations. For user requests involving operations, always initiate the corresponding operation to the target object first (refer to the operation documentation of relevant objects).`;
149
- export const QueryEventSchema = z.object({
150
- type: z.enum(['OnNewArb', 'OnPresentService', 'OnNewProgress', 'OnNewOrder']).describe("Type of Events: OnNewArb, OnPresentService, OnNewProgress, OnNewOrder"),
151
- cursor: EventCursorSchema.optional().nullable().describe('Paging cursor.'),
152
- limit: z.number().optional().nullable().describe('Mmaximum number of items per page, default to 50 if not specified.'),
153
- order: z.enum(['ascending', 'descending']).optional().nullable().describe('Query result ordering, default to "ascending order", oldest record first.'),
154
- session: SessionSchema,
155
- });
156
- export const QueryEventSchemaInput = () => {
157
- return zodToJsonSchema(QueryEventSchema);
158
- };
159
- export const QueryByAddressSchema = z.object({
160
- parent: z.string().describe("The address or name of the on-chain object that owns the table."),
161
- address: z.string().nonempty().describe('The query key(address) of the table item.'),
162
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
163
- session: SessionSchema,
164
- }).describe("Query the table item by address from the on-chain object.");
165
- export const QueryByNameSchema = z.object({
166
- parent: z.string().describe("The address or name of the on-chain object that owns the table."),
167
- name: z.string().nonempty().describe('The query key(name) of the table item.'),
168
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
169
- session: SessionSchema,
170
- }).describe('Query the table item by name from the on-chain object.');
171
- export const QueryByIndexSchema = z.object({
172
- parent: z.string().nonempty().describe("The address of the on-chain object that owns the table."),
173
- index: z.number().int().min(0).describe('The query key(index) of the table item. Auto-incrementing index starting at 0.'),
174
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
175
- session: SessionSchema,
176
- }).describe("Query the table item by index from the on-chain object.");
177
- export const QueryByAddressNameSchema = z.object({
178
- parent: z.string().describe("The address or name of the on-chain object that owns the table."),
179
- address: z.union([
180
- z.string().nonempty().describe('The address that own the data. '),
181
- z.number().int().min(0).describe('number converted to address, such as time.')
182
- ]),
183
- name: z.string().nonempty().describe('Data field name.'),
184
- no_cache: z.boolean().optional().describe("Whether to not use local cache data."),
185
- session: SessionSchema,
186
- }).describe('Query the data by the address and the name from the on-chain Repository object.');
187
- export const QueryReceivedSchema = z.object({
188
- object: GetMarkNameSchema('Treasury or Order'),
189
- cursor: z.string().optional().nullable().describe('Paging cursor.'),
190
- limit: z.number().optional().nullable().describe('Mmaximum number of items per page, default to 50 if not specified.'),
191
- session: SessionSchema,
192
- });
193
- export const QueryReceivedSchemaInput = () => {
194
- return zodToJsonSchema(QueryReceivedSchema);
195
- };
196
- export const QueryTableItemSchemaDescription = `Retrieves a specific table data item from a Wowok on-chain object based on query criteria. This schema describes the structured format of individual table items returned by the query, varying according to the object type.
197
-
198
- Supported object types and their corresponding item schemas:
199
- - **Demand**: An item containing timestamp (u64), transaction_digest (string), and associated_entity (address).
200
- - **Arb**: An item with voter_address (address), voting_weight (u64), and claim_list (array<string>).
201
- - **Machine**: An item including node_name (string), operation_paths (array<string>), and metadata (string).
202
- - **PersonalMark**: An item with address (address), name (string), and tags (array<string>).
203
- - **Permission**: An item containing entity_address (address), permissions (array<string>), and guard_constraints (optional<address>).
204
- - **Repository**: An item with data_fields (string), searchable_address (address), and field_name (string).
205
- - **Progress**: An item including prev_node (string), next_node (string), timestamp (u64), and session_logs (array<string>).
206
- - **Service**: An item with product_name (string), endpoint (optional<string>), price (u64), and stock (u64).
207
- - **Treasury**: An item containing operation_code (string), operator (address), payment_address (address), amount (u64), and timestamp (u64).`;
208
- export const QueryTableItemSchema = z.object({
209
- query: z.union([
210
- z.object({ name: z.literal('treasury'), data: QueryByIndexSchema }).describe(Treasury_TableItem_Description),
211
- z.object({ name: z.literal('service'), data: QueryByNameSchema }).describe(Service_TableItem_Description),
212
- z.object({ name: z.literal('arb'), data: QueryByAddressSchema }).describe(Arb_TableItem_Description),
213
- z.object({ name: z.literal('demand'), data: QueryByAddressSchema }).describe(Demand_TableItem_Description),
214
- z.object({ name: z.literal('machine'), data: QueryByNameSchema }).describe(Machine_TableItem_Description),
215
- z.object({ name: z.literal('personalmark'), data: QueryByAddressSchema }).describe(PersonalMark_TableItem_Description),
216
- z.object({ name: z.literal('permission'), data: QueryByAddressSchema }).describe(Permission_TableItem_Description),
217
- z.object({ name: z.literal('repository'), data: QueryByAddressNameSchema }).describe(Repository_TableItem_Description),
218
- z.object({ name: z.literal('progress'), data: QueryByIndexSchema }).describe(Progress_TableItem_Description)
219
- ])
220
- });
221
- export const QueryTableItemSchemaInput = () => {
222
- return zodToJsonSchema(QueryTableItemSchema);
223
- };
224
- //# sourceMappingURL=query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/schema/query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,CAAC,MAAM,mCAAmC,GAAG,mCAAmC,CAAC;AAEvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAA2B,CAAC,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;CAC7K,CAAC,CAAC,QAAQ,CAAC,+DAA+D,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC7C,OAAO,eAAe,CAAC,uBAAuB,CAAC,CAAC;AACpD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC3C,OAAO,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAClD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IA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call/base.js";
2
- import { ObjectBaseType } from "../query/objects.js";
3
- /**
4
- * Parses URL parameters and converts them to specified types (supports automatic conversion of strings, numbers, arrays, etc.)
5
- * @param url - The full URL or query parameter string
6
- * @returns Parsed parameter objects (generic T)
7
- */
8
- export declare function parseUrlParams<T extends Record<string, any>>(url: string): T;
9
- export declare enum ToolName {
10
- QUERY_OBJECTS = "objects_query",
11
- QUERY_EVENTS = "events_query",
12
- QUERY_PERMISSIONS = "permissions_query",
13
- QUERY_PERSONAL = "presonal_information_query",
14
- QUERY_LOCAL_MARK_LIST = "local_marks_list",
15
- QUERY_LOCAL_INFO_LIST = "local_information_list",
16
- QUERY_ACCOUNT_LIST = "local_accounts_list",
17
- QUERY_COIN_INFO_LIST = "coin_info_list",
18
- QUERY_LOCAL_MARK_FILTER = "local_mark_filter",
19
- QUERY_LOCAL_MARK = "local_mark_query",
20
- QUERY_LOCAL_INFO = "local_info_query",
21
- QUERY_ACCOUNT = "local_account_query",
22
- QUERY_COIN_INFO = "coin_info_list",
23
- OP_PERSONAL = "personal_operations",
24
- OP_MACHINE = "machine_operations",
25
- OP_SERVICE = "service_operations",
26
- OP_PERMISSION = "permission_operations",
27
- OP_TREASURY = "treasury_operations",
28
- OP_ARBITRATION = "arbitration_operations",
29
- OP_REPOSITORY = "repository_operations",
30
- OP_GUARD = "guard_operations",
31
- OP_DEMAND = "demand_operations",
32
- OP_REPLACE_PERMISSION_OBJECT = "replace_permission_object",
33
- OP_ACCOUNT = "local_account_operations",
34
- OP_LOCAL_MARK = "local_mark_operations",
35
- OP_LOCAL_INFO = "local_info_operations",
36
- OP_COIN_INFO = "coin_info_fetch",
37
- QUERY_TABLE_ITEMS_LIST = "table_items_list",
38
- QUERY_ARB_VOTING = "arb_table_item_query",
39
- QUERY_DEMAND_SERVICE = "demand_table_item_query",
40
- QUERY_PERMISSION_ENTITY = "permission_table_item_query",
41
- QUERY_MACHINE_NODE = "machine_table_item_query",
42
- QUERY_SERVICE_SALE = "service_table_item_query",
43
- QUERY_PROGRESS_HISTORY = "progress_table_item_query",
44
- QUERY_TREASURY_HISTORY = "treasury_table_item_query",
45
- QUERY_REPOSITORY_DATA = "repository_table_item_query",
46
- QUERY_PERSONAL_MARK = "personalmark_table_item_query",
47
- QUERY_RECEIVED = "received_query",
48
- QUERY_LOCAL = "local_query",
49
- QUERY_TABLE_ITEM = "table_item_query",
50
- QUERY_WOWOK_PROTOCOL = "wowok_protocol",
51
- QUERY_BUILT_IN_PERMISSIONS = "built_in_permissions",
52
- QUERY_GUARD_QUERIES = "guard_queries"
53
- }
54
- export declare enum PromptName {
55
- ARBITRATION_NEW = "Create a new Arbitration object",
56
- ARBITRATION_OP = "Operate an existing Arbitration object"
57
- }
58
- export declare const ObjectUrl: (id: string | undefined) => string | undefined;
59
- export declare const BaseTypeFilter: (type?: ObjectBaseType) => boolean;
60
- export declare const ObjectOperationResult: (r: CallResult) => string;
61
- export declare const PermissionModules: () => string[];
62
- export declare const GuardQueryModules: () => string[];
63
- export declare const NoticeFieldsOrder = "Notice:The fields within each tool's parameters are independent and are executed in the order defined by the schema. \n If the requirements of this tool's invocation have a field sequence relationship, but it does not conform to the sequence of fields in the parameter schema (for example, the requirement is to set up Guard for purchase first, and then make the purchase; but the sequence of fields in the schema is purchase first, and setting Guard for purchase second), then it needs to be decomposed into multiple sub-tool invocations (for example, setting up Guard for purchase is the first tool invocation, and the purchase is the second tool invocation).";
64
- export declare const schemaToPromptArguments: (schema: any) => Array<{
65
- name: string;
66
- description: string;
67
- type: string;
68
- required: boolean;
69
- properties?: any;
70
- }>;
71
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/schema/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CA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cAAc,GAAI,OAAM,cAAc,KAAI,OAItD,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,GAAG,UAAU,KAAI,MAUtD,CAAA;AAED,eAAO,MAAM,iBAAiB,QAAQ,MAAM,EAQ3C,CAAA;AACD,eAAO,MAAM,iBAAiB,QAAQ,MAAM,EAQ3C,CAAA;AAED,eAAO,MAAM,iBAAiB,6pBACogB,CAAC;AAIniB,eAAO,MAAM,uBAAuB,GAAI,QAAQ,GAAG,KAAG,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAC,CASjJ,CAAC"}
@@ -1,139 +0,0 @@
1
- import { ResponseData } from "../call/base.js";
2
- import * as WOWOK from "wowok";
3
- /**
4
- * Parses URL parameters and converts them to specified types (supports automatic conversion of strings, numbers, arrays, etc.)
5
- * @param url - The full URL or query parameter string
6
- * @returns Parsed parameter objects (generic T)
7
- */
8
- export function parseUrlParams(url) {
9
- const searchParams = new URLSearchParams(url.includes("?") ? url.split("?")[1] : url);
10
- const result = {};
11
- searchParams.forEach((value, key) => {
12
- if (value.toLowerCase() === "true" || value.toLowerCase() === "false") {
13
- result[key] = value.toLowerCase() === "true";
14
- }
15
- else if (value.includes(",")) {
16
- result[key] = value.split(",").map(item => decodeURIComponent(item));
17
- }
18
- else {
19
- if (WOWOK.IsValidAddress(value)) { //'0x...' address converts to string
20
- result[key] = decodeURIComponent(value);
21
- }
22
- else if (value === '' || value === null || value === undefined) {
23
- result[key] = "false";
24
- }
25
- else if (!isNaN(Number(value))) {
26
- result[key] = Number(value);
27
- }
28
- else {
29
- result[key] = decodeURIComponent(value);
30
- }
31
- }
32
- });
33
- return result;
34
- }
35
- export var ToolName;
36
- (function (ToolName) {
37
- ToolName["QUERY_OBJECTS"] = "objects_query";
38
- ToolName["QUERY_EVENTS"] = "events_query";
39
- ToolName["QUERY_PERMISSIONS"] = "permissions_query";
40
- ToolName["QUERY_PERSONAL"] = "presonal_information_query";
41
- ToolName["QUERY_LOCAL_MARK_LIST"] = "local_marks_list";
42
- ToolName["QUERY_LOCAL_INFO_LIST"] = "local_information_list";
43
- ToolName["QUERY_ACCOUNT_LIST"] = "local_accounts_list";
44
- ToolName["QUERY_COIN_INFO_LIST"] = "coin_info_list";
45
- ToolName["QUERY_LOCAL_MARK_FILTER"] = "local_mark_filter";
46
- ToolName["QUERY_LOCAL_MARK"] = "local_mark_query";
47
- ToolName["QUERY_LOCAL_INFO"] = "local_info_query";
48
- ToolName["QUERY_ACCOUNT"] = "local_account_query";
49
- ToolName["QUERY_COIN_INFO"] = "coin_info_list";
50
- ToolName["OP_PERSONAL"] = "personal_operations";
51
- ToolName["OP_MACHINE"] = "machine_operations";
52
- ToolName["OP_SERVICE"] = "service_operations";
53
- ToolName["OP_PERMISSION"] = "permission_operations";
54
- ToolName["OP_TREASURY"] = "treasury_operations";
55
- ToolName["OP_ARBITRATION"] = "arbitration_operations";
56
- ToolName["OP_REPOSITORY"] = "repository_operations";
57
- ToolName["OP_GUARD"] = "guard_operations";
58
- ToolName["OP_DEMAND"] = "demand_operations";
59
- ToolName["OP_REPLACE_PERMISSION_OBJECT"] = "replace_permission_object";
60
- ToolName["OP_ACCOUNT"] = "local_account_operations";
61
- ToolName["OP_LOCAL_MARK"] = "local_mark_operations";
62
- ToolName["OP_LOCAL_INFO"] = "local_info_operations";
63
- ToolName["OP_COIN_INFO"] = "coin_info_fetch";
64
- ToolName["QUERY_TABLE_ITEMS_LIST"] = "table_items_list";
65
- ToolName["QUERY_ARB_VOTING"] = "arb_table_item_query";
66
- ToolName["QUERY_DEMAND_SERVICE"] = "demand_table_item_query";
67
- ToolName["QUERY_PERMISSION_ENTITY"] = "permission_table_item_query";
68
- ToolName["QUERY_MACHINE_NODE"] = "machine_table_item_query";
69
- ToolName["QUERY_SERVICE_SALE"] = "service_table_item_query";
70
- ToolName["QUERY_PROGRESS_HISTORY"] = "progress_table_item_query";
71
- ToolName["QUERY_TREASURY_HISTORY"] = "treasury_table_item_query";
72
- ToolName["QUERY_REPOSITORY_DATA"] = "repository_table_item_query";
73
- ToolName["QUERY_PERSONAL_MARK"] = "personalmark_table_item_query";
74
- ToolName["QUERY_RECEIVED"] = "received_query";
75
- ToolName["QUERY_LOCAL"] = "local_query";
76
- ToolName["QUERY_TABLE_ITEM"] = "table_item_query";
77
- ToolName["QUERY_WOWOK_PROTOCOL"] = "wowok_protocol";
78
- ToolName["QUERY_BUILT_IN_PERMISSIONS"] = "built_in_permissions";
79
- ToolName["QUERY_GUARD_QUERIES"] = "guard_queries";
80
- })(ToolName || (ToolName = {}));
81
- export var PromptName;
82
- (function (PromptName) {
83
- PromptName["ARBITRATION_NEW"] = "Create a new Arbitration object";
84
- PromptName["ARBITRATION_OP"] = "Operate an existing Arbitration object";
85
- })(PromptName || (PromptName = {}));
86
- export const ObjectUrl = (id) => {
87
- if (WOWOK.IsValidAddress(id)) {
88
- return 'https://wowok.net/' + id;
89
- }
90
- };
91
- export const BaseTypeFilter = (type) => {
92
- return type === 'Demand' || type === 'Progress' || type === 'Service' || type === 'Machine' || type === 'Order' || type === 'Treasury' || type === 'Arbitration' || type === 'Arb'
93
- || type === 'Payment' || type === 'Guard' || type === 'Discount' ||
94
- type === 'Personal' || type === 'Permission' || type === 'PersonalMark' || type === 'Repository';
95
- };
96
- export const ObjectOperationResult = (r) => {
97
- const output = ResponseData(r).filter(v => BaseTypeFilter(v.type)).map(v => {
98
- return {
99
- type: v.type,
100
- object: v.object,
101
- change: v.change,
102
- url: ObjectUrl(v.object)
103
- };
104
- });
105
- return JSON.stringify({ objects: output, raw_data: r });
106
- };
107
- export const PermissionModules = () => {
108
- const ret = [];
109
- WOWOK.PermissionInfo.forEach(v => {
110
- if (!ret.find(i => i === v.module)) {
111
- ret.push(v.module);
112
- }
113
- });
114
- return ret;
115
- };
116
- export const GuardQueryModules = () => {
117
- const ret = [];
118
- WOWOK.GUARD_QUERIES.forEach(v => {
119
- if (!ret.find(i => i === v.module)) {
120
- ret.push(v.module);
121
- }
122
- });
123
- return ret;
124
- };
125
- export const NoticeFieldsOrder = `Notice:The fields within each tool's parameters are independent and are executed in the order defined by the schema.
126
- If the requirements of this tool's invocation have a field sequence relationship, but it does not conform to the sequence of fields in the parameter schema (for example, the requirement is to set up Guard for purchase first, and then make the purchase; but the sequence of fields in the schema is purchase first, and setting Guard for purchase second), then it needs to be decomposed into multiple sub-tool invocations (for example, setting up Guard for purchase is the first tool invocation, and the purchase is the second tool invocation).`;
127
- // Helper function to convert Zod schema to prompt arguments
128
- export const schemaToPromptArguments = (schema) => {
129
- if (!schema || !schema.properties)
130
- return [];
131
- return Object.entries(schema.properties).map(([name, prop]) => ({
132
- name,
133
- description: prop.description || '',
134
- type: prop.type || 'string',
135
- required: schema.required?.includes(name) || false,
136
- properties: prop.properties ? schemaToPromptArguments(prop) : undefined
137
- }));
138
- };
139
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/schema/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC1B,GAAW;IAEX,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACtF,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAClC,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,IAAI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