wowok_agent 2.2.4 → 2.2.5

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.
package/dist/index.js CHANGED
@@ -146,6 +146,15 @@ function transformRewardData(data) {
146
146
  const OnchainOperationsSchema = z.preprocess((input) => {
147
147
  if (typeof input === 'object' && input !== null) {
148
148
  const obj = { ...input };
149
+ if (typeof obj.description === 'string' && !obj.operation_type) {
150
+ try {
151
+ const parsed = JSON.parse(obj.description);
152
+ if (parsed && typeof parsed === 'object' && parsed.operation_type) {
153
+ return parsed;
154
+ }
155
+ }
156
+ catch { }
157
+ }
149
158
  if (typeof obj.data === 'string') {
150
159
  try {
151
160
  obj.data = JSON.parse(obj.data);
@@ -237,7 +246,7 @@ const OnchainOperationsSchema = z.preprocess((input) => {
237
246
  operation_type: z.literal("guard"),
238
247
  data: CallGuard_DataSchema,
239
248
  env: CallEnvSchema.optional(),
240
- }).describe("🛡️ Guard Object: Create immutable programmable validation rules that return boolean results. Set 'namedNew' to name the new Guard. Use root.type='node' for direct node tree or root.type='file' to load from file. Use 'wowok_buildin_info' tool with query='guard instructions' for all available operations."),
249
+ }).describe("🛡️ Guard Object: Create immutable programmable validation rules that return boolean results. Set 'namedNew' to name the new Guard. Use root.type='node' for direct node tree or root.type='file' to load from file. Use 'wowok_buildin_info' tool with query='guard instructions' for all available operations. NOTE for EntityLinker/EntityRegistrar queries: Add system addresses to the Guard table - ENTITY_LINKER_ADDRESS (0xaaa) for EntityLinker, ENTITY_REGISTRAR_ADDRESS (0xaab) for EntityRegistrar."),
241
250
  z.object({
242
251
  operation_type: z.literal("personal"),
243
252
  data: CallPersonal_DataSchema,
@@ -270,6 +279,15 @@ const OnchainOperationsSchema = z.preprocess((input) => {
270
279
  const WipOperationsSchema = z.preprocess((input) => {
271
280
  if (typeof input === 'object' && input !== null) {
272
281
  const obj = { ...input };
282
+ if (typeof obj.description === 'string' && !obj.type) {
283
+ try {
284
+ const parsed = JSON.parse(obj.description);
285
+ if (parsed && typeof parsed === 'object' && parsed.type) {
286
+ return parsed;
287
+ }
288
+ }
289
+ catch { }
290
+ }
273
291
  if (typeof obj.options === 'string') {
274
292
  try {
275
293
  obj.options = JSON.parse(obj.options);
@@ -306,6 +324,15 @@ const WipOperationsSchema = z.preprocess((input) => {
306
324
  const OnchainTableDataSchema = z.preprocess((input) => {
307
325
  if (typeof input === 'object' && input !== null && !Array.isArray(input)) {
308
326
  const obj = { ...input };
327
+ if (typeof obj.description === 'string' && !obj.query_type) {
328
+ try {
329
+ const parsed = JSON.parse(obj.description);
330
+ if (parsed && typeof parsed === 'object' && parsed.query_type) {
331
+ return parsed;
332
+ }
333
+ }
334
+ catch { }
335
+ }
309
336
  if (obj.cursor === '')
310
337
  obj.cursor = null;
311
338
  if (obj.limit === '')
@@ -481,6 +508,15 @@ async function handleOnchainTableData(args) {
481
508
  const WatchQueryOperationsSchema = z.preprocess((input) => {
482
509
  if (typeof input === 'object' && input !== null) {
483
510
  const obj = { ...input };
511
+ if (typeof obj.description === 'string' && !obj.query_type) {
512
+ try {
513
+ const parsed = JSON.parse(obj.description);
514
+ if (parsed && typeof parsed === 'object' && parsed.query_type) {
515
+ return parsed;
516
+ }
517
+ }
518
+ catch { }
519
+ }
484
520
  for (const key of ['filter', 'objects', 'env', 'token_type']) {
485
521
  if (typeof obj[key] === 'string') {
486
522
  try {
@@ -548,6 +584,15 @@ const WatchQueryOperationsSchema = z.preprocess((input) => {
548
584
  ]));
549
585
  async function handleOnchainOperations(args) {
550
586
  try {
587
+ if (typeof args === 'object' && args !== null && args.description && !args.operation_type) {
588
+ const hasWrappedParams = typeof args.description === 'string' &&
589
+ (args.description.includes('operation_type') || args.description.includes('data'));
590
+ if (hasWrappedParams) {
591
+ throw new Error("Invalid parameter structure. Parameters should NOT be wrapped in 'description' field.\n" +
592
+ "Correct format: { operation_type: '...', data: {...} }\n" +
593
+ "Incorrect format: { description: '{ operation_type: ... }' }");
594
+ }
595
+ }
551
596
  const validated = strictParse(OnchainOperationsSchema, args, "onchain_operations input");
552
597
  const env = getEnvConfig(validated.env);
553
598
  switch (validated.operation_type) {
@@ -420,7 +420,7 @@ export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
420
420
  convert_witness: WitnessTypeSchema.optional().describe("Optional. When specified, the query retrieves data from the associated object instead of the object itself. For example, querying an order with convert_witness=TypeOrderProgress retrieves the associated Progress object data."),
421
421
  }).strict().describe("The object to query from the Guard table."),
422
422
  parameters: z.array(GuardNodeSchema).describe("Parameters required by the query (must match the query's expected parameters type)."),
423
- }).strict().describe("Returns the result of executing a data query instruction on the specified object. The return type depends on the query being executed."),
423
+ }).strict().describe("Returns the result of executing a data query instruction on the specified object. The return type depends on the query being executed. SPECIAL NOTE for EntityLinker/EntityRegistrar queries: Use system addresses in the Guard table - ENTITY_LINKER_ADDRESS (0xaaa) for EntityLinker queries, ENTITY_REGISTRAR_ADDRESS (0xaab) for EntityRegistrar queries."),
424
424
  z.object({
425
425
  type: z.literal('logic_as_u256_greater_or_equal'),
426
426
  nodes: z.array(GuardNodeSchema),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wowok_agent",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@modelcontextprotocol/sdk": "^1.29.0",
32
32
  "lodash": "^4.18.1",
33
- "wowok": "2.2.5",
33
+ "wowok": "2.2.7",
34
34
  "zod": "^3.25.76"
35
35
  },
36
36
  "devDependencies": {