@wowok/agent-mcp 2.3.14 → 2.3.18

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 (189) hide show
  1. package/dist/config/index.d.ts +1 -0
  2. package/dist/config/index.js +1 -0
  3. package/dist/config/runtime.d.ts +26 -0
  4. package/dist/config/runtime.js +217 -0
  5. package/dist/customer/index.d.ts +9 -0
  6. package/dist/customer/index.js +9 -0
  7. package/dist/customer/industry-risks.d.ts +40 -0
  8. package/dist/customer/industry-risks.js +438 -0
  9. package/dist/customer/info-puzzle.d.ts +102 -0
  10. package/dist/customer/info-puzzle.js +312 -0
  11. package/dist/customer/order-monitor.d.ts +75 -0
  12. package/dist/customer/order-monitor.js +327 -0
  13. package/dist/customer/order-strategy.d.ts +36 -0
  14. package/dist/customer/order-strategy.js +373 -0
  15. package/dist/customer/post-purchase.d.ts +42 -0
  16. package/dist/customer/post-purchase.js +350 -0
  17. package/dist/customer/reminder-system.d.ts +42 -0
  18. package/dist/customer/reminder-system.js +295 -0
  19. package/dist/customer/risk-assessment.d.ts +8 -0
  20. package/dist/customer/risk-assessment.js +337 -0
  21. package/dist/customer/types.d.ts +193 -0
  22. package/dist/customer/types.js +13 -0
  23. package/dist/customer/user-preferences.d.ts +70 -0
  24. package/dist/customer/user-preferences.js +460 -0
  25. package/dist/experience/experience-reuse.d.ts +10 -0
  26. package/dist/experience/experience-reuse.js +103 -0
  27. package/dist/experience/index.d.ts +6 -0
  28. package/dist/experience/index.js +5 -0
  29. package/dist/experience/intent-distill.d.ts +3 -0
  30. package/dist/experience/intent-distill.js +83 -0
  31. package/dist/experience/realtime-feedback.d.ts +5 -0
  32. package/dist/experience/realtime-feedback.js +94 -0
  33. package/dist/experience/types.d.ts +50 -0
  34. package/dist/experience/types.js +1 -0
  35. package/dist/experience/user-profile.d.ts +25 -0
  36. package/dist/experience/user-profile.js +171 -0
  37. package/dist/index.js +842 -371
  38. package/dist/knowledge/acquisition-flywheel.d.ts +53 -0
  39. package/dist/knowledge/acquisition-flywheel.js +192 -0
  40. package/dist/knowledge/arbitration-trust.d.ts +24 -0
  41. package/dist/knowledge/arbitration-trust.js +117 -0
  42. package/dist/knowledge/audit-rules.d.ts +28 -0
  43. package/dist/knowledge/audit-rules.js +141 -0
  44. package/dist/knowledge/demand-matching.d.ts +29 -0
  45. package/dist/knowledge/demand-matching.js +132 -0
  46. package/dist/knowledge/dynamic-pricing.d.ts +31 -0
  47. package/dist/knowledge/dynamic-pricing.js +87 -0
  48. package/dist/knowledge/flywheel-loop.d.ts +87 -0
  49. package/dist/knowledge/flywheel-loop.js +378 -0
  50. package/dist/knowledge/glossary.d.ts +18 -0
  51. package/dist/knowledge/glossary.js +209 -0
  52. package/dist/knowledge/guard-ledger.d.ts +19 -0
  53. package/dist/knowledge/guard-ledger.js +219 -0
  54. package/dist/knowledge/guard-puzzle.d.ts +93 -0
  55. package/dist/knowledge/guard-puzzle.js +278 -0
  56. package/dist/knowledge/guard-risk.d.ts +60 -0
  57. package/dist/knowledge/guard-risk.js +474 -0
  58. package/dist/knowledge/guard-translation.d.ts +46 -0
  59. package/dist/knowledge/guard-translation.js +487 -0
  60. package/dist/knowledge/index.d.ts +77 -0
  61. package/dist/knowledge/index.js +79 -0
  62. package/dist/knowledge/industry-evolution.d.ts +82 -0
  63. package/dist/knowledge/industry-evolution.js +323 -0
  64. package/dist/knowledge/industry-generalizer.d.ts +17 -0
  65. package/dist/knowledge/industry-generalizer.js +381 -0
  66. package/dist/knowledge/industry-registry.d.ts +48 -0
  67. package/dist/knowledge/industry-registry.js +187 -0
  68. package/dist/knowledge/intent-metrics.d.ts +42 -0
  69. package/dist/knowledge/intent-metrics.js +566 -0
  70. package/dist/knowledge/process-model.d.ts +24 -0
  71. package/dist/knowledge/process-model.js +160 -0
  72. package/dist/knowledge/reputation-rules.d.ts +42 -0
  73. package/dist/knowledge/reputation-rules.js +99 -0
  74. package/dist/knowledge/reward-templates.d.ts +25 -0
  75. package/dist/knowledge/reward-templates.js +125 -0
  76. package/dist/knowledge/safety-rules.d.ts +36 -0
  77. package/dist/knowledge/safety-rules.js +232 -0
  78. package/dist/knowledge/tool-constraints.d.ts +30 -0
  79. package/dist/knowledge/tool-constraints.js +175 -0
  80. package/dist/knowledge/trust-metrics.d.ts +37 -0
  81. package/dist/knowledge/trust-metrics.js +138 -0
  82. package/dist/loop-engineering/diagnose.d.ts +3 -2
  83. package/dist/loop-engineering/diagnose.js +94 -0
  84. package/dist/loop-engineering/improve.d.ts +1 -1
  85. package/dist/loop-engineering/improve.js +52 -1
  86. package/dist/project/graph.d.ts +71 -0
  87. package/dist/project/graph.js +314 -0
  88. package/dist/project/index.d.ts +62 -0
  89. package/dist/project/index.js +167 -0
  90. package/dist/project/namespace.d.ts +62 -0
  91. package/dist/project/namespace.js +181 -0
  92. package/dist/project/query.d.ts +40 -0
  93. package/dist/project/query.js +110 -0
  94. package/dist/safety/confirm-gate.d.ts +17 -0
  95. package/dist/safety/confirm-gate.js +88 -0
  96. package/dist/safety/index.d.ts +3 -0
  97. package/dist/safety/index.js +3 -0
  98. package/dist/safety/preview.d.ts +2 -0
  99. package/dist/safety/preview.js +36 -0
  100. package/dist/schema/call/allocation.d.ts +39 -14
  101. package/dist/schema/call/arbitration.d.ts +187 -162
  102. package/dist/schema/call/base.d.ts +1971 -87
  103. package/dist/schema/call/base.js +135 -3
  104. package/dist/schema/call/bridge-handler.js +15 -2
  105. package/dist/schema/call/bridge.d.ts +1478 -53
  106. package/dist/schema/call/bridge.js +50 -2
  107. package/dist/schema/call/contact.d.ts +25 -0
  108. package/dist/schema/call/demand.d.ts +79 -54
  109. package/dist/schema/call/guard.d.ts +125 -50
  110. package/dist/schema/call/handler.d.ts +3 -0
  111. package/dist/schema/call/handler.js +60 -14
  112. package/dist/schema/call/machine.d.ts +988 -938
  113. package/dist/schema/call/order.d.ts +25 -0
  114. package/dist/schema/call/payment.d.ts +25 -0
  115. package/dist/schema/call/permission.d.ts +244 -219
  116. package/dist/schema/call/personal.d.ts +25 -0
  117. package/dist/schema/call/progress.d.ts +25 -0
  118. package/dist/schema/call/proof.d.ts +62 -12
  119. package/dist/schema/call/proof.js +3 -3
  120. package/dist/schema/call/repository.d.ts +101 -76
  121. package/dist/schema/call/reward.d.ts +55 -30
  122. package/dist/schema/call/semantic.d.ts +10 -2
  123. package/dist/schema/call/semantic.js +616 -11
  124. package/dist/schema/call/service.d.ts +442 -417
  125. package/dist/schema/call/treasury.d.ts +25 -0
  126. package/dist/schema/common/index.js +3 -3
  127. package/dist/schema/config/index.d.ts +18 -0
  128. package/dist/schema/config/index.js +17 -0
  129. package/dist/schema/index.d.ts +6 -0
  130. package/dist/schema/index.js +5 -0
  131. package/dist/schema/local/index.d.ts +237 -81
  132. package/dist/schema/local/index.js +42 -6
  133. package/dist/schema/messenger/index.d.ts +1018 -79
  134. package/dist/schema/messenger/index.js +26 -17
  135. package/dist/schema/operations.d.ts +3192 -1746
  136. package/dist/schema/operations.js +93 -98
  137. package/dist/schema/project/index.d.ts +21 -0
  138. package/dist/schema/project/index.js +32 -0
  139. package/dist/schema/query/index.d.ts +2762 -1856
  140. package/dist/schema/query/index.js +38 -35
  141. package/dist/schema/schema-query/index.d.ts +33 -0
  142. package/dist/schema/schema-query/index.js +36 -0
  143. package/dist/schema/schema-version.d.ts +25 -0
  144. package/dist/schema/schema-version.js +76 -0
  145. package/dist/schema/trust/index.d.ts +407 -0
  146. package/dist/schema/trust/index.js +113 -0
  147. package/dist/schemas/account_operation.output.json +25 -16
  148. package/dist/schemas/account_operation.schema.json +1 -1
  149. package/dist/schemas/bridge_operation.output.json +744 -0
  150. package/dist/schemas/bridge_operation.schema.json +82 -8
  151. package/dist/schemas/config_operation.output.json +18 -0
  152. package/dist/schemas/config_operation.schema.json +34 -0
  153. package/dist/schemas/guard-node-schema.json +82 -0
  154. package/dist/schemas/guard2file.schema.json +23 -0
  155. package/dist/schemas/index.json +19 -1
  156. package/dist/schemas/local_info_operation.output.json +23 -0
  157. package/dist/schemas/local_info_operation.schema.json +1 -1
  158. package/dist/schemas/local_mark_operation.output.json +24 -1
  159. package/dist/schemas/local_mark_operation.schema.json +4 -4
  160. package/dist/schemas/machineNode2file.schema.json +23 -0
  161. package/dist/schemas/messenger_operation.output.json +752 -0
  162. package/dist/schemas/onchain_events.output.json +718 -0
  163. package/dist/schemas/onchain_operations.output.json +627 -18
  164. package/dist/schemas/onchain_operations.schema.json +115 -39
  165. package/dist/schemas/onchain_operations_allocation.schema.json +23 -0
  166. package/dist/schemas/onchain_operations_arbitration.schema.json +23 -0
  167. package/dist/schemas/onchain_operations_contact.schema.json +23 -0
  168. package/dist/schemas/onchain_operations_demand.schema.json +23 -0
  169. package/dist/schemas/onchain_operations_gen_passport.schema.json +46 -0
  170. package/dist/schemas/onchain_operations_guard.schema.json +26 -16
  171. package/dist/schemas/onchain_operations_machine.schema.json +89 -23
  172. package/dist/schemas/onchain_operations_order.schema.json +23 -0
  173. package/dist/schemas/onchain_operations_payment.schema.json +23 -0
  174. package/dist/schemas/onchain_operations_permission.schema.json +23 -0
  175. package/dist/schemas/onchain_operations_personal.schema.json +23 -0
  176. package/dist/schemas/onchain_operations_progress.schema.json +23 -0
  177. package/dist/schemas/onchain_operations_repository.schema.json +23 -0
  178. package/dist/schemas/onchain_operations_reward.schema.json +23 -0
  179. package/dist/schemas/onchain_operations_service.schema.json +23 -0
  180. package/dist/schemas/onchain_operations_treasury.schema.json +23 -0
  181. package/dist/schemas/onchain_table_data.output.json +939 -69
  182. package/dist/schemas/onchain_table_data.schema.json +2 -2
  183. package/dist/schemas/project_operation.output.json +18 -0
  184. package/dist/schemas/project_operation.schema.json +42 -0
  185. package/dist/schemas/query_toolkit.schema.json +360 -368
  186. package/dist/schemas/schema_query.schema.json +6 -3
  187. package/dist/schemas/trust_score.output.json +327 -0
  188. package/dist/schemas/trust_score.schema.json +46 -0
  189. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { TokenTypeInfoSchema, QueryLocalMarkListResultSchema, QueryAccountListResultSchema, QueryLocalInfoListResultSchema, QueryLocalTokenListResultSchema, QueryAccountResultSchema } from "../local/index.js";
3
3
  import { AccountOrMark_AddressSchema, BalanceTypeSchema, CacheExpireTypeSchema, EntrypointSchema, GuardIdentifierSchema, GuardTableItemSchema, NameOrAddressSchema, ObjectBaseSchema, ObjectTypeSchema, QueryIdSchema, SupportedValueSchema, ValueTypeSchema, QueryReceivedResultSchema, LongNameSchema, DescriptionSchema } from "../common/index.js";
4
- const SemanticSummarySchema = z.any();
4
+ import { SemanticSummarySchema } from "../call/index.js";
5
5
  import { isValidPermissionIndex } from '../utils/permission-index-utils.js';
6
6
  import { isValidGuardQueryId, isValidGuardQueryIdOrName } from '../utils/guard-query-utils.js';
7
7
  import { ENTITY_LINKER_ADDRESS, ENTITY_REGISTRAR_ADDRESS, isWitnessType, } from "@wowok/wowok";
@@ -9,6 +9,9 @@ import { DiscountType as WDiscountType } from "@wowok/wowok";
9
9
  import { QueryEnvSchema } from "../common/index.js";
10
10
  const MAX_MULTI_OPERANDS = 8;
11
11
  const VALUE_TYPE_DESCRIPTION = "Value type: can be specified as a string name (e.g., 'U64', 'Address', 'String') or a number (0-18). Supported types: Bool=0/'Bool', Address=1/'Address', String=2/'String', U8=3/'U8', U16=4/'U16', U32=5/'U32', U64=6/'U64', U128=7/'U128', U256=8/'U256', VecBool=9/'VecBool', VecAddress=10/'VecAddress', VecString=11/'VecString', VecU8=12/'VecU8', VecU16=13/'VecU16', VecU32=14/'VecU32', VecU64=15/'VecU64', VecU128=16/'VecU128', VecU256=17/'VecU256', VecVecU8=18/'VecVecU8'. Note: Value=19 is an INTERNAL type for wowok system use only and should NOT be used directly by users. String format is recommended for better readability.";
12
+ const tolerantNumber = z.union([z.number(), z.string()]);
13
+ const tolerantStringNullable = z.union([z.string(), z.null(), z.undefined()]);
14
+ const tolerantNumberNullable = z.union([z.number(), z.string(), z.null(), z.undefined()]);
12
15
  export const AmountTypeSchema = z.enum(["GuardU64Identifier", "Fixed"]).describe("Amount type. GuardU64Identifier indicates the amount comes from U64 type data defined in Guard table (Identifier index), Fixed indicates using a fixed amount.");
13
16
  export const GuardQuerySchema = z.object({
14
17
  id: QueryIdSchema,
@@ -44,7 +47,7 @@ export const VoteInEntityLinkerSchema = z.object({
44
47
  like: z.boolean().optional().describe("Whether liked"),
45
48
  dislike: z.boolean().optional().describe("Whether disliked"),
46
49
  affiliation: z.boolean().optional().describe("Whether affiliated"),
47
- time: z.number().describe("Time"),
50
+ time: tolerantNumber.describe("Time"),
48
51
  }).describe("Follow record");
49
52
  export const ObjectEntityRegistrarSchema = ObjectBaseSchema.extend({
50
53
  entity_count: z.number().describe("Entity count. Number of entities registered in the entity registrar table. Use 'query_table' or 'query_table_item' to get 'EntityRegistrar' table items."),
@@ -57,16 +60,16 @@ export const ObjectResourceSchema = ObjectBaseSchema.extend({
57
60
  }).describe("On-chain address tag manager");
58
61
  export const TableItem_EntityLinkerSchema = ObjectBaseSchema.extend({
59
62
  address: z.string().describe("Followed ID"),
60
- pos: z.number().describe("Current follow information position"),
61
- count: z.number().describe("Follower count. Number of entities who have been followed others. Use 'query_table' or 'query_table_item' to get 'EntityLinker' table items."),
63
+ pos: tolerantNumber.describe("Current follow information position"),
64
+ count: tolerantNumber.describe("Follower count. Number of entities who have been followed others. Use 'query_table' or 'query_table_item' to get 'EntityLinker' table items."),
62
65
  votes: z.array(VoteInEntityLinkerSchema).describe("Follow records"),
63
66
  }).describe("On-chain followed object data");
64
67
  export const TableItem_EntityRegistrarSchema = ObjectBaseSchema.extend({
65
68
  address: z.string().describe("Entity ID"),
66
69
  description: z.string().describe("Entity description"),
67
- time: z.number().describe("On-chain registration time"),
68
- referrer: z.union([z.string(), z.null()]).describe("Referrer"),
69
- mark_object: z.union([z.string(), z.null()]).describe("Your on-chain address mark object by entity ID"),
70
+ time: tolerantNumber.describe("On-chain registration time"),
71
+ referrer: tolerantStringNullable.describe("Referrer"),
72
+ mark_object: tolerantStringNullable.describe("Your on-chain address mark object by entity ID"),
70
73
  records: z.array(RecordsInEntitySchema).describe("Information records"),
71
74
  }).describe("On-chain entity data");
72
75
  export const TableItem_AddressMarkSchema = ObjectBaseSchema.extend({
@@ -135,13 +138,13 @@ export const ProgressSessionHolderSchema = z.object({
135
138
  retained_submission: z.array(GuardSubmissionSchema).describe("Used to define submitted data after Guard verification"),
136
139
  msg: z.string().describe("Information submitted to complete operation"),
137
140
  accomplished: z.boolean().describe("Whether completed"),
138
- time: z.number().describe("Session creation time"),
141
+ time: tolerantNumber.describe("Session creation time"),
139
142
  }).describe("An operation in Progress session");
140
143
  export const ProgressSessionSchema = z.object({
141
144
  next_node: z.string().describe("Next node ID"),
142
145
  forwards: z.array(ProgressSessionHolderSchema).describe("Operation list in Progress session"),
143
- weights: z.number().describe("Total operation weight"),
144
- threshold: z.number().describe("Operation threshold. When total operation weight exceeds threshold, session is considered completed and Progress moves from current node to next node."),
146
+ weights: tolerantNumber.describe("Total operation weight"),
147
+ threshold: tolerantNumber.describe("Operation threshold. When total operation weight exceeds threshold, session is considered completed and Progress moves from current node to next node."),
145
148
  }).describe("Progress session");
146
149
  export const ObjectProgressSchema = ObjectBaseSchema.extend({
147
150
  machine: z.string().describe("Machine ID that Progress object belongs to"),
@@ -336,8 +339,8 @@ export const TableItem_RewardRecordSchema = ObjectBaseSchema.extend({
336
339
  total: BalanceTypeSchema.describe("Total reward amount"),
337
340
  record: z.array(z.object({
338
341
  amount: BalanceTypeSchema.describe("Reward amount"),
339
- time: z.number().describe("Reward time"),
340
- store_from_id: z.union([z.string(), z.null()]).describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
342
+ time: tolerantNumber.describe("Reward time"),
343
+ store_from_id: tolerantStringNullable.describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
341
344
  })).describe("Reward record list"),
342
345
  }).describe("Reward object's reward record");
343
346
  export const ObjectRepositorySchema = ObjectBaseSchema.extend({
@@ -821,31 +824,31 @@ export const ObjectPassportSchema = ObjectBaseSchema.extend({
821
824
  }).describe("Passport object");
822
825
  export const TableItem_PermissionPermSchema = ObjectBaseSchema.extend({
823
826
  address: z.string().describe("User ID or Guard ID"),
824
- perm: z.array(PermissionIndexTypeSchema).describe("Permission list obtained after user or Guard object verification"),
827
+ perm: z.array(PermissionIndexTypeSchema.nullable().or(z.number())).describe("Permission list obtained after user or Guard object verification"),
825
828
  }).describe("Permission object's permission record");
826
829
  export const TableItem_DemandPresenterSchema = ObjectBaseSchema.extend({
827
830
  address: z.string().describe("Referrer ID"),
828
831
  recommend: z.string().describe("Recommendation letter"),
829
- service: z.union([z.string(), z.null()]).describe("Recommended service object ID"),
830
- update_time: z.number().describe("Last update time"),
831
- acceptance_score: z.union([z.number(), z.null()]).describe("Demand object feedback score"),
832
+ service: tolerantStringNullable.describe("Recommended service object ID"),
833
+ update_time: tolerantNumber.describe("Last update time"),
834
+ acceptance_score: tolerantNumberNullable.describe("Demand object feedback score"),
832
835
  feedback: z.string().describe("Demand object feedback information"),
833
- feedback_time: z.number().describe("Demand object feedback time"),
836
+ feedback_time: tolerantNumber.describe("Demand object feedback time"),
834
837
  }).describe("Demand object's Service recommendation record");
835
838
  export const MachineForwardGuardSchema = z.object({
836
839
  guard: z.string().describe("Guard object ID"),
837
- retained_submission: z.array(z.number()).optional().describe("Data submitted by user during Guard object verification"),
840
+ retained_submission: z.array(tolerantNumber).nullable().optional().describe("Data submitted by user during Guard object verification"),
838
841
  }).strict().describe("Record of Guard object in MachineForwardGuard object");
839
842
  export const MachineForwardSchema = z.object({
840
843
  name: z.string().describe("Forward name"),
841
- namedOperator: z.string().optional().describe("Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders)."),
842
- permissionIndex: PermissionIndexTypeSchema.optional().describe("Forward operation permission 2: Permission index (one of the two must be specified); recommended if all Progress object operators are the same (e.g., same reward reviewers for all orders)."),
843
- weight: z.number().int().min(0).max(65535).describe("Forward weight"),
844
- guard: MachineForwardGuardSchema.optional().describe("Guard object ID, if defined, Guard verification must also pass to complete Forward (e.g., completed promised supply chain sub-order)."),
844
+ namedOperator: tolerantStringNullable.describe("Forward operation permission 1: Namespace (one of the two must be specified); recommended if Progress object operators are different (e.g., different delivery personnel for different orders)."),
845
+ permissionIndex: tolerantNumberNullable.describe("Forward operation permission 2: Permission index (one of the two must be specified); recommended if all Progress object operators are the same (e.g., same reward reviewers for all orders)."),
846
+ weight: tolerantNumber.describe("Forward weight"),
847
+ guard: MachineForwardGuardSchema.nullable().optional().describe("Guard object ID, if defined, Guard verification must also pass to complete Forward (e.g., completed promised supply chain sub-order)."),
845
848
  }).strict().describe("Forward in Machine object");
846
849
  export const MachineNodePairSchema = z.object({
847
850
  prev_node: z.string().describe("Previous node name"),
848
- threshold: z.number().int().min(0).max(4294967295).describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
851
+ threshold: tolerantNumber.describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
849
852
  forwards: z.array(MachineForwardSchema).describe("Forward list"),
850
853
  }).strict().describe("Node pair in Machine object");
851
854
  export const MachineNodeSchema = z.object({
@@ -857,20 +860,20 @@ export const TableItem_MachineNodeSchema = ObjectBaseSchema.extend({
857
860
  value: z.array(MachineNodePairSchema).describe("Node pair list"),
858
861
  }).describe("Node record in Machine object");
859
862
  export const TableItem_ProgressHistorySchema = ObjectBaseSchema.extend({
860
- index: z.number().int().describe("Progress record index (starting from 0)"),
863
+ index: tolerantNumber.describe("Progress record index (starting from 0)"),
861
864
  node: z.string().describe("Previous node name"),
862
865
  next_node: z.string().describe("Next node name"),
863
866
  session: z.array(ProgressSessionSchema).describe("Progress session list"),
864
- time: z.number().describe("Progress record completion time (Unix timestamp)"),
867
+ time: tolerantNumberNullable.describe("Progress record completion time (Unix timestamp)"),
865
868
  }).describe("Completed progress record in Progress object");
866
869
  export const TableItem_TreasuryHistorySchema = ObjectBaseSchema.extend({
867
870
  payment: NameOrAddressSchema.describe("Payment object ID"),
868
871
  op: TreasuryOpSchema.describe("Operation type"),
869
872
  signer: z.string().describe("Operator ID"),
870
- external_guard: z.union([z.string(), z.null()]).describe("Guard object ID verified during operation (none if operated through Permission)"),
873
+ external_guard: tolerantStringNullable.describe("Guard object ID verified during operation (none if operated through Permission)"),
871
874
  amount: BalanceTypeSchema.describe("Payment amount"),
872
- time: z.number().describe("Payment time (Unix timestamp)"),
873
- store_from_id: z.union([z.string(), z.null()]).describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
875
+ time: tolerantNumber.describe("Payment time (Unix timestamp)"),
876
+ store_from_id: tolerantStringNullable.describe("Stored value from Guard table. This stores the value (address or number converted to address, including submitted values) from the Guard table at the specified index for Guard verification purposes."),
874
877
  }).describe("Payment record in Treasury object");
875
878
  export const ObjectsQuerySchema = QueryEnvSchema.extend({
876
879
  objects: z.array(NameOrAddressSchema).describe("List of object IDs to query"),
@@ -1032,7 +1035,7 @@ export const OnchainEventsInputSchema = z.object({
1032
1035
  order: z.union([z.literal("ascending"), z.literal("descending"), z.null()]).optional().describe("Sort order for results: 'ascending' (oldest first) or 'descending' (newest first). Use null for default order"),
1033
1036
  no_cache: z.boolean().optional().describe("Whether to bypass cache and fetch fresh data from the blockchain"),
1034
1037
  network: EntrypointSchema.optional().describe("Network to query: 'mainnet' or 'testnet'. Uses default network if not specified"),
1035
- }).describe("Input parameters for querying on-chain WOWOK events");
1038
+ }).strict().describe("Input parameters for querying on-chain WOWOK events");
1036
1039
  export const OnchainEventsResultSchema = z.object({
1037
1040
  result: z.union([EventAnswerSchema, z.null()]).describe("Event query result containing list of events and pagination info, or null if no data found"),
1038
1041
  semantic: SemanticSummarySchema.optional().describe("Business semantic summary for the event query"),
@@ -1200,24 +1203,24 @@ export const BridgeTokenInfoSchema = z.object({
1200
1203
  export const ProtocolInfoQuerySchema = z.discriminatedUnion('info', [
1201
1204
  z.object({
1202
1205
  info: z.literal('constants')
1203
- }).describe('Constants query'),
1206
+ }).strict().describe('Constants query'),
1204
1207
  z.object({
1205
1208
  info: z.literal('built-in permissions'),
1206
1209
  filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions')
1207
- }).describe('Built-in permissions query'),
1210
+ }).strict().describe('Built-in permissions query'),
1208
1211
  z.object({
1209
1212
  info: z.literal('guard instructions'),
1210
1213
  filter: z.optional(GuardInstructFilterOptionsSchema).describe('Filter for guard instructions')
1211
- }).describe('Guard instructions and wowok object queries'),
1214
+ }).strict().describe('Guard instructions and wowok object queries'),
1212
1215
  z.object({
1213
1216
  info: z.literal('current network')
1214
- }).describe('Current network entrypoint'),
1217
+ }).strict().describe('Current network entrypoint'),
1215
1218
  z.object({
1216
1219
  info: z.literal('value types')
1217
- }).describe('Value types query - returns all supported value types with their numeric and string representations'),
1220
+ }).strict().describe('Value types query - returns all supported value types with their numeric and string representations'),
1218
1221
  z.object({
1219
1222
  info: z.literal('mainnet bridge tokens')
1220
- }).describe('Mainnet Bridge tokens query - returns all tokens deployed on the mainnet bridge with their symbol, WOW-side type tag, EVM address, decimals, and description')
1223
+ }).strict().describe('Mainnet Bridge tokens query - returns all tokens deployed on the mainnet bridge with their symbol, WOW-side type tag, EVM address, decimals, and description')
1221
1224
  ]).describe('WoWok Build-in infomation query');
1222
1225
  export const BuiltinPermissionSchema = z.object({
1223
1226
  result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result')
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const SchemaQueryInputSchema: z.ZodObject<{
3
+ action: z.ZodEnum<["list", "get", "get_output", "search", "list_operations"]>;
4
+ name: z.ZodOptional<z.ZodString>;
5
+ query: z.ZodOptional<z.ZodString>;
6
+ }, "strict", z.ZodTypeAny, {
7
+ action: "get" | "search" | "list" | "get_output" | "list_operations";
8
+ name?: string | undefined;
9
+ query?: string | undefined;
10
+ }, {
11
+ action: "get" | "search" | "list" | "get_output" | "list_operations";
12
+ name?: string | undefined;
13
+ query?: string | undefined;
14
+ }>;
15
+ export declare const SchemaQueryOutputSchema: z.ZodObject<{
16
+ success: z.ZodBoolean;
17
+ action: z.ZodString;
18
+ data: z.ZodAny;
19
+ message: z.ZodString;
20
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
+ }, "strict", z.ZodTypeAny, {
22
+ message: string;
23
+ success: boolean;
24
+ action: string;
25
+ data?: any;
26
+ suggestions?: string[] | undefined;
27
+ }, {
28
+ message: string;
29
+ success: boolean;
30
+ action: string;
31
+ data?: any;
32
+ suggestions?: string[] | undefined;
33
+ }>;
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ export const SchemaQueryInputSchema = z
3
+ .object({
4
+ action: z
5
+ .enum([
6
+ "list",
7
+ "get",
8
+ "get_output",
9
+ "search",
10
+ "list_operations",
11
+ ])
12
+ .describe("Action to perform: 'list' to see all available schemas, 'get' to retrieve a specific input schema, 'get_output' to retrieve a tool's output schema, 'search' to find schemas by keyword, 'list_operations' to list all on-chain operations"),
13
+ name: z
14
+ .string()
15
+ .optional()
16
+ .describe("Schema/tool name for 'get'/'get_output' action (e.g., 'onchain_operations', 'account_operation', 'onchain_operations_permission')"),
17
+ query: z
18
+ .string()
19
+ .optional()
20
+ .describe("Search query for 'search' action"),
21
+ })
22
+ .strict();
23
+ export const SchemaQueryOutputSchema = z
24
+ .object({
25
+ success: z.boolean().describe("Whether the request was successful"),
26
+ action: z.string().describe("The action that was performed"),
27
+ data: z
28
+ .any()
29
+ .describe("Response data - JSON Schema object for 'get'/'get_output', array of schema info for 'list'/'search'/'list_operations'"),
30
+ message: z.string().describe("Human-readable message describing the result"),
31
+ suggestions: z
32
+ .array(z.string())
33
+ .optional()
34
+ .describe("Suggested next steps or alternatives"),
35
+ })
36
+ .strict();
@@ -0,0 +1,25 @@
1
+ export declare const MCP_SCHEMA_VERSION = "1.0.0";
2
+ export interface SchemaVersions {
3
+ sdk: string;
4
+ mcp: string;
5
+ }
6
+ export declare function getSchemaVersions(): SchemaVersions;
7
+ export type SchemaCompatibilityMode = "warn" | "strict";
8
+ export interface SchemaCheckOptions {
9
+ mode?: SchemaCompatibilityMode;
10
+ }
11
+ export interface SchemaCheckResult {
12
+ compatible: boolean;
13
+ warnings: string[];
14
+ errors: string[];
15
+ versions: SchemaVersions;
16
+ client_version?: string;
17
+ }
18
+ export declare function checkClientSchemaCompatibility(clientSchemaVersion: string | undefined, options?: SchemaCheckOptions): SchemaCheckResult;
19
+ export declare function attachSchemaWarning<T extends {
20
+ result?: unknown;
21
+ message?: string;
22
+ semantic?: {
23
+ warnings?: string[];
24
+ };
25
+ }>(output: T, schemaCheck: SchemaCheckResult): T;
@@ -0,0 +1,76 @@
1
+ import * as wowok from "@wowok/wowok";
2
+ const SDK_SCHEMA_VERSION = wowok.SCHEMA_VERSION ?? "1.0.0";
3
+ const checkSchemaCompatibility = wowok
4
+ .checkSchemaCompatibility ??
5
+ ((_client, _server) => ({ compatible: true }));
6
+ export const MCP_SCHEMA_VERSION = "1.0.0";
7
+ export function getSchemaVersions() {
8
+ return {
9
+ sdk: SDK_SCHEMA_VERSION,
10
+ mcp: MCP_SCHEMA_VERSION,
11
+ };
12
+ }
13
+ export function checkClientSchemaCompatibility(clientSchemaVersion, options = {}) {
14
+ const versions = getSchemaVersions();
15
+ const result = {
16
+ compatible: true,
17
+ warnings: [],
18
+ errors: [],
19
+ versions,
20
+ client_version: clientSchemaVersion,
21
+ };
22
+ if (!clientSchemaVersion) {
23
+ return result;
24
+ }
25
+ const sdkCheck = checkSchemaCompatibility(clientSchemaVersion, versions.sdk);
26
+ if (!sdkCheck.compatible) {
27
+ result.compatible = false;
28
+ const message = `SDK schema incompatibility: ${sdkCheck.reason}`;
29
+ if (options.mode === "strict") {
30
+ result.errors.push(message);
31
+ }
32
+ else {
33
+ result.warnings.push(message);
34
+ }
35
+ }
36
+ const mcpCheck = checkSchemaCompatibility(clientSchemaVersion, versions.mcp);
37
+ if (!mcpCheck.compatible) {
38
+ result.compatible = false;
39
+ const message = `MCP schema incompatibility: ${mcpCheck.reason}`;
40
+ if (options.mode === "strict") {
41
+ result.errors.push(message);
42
+ }
43
+ else {
44
+ result.warnings.push(message);
45
+ }
46
+ }
47
+ return result;
48
+ }
49
+ export function attachSchemaWarning(output, schemaCheck) {
50
+ if (schemaCheck.warnings.length === 0 && schemaCheck.errors.length === 0) {
51
+ return output;
52
+ }
53
+ const warnings = [];
54
+ if (schemaCheck.warnings.length > 0) {
55
+ warnings.push(...schemaCheck.warnings);
56
+ }
57
+ if (schemaCheck.errors.length > 0) {
58
+ warnings.push(...schemaCheck.errors);
59
+ }
60
+ const semantic = output.semantic
61
+ ? {
62
+ ...output.semantic,
63
+ warnings: [...(output.semantic.warnings || []), ...warnings],
64
+ }
65
+ : undefined;
66
+ return {
67
+ ...output,
68
+ semantic,
69
+ schema_warning: {
70
+ compatible: schemaCheck.compatible,
71
+ warnings,
72
+ client_version: schemaCheck.client_version,
73
+ server_versions: schemaCheck.versions,
74
+ },
75
+ };
76
+ }