@wowok/agent-mcp 2.3.0 → 2.3.2

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.
@@ -0,0 +1,918 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://wowok.net/schemas/guard-node.json",
4
+ "title": "GuardNode",
5
+ "description": "Guard computational tree node. Each node represents an operation that returns a typed value. Nodes can be nested to build complex validation logic. IMPORTANT: This schema uses type discrimination - each node MUST have a 'type' field that determines its structure. The 'returns' field in each node definition indicates the return type.",
6
+ "oneOf": [
7
+ { "$ref": "#/definitions/IdentifierNode" },
8
+ { "$ref": "#/definitions/QueryNode" },
9
+ { "$ref": "#/definitions/ContextNode" },
10
+ { "$ref": "#/definitions/LogicAsU256GreaterOrEqualNode" },
11
+ { "$ref": "#/definitions/LogicAsU256LesserOrEqualNode" },
12
+ { "$ref": "#/definitions/LogicAsU256GreaterNode" },
13
+ { "$ref": "#/definitions/LogicAsU256LesserNode" },
14
+ { "$ref": "#/definitions/LogicAsU256EqualNode" },
15
+ { "$ref": "#/definitions/LogicEqualNode" },
16
+ { "$ref": "#/definitions/LogicNotNode" },
17
+ { "$ref": "#/definitions/LogicAndNode" },
18
+ { "$ref": "#/definitions/LogicOrNode" },
19
+ { "$ref": "#/definitions/LogicStringContainsNode" },
20
+ { "$ref": "#/definitions/LogicStringNocaseContainsNode" },
21
+ { "$ref": "#/definitions/LogicStringNocaseEqualNode" },
22
+ { "$ref": "#/definitions/CalcNumberAddNode" },
23
+ { "$ref": "#/definitions/CalcNumberMultiplyNode" },
24
+ { "$ref": "#/definitions/CalcNumberSubtractNode" },
25
+ { "$ref": "#/definitions/CalcNumberDivideNode" },
26
+ { "$ref": "#/definitions/CalcNumberModNode" },
27
+ { "$ref": "#/definitions/CalcStringLengthNode" },
28
+ { "$ref": "#/definitions/CalcStringContainsNode" },
29
+ { "$ref": "#/definitions/CalcStringNocaseContainsNode" },
30
+ { "$ref": "#/definitions/CalcStringNocaseEqualNode" },
31
+ { "$ref": "#/definitions/CalcStringIndexofNode" },
32
+ { "$ref": "#/definitions/CalcStringNocaseIndexofNode" },
33
+ { "$ref": "#/definitions/ConvertNumberAddressNode" },
34
+ { "$ref": "#/definitions/ConvertAddressNumberNode" },
35
+ { "$ref": "#/definitions/ConvertNumberStringNode" },
36
+ { "$ref": "#/definitions/ConvertStringNumberNode" },
37
+ { "$ref": "#/definitions/ConvertSafeU8Node" },
38
+ { "$ref": "#/definitions/ConvertSafeU16Node" },
39
+ { "$ref": "#/definitions/ConvertSafeU32Node" },
40
+ { "$ref": "#/definitions/ConvertSafeU64Node" },
41
+ { "$ref": "#/definitions/ConvertSafeU128Node" },
42
+ { "$ref": "#/definitions/ConvertSafeU256Node" },
43
+ { "$ref": "#/definitions/VecLengthNode" },
44
+ { "$ref": "#/definitions/VecContainsBoolNode" },
45
+ { "$ref": "#/definitions/VecContainsAddressNode" },
46
+ { "$ref": "#/definitions/VecContainsStringNode" },
47
+ { "$ref": "#/definitions/VecContainsStringNocaseNode" },
48
+ { "$ref": "#/definitions/VecContainsNumberNode" },
49
+ { "$ref": "#/definitions/QueryProgressHistoryFindNode" },
50
+ { "$ref": "#/definitions/QueryProgressHistorySessionFindNode" },
51
+ { "$ref": "#/definitions/QueryProgressHistorySessionForwardFindNode" },
52
+ { "$ref": "#/definitions/QueryProgressHistorySessionCountNode" },
53
+ { "$ref": "#/definitions/QueryProgressHistorySessionForwardCountNode" },
54
+ { "$ref": "#/definitions/QueryProgressHistorySessionForwardRetainedSubmissionCountNode" },
55
+ { "$ref": "#/definitions/QueryRewardRecordFindNode" },
56
+ { "$ref": "#/definitions/QueryRewardRecordCountNode" },
57
+ { "$ref": "#/definitions/QueryRewardRecordExistsNode" }
58
+ ],
59
+ "definitions": {
60
+ "GuardIdentifier": {
61
+ "type": "integer",
62
+ "minimum": 0,
63
+ "maximum": 255,
64
+ "description": "Identifier index (0-255) referencing a value in the Guard table"
65
+ },
66
+ "GuardNodeRef": {
67
+ "description": "Reference to a GuardNode. This is a recursive structure that can be any of the node types defined in this schema. Use the 'type' field to determine which node type it is.",
68
+ "oneOf": [
69
+ { "$ref": "#/definitions/IdentifierNode" },
70
+ { "$ref": "#/definitions/QueryNode" },
71
+ { "$ref": "#/definitions/ContextNode" },
72
+ { "$ref": "#/definitions/LogicAsU256GreaterOrEqualNode" },
73
+ { "$ref": "#/definitions/LogicAsU256LesserOrEqualNode" },
74
+ { "$ref": "#/definitions/LogicAsU256GreaterNode" },
75
+ { "$ref": "#/definitions/LogicAsU256LesserNode" },
76
+ { "$ref": "#/definitions/LogicAsU256EqualNode" },
77
+ { "$ref": "#/definitions/LogicEqualNode" },
78
+ { "$ref": "#/definitions/LogicNotNode" },
79
+ { "$ref": "#/definitions/LogicAndNode" },
80
+ { "$ref": "#/definitions/LogicOrNode" },
81
+ { "$ref": "#/definitions/LogicStringContainsNode" },
82
+ { "$ref": "#/definitions/LogicStringNocaseContainsNode" },
83
+ { "$ref": "#/definitions/LogicStringNocaseEqualNode" },
84
+ { "$ref": "#/definitions/CalcNumberAddNode" },
85
+ { "$ref": "#/definitions/CalcNumberMultiplyNode" },
86
+ { "$ref": "#/definitions/CalcNumberSubtractNode" },
87
+ { "$ref": "#/definitions/CalcNumberDivideNode" },
88
+ { "$ref": "#/definitions/CalcNumberModNode" },
89
+ { "$ref": "#/definitions/CalcStringLengthNode" },
90
+ { "$ref": "#/definitions/CalcStringContainsNode" },
91
+ { "$ref": "#/definitions/CalcStringNocaseContainsNode" },
92
+ { "$ref": "#/definitions/CalcStringNocaseEqualNode" },
93
+ { "$ref": "#/definitions/CalcStringIndexofNode" },
94
+ { "$ref": "#/definitions/CalcStringNocaseIndexofNode" },
95
+ { "$ref": "#/definitions/ConvertNumberAddressNode" },
96
+ { "$ref": "#/definitions/ConvertAddressNumberNode" },
97
+ { "$ref": "#/definitions/ConvertNumberStringNode" },
98
+ { "$ref": "#/definitions/ConvertStringNumberNode" },
99
+ { "$ref": "#/definitions/ConvertSafeU8Node" },
100
+ { "$ref": "#/definitions/ConvertSafeU16Node" },
101
+ { "$ref": "#/definitions/ConvertSafeU32Node" },
102
+ { "$ref": "#/definitions/ConvertSafeU64Node" },
103
+ { "$ref": "#/definitions/ConvertSafeU128Node" },
104
+ { "$ref": "#/definitions/ConvertSafeU256Node" },
105
+ { "$ref": "#/definitions/VecLengthNode" },
106
+ { "$ref": "#/definitions/VecContainsBoolNode" },
107
+ { "$ref": "#/definitions/VecContainsAddressNode" },
108
+ { "$ref": "#/definitions/VecContainsStringNode" },
109
+ { "$ref": "#/definitions/VecContainsStringNocaseNode" },
110
+ { "$ref": "#/definitions/VecContainsNumberNode" },
111
+ { "$ref": "#/definitions/QueryProgressHistoryFindNode" },
112
+ { "$ref": "#/definitions/QueryProgressHistorySessionFindNode" },
113
+ { "$ref": "#/definitions/QueryProgressHistorySessionForwardFindNode" },
114
+ { "$ref": "#/definitions/QueryProgressHistorySessionCountNode" },
115
+ { "$ref": "#/definitions/QueryProgressHistorySessionForwardCountNode" },
116
+ { "$ref": "#/definitions/QueryProgressHistorySessionForwardRetainedSubmissionCountNode" },
117
+ { "$ref": "#/definitions/QueryRewardRecordFindNode" },
118
+ { "$ref": "#/definitions/QueryRewardRecordCountNode" },
119
+ { "$ref": "#/definitions/QueryRewardRecordExistsNode" }
120
+ ]
121
+ },
122
+ "GuardNodeArray": {
123
+ "type": "array",
124
+ "items": { "$ref": "#/definitions/GuardNodeRef" },
125
+ "minItems": 1,
126
+ "maxItems": 8,
127
+ "description": "Array of 1-8 child GuardNodes. All nodes in the array are evaluated and their results are combined according to the parent node's logic."
128
+ },
129
+ "WitnessType": {
130
+ "type": "integer",
131
+ "description": "Witness type for converting object data. Common values: 100 (TypeOrderProgress) for querying order progress, 200 (TypeOrder) for order data"
132
+ },
133
+ "IdentifierNode": {
134
+ "type": "object",
135
+ "properties": {
136
+ "type": { "const": "identifier" },
137
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
138
+ },
139
+ "required": ["type", "identifier"],
140
+ "additionalProperties": false,
141
+ "returns": "any",
142
+ "description": "Returns the constant value stored at the specified identifier in the Guard table. Return type depends on the table item's value_type (U8, U16, U32, U64, U128, U256, Bool, Address, String, Vec)."
143
+ },
144
+ "QueryNode": {
145
+ "type": "object",
146
+ "properties": {
147
+ "type": { "const": "query" },
148
+ "query": {
149
+ "oneOf": [
150
+ { "type": "integer", "description": "Query instruction ID (e.g., 1562 for order.owner, 1563 for order.service, 1253 for order.progress.node)" },
151
+ { "type": "string", "description": "Query instruction name (e.g., 'order.owner', 'order.service')" }
152
+ ]
153
+ },
154
+ "object": {
155
+ "type": "object",
156
+ "properties": {
157
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" },
158
+ "convert_witness": { "$ref": "#/definitions/WitnessType" }
159
+ },
160
+ "required": ["identifier"],
161
+ "additionalProperties": false,
162
+ "description": "The object to query from the Guard table"
163
+ },
164
+ "parameters": {
165
+ "type": "array",
166
+ "items": { "$ref": "#/definitions/GuardNodeRef" },
167
+ "description": "Parameters required by the query (must match the query's expected parameter types)"
168
+ }
169
+ },
170
+ "required": ["type", "query", "object", "parameters"],
171
+ "additionalProperties": false,
172
+ "returns": "any",
173
+ "description": "Returns the result of executing a data query instruction on the specified object. Return type depends on the query being executed. Use convert_witness to access specific object data like order progress."
174
+ },
175
+ "ContextNode": {
176
+ "type": "object",
177
+ "properties": {
178
+ "type": { "const": "context" },
179
+ "context": {
180
+ "type": "string",
181
+ "enum": ["Signer", "Clock", "Guard"],
182
+ "description": "System context type: Signer returns transaction sender address (Address), Clock returns current on-chain timestamp (U64), Guard returns current Guard object ID (Address)"
183
+ }
184
+ },
185
+ "required": ["type", "context"],
186
+ "additionalProperties": false,
187
+ "returns": "Address | U64",
188
+ "description": "Returns system context information. Signer and Guard return Address, Clock returns U64."
189
+ },
190
+ "LogicAsU256GreaterOrEqualNode": {
191
+ "type": "object",
192
+ "properties": {
193
+ "type": { "const": "logic_as_u256_greater_or_equal" },
194
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
195
+ },
196
+ "required": ["type", "nodes"],
197
+ "additionalProperties": false,
198
+ "returns": "Bool",
199
+ "description": "Returns Bool. Requires 2-8 numeric nodes (U8, U16, U32, U64, U128, U256). Returns true if first >= all others."
200
+ },
201
+ "LogicAsU256LesserOrEqualNode": {
202
+ "type": "object",
203
+ "properties": {
204
+ "type": { "const": "logic_as_u256_lesser_or_equal" },
205
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
206
+ },
207
+ "required": ["type", "nodes"],
208
+ "additionalProperties": false,
209
+ "returns": "Bool",
210
+ "description": "Returns Bool. Requires 2-8 numeric nodes. Returns true if first <= all others."
211
+ },
212
+ "LogicAsU256GreaterNode": {
213
+ "type": "object",
214
+ "properties": {
215
+ "type": { "const": "logic_as_u256_greater" },
216
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
217
+ },
218
+ "required": ["type", "nodes"],
219
+ "additionalProperties": false,
220
+ "returns": "Bool",
221
+ "description": "Returns Bool. Requires 2-8 numeric nodes. Returns true if first > all others."
222
+ },
223
+ "LogicAsU256LesserNode": {
224
+ "type": "object",
225
+ "properties": {
226
+ "type": { "const": "logic_as_u256_lesser" },
227
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
228
+ },
229
+ "required": ["type", "nodes"],
230
+ "additionalProperties": false,
231
+ "returns": "Bool",
232
+ "description": "Returns Bool. Requires 2-8 numeric nodes. Returns true if first < all others."
233
+ },
234
+ "LogicAsU256EqualNode": {
235
+ "type": "object",
236
+ "properties": {
237
+ "type": { "const": "logic_as_u256_equal" },
238
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
239
+ },
240
+ "required": ["type", "nodes"],
241
+ "additionalProperties": false,
242
+ "returns": "Bool",
243
+ "description": "Returns Bool. Requires 2-8 numeric nodes. Returns true if first equals all others."
244
+ },
245
+ "LogicEqualNode": {
246
+ "type": "object",
247
+ "properties": {
248
+ "type": { "const": "logic_equal" },
249
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
250
+ },
251
+ "required": ["type", "nodes"],
252
+ "additionalProperties": false,
253
+ "returns": "Bool",
254
+ "description": "Returns Bool. Requires 2-8 nodes of any type. Returns true if type and value match for all. Can compare Address, String, Bool, or numeric types."
255
+ },
256
+ "LogicNotNode": {
257
+ "type": "object",
258
+ "properties": {
259
+ "type": { "const": "logic_not" },
260
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
261
+ },
262
+ "required": ["type", "node"],
263
+ "additionalProperties": false,
264
+ "returns": "Bool",
265
+ "description": "Returns Bool. Inverts the boolean value of the child node. The child node must return Bool."
266
+ },
267
+ "LogicAndNode": {
268
+ "type": "object",
269
+ "properties": {
270
+ "type": { "const": "logic_and" },
271
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
272
+ },
273
+ "required": ["type", "nodes"],
274
+ "additionalProperties": false,
275
+ "returns": "Bool",
276
+ "description": "Returns Bool. Requires 2-8 boolean nodes. Returns true if ALL are true. This is the most common root node type for combining multiple validation conditions."
277
+ },
278
+ "LogicOrNode": {
279
+ "type": "object",
280
+ "properties": {
281
+ "type": { "const": "logic_or" },
282
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
283
+ },
284
+ "required": ["type", "nodes"],
285
+ "additionalProperties": false,
286
+ "returns": "Bool",
287
+ "description": "Returns Bool. Requires 2-8 boolean nodes. Returns true if ANY is true."
288
+ },
289
+ "LogicStringContainsNode": {
290
+ "type": "object",
291
+ "properties": {
292
+ "type": { "const": "logic_string_contains" },
293
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
294
+ },
295
+ "required": ["type", "nodes"],
296
+ "additionalProperties": false,
297
+ "returns": "Bool",
298
+ "description": "Returns Bool. Requires 2-8 string nodes. First is haystack, others are needles. Case-sensitive substring check."
299
+ },
300
+ "LogicStringNocaseContainsNode": {
301
+ "type": "object",
302
+ "properties": {
303
+ "type": { "const": "logic_string_nocase_contains" },
304
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
305
+ },
306
+ "required": ["type", "nodes"],
307
+ "additionalProperties": false,
308
+ "returns": "Bool",
309
+ "description": "Returns Bool. String contains check, case-insensitive."
310
+ },
311
+ "LogicStringNocaseEqualNode": {
312
+ "type": "object",
313
+ "properties": {
314
+ "type": { "const": "logic_string_nocase_equal" },
315
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
316
+ },
317
+ "required": ["type", "nodes"],
318
+ "additionalProperties": false,
319
+ "returns": "Bool",
320
+ "description": "Returns Bool. String equality check, case-insensitive."
321
+ },
322
+ "CalcNumberAddNode": {
323
+ "type": "object",
324
+ "properties": {
325
+ "type": { "const": "calc_number_add" },
326
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
327
+ },
328
+ "required": ["type", "nodes"],
329
+ "additionalProperties": false,
330
+ "returns": "U256",
331
+ "description": "Returns U256. Adds all numeric nodes (first + second + third + ...). All inputs must be numeric types."
332
+ },
333
+ "CalcNumberMultiplyNode": {
334
+ "type": "object",
335
+ "properties": {
336
+ "type": { "const": "calc_number_multiply" },
337
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
338
+ },
339
+ "required": ["type", "nodes"],
340
+ "additionalProperties": false,
341
+ "returns": "U256",
342
+ "description": "Returns U256. Multiplies all numeric nodes (first * second * third * ...)"
343
+ },
344
+ "CalcNumberSubtractNode": {
345
+ "type": "object",
346
+ "properties": {
347
+ "type": { "const": "calc_number_subtract" },
348
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
349
+ },
350
+ "required": ["type", "nodes"],
351
+ "additionalProperties": false,
352
+ "returns": "U256",
353
+ "description": "Returns U256. Subtracts subsequent nodes from first (first - second - third - ...)"
354
+ },
355
+ "CalcNumberDivideNode": {
356
+ "type": "object",
357
+ "properties": {
358
+ "type": { "const": "calc_number_divide" },
359
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
360
+ },
361
+ "required": ["type", "nodes"],
362
+ "additionalProperties": false,
363
+ "returns": "U256",
364
+ "description": "Returns U256. Divides first by subsequent nodes (first / second / third / ...). Division by zero will fail."
365
+ },
366
+ "CalcNumberModNode": {
367
+ "type": "object",
368
+ "properties": {
369
+ "type": { "const": "calc_number_mod" },
370
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
371
+ },
372
+ "required": ["type", "nodes"],
373
+ "additionalProperties": false,
374
+ "returns": "U256",
375
+ "description": "Returns U256. Modulo operation (first % second % third % ...)"
376
+ },
377
+ "CalcStringLengthNode": {
378
+ "type": "object",
379
+ "properties": {
380
+ "type": { "const": "calc_string_length" },
381
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
382
+ },
383
+ "required": ["type", "node"],
384
+ "additionalProperties": false,
385
+ "returns": "U64",
386
+ "description": "Returns U64. Returns the length of the string in bytes."
387
+ },
388
+ "CalcStringContainsNode": {
389
+ "type": "object",
390
+ "properties": {
391
+ "type": { "const": "calc_string_contains" },
392
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
393
+ },
394
+ "required": ["type", "nodes"],
395
+ "additionalProperties": false,
396
+ "returns": "Bool",
397
+ "description": "Returns Bool. String contains check (for use in calculations). First is haystack, others are needles."
398
+ },
399
+ "CalcStringNocaseContainsNode": {
400
+ "type": "object",
401
+ "properties": {
402
+ "type": { "const": "calc_string_nocase_contains" },
403
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
404
+ },
405
+ "required": ["type", "nodes"],
406
+ "additionalProperties": false,
407
+ "returns": "Bool",
408
+ "description": "Returns Bool. Case-insensitive string contains."
409
+ },
410
+ "CalcStringNocaseEqualNode": {
411
+ "type": "object",
412
+ "properties": {
413
+ "type": { "const": "calc_string_nocase_equal" },
414
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
415
+ },
416
+ "required": ["type", "nodes"],
417
+ "additionalProperties": false,
418
+ "returns": "Bool",
419
+ "description": "Returns Bool. Case-insensitive string equality."
420
+ },
421
+ "CalcStringIndexofNode": {
422
+ "type": "object",
423
+ "properties": {
424
+ "type": { "const": "calc_string_indexof" },
425
+ "nodeLeft": { "$ref": "#/definitions/GuardNodeRef" },
426
+ "nodeRight": { "$ref": "#/definitions/GuardNodeRef" },
427
+ "order": { "type": "string", "enum": ["forward", "backward"] }
428
+ },
429
+ "required": ["type", "nodeLeft", "nodeRight", "order"],
430
+ "additionalProperties": false,
431
+ "returns": "U64",
432
+ "description": "Returns U64. Finds index of substring. Returns -1 (as U64 max) if not found. 'forward' searches from start, 'backward' from end."
433
+ },
434
+ "CalcStringNocaseIndexofNode": {
435
+ "type": "object",
436
+ "properties": {
437
+ "type": { "const": "calc_string_nocase_indexof" },
438
+ "nodeLeft": { "$ref": "#/definitions/GuardNodeRef" },
439
+ "nodeRight": { "$ref": "#/definitions/GuardNodeRef" },
440
+ "order": { "type": "string", "enum": ["forward", "backward"] }
441
+ },
442
+ "required": ["type", "nodeLeft", "nodeRight", "order"],
443
+ "additionalProperties": false,
444
+ "returns": "U64",
445
+ "description": "Returns U64. Case-insensitive index search."
446
+ },
447
+ "ConvertNumberAddressNode": {
448
+ "type": "object",
449
+ "properties": {
450
+ "type": { "const": "convert_number_address" },
451
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
452
+ },
453
+ "required": ["type", "node"],
454
+ "additionalProperties": false,
455
+ "returns": "Address",
456
+ "description": "Returns Address. Converts a U64 number to an address. Useful for converting numeric IDs to addresses."
457
+ },
458
+ "ConvertAddressNumberNode": {
459
+ "type": "object",
460
+ "properties": {
461
+ "type": { "const": "convert_address_number" },
462
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
463
+ },
464
+ "required": ["type", "node"],
465
+ "additionalProperties": false,
466
+ "returns": "U64",
467
+ "description": "Returns U64. Converts an address to a number (takes the lower 8 bytes)."
468
+ },
469
+ "ConvertNumberStringNode": {
470
+ "type": "object",
471
+ "properties": {
472
+ "type": { "const": "convert_number_string" },
473
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
474
+ },
475
+ "required": ["type", "node"],
476
+ "additionalProperties": false,
477
+ "returns": "String",
478
+ "description": "Returns String. Converts a number to its decimal string representation."
479
+ },
480
+ "ConvertStringNumberNode": {
481
+ "type": "object",
482
+ "properties": {
483
+ "type": { "const": "convert_string_number" },
484
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
485
+ },
486
+ "required": ["type", "node"],
487
+ "additionalProperties": false,
488
+ "returns": "U256",
489
+ "description": "Returns U256. Parses a decimal string as a number. Returns 0 if parsing fails."
490
+ },
491
+ "ConvertSafeU8Node": {
492
+ "type": "object",
493
+ "properties": {
494
+ "type": { "const": "convert_safe_u8" },
495
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
496
+ },
497
+ "required": ["type", "node"],
498
+ "additionalProperties": false,
499
+ "returns": "U8",
500
+ "description": "Returns U8. Safely converts a number to U8 with overflow protection (values > 255 become 255)."
501
+ },
502
+ "ConvertSafeU16Node": {
503
+ "type": "object",
504
+ "properties": {
505
+ "type": { "const": "convert_safe_u16" },
506
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
507
+ },
508
+ "required": ["type", "node"],
509
+ "additionalProperties": false,
510
+ "returns": "U16",
511
+ "description": "Returns U16. Safely converts a number to U16 with overflow protection."
512
+ },
513
+ "ConvertSafeU32Node": {
514
+ "type": "object",
515
+ "properties": {
516
+ "type": { "const": "convert_safe_u32" },
517
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
518
+ },
519
+ "required": ["type", "node"],
520
+ "additionalProperties": false,
521
+ "returns": "U32",
522
+ "description": "Returns U32. Safely converts a number to U32 with overflow protection."
523
+ },
524
+ "ConvertSafeU64Node": {
525
+ "type": "object",
526
+ "properties": {
527
+ "type": { "const": "convert_safe_u64" },
528
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
529
+ },
530
+ "required": ["type", "node"],
531
+ "additionalProperties": false,
532
+ "returns": "U64",
533
+ "description": "Returns U64. Safely converts a number to U64 with overflow protection."
534
+ },
535
+ "ConvertSafeU128Node": {
536
+ "type": "object",
537
+ "properties": {
538
+ "type": { "const": "convert_safe_u128" },
539
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
540
+ },
541
+ "required": ["type", "node"],
542
+ "additionalProperties": false,
543
+ "returns": "U128",
544
+ "description": "Returns U128. Safely converts a number to U128 with overflow protection."
545
+ },
546
+ "ConvertSafeU256Node": {
547
+ "type": "object",
548
+ "properties": {
549
+ "type": { "const": "convert_safe_u256" },
550
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
551
+ },
552
+ "required": ["type", "node"],
553
+ "additionalProperties": false,
554
+ "returns": "U256",
555
+ "description": "Returns U256. Safely converts a number to U256 with overflow protection."
556
+ },
557
+ "VecLengthNode": {
558
+ "type": "object",
559
+ "properties": {
560
+ "type": { "const": "vec_length" },
561
+ "node": { "$ref": "#/definitions/GuardNodeRef" }
562
+ },
563
+ "required": ["type", "node"],
564
+ "additionalProperties": false,
565
+ "returns": "U64",
566
+ "description": "Returns U64. Returns the length of a vector (array)."
567
+ },
568
+ "VecContainsBoolNode": {
569
+ "type": "object",
570
+ "properties": {
571
+ "type": { "const": "vec_contains_bool" },
572
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
573
+ },
574
+ "required": ["type", "nodes"],
575
+ "additionalProperties": false,
576
+ "returns": "Bool",
577
+ "description": "Returns Bool. Checks if vector contains a boolean value. First node is the vector, others are values to check."
578
+ },
579
+ "VecContainsAddressNode": {
580
+ "type": "object",
581
+ "properties": {
582
+ "type": { "const": "vec_contains_address" },
583
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
584
+ },
585
+ "required": ["type", "nodes"],
586
+ "additionalProperties": false,
587
+ "returns": "Bool",
588
+ "description": "Returns Bool. Checks if vector contains an address."
589
+ },
590
+ "VecContainsStringNode": {
591
+ "type": "object",
592
+ "properties": {
593
+ "type": { "const": "vec_contains_string" },
594
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
595
+ },
596
+ "required": ["type", "nodes"],
597
+ "additionalProperties": false,
598
+ "returns": "Bool",
599
+ "description": "Returns Bool. Checks if vector contains a string."
600
+ },
601
+ "VecContainsStringNocaseNode": {
602
+ "type": "object",
603
+ "properties": {
604
+ "type": { "const": "vec_contains_string_nocase" },
605
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
606
+ },
607
+ "required": ["type", "nodes"],
608
+ "additionalProperties": false,
609
+ "returns": "Bool",
610
+ "description": "Returns Bool. Case-insensitive vector string contains."
611
+ },
612
+ "VecContainsNumberNode": {
613
+ "type": "object",
614
+ "properties": {
615
+ "type": { "const": "vec_contains_number" },
616
+ "nodes": { "$ref": "#/definitions/GuardNodeArray" }
617
+ },
618
+ "required": ["type", "nodes"],
619
+ "additionalProperties": false,
620
+ "returns": "Bool",
621
+ "description": "Returns Bool. Checks if vector contains a number."
622
+ },
623
+ "QueryProgressHistoryFindNode": {
624
+ "type": "object",
625
+ "properties": {
626
+ "type": { "const": "query_progress_history_find" },
627
+ "object": {
628
+ "type": "object",
629
+ "properties": {
630
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
631
+ },
632
+ "required": ["identifier"],
633
+ "additionalProperties": false
634
+ },
635
+ "where": {
636
+ "type": "object",
637
+ "properties": {
638
+ "node": { "type": "string", "description": "Filter by node name" },
639
+ "nextNode": { "type": "string", "description": "Filter by next node name" },
640
+ "timeMin": { "type": "string", "description": "Minimum timestamp (inclusive) as U64 string" },
641
+ "timeMax": { "type": "string", "description": "Maximum timestamp (inclusive) as U64 string" },
642
+ "indexMin": { "type": "string", "description": "Minimum history index (inclusive) as U64 string" },
643
+ "indexMax": { "type": "string", "description": "Maximum history index (inclusive) as U64 string" }
644
+ },
645
+ "additionalProperties": false
646
+ },
647
+ "find": { "type": "string", "enum": ["first", "last"], "description": "'first' finds earliest, 'last' finds most recent" }
648
+ },
649
+ "required": ["type", "object", "where", "find"],
650
+ "additionalProperties": false,
651
+ "returns": "U64",
652
+ "description": "Returns U64. Finds the index of the first or last history entry matching the filter conditions. Returns index if found, throws error if not found."
653
+ },
654
+ "QueryProgressHistorySessionFindNode": {
655
+ "type": "object",
656
+ "properties": {
657
+ "type": { "const": "query_progress_history_session_find" },
658
+ "object": {
659
+ "type": "object",
660
+ "properties": {
661
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
662
+ },
663
+ "required": ["identifier"],
664
+ "additionalProperties": false
665
+ },
666
+ "historyIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "History entry index (U64)" },
667
+ "where": {
668
+ "type": "object",
669
+ "properties": {
670
+ "nextNode": { "type": "string", "description": "Filter by next node name" }
671
+ },
672
+ "additionalProperties": false
673
+ },
674
+ "find": { "type": "string", "enum": ["first", "last"] }
675
+ },
676
+ "required": ["type", "object", "historyIdx", "where", "find"],
677
+ "additionalProperties": false,
678
+ "returns": "U64",
679
+ "description": "Returns U64. Finds the index of the first or last session within the specified history entry."
680
+ },
681
+ "QueryProgressHistorySessionForwardFindNode": {
682
+ "type": "object",
683
+ "properties": {
684
+ "type": { "const": "query_progress_history_session_forward_find" },
685
+ "object": {
686
+ "type": "object",
687
+ "properties": {
688
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
689
+ },
690
+ "required": ["identifier"],
691
+ "additionalProperties": false
692
+ },
693
+ "historyIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "History entry index (U64)" },
694
+ "sessionIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "Session index within history (U64)" },
695
+ "where": {
696
+ "type": "object",
697
+ "properties": {
698
+ "who": { "type": "string", "description": "Filter by operator address" },
699
+ "operation": { "type": "string", "description": "Filter by operation name" },
700
+ "accomplished": { "type": "boolean", "description": "Filter by accomplished status" },
701
+ "timeMin": { "type": "string", "description": "Minimum timestamp as U64 string" },
702
+ "timeMax": { "type": "string", "description": "Maximum timestamp as U64 string" }
703
+ },
704
+ "additionalProperties": false
705
+ },
706
+ "find": { "type": "string", "enum": ["first", "last"] }
707
+ },
708
+ "required": ["type", "object", "historyIdx", "sessionIdx", "where", "find"],
709
+ "additionalProperties": false,
710
+ "returns": "U64",
711
+ "description": "Returns U64. Finds the index of the first or last forward operation within the specified history session."
712
+ },
713
+ "QueryProgressHistorySessionCountNode": {
714
+ "type": "object",
715
+ "properties": {
716
+ "type": { "const": "query_progress_history_session_count" },
717
+ "object": {
718
+ "type": "object",
719
+ "properties": {
720
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
721
+ },
722
+ "required": ["identifier"],
723
+ "additionalProperties": false
724
+ },
725
+ "historyIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "History entry index (U64)" }
726
+ },
727
+ "required": ["type", "object", "historyIdx"],
728
+ "additionalProperties": false,
729
+ "returns": "U64",
730
+ "description": "Returns U64. Counts the number of sessions within the specified history entry."
731
+ },
732
+ "QueryProgressHistorySessionForwardCountNode": {
733
+ "type": "object",
734
+ "properties": {
735
+ "type": { "const": "query_progress_history_session_forward_count" },
736
+ "object": {
737
+ "type": "object",
738
+ "properties": {
739
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
740
+ },
741
+ "required": ["identifier"],
742
+ "additionalProperties": false
743
+ },
744
+ "historyIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "History entry index (U64)" },
745
+ "sessionIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "Session index within history (U64)" }
746
+ },
747
+ "required": ["type", "object", "historyIdx", "sessionIdx"],
748
+ "additionalProperties": false,
749
+ "returns": "U64",
750
+ "description": "Returns U64. Counts the number of forward operations within the specified history session."
751
+ },
752
+ "QueryProgressHistorySessionForwardRetainedSubmissionCountNode": {
753
+ "type": "object",
754
+ "properties": {
755
+ "type": { "const": "query_progress_history_session_forward_retained_submission_count" },
756
+ "object": {
757
+ "type": "object",
758
+ "properties": {
759
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
760
+ },
761
+ "required": ["identifier"],
762
+ "additionalProperties": false
763
+ },
764
+ "historyIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "History entry index (U64)" },
765
+ "sessionIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "Session index within history (U64)" },
766
+ "forwardIdx": { "$ref": "#/definitions/GuardNodeRef", "description": "Forward operation index (U64)" }
767
+ },
768
+ "required": ["type", "object", "historyIdx", "sessionIdx", "forwardIdx"],
769
+ "additionalProperties": false,
770
+ "returns": "U64",
771
+ "description": "Returns U64. Counts the number of retained submissions within the specified forward operation."
772
+ },
773
+ "QueryRewardRecordFindNode": {
774
+ "type": "object",
775
+ "properties": {
776
+ "type": { "const": "query_reward_record_find" },
777
+ "object": {
778
+ "type": "object",
779
+ "properties": {
780
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
781
+ },
782
+ "required": ["identifier"],
783
+ "additionalProperties": false,
784
+ "description": "Reference to the Reward object in the Guard table (must be Address type)"
785
+ },
786
+ "find": { "type": "string", "enum": ["first", "last"], "description": "'first' finds earliest, 'last' finds most recent" },
787
+ "recipient": {
788
+ "type": "object",
789
+ "properties": {
790
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
791
+ },
792
+ "required": ["identifier"],
793
+ "additionalProperties": false,
794
+ "description": "Optional: Identifier reference to recipient address in Guard table (must be Address type). If not specified, uses the transaction signer address."
795
+ },
796
+ "where": {
797
+ "type": "object",
798
+ "properties": {
799
+ "guard": { "type": "string", "description": "Optional: Guard object address constant to match" },
800
+ "timeMin": { "type": "string", "description": "Optional: minimum timestamp (inclusive) as U64 string" },
801
+ "timeMax": { "type": "string", "description": "Optional: maximum timestamp (inclusive) as U64 string" },
802
+ "amountMin": { "type": "string", "description": "Optional: minimum reward amount (inclusive) as U64 string" },
803
+ "amountMax": { "type": "string", "description": "Optional: maximum reward amount (inclusive) as U64 string" },
804
+ "storeFromId": {
805
+ "type": "object",
806
+ "properties": {
807
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
808
+ },
809
+ "required": ["identifier"],
810
+ "additionalProperties": false,
811
+ "description": "Optional: identifier reference to store_from_id address. If not specified, field is ignored during matching."
812
+ }
813
+ },
814
+ "additionalProperties": false,
815
+ "description": "Filter conditions for the reward record query"
816
+ }
817
+ },
818
+ "required": ["type", "object", "find", "where"],
819
+ "additionalProperties": false,
820
+ "returns": "U64",
821
+ "description": "Returns U64. Finds the index of the first or last reward record matching the specified recipient and filter conditions. Returns record index if found, throws error if not found. Use this to verify a reward has NOT been claimed (wrap in logic_not). If recipient is not specified, uses the transaction signer address."
822
+ },
823
+ "QueryRewardRecordCountNode": {
824
+ "type": "object",
825
+ "properties": {
826
+ "type": { "const": "query_reward_record_count" },
827
+ "object": {
828
+ "type": "object",
829
+ "properties": {
830
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
831
+ },
832
+ "required": ["identifier"],
833
+ "additionalProperties": false,
834
+ "description": "Reference to the Reward object in the Guard table (must be Address type)"
835
+ },
836
+ "recipient": {
837
+ "type": "object",
838
+ "properties": {
839
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
840
+ },
841
+ "required": ["identifier"],
842
+ "additionalProperties": false,
843
+ "description": "Optional: Identifier reference to recipient address in Guard table (must be Address type). If not specified, uses the transaction signer address."
844
+ },
845
+ "where": {
846
+ "type": "object",
847
+ "properties": {
848
+ "guard": { "type": "string" },
849
+ "timeMin": { "type": "string" },
850
+ "timeMax": { "type": "string" },
851
+ "amountMin": { "type": "string" },
852
+ "amountMax": { "type": "string" },
853
+ "storeFromId": {
854
+ "type": "object",
855
+ "properties": {
856
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
857
+ },
858
+ "required": ["identifier"],
859
+ "additionalProperties": false
860
+ }
861
+ },
862
+ "additionalProperties": false
863
+ }
864
+ },
865
+ "required": ["type", "object", "where"],
866
+ "additionalProperties": false,
867
+ "returns": "U64",
868
+ "description": "Returns U64. Counts the number of reward records matching the specified recipient and filter conditions. If recipient is not specified, uses the transaction signer address."
869
+ },
870
+ "QueryRewardRecordExistsNode": {
871
+ "type": "object",
872
+ "properties": {
873
+ "type": { "const": "query_reward_record_exists" },
874
+ "object": {
875
+ "type": "object",
876
+ "properties": {
877
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
878
+ },
879
+ "required": ["identifier"],
880
+ "additionalProperties": false,
881
+ "description": "Reference to the Reward object in the Guard table (must be Address type)"
882
+ },
883
+ "recipient": {
884
+ "type": "object",
885
+ "properties": {
886
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
887
+ },
888
+ "required": ["identifier"],
889
+ "additionalProperties": false,
890
+ "description": "Optional: Identifier reference to recipient address in Guard table (must be Address type). If not specified, uses the transaction signer address."
891
+ },
892
+ "where": {
893
+ "type": "object",
894
+ "properties": {
895
+ "guard": { "type": "string" },
896
+ "timeMin": { "type": "string" },
897
+ "timeMax": { "type": "string" },
898
+ "amountMin": { "type": "string" },
899
+ "amountMax": { "type": "string" },
900
+ "storeFromId": {
901
+ "type": "object",
902
+ "properties": {
903
+ "identifier": { "$ref": "#/definitions/GuardIdentifier" }
904
+ },
905
+ "required": ["identifier"],
906
+ "additionalProperties": false
907
+ }
908
+ },
909
+ "additionalProperties": false
910
+ }
911
+ },
912
+ "required": ["type", "object", "where"],
913
+ "additionalProperties": false,
914
+ "returns": "Bool",
915
+ "description": "Returns Bool. Returns true if at least one reward record exists matching the specified recipient and filter conditions, otherwise false. Use this to check if a reward has been claimed. If recipient is not specified, uses the transaction signer address."
916
+ }
917
+ }
918
+ }