@wowok/agent-mcp 2.6.1 → 2.6.4

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 (246) hide show
  1. package/dist/customer/customer-advice.d.ts +31 -0
  2. package/dist/customer/customer-advice.js +129 -0
  3. package/dist/customer/index.d.ts +2 -0
  4. package/dist/customer/index.js +2 -0
  5. package/dist/customer/info-puzzle.d.ts +9 -2
  6. package/dist/customer/info-puzzle.js +34 -7
  7. package/dist/customer/order-monitor.d.ts +2 -0
  8. package/dist/customer/order-monitor.js +3 -2
  9. package/dist/customer/post-purchase.d.ts +2 -0
  10. package/dist/customer/post-purchase.js +6 -5
  11. package/dist/customer/preorder-compare.d.ts +24 -0
  12. package/dist/customer/preorder-compare.js +34 -0
  13. package/dist/customer/reminder-system.d.ts +2 -0
  14. package/dist/customer/reminder-system.js +2 -1
  15. package/dist/customer/risk-assessment.js +30 -7
  16. package/dist/customer/types.d.ts +7 -0
  17. package/dist/examples/arbitration-dispute-create.json +41 -0
  18. package/dist/examples/arbitration-vote-weighted.json +35 -0
  19. package/dist/examples/arbitration-voting-guard-add.json +38 -0
  20. package/dist/examples/demand-present-service.json +33 -0
  21. package/dist/examples/gen-passport-verify-guard.json +48 -0
  22. package/dist/examples/guard-template-balance-check.json +59 -0
  23. package/dist/examples/guard-template-time-lock.json +60 -0
  24. package/dist/examples/insurance-guard-claim-timelock.json +75 -0
  25. package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
  26. package/dist/examples/insurance-machine-create-publish.json +75 -0
  27. package/dist/examples/insurance-service-allocators-publish.json +56 -0
  28. package/dist/examples/machine-multisig-threshold.json +86 -0
  29. package/dist/examples/machine-template-7node-rental.json +119 -0
  30. package/dist/examples/payment-scenario-bound.json +45 -0
  31. package/dist/examples/rental-ziroom-machine-create.json +149 -0
  32. package/dist/examples/rental-ziroom-permission-create.json +42 -0
  33. package/dist/examples/rental-ziroom-service-create.json +89 -0
  34. package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
  35. package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
  36. package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
  37. package/dist/examples/retail-adv-reward-guard-add.json +51 -0
  38. package/dist/examples/retail-myshop-allocation-activate.json +55 -0
  39. package/dist/examples/retail-myshop-arbitration-create.json +40 -0
  40. package/dist/examples/retail-myshop-contact-create.json +43 -0
  41. package/dist/examples/retail-myshop-order-create.json +56 -0
  42. package/dist/examples/retail-myshop-progress-operate.json +38 -0
  43. package/dist/examples/retail-myshop-reward-create.json +35 -0
  44. package/dist/examples/retail-myshop-service-create.json +88 -0
  45. package/dist/examples/service-discount-issue.json +46 -0
  46. package/dist/examples/threebody-guard-create.json +56 -0
  47. package/dist/examples/threebody-machine-create.json +72 -0
  48. package/dist/examples/threebody-permission-create.json +38 -0
  49. package/dist/examples/threebody-service-allocators.json +49 -0
  50. package/dist/examples/travel-guard-time-lock.json +69 -0
  51. package/dist/examples/travel-guard-weather-oracle.json +70 -0
  52. package/dist/examples/travel-machine-create.json +136 -0
  53. package/dist/examples/travel-repository-create.json +47 -0
  54. package/dist/examples/travel-service-create.json +102 -0
  55. package/dist/examples/travel-treasury-create.json +34 -0
  56. package/dist/examples/treasury-deposit.json +37 -0
  57. package/dist/examples/treasury-withdraw.json +38 -0
  58. package/dist/extensions/business-modules.d.ts +49 -0
  59. package/dist/extensions/business-modules.js +287 -0
  60. package/dist/extensions/capability-manifest.js +216 -29
  61. package/dist/extensions/constraint-registry.js +21 -19
  62. package/dist/extensions/metric-registry.js +14 -14
  63. package/dist/extensions/mode-evaluator.js +16 -16
  64. package/dist/extensions/modes.js +141 -49
  65. package/dist/extensions/registry.d.ts +16 -9
  66. package/dist/extensions/registry.js +132 -44
  67. package/dist/extensions/types.d.ts +2 -0
  68. package/dist/index.js +50 -0
  69. package/dist/knowledge/deployment-scanner.js +1 -1
  70. package/dist/knowledge/fund-layer.d.ts +138 -0
  71. package/dist/knowledge/fund-layer.js +969 -0
  72. package/dist/knowledge/guard-render.d.ts +57 -0
  73. package/dist/knowledge/guard-render.js +700 -0
  74. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  75. package/dist/knowledge/guard-submission-prompt.js +171 -0
  76. package/dist/knowledge/guard-templates.d.ts +10 -0
  77. package/dist/knowledge/guard-templates.js +50 -0
  78. package/dist/knowledge/index.d.ts +2 -2
  79. package/dist/knowledge/index.js +2 -2
  80. package/dist/knowledge/machine-ledger.js +1 -1
  81. package/dist/knowledge/machine-render.d.ts +41 -0
  82. package/dist/knowledge/machine-render.js +565 -0
  83. package/dist/knowledge/machine-risk.js +4 -1
  84. package/dist/knowledge/machine-templates.js +4 -4
  85. package/dist/knowledge/progress-context.js +1 -1
  86. package/dist/knowledge/progress-ledger.js +3 -3
  87. package/dist/knowledge/progress-templates.js +1 -1
  88. package/dist/knowledge/progress-translation.js +1 -1
  89. package/dist/knowledge/reward-confirm.js +2 -2
  90. package/dist/knowledge/reward-puzzle.js +1 -1
  91. package/dist/knowledge/reward-risk.js +9 -9
  92. package/dist/knowledge/reward-templates.js +2 -2
  93. package/dist/knowledge/safety-rules.d.ts +83 -1
  94. package/dist/knowledge/safety-rules.js +166 -2
  95. package/dist/knowledge/scenario-modes.d.ts +1 -1
  96. package/dist/knowledge/scenario-modes.js +13 -11
  97. package/dist/knowledge/service-confirm.d.ts +1 -1
  98. package/dist/knowledge/service-confirm.js +3 -3
  99. package/dist/knowledge/service-context.js +1 -1
  100. package/dist/knowledge/service-ledger.js +1 -1
  101. package/dist/knowledge/service-risk.d.ts +1 -1
  102. package/dist/knowledge/service-risk.js +3 -3
  103. package/dist/knowledge/service-templates.js +2 -2
  104. package/dist/knowledge/service-translation.d.ts +1 -1
  105. package/dist/knowledge/service-translation.js +7 -7
  106. package/dist/knowledge/template-registry.d.ts +48 -0
  107. package/dist/knowledge/template-registry.js +341 -0
  108. package/dist/knowledge/tool-constraints.js +6 -6
  109. package/dist/knowledge/tools-reference.js +11 -8
  110. package/dist/participation/merchant-interest.d.ts +32 -0
  111. package/dist/participation/merchant-interest.js +100 -0
  112. package/dist/participation/radar-core.d.ts +104 -0
  113. package/dist/participation/radar-core.js +269 -0
  114. package/dist/project/context-assembly.js +8 -0
  115. package/dist/project/deployment-bridge.js +6 -5
  116. package/dist/project/deployment-doc.js +5 -5
  117. package/dist/project/edit-planner.d.ts +123 -0
  118. package/dist/project/edit-planner.js +1342 -0
  119. package/dist/project/evaluation.d.ts +36 -0
  120. package/dist/project/evaluation.js +734 -68
  121. package/dist/project/game-theory.d.ts +43 -0
  122. package/dist/project/game-theory.js +177 -0
  123. package/dist/project/graph-builder.js +7 -1
  124. package/dist/project/handlers.d.ts +137 -2
  125. package/dist/project/handlers.js +423 -51
  126. package/dist/project/intent-analyzer.d.ts +71 -0
  127. package/dist/project/intent-analyzer.js +149 -0
  128. package/dist/project/machine-nodes.d.ts +2 -0
  129. package/dist/project/machine-nodes.js +36 -0
  130. package/dist/project/merchant-guide.d.ts +165 -0
  131. package/dist/project/merchant-guide.js +264 -0
  132. package/dist/project/mode-actions.d.ts +199 -0
  133. package/dist/project/mode-actions.js +309 -0
  134. package/dist/project/participation-radar.d.ts +18 -0
  135. package/dist/project/participation-radar.js +428 -0
  136. package/dist/project/pipeline-actions.d.ts +101 -0
  137. package/dist/project/pipeline-actions.js +109 -0
  138. package/dist/project/semantic-graph.d.ts +95 -0
  139. package/dist/project/semantic-graph.js +245 -0
  140. package/dist/project/stage-gate.js +4 -4
  141. package/dist/schema/call/allocation.d.ts +11 -11
  142. package/dist/schema/call/allocation.js +13 -3
  143. package/dist/schema/call/arbitration.d.ts +21 -21
  144. package/dist/schema/call/arbitration.js +30 -9
  145. package/dist/schema/call/base.d.ts +2 -2
  146. package/dist/schema/call/base.js +1 -1
  147. package/dist/schema/call/bridge.d.ts +127 -127
  148. package/dist/schema/call/bridge.js +12 -12
  149. package/dist/schema/call/contact.d.ts +3 -3
  150. package/dist/schema/call/contact.js +2 -2
  151. package/dist/schema/call/demand.d.ts +3 -3
  152. package/dist/schema/call/demand.js +2 -2
  153. package/dist/schema/call/guard.d.ts +11 -11
  154. package/dist/schema/call/guard.js +2 -2
  155. package/dist/schema/call/machine.d.ts +2072 -679
  156. package/dist/schema/call/machine.js +51 -5
  157. package/dist/schema/call/order.d.ts +7 -7
  158. package/dist/schema/call/order.js +3 -6
  159. package/dist/schema/call/payment.d.ts +3 -3
  160. package/dist/schema/call/permission.d.ts +3 -3
  161. package/dist/schema/call/permission.js +2 -2
  162. package/dist/schema/call/personal.d.ts +337 -3
  163. package/dist/schema/call/personal.js +10 -0
  164. package/dist/schema/call/progress.d.ts +177 -9
  165. package/dist/schema/call/progress.js +7 -3
  166. package/dist/schema/call/proof.d.ts +6 -6
  167. package/dist/schema/call/repository.d.ts +3 -3
  168. package/dist/schema/call/repository.js +2 -2
  169. package/dist/schema/call/reward.d.ts +57 -57
  170. package/dist/schema/call/reward.js +3 -3
  171. package/dist/schema/call/semantic.js +48 -2
  172. package/dist/schema/call/service.d.ts +285 -113
  173. package/dist/schema/call/service.js +92 -28
  174. package/dist/schema/call/treasury.d.ts +57 -57
  175. package/dist/schema/call/treasury.js +3 -3
  176. package/dist/schema/common/index.d.ts +2 -0
  177. package/dist/schema/common/index.js +46 -10
  178. package/dist/schema/local/index.js +5 -1
  179. package/dist/schema/messenger/index.js +4 -1
  180. package/dist/schema/operations.d.ts +1318 -317
  181. package/dist/schema/operations.js +76 -7
  182. package/dist/schema/project/index.d.ts +5662 -164
  183. package/dist/schema/project/index.js +1136 -5
  184. package/dist/schema/query/index.d.ts +580 -19
  185. package/dist/schema/query/index.js +88 -36
  186. package/dist/schema/schema-query/index.d.ts +59 -3
  187. package/dist/schema/schema-query/index.js +45 -6
  188. package/dist/schema/trust/index.d.ts +1012 -6
  189. package/dist/schema/trust/index.js +212 -11
  190. package/dist/schema/utils/node-parser.js +13 -0
  191. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  192. package/dist/schema/utils/object-type-utils.js +35 -0
  193. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  194. package/dist/schema/utils/permission-machine-check.js +121 -0
  195. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  196. package/dist/schema/utils/skills-recommendation.js +77 -0
  197. package/dist/schema-query/index.d.ts +17 -1
  198. package/dist/schema-query/index.js +359 -3
  199. package/dist/schemas/account_operation.schema.json +1 -1
  200. package/dist/schemas/bridge_operation.schema.json +14 -7
  201. package/dist/schemas/guard2file.schema.json +2 -0
  202. package/dist/schemas/index.json +1 -1
  203. package/dist/schemas/machineNode2file.schema.json +2 -0
  204. package/dist/schemas/messenger_operation.schema.json +1 -1
  205. package/dist/schemas/onchain_events.output.json +1 -1
  206. package/dist/schemas/onchain_operations.output.json +2820 -0
  207. package/dist/schemas/onchain_operations.schema.json +255 -65
  208. package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
  209. package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
  210. package/dist/schemas/onchain_operations_contact.schema.json +4 -3
  211. package/dist/schemas/onchain_operations_demand.schema.json +4 -3
  212. package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
  213. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
  214. package/dist/schemas/onchain_operations_guard.schema.json +579 -1
  215. package/dist/schemas/onchain_operations_machine.schema.json +5 -4
  216. package/dist/schemas/onchain_operations_order.schema.json +7 -6
  217. package/dist/schemas/onchain_operations_payment.schema.json +2 -1
  218. package/dist/schemas/onchain_operations_permission.schema.json +3 -2
  219. package/dist/schemas/onchain_operations_personal.schema.json +37 -0
  220. package/dist/schemas/onchain_operations_progress.schema.json +91 -4
  221. package/dist/schemas/onchain_operations_proof.schema.json +2 -1
  222. package/dist/schemas/onchain_operations_repository.schema.json +4 -3
  223. package/dist/schemas/onchain_operations_reward.schema.json +7 -6
  224. package/dist/schemas/onchain_operations_service.schema.json +80 -19
  225. package/dist/schemas/onchain_operations_treasury.schema.json +5 -4
  226. package/dist/schemas/onchain_table_data.output.json +1 -1
  227. package/dist/schemas/onchain_table_data.schema.json +10 -9
  228. package/dist/schemas/project_operation.output.json +3318 -57
  229. package/dist/schemas/project_operation.schema.json +728 -4
  230. package/dist/schemas/query_toolkit.output.json +16 -16
  231. package/dist/schemas/query_toolkit.schema.json +40 -3
  232. package/dist/schemas/schema_query.output.json +65 -2
  233. package/dist/schemas/schema_query.schema.json +31 -5
  234. package/dist/schemas/trust_score.output.json +392 -1
  235. package/dist/schemas/trust_score.schema.json +275 -1
  236. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  237. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  238. package/dist/tools/handlers/onchain.js +636 -6
  239. package/dist/tools/handlers/project.js +71 -2
  240. package/dist/tools/handlers/query.js +117 -2
  241. package/dist/tools/handlers/schema-query.js +65 -1
  242. package/dist/tools/handlers/trust.js +192 -6
  243. package/dist/tools/index.d.ts +8 -0
  244. package/dist/tools/index.js +229 -15
  245. package/dist/tools/wrap.js +194 -15
  246. package/package.json +2 -2
@@ -61,6 +61,29 @@ export const OnchainOperationsSchema = z.preprocess((input) => {
61
61
  catch { }
62
62
  }
63
63
  }
64
+ if (obj.operation_type === 'guard' && obj.data && typeof obj.data === 'object'
65
+ && !Array.isArray(obj.data)) {
66
+ const guardData = obj.data;
67
+ if (guardData.object && !guardData.namedNew) {
68
+ guardData.namedNew = guardData.object;
69
+ delete guardData.object;
70
+ }
71
+ if (Array.isArray(guardData.table)) {
72
+ for (const item of guardData.table) {
73
+ if (item && typeof item === 'object' && !Array.isArray(item)
74
+ && 'object_type' in item) {
75
+ delete item.object_type;
76
+ }
77
+ }
78
+ }
79
+ }
80
+ if (obj.data && typeof obj.data === 'object' && !Array.isArray(obj.data)) {
81
+ const d = obj.data;
82
+ if (d.submission !== undefined && obj.submission === undefined) {
83
+ obj.submission = d.submission;
84
+ delete d.submission;
85
+ }
86
+ }
64
87
  return obj;
65
88
  }
66
89
  return input;
@@ -128,7 +151,7 @@ export const OnchainOperationsSchema = z.preprocess((input) => {
128
151
  operation_type: z.literal("guard"),
129
152
  data: CallGuard_DataSchema,
130
153
  env: CallEnvSchema.optional(),
131
- }).strict().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."),
154
+ }).strict().describe("🛡️ Guard Object: Create immutable programmable validation rules that return boolean results. Set 'namedNew' to name the new Guard (you may also use 'object' as an alias — both work). 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."),
132
155
  z.object({
133
156
  operation_type: z.literal("personal"),
134
157
  data: CallPersonal_DataSchema,
@@ -252,19 +275,19 @@ export const OnchainTableDataSchema = z.preprocess((input) => {
252
275
  z.object({
253
276
  query_type: z.literal("onchain_table_item_permission_perm"),
254
277
  parent: NameOrAddressSchema.describe("Parent Permission object ID"),
255
- address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("User address or Guard ID whose permissions to check"),
278
+ address: AccountOrMark_AddressAISchema.describe("User address or Guard ID whose permissions to check. Supports string (name/address) or object form. LocalMark names are resolved automatically."),
256
279
  no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
257
280
  network: EntrypointSchema.optional(),
258
281
  }).strict().describe("Query a permission entry from a Permission object's perm table — checks what operations a user/guard is allowed to perform. Use to verify access rights. Returns: TableItem_PermissionPerm | undefined"),
259
282
  z.object({
260
283
  query_type: z.literal("onchain_table_item_entity_registrar"),
261
- address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("User address to look up in the global EntityRegistrar"),
284
+ address: AccountOrMark_AddressAISchema.describe("User address to look up in the global EntityRegistrar. Supports string (name/address) or object form. LocalMark names are resolved automatically."),
262
285
  no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
263
286
  network: EntrypointSchema.optional(),
264
287
  }).strict().describe("Query an entity's registration record from the global EntityRegistrar — verifies if an address is registered on the blockchain. Use to check registration status and details. Returns: TableItem_EntityRegistrar | undefined"),
265
288
  z.object({
266
289
  query_type: z.literal("onchain_table_item_entity_linker"),
267
- address: z.union([AccountOrMark_AddressSchema, z.string()]).describe("Entity address whose community votes/endorsements to query"),
290
+ address: AccountOrMark_AddressAISchema.describe("Entity address whose community votes/endorsements to query. Supports string (name/address) or object form. LocalMark names are resolved automatically."),
268
291
  no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
269
292
  network: EntrypointSchema.optional(),
270
293
  }).strict().describe("Query community votes/endorsements for an entity from the global EntityLinker — shows how others have voted on this entity. Use to check reputation and community trust. Returns: TableItem_EntityLinker | undefined"),
@@ -348,6 +371,24 @@ export const WatchQueryOperationsSchema = z.preprocess((input) => {
348
371
  catch { }
349
372
  }
350
373
  }
374
+ if (obj.query_type === 'account_balance' && obj.filter && typeof obj.filter === 'object') {
375
+ const f = obj.filter;
376
+ if (!obj.name_or_address) {
377
+ if (typeof f.name_or_address === 'string') {
378
+ obj.name_or_address = f.name_or_address;
379
+ }
380
+ else if (typeof f.name === 'string') {
381
+ obj.name_or_address = f.name;
382
+ }
383
+ else if (typeof f.address === 'string') {
384
+ obj.name_or_address = f.address;
385
+ }
386
+ }
387
+ if (!obj.token_type && typeof f.token_type === 'string') {
388
+ obj.token_type = f.token_type;
389
+ }
390
+ delete obj.filter;
391
+ }
351
392
  return obj;
352
393
  }
353
394
  return input;
@@ -370,15 +411,25 @@ export const WatchQueryOperationsSchema = z.preprocess((input) => {
370
411
  }).strict().describe("Query cached token metadata — symbol, decimals, icon URL, description for tokens previously fetched from chain. Use to look up token info without an on-chain query. Returns: TokenTypeInfo[] (type, alias, name, symbol, decimals, iconUrl)"),
371
412
  z.object({
372
413
  query_type: z.literal("account_balance"),
373
- name_or_address: NameOrAddressSchema.optional().describe("Account name or address. Use empty string '' for the default account. Defaults to '' if omitted."),
414
+ name_or_address: NameOrAddressSchema.optional().describe("Account name or address to query. " +
415
+ "Examples: \"my_account\", \"0xabc123...\", or \"\" for the default account. " +
416
+ "NOTE: This field is NOT named 'filter' — use 'name_or_address' directly. " +
417
+ "Defaults to '' (default account) if omitted."),
374
418
  balance: z.boolean().optional().describe("Set to true to query total balance amount for the token type"),
375
419
  coin: z.object({
376
420
  cursor: z.union([z.string(), z.null()]).optional().describe("Pagination cursor for listing coin objects"),
377
421
  limit: z.union([z.number(), z.null()]).optional().describe("Max coin objects per page"),
378
422
  }).strict().optional().describe("Set to query paginated coin objects instead of balance. Use cursor/limit for pagination."),
379
- token_type: TokenTypeSchema.optional().describe("Token type to query; defaults to 0x2::wow::WOW (platform token)"),
423
+ token_type: TokenTypeSchema.optional().describe("Token type in Move format: 0x<package>::<module>::<struct>. " +
424
+ "Examples: \"0x2::wow::WOW\" (default, 9 decimals), \"0x2::sui::SUI\" (9 decimals). " +
425
+ "For custom tokens, use the full type string from the token's coin metadata. " +
426
+ "The Fund Processing Layer resolves precision from the official registry → cache → on-chain."),
380
427
  network: EntrypointSchema.optional(),
381
- }).strict().describe("Query an account's coin balance OR paginated coin objects. Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Returns: { address, balance? | coin? }"),
428
+ }).strict().describe("Query an account's coin balance OR paginated coin objects. " +
429
+ "PARAMETERS: Use 'name_or_address' to specify the account (NOT 'filter'). " +
430
+ "Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. " +
431
+ "Use token_type to query non-default tokens (format: 0x<package>::<module>::<struct>). " +
432
+ "Returns: { address, balance? | coin? }"),
382
433
  z.object({
383
434
  query_type: z.literal("local_names"),
384
435
  addresses: z.array(z.string()).describe("Array of addresses to look up local names for"),
@@ -431,6 +482,24 @@ export const WatchQueryOperationsSchema = z.preprocess((input) => {
431
482
  no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
432
483
  network: EntrypointSchema.optional(),
433
484
  }).strict().describe("FORENSICS TOOL — query all transactions sent by an address. WARNING: like onchain_object_history, this can lead to non-convergent queries. For AI context building, use assemble_context (extracts embedded history) or query_events (real-time transitions) instead. This tool is for auditing/user-activity profiling only. Returns: TransactionHistoryAnswer | undefined"),
485
+ z.object({
486
+ query_type: z.literal("token_value_convert"),
487
+ token_type: TokenTypeSchema.describe("Full token type in Move format: 0x<package>::<module>::<struct>. " +
488
+ "Examples: \"0x2::wow::WOW\" (9 decimals). The token's decimals drive the conversion — " +
489
+ "resolved from official registry → local cache → on-chain coin metadata."),
490
+ raw: z.union([z.string(), z.number()]).optional().describe("Raw smallest-unit value (u64, e.g. \"2200000000\") to convert TO a human unit value. " +
491
+ "Provide EXACTLY ONE of raw / unit."),
492
+ unit: z.union([z.string(), z.number()]).optional().describe("Human unit value (e.g. \"2.2\") to convert TO raw smallest units (u64). " +
493
+ "Provide EXACTLY ONE of raw / unit. Conversion is REFUSED when the token's " +
494
+ "decimals cannot be resolved (guessing would forge wrong on-chain values)."),
495
+ network: EntrypointSchema.optional(),
496
+ }).strict()
497
+ .describe("Convert between raw on-chain smallest units (u64) and human unit values, in EITHER direction. " +
498
+ "Provide EXACTLY ONE of raw / unit (handler-validated). " +
499
+ "raw → unit: \"2200000000\" → \"2.2\" (pass-through when precision unknown). " +
500
+ "unit → raw: \"2.2\" → \"2200000000\" (REFUSED when precision unknown — never guesses decimals). " +
501
+ "Use this before displaying chain values to users, and before entering amounts for on-chain operations. " +
502
+ "Returns: { token_type, symbol?, decimals?, precision_known, direction, input, output, error?, text }"),
434
503
  ]));
435
504
  export const OnchainTableDataResultSchema = z.object({
436
505
  result: z.union([