@wowok/agent-mcp 2.7.0 → 2.7.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.
Files changed (427) hide show
  1. package/dist/config/index.js +1 -1
  2. package/dist/config/runtime.js +1 -238
  3. package/dist/customer/customer-advice.js +1 -130
  4. package/dist/customer/index.js +1 -11
  5. package/dist/customer/industry-risks.js +1 -438
  6. package/dist/customer/info-puzzle.js +1 -681
  7. package/dist/customer/order-monitor.js +1 -328
  8. package/dist/customer/order-strategy.js +1 -373
  9. package/dist/customer/post-purchase.js +1 -351
  10. package/dist/customer/preorder-compare.js +1 -34
  11. package/dist/customer/reminder-system.js +1 -316
  12. package/dist/customer/risk-assessment.d.ts +5 -1
  13. package/dist/customer/risk-assessment.js +1 -397
  14. package/dist/customer/types.js +1 -13
  15. package/dist/customer/user-preferences.js +1 -460
  16. package/dist/evaluation/arbitration-game.d.ts +23 -0
  17. package/dist/evaluation/arbitration-game.js +1 -0
  18. package/dist/evaluation/builtins/demand-match.d.ts +15 -0
  19. package/dist/evaluation/builtins/demand-match.js +1 -0
  20. package/dist/evaluation/builtins/index.d.ts +3 -0
  21. package/dist/evaluation/builtins/index.js +1 -0
  22. package/dist/evaluation/builtins/service-risk.d.ts +6 -0
  23. package/dist/evaluation/builtins/service-risk.js +1 -0
  24. package/dist/evaluation/capability.d.ts +50 -0
  25. package/dist/evaluation/capability.js +1 -0
  26. package/dist/evaluation/composer.d.ts +13 -0
  27. package/dist/evaluation/composer.js +1 -0
  28. package/dist/evaluation/engine.d.ts +18 -0
  29. package/dist/evaluation/engine.js +1 -0
  30. package/dist/evaluation/extract.d.ts +30 -0
  31. package/dist/evaluation/extract.js +1 -0
  32. package/dist/evaluation/game-strategy.d.ts +27 -0
  33. package/dist/evaluation/game-strategy.js +1 -0
  34. package/dist/evaluation/gap.d.ts +2 -0
  35. package/dist/evaluation/gap.js +1 -0
  36. package/dist/evaluation/index.d.ts +12 -0
  37. package/dist/evaluation/index.js +1 -0
  38. package/dist/evaluation/node-game.d.ts +62 -0
  39. package/dist/evaluation/node-game.js +1 -0
  40. package/dist/evaluation/region.d.ts +10 -0
  41. package/dist/evaluation/region.js +1 -0
  42. package/dist/evaluation/types.d.ts +77 -0
  43. package/dist/evaluation/types.js +1 -0
  44. package/dist/evaluation/user-injection.d.ts +6 -0
  45. package/dist/evaluation/user-injection.js +1 -0
  46. package/dist/examples/education-contact-create.json +40 -0
  47. package/dist/examples/freelance-contact-create.json +40 -0
  48. package/dist/examples/insurance-machine-create.json +1 -1
  49. package/dist/examples/insurance-service-allocators.json +1 -1
  50. package/dist/examples/machine-publish.json +1 -1
  51. package/dist/examples/rental-ziroom-service-create.json +1 -1
  52. package/dist/examples/retail-adv-guard-messenger-proof-create.json +1 -1
  53. package/dist/examples/retail-myshop-service-create.json +1 -1
  54. package/dist/examples/retail-myshop-service-customer-required.json +1 -1
  55. package/dist/examples/subscription-contact-create.json +40 -0
  56. package/dist/examples/threebody-machine-create.json +1 -1
  57. package/dist/examples/travel-machine-create.json +1 -1
  58. package/dist/examples/travel-service-create.json +1 -1
  59. package/dist/experience/experience-reuse.js +1 -103
  60. package/dist/experience/index.js +1 -5
  61. package/dist/experience/intent-distill.js +1 -83
  62. package/dist/experience/realtime-feedback.js +1 -94
  63. package/dist/experience/types.js +1 -1
  64. package/dist/experience/user-profile.js +1 -171
  65. package/dist/extensions/business-modules.js +1 -287
  66. package/dist/extensions/capability-manifest.js +1 -781
  67. package/dist/extensions/constraint-registry.js +1 -198
  68. package/dist/extensions/index.js +1 -6
  69. package/dist/extensions/metric-registry.js +1 -257
  70. package/dist/extensions/mode-evaluator.js +1 -170
  71. package/dist/extensions/modes.js +1 -499
  72. package/dist/extensions/registry.js +1 -717
  73. package/dist/extensions/types.js +1 -1
  74. package/dist/harness/auto-escalation.js +1 -68
  75. package/dist/harness/checkpoint.js +1 -129
  76. package/dist/harness/index.js +1 -78
  77. package/dist/harness/plan.js +1 -276
  78. package/dist/harness/recover.js +1 -139
  79. package/dist/harness/types.js +1 -1
  80. package/dist/harness/verify.js +1 -237
  81. package/dist/index.js +1 -273
  82. package/dist/intent/enrich.d.ts +1 -0
  83. package/dist/intent/enrich.js +1 -0
  84. package/dist/intent/index.d.ts +23 -0
  85. package/dist/intent/index.js +1 -0
  86. package/dist/intent/matcher.d.ts +2 -0
  87. package/dist/intent/matcher.js +1 -0
  88. package/dist/intent/store.d.ts +19 -0
  89. package/dist/intent/store.js +1 -0
  90. package/dist/intent/types.d.ts +33 -0
  91. package/dist/intent/types.js +1 -0
  92. package/dist/knowledge/acquisition-flywheel.js +1 -192
  93. package/dist/knowledge/allocation-confirm.js +1 -534
  94. package/dist/knowledge/allocation-context.js +1 -249
  95. package/dist/knowledge/allocation-ledger.js +1 -463
  96. package/dist/knowledge/allocation-puzzle.js +1 -298
  97. package/dist/knowledge/allocation-risk.js +1 -568
  98. package/dist/knowledge/allocation-templates.js +1 -970
  99. package/dist/knowledge/allocation-translation.js +1 -585
  100. package/dist/knowledge/arb-risk.js +1 -210
  101. package/dist/knowledge/arbitration-confirm.js +1 -559
  102. package/dist/knowledge/arbitration-context.js +1 -505
  103. package/dist/knowledge/arbitration-ledger.js +1 -521
  104. package/dist/knowledge/arbitration-puzzle.js +1 -304
  105. package/dist/knowledge/arbitration-risk.js +1 -433
  106. package/dist/knowledge/arbitration-templates.js +1 -276
  107. package/dist/knowledge/arbitration-translation.js +1 -487
  108. package/dist/knowledge/arbitration-trust.js +1 -117
  109. package/dist/knowledge/audit-rules.js +1 -141
  110. package/dist/knowledge/bridge-risk.js +1 -263
  111. package/dist/knowledge/contact-risk.js +1 -200
  112. package/dist/knowledge/contact-templates.d.ts +27 -0
  113. package/dist/knowledge/contact-templates.js +1 -0
  114. package/dist/knowledge/demand-confirm.js +1 -206
  115. package/dist/knowledge/demand-matching.js +1 -132
  116. package/dist/knowledge/demand-risk.js +1 -240
  117. package/dist/knowledge/demand-translation.js +1 -354
  118. package/dist/knowledge/deployment-scanner.js +1 -823
  119. package/dist/knowledge/dynamic-pricing.js +1 -87
  120. package/dist/knowledge/examples-scanner-cli.js +1 -26
  121. package/dist/knowledge/examples-scanner.js +1 -825
  122. package/dist/knowledge/flywheel-loop.js +1 -404
  123. package/dist/knowledge/fund-layer.js +1 -973
  124. package/dist/knowledge/glossary.js +1 -211
  125. package/dist/knowledge/guard-confirm.js +1 -406
  126. package/dist/knowledge/guard-context.js +1 -287
  127. package/dist/knowledge/guard-design-patterns.js +1 -360
  128. package/dist/knowledge/guard-ledger.js +1 -260
  129. package/dist/knowledge/guard-lint.js +1 -670
  130. package/dist/knowledge/guard-migration.js +1 -228
  131. package/dist/knowledge/guard-puzzle.js +1 -805
  132. package/dist/knowledge/guard-render.js +1 -700
  133. package/dist/knowledge/guard-risk.js +1 -1879
  134. package/dist/knowledge/guard-submission-prompt.js +1 -171
  135. package/dist/knowledge/guard-templates.js +1 -1105
  136. package/dist/knowledge/guard-translation.js +1 -1119
  137. package/dist/knowledge/index.js +1 -436
  138. package/dist/knowledge/industry-evolution.js +1 -323
  139. package/dist/knowledge/industry-generalizer.js +1 -381
  140. package/dist/knowledge/industry-registry.js +1 -174
  141. package/dist/knowledge/intent-metrics.d.ts +4 -3
  142. package/dist/knowledge/intent-metrics.js +1 -566
  143. package/dist/knowledge/machine-confirm.js +1 -559
  144. package/dist/knowledge/machine-context.js +1 -833
  145. package/dist/knowledge/machine-ledger.js +1 -338
  146. package/dist/knowledge/machine-puzzle.js +1 -494
  147. package/dist/knowledge/machine-render.js +1 -565
  148. package/dist/knowledge/machine-risk.js +1 -670
  149. package/dist/knowledge/machine-templates.js +1 -1597
  150. package/dist/knowledge/machine-topology.js +1 -234
  151. package/dist/knowledge/machine-translation.js +1 -513
  152. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  153. package/dist/knowledge/mcp-schema-audit.d.ts +1 -1
  154. package/dist/knowledge/mcp-schema-audit.js +1 -773
  155. package/dist/knowledge/onchain-constants.js +1 -35
  156. package/dist/knowledge/order-confirm.js +1 -573
  157. package/dist/knowledge/order-context.js +1 -390
  158. package/dist/knowledge/order-ledger.js +1 -341
  159. package/dist/knowledge/order-puzzle.js +1 -255
  160. package/dist/knowledge/order-risk.js +1 -653
  161. package/dist/knowledge/order-templates.js +1 -368
  162. package/dist/knowledge/order-translation.js +1 -550
  163. package/dist/knowledge/overrides-loader.js +1 -65
  164. package/dist/knowledge/passport-confirm.js +1 -531
  165. package/dist/knowledge/passport-context.js +1 -306
  166. package/dist/knowledge/passport-ledger.js +1 -282
  167. package/dist/knowledge/passport-puzzle.js +1 -333
  168. package/dist/knowledge/passport-risk.js +1 -450
  169. package/dist/knowledge/passport-templates.js +1 -568
  170. package/dist/knowledge/passport-translation.js +1 -516
  171. package/dist/knowledge/payment-risk.js +1 -249
  172. package/dist/knowledge/permission-confirm.js +1 -426
  173. package/dist/knowledge/permission-context.js +1 -224
  174. package/dist/knowledge/permission-ledger.js +1 -403
  175. package/dist/knowledge/permission-puzzle.js +1 -173
  176. package/dist/knowledge/permission-risk.js +1 -411
  177. package/dist/knowledge/permission-templates.js +1 -234
  178. package/dist/knowledge/permission-translation.js +1 -350
  179. package/dist/knowledge/personal-risk.js +1 -212
  180. package/dist/knowledge/process-model.js +1 -160
  181. package/dist/knowledge/progress-confirm.js +1 -456
  182. package/dist/knowledge/progress-context.js +1 -452
  183. package/dist/knowledge/progress-ledger.js +1 -330
  184. package/dist/knowledge/progress-puzzle.js +1 -219
  185. package/dist/knowledge/progress-risk.js +1 -461
  186. package/dist/knowledge/progress-templates.js +1 -228
  187. package/dist/knowledge/progress-translation.js +1 -405
  188. package/dist/knowledge/proof-confirm.js +1 -187
  189. package/dist/knowledge/proof-risk.js +1 -207
  190. package/dist/knowledge/proof-translation.js +1 -283
  191. package/dist/knowledge/registrar-risk.js +1 -217
  192. package/dist/knowledge/repository-confirm.js +1 -286
  193. package/dist/knowledge/repository-risk.js +1 -373
  194. package/dist/knowledge/repository-translation.js +1 -445
  195. package/dist/knowledge/reputation-rules.js +1 -99
  196. package/dist/knowledge/resource-risk.js +1 -157
  197. package/dist/knowledge/reward-confirm.js +1 -526
  198. package/dist/knowledge/reward-context.js +1 -504
  199. package/dist/knowledge/reward-ledger.js +1 -502
  200. package/dist/knowledge/reward-puzzle.js +1 -300
  201. package/dist/knowledge/reward-risk.js +1 -627
  202. package/dist/knowledge/reward-templates.js +1 -197
  203. package/dist/knowledge/reward-translation.js +1 -501
  204. package/dist/knowledge/safety-rules.js +1 -404
  205. package/dist/knowledge/scenario-modes.js +1 -321
  206. package/dist/knowledge/service-confirm.js +1 -807
  207. package/dist/knowledge/service-context.js +1 -403
  208. package/dist/knowledge/service-ledger.js +1 -609
  209. package/dist/knowledge/service-puzzle.js +1 -236
  210. package/dist/knowledge/service-risk.js +1 -615
  211. package/dist/knowledge/service-templates.js +1 -456
  212. package/dist/knowledge/service-translation.js +1 -622
  213. package/dist/knowledge/template-registry.d.ts +1 -1
  214. package/dist/knowledge/template-registry.js +1 -341
  215. package/dist/knowledge/tool-constraints.js +1 -195
  216. package/dist/knowledge/tools-reference.js +1 -155
  217. package/dist/knowledge/treasury-confirm.js +1 -512
  218. package/dist/knowledge/treasury-context.js +1 -363
  219. package/dist/knowledge/treasury-ledger.js +1 -300
  220. package/dist/knowledge/treasury-puzzle.js +1 -216
  221. package/dist/knowledge/treasury-risk.js +1 -440
  222. package/dist/knowledge/treasury-templates.js +1 -358
  223. package/dist/knowledge/treasury-translation.js +1 -498
  224. package/dist/knowledge/trust-metrics.js +1 -198
  225. package/dist/knowledge/util-risk.js +1 -135
  226. package/dist/loop-engineering/aggregate.js +1 -132
  227. package/dist/loop-engineering/context-collect.js +1 -83
  228. package/dist/loop-engineering/diagnose.js +1 -273
  229. package/dist/loop-engineering/improve.js +1 -405
  230. package/dist/loop-engineering/index.js +1 -4
  231. package/dist/loop-engineering/pipeline.js +1 -56
  232. package/dist/mode-market/index.js +1 -3
  233. package/dist/mode-market/registry.js +1 -124
  234. package/dist/mode-market/review.js +1 -214
  235. package/dist/mode-market/submission.js +1 -85
  236. package/dist/participation/collaborator-interest.d.ts +23 -0
  237. package/dist/participation/collaborator-interest.js +1 -0
  238. package/dist/participation/customer-interest.d.ts +25 -0
  239. package/dist/participation/customer-interest.js +1 -0
  240. package/dist/participation/merchant-interest.js +1 -100
  241. package/dist/participation/radar-core.d.ts +13 -3
  242. package/dist/participation/radar-core.js +1 -269
  243. package/dist/participation/supplier-interest.d.ts +25 -0
  244. package/dist/participation/supplier-interest.js +1 -0
  245. package/dist/persona/analyzer.d.ts +16 -0
  246. package/dist/persona/analyzer.js +1 -0
  247. package/dist/persona/bridge.d.ts +5 -0
  248. package/dist/persona/bridge.js +1 -0
  249. package/dist/persona/defaults.d.ts +4 -0
  250. package/dist/persona/defaults.js +1 -0
  251. package/dist/persona/experience-bridge.d.ts +3 -0
  252. package/dist/persona/experience-bridge.js +1 -0
  253. package/dist/persona/index.d.ts +18 -0
  254. package/dist/persona/index.js +1 -0
  255. package/dist/persona/model.d.ts +7 -0
  256. package/dist/persona/model.js +1 -0
  257. package/dist/persona/store.d.ts +19 -0
  258. package/dist/persona/store.js +1 -0
  259. package/dist/persona/types.d.ts +45 -0
  260. package/dist/persona/types.js +1 -0
  261. package/dist/project/business-puzzle.js +1 -383
  262. package/dist/project/context-assembly.js +1 -254
  263. package/dist/project/deployment-bridge.js +1 -120
  264. package/dist/project/deployment-doc.js +1 -1126
  265. package/dist/project/edit-planner.js +1 -1342
  266. package/dist/project/evaluation.js +1 -2011
  267. package/dist/project/game-theory.js +1 -177
  268. package/dist/project/graph-builder.js +1 -656
  269. package/dist/project/graph.js +1 -340
  270. package/dist/project/handlers.d.ts +5 -0
  271. package/dist/project/handlers.js +1 -1762
  272. package/dist/project/index.d.ts +1 -0
  273. package/dist/project/index.js +1 -301
  274. package/dist/project/intent-analyzer.js +1 -149
  275. package/dist/project/machine-nodes.js +1 -36
  276. package/dist/project/merchant-guide.js +1 -264
  277. package/dist/project/migration.js +1 -125
  278. package/dist/project/mode-actions.js +1 -309
  279. package/dist/project/namespace.js +1 -206
  280. package/dist/project/participation-radar.js +1 -428
  281. package/dist/project/pipeline-actions.js +1 -109
  282. package/dist/project/project-store.js +1 -422
  283. package/dist/project/query.js +1 -153
  284. package/dist/project/reverse-mapping.d.ts +34 -0
  285. package/dist/project/reverse-mapping.js +1 -0
  286. package/dist/project/risk-aggregator.js +1 -295
  287. package/dist/project/rollback-policy.js +1 -290
  288. package/dist/project/semantic-assembler.js +1 -345
  289. package/dist/project/semantic-graph.js +1 -245
  290. package/dist/project/stage-gate.js +1 -369
  291. package/dist/project/substep-trace.js +1 -332
  292. package/dist/project/task-tracker.js +1 -78
  293. package/dist/role/derivation.d.ts +18 -0
  294. package/dist/role/derivation.js +1 -0
  295. package/dist/role/index.d.ts +5 -0
  296. package/dist/role/index.js +1 -0
  297. package/dist/role/model.d.ts +8 -0
  298. package/dist/role/model.js +1 -0
  299. package/dist/role/resolution.d.ts +11 -0
  300. package/dist/role/resolution.js +1 -0
  301. package/dist/role/types.d.ts +11 -0
  302. package/dist/role/types.js +1 -0
  303. package/dist/rules.d.ts +2 -0
  304. package/dist/rules.js +1 -9
  305. package/dist/safety/confirm-gate.js +1 -88
  306. package/dist/safety/index.js +1 -3
  307. package/dist/safety/preview.js +1 -52
  308. package/dist/schema/call/allocation.js +1 -34
  309. package/dist/schema/call/arbitration.js +1 -113
  310. package/dist/schema/call/base.d.ts +15 -15
  311. package/dist/schema/call/base.js +1 -370
  312. package/dist/schema/call/bridge-handler.js +1 -265
  313. package/dist/schema/call/bridge.d.ts +7 -7
  314. package/dist/schema/call/bridge.js +1 -458
  315. package/dist/schema/call/contact.js +1 -37
  316. package/dist/schema/call/demand.js +1 -47
  317. package/dist/schema/call/guard.js +1 -161
  318. package/dist/schema/call/handler.js +1 -322
  319. package/dist/schema/call/index.js +1 -20
  320. package/dist/schema/call/machine.js +1 -193
  321. package/dist/schema/call/order.js +1 -35
  322. package/dist/schema/call/payment.js +1 -37
  323. package/dist/schema/call/permission-handler.js +1 -54
  324. package/dist/schema/call/permission.js +1 -105
  325. package/dist/schema/call/personal.js +1 -78
  326. package/dist/schema/call/progress.js +1 -47
  327. package/dist/schema/call/proof.js +1 -33
  328. package/dist/schema/call/repository.js +1 -77
  329. package/dist/schema/call/reward.js +1 -30
  330. package/dist/schema/call/semantic.js +1 -1657
  331. package/dist/schema/call/service.js +1 -178
  332. package/dist/schema/call/treasury.js +1 -71
  333. package/dist/schema/common/index.js +1 -407
  334. package/dist/schema/config/index.js +1 -68
  335. package/dist/schema/evaluation/index.d.ts +4436 -0
  336. package/dist/schema/evaluation/index.js +1 -0
  337. package/dist/schema/index.d.ts +4 -0
  338. package/dist/schema/index.js +1 -13
  339. package/dist/schema/intent-radar/index.d.ts +284 -0
  340. package/dist/schema/intent-radar/index.js +1 -0
  341. package/dist/schema/local/index.d.ts +21 -21
  342. package/dist/schema/local/index.js +1 -927
  343. package/dist/schema/local/wip.js +1 -187
  344. package/dist/schema/messenger/index.d.ts +7 -7
  345. package/dist/schema/messenger/index.js +1 -475
  346. package/dist/schema/operations.d.ts +7 -7
  347. package/dist/schema/operations.js +1 -520
  348. package/dist/schema/persona/index.d.ts +1985 -0
  349. package/dist/schema/persona/index.js +1 -0
  350. package/dist/schema/project/index.d.ts +96 -50
  351. package/dist/schema/project/index.js +1 -2057
  352. package/dist/schema/query/index.d.ts +423 -7
  353. package/dist/schema/query/index.js +1 -1640
  354. package/dist/schema/schema-query/index.js +1 -104
  355. package/dist/schema/schema-version.js +1 -76
  356. package/dist/schema/sync-layer4.d.ts +1 -1
  357. package/dist/schema/sync-layer4.js +1 -282
  358. package/dist/schema/task-status.d.ts +168 -0
  359. package/dist/schema/task-status.js +1 -0
  360. package/dist/schema/trust/index.js +1 -314
  361. package/dist/schema/utils/guard-parser.js +1 -419
  362. package/dist/schema/utils/guard-query-utils.js +1 -46
  363. package/dist/schema/utils/node-parser.js +1 -369
  364. package/dist/schema/utils/object-type-utils.js +1 -35
  365. package/dist/schema/utils/permission-index-utils.js +1 -7
  366. package/dist/schema/utils/permission-machine-check.js +1 -121
  367. package/dist/schema/utils/skills-recommendation.js +1 -77
  368. package/dist/schema-query/index.js +1 -810
  369. package/dist/schemas/account_operation.output.json +5 -2
  370. package/dist/schemas/bridge_operation.output.json +5 -2
  371. package/dist/schemas/evaluation_operation.output.json +782 -0
  372. package/dist/schemas/evaluation_operation.schema.json +990 -0
  373. package/dist/schemas/index.json +25 -1
  374. package/dist/schemas/intent_radar.output.json +232 -0
  375. package/dist/schemas/intent_radar.schema.json +138 -0
  376. package/dist/schemas/local_info_operation.output.json +5 -2
  377. package/dist/schemas/local_mark_operation.output.json +5 -2
  378. package/dist/schemas/messenger_operation.output.json +5 -2
  379. package/dist/schemas/onchain_events.output.json +5 -2
  380. package/dist/schemas/onchain_operations.output.json +5 -2
  381. package/dist/schemas/onchain_operations.schema.json +6 -6
  382. package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
  383. package/dist/schemas/onchain_operations_machine.schema.json +2 -2
  384. package/dist/schemas/onchain_operations_service.schema.json +3 -3
  385. package/dist/schemas/onchain_table_data.output.json +6 -3
  386. package/dist/schemas/persona_operation.output.json +392 -0
  387. package/dist/schemas/persona_operation.schema.json +250 -0
  388. package/dist/schemas/project_operation.output.json +28 -8
  389. package/dist/schemas/query_task_status.output.json +115 -0
  390. package/dist/schemas/query_task_status.schema.json +24 -0
  391. package/dist/schemas/query_toolkit.output.json +9 -6
  392. package/dist/schemas/trust_score.schema.json +1 -1
  393. package/dist/schemas/wowok_buildin_info.output.json +132 -0
  394. package/dist/schemas/wowok_buildin_info.schema.json +14 -0
  395. package/dist/telemetry/index.js +1 -112
  396. package/dist/telemetry/redact.js +1 -23
  397. package/dist/telemetry/storage.js +1 -80
  398. package/dist/tools/handlers/bridge.js +1 -1
  399. package/dist/tools/handlers/config.js +1 -74
  400. package/dist/tools/handlers/evaluation.d.ts +2 -0
  401. package/dist/tools/handlers/evaluation.js +1 -0
  402. package/dist/tools/handlers/file-export.js +1 -90
  403. package/dist/tools/handlers/intent-radar.d.ts +2 -0
  404. package/dist/tools/handlers/intent-radar.js +1 -0
  405. package/dist/tools/handlers/local.js +1 -53
  406. package/dist/tools/handlers/messenger.js +1 -188
  407. package/dist/tools/handlers/onchain.js +1 -1082
  408. package/dist/tools/handlers/persona.d.ts +4 -0
  409. package/dist/tools/handlers/persona.js +1 -0
  410. package/dist/tools/handlers/project.js +1 -211
  411. package/dist/tools/handlers/query.js +1 -434
  412. package/dist/tools/handlers/schema-query.js +1 -176
  413. package/dist/tools/handlers/task-status.d.ts +0 -168
  414. package/dist/tools/handlers/task-status.js +1 -55
  415. package/dist/tools/handlers/trust.js +1 -380
  416. package/dist/tools/handlers/wip.js +1 -90
  417. package/dist/tools/index.js +1 -1306
  418. package/dist/tools/retry.js +1 -85
  419. package/dist/tools/rules-hook.js +1 -23
  420. package/dist/tools/shared.js +1 -130
  421. package/dist/tools/types.js +1 -1
  422. package/dist/tools/upgrade-check.d.ts +19 -0
  423. package/dist/tools/upgrade-check.js +1 -0
  424. package/dist/tools/wip-deploy-assist.d.ts +1 -1
  425. package/dist/tools/wip-deploy-assist.js +1 -278
  426. package/dist/tools/wrap.js +1 -500
  427. package/package.json +5 -3
@@ -1,458 +1 @@
1
- import { z } from "zod";
2
- import { CallEnvSchema, SemanticSummarySchema } from "./base.js";
3
- import { WowAddressSchema } from "../common/index.js";
4
- export const BridgeTokenSchema = z.enum(["ETH", "WETH", "WBTC", "USDC", "USDT"])
5
- .describe("Cross-chain token identifier. ETH=native ETH; WETH/WBTC/USDC/USDT=ERC20. Decimals are handled by SDK config.");
6
- export const EvmChainSchema = z.enum(["mainnet"])
7
- .default("mainnet")
8
- .describe("EVM chain identifier. Currently only 'mainnet' (Ethereum mainnet, chainId=1) is supported. Extensible to BSC/Polygon/Arbitrum in the future.");
9
- export const EvmAddressSchema = z.string()
10
- .regex(/^0x[0-9a-fA-F]{40}$/, "Invalid EVM address (must be 0x + 40 hex)")
11
- .describe("EVM address (0x + 40 hex)");
12
- export const BridgeAmountSchema = z.string()
13
- .describe("Cross-chain amount as a string in the smallest unit (e.g. wei / token minimal unit). Example: 1 ETH = '1000000000000000000'");
14
- export const BridgeIdempotencyKeySchema = z.string().min(1).max(128)
15
- .describe("Idempotency key (1-128 chars). Prevents duplicate transfers on retry. If a successful transfer with this key exists, returns it immediately (idempotentHit=true).");
16
- export const BridgeOperationTypeSchema = z.enum([
17
- "cross_chain_wow_to_evm",
18
- "cross_chain_evm_to_wow",
19
- "claim_wow_to_evm",
20
- "resume_transfer",
21
- "withdraw",
22
- "query_active_evm_account",
23
- "query_supported_evm_chains",
24
- "query_supported_tokens",
25
- "query_transfer_list",
26
- "query_transfer_status",
27
- "manage_evm_rpc",
28
- ]).describe("Bridge operation type");
29
- export const BridgeWowToEvmDataSchema = z.object({
30
- token: BridgeTokenSchema.describe("Cross-chain token type"),
31
- amount: BridgeAmountSchema.describe("Cross-chain amount (WOW-side smallest unit, wowDecimals)"),
32
- withdrawTo: EvmAddressSchema.optional()
33
- .describe("Final withdrawal EVM address; if omitted, assets remain in activeEvmAccount. When provided, the SDK uses the activeEvmAccount key to transfer to this address."),
34
- idempotencyKey: BridgeIdempotencyKeySchema.optional()
35
- .describe("Idempotency key to prevent duplicate deposits on retry. If a successful transfer with this key exists, returns it immediately (idempotentHit=true)."),
36
- idempotentByParams: z.boolean().optional()
37
- .describe("If true, auto-generates an idempotency key from token+amount+withdrawTo. Use when you want implicit idempotency without managing explicit keys."),
38
- }).strict().describe("WOW→EVM cross-chain (step 1: deposit only). " +
39
- "Returns immediately with depositTxDigest + bridgeSeq + transferId. " +
40
- "This operation only locks assets on WOW; it does NOT complete the cross-chain. " +
41
- "After deposit, bridge nodes need ~1-5 minutes to sign. " +
42
- "Use query_transfer_status to monitor progress; when latestState.step shows 'signatures_ready', " +
43
- "call claim_wow_to_evm (step 2) to claim assets on EVM. " +
44
- "[Gas requirements] Step 1 needs WOW gas; Step 2 (claim_wow_to_evm) needs activeEvmAccount to have target-chain gas.");
45
- export const BridgeEvmToWowDataSchema = z.object({
46
- token: BridgeTokenSchema.describe("Cross-chain token type (ETH=native ETH, others are ERC20)"),
47
- amount: BridgeAmountSchema.describe("Cross-chain amount (EVM-side smallest unit, evmDecimals)"),
48
- recipientWowAddress: WowAddressSchema.optional()
49
- .describe("WOW recipient address or account name; defaults to env.account if omitted"),
50
- idempotencyKey: BridgeIdempotencyKeySchema.optional()
51
- .describe("Idempotency key to prevent duplicate deposits on retry. If a successful transfer with this key exists, returns it immediately (idempotentHit=true)."),
52
- idempotentByParams: z.boolean().optional()
53
- .describe("If true, auto-generates an idempotency key from token+amount+recipientWowAddress. Use when you want implicit idempotency without managing explicit keys."),
54
- }).strict().describe("EVM→WOW cross-chain (single step: deposit). " +
55
- "Returns immediately with depositTxHash + transferId. " +
56
- "Bridge will automatically claim on WOW (no WOW gas needed, no user action required). " +
57
- "[Time estimate] ~10-20 minutes total: " +
58
- "(1) 64-block confirmation ~12.8 min on ETH; " +
59
- "(2) bridge node auto-claim ~1-5 min on WOW. " +
60
- "[Status flow] Use query_transfer_status(refresh=true) to monitor: " +
61
- "latestState.step: source_tx_pending → source_tx_confirmed → signatures_ready → completed. " +
62
- "When latestState.confirmations >= 64, deposit is finalized and bridge nodes will sign. " +
63
- "[Gas requirements] Only needs activeEvmAccount to have target-chain gas (for deposit). No WOW gas needed.");
64
- export const BridgeClaimWowToEvmDataSchema = z.object({
65
- transferId: z.string().describe("Transfer ID from cross_chain_wow_to_evm (br_<timestamp>_<counter>)"),
66
- }).strict().describe("WOW→EVM claim (step 2): claim assets on EVM after bridge nodes have signed. " +
67
- "Prerequisite: cross_chain_wow_to_evm (step 1) must be completed, and query_transfer_status " +
68
- "must show latestState.step = 'signatures_ready' or 'source_tx_confirmed' (nodes have approved). " +
69
- "Returns claimTxHash on success. " +
70
- "After claim_wow_to_evm returns, the claim tx has been submitted and confirmed (1 block) on EVM. " +
71
- "Use query_transfer_status(refresh=true) to verify latestState.step = 'completed'. " +
72
- "[Gas requirements] Requires activeEvmAccount to have target-chain gas (for the claim transaction).");
73
- export const BridgeResumeTransferDataSchema = z.object({
74
- transferId: z.string().describe("Transfer ID to resume (br_<timestamp>_<counter>)"),
75
- }).strict().describe("Resume an interrupted transfer from its current step. " +
76
- "Use this when a transfer was interrupted (e.g. MCP restart, network error) and you want to continue from where it left off. " +
77
- "The SDK determines the current step and attempts to advance it: " +
78
- "- If deposit step failed: retries the deposit " +
79
- "- If deposit is pending/confirmed: waits for bridge signatures and proceeds to claim " +
80
- "- If claim step is ready: executes the claim " +
81
- "- If transfer is already complete: returns the existing record (idempotentHit=true) " +
82
- "[Returns] The updated transfer record after attempting to advance it. " +
83
- "[Requires env] WOW env is needed for WOW-side operations; EVM-side operations use activeEvmAccount.");
84
- export const BridgeWithdrawDataSchema = z.object({
85
- to: EvmAddressSchema.describe("Withdrawal target EVM address"),
86
- amount: BridgeAmountSchema.describe("Withdrawal amount (smallest unit)"),
87
- token: BridgeTokenSchema.optional()
88
- .describe("ERC20 token identifier; if omitted or ETH, withdraws native ETH"),
89
- tokenAddress: EvmAddressSchema.optional()
90
- .describe("ERC20 contract address (alternative to token; allows withdrawing by contract address)"),
91
- network: EvmChainSchema
92
- .describe("Target chain (defaults to Ethereum mainnet when omitted — EvmChainSchema carries .default(\"mainnet\"))"),
93
- }).strict().describe("Withdraw from activeEvmAccount to another EVM address");
94
- export const BridgeQueryActiveEvmAccountDataSchema = z.object({
95
- network: EvmChainSchema.optional()
96
- .describe("Specific chain; if omitted, queries all supported chains"),
97
- tokens: z.array(EvmAddressSchema).optional()
98
- .describe("Additional ERC20 token contract addresses to query; if omitted, only native ETH balance is queried"),
99
- }).strict().describe("Query activeEvmAccount parameters");
100
- export const BridgeQuerySupportedTokensDataSchema = z.object({
101
- network: EvmChainSchema.optional()
102
- .describe("Specific chain; if omitted, returns token lists for all supported chains"),
103
- }).strict().describe("Query supported Bridge tokens per chain (WOW/EVM addresses, decimals, description)");
104
- export const BridgeQueryTransferListDataSchema = z.object({
105
- onlyActive: z.boolean().optional()
106
- .describe("true returns only in-progress transfers; false/omitted returns all"),
107
- status: z.enum(["pending", "in_progress", "success", "failed"]).optional()
108
- .describe("Filter by transfer status"),
109
- direction: z.enum(["wow_to_evm", "evm_to_wow", "withdraw"]).optional()
110
- .describe("Filter by transfer direction"),
111
- token: BridgeTokenSchema.optional()
112
- .describe("Filter by token type (ETH/WETH/WBTC/USDC/USDT)"),
113
- limit: z.number().int().positive().max(100).optional()
114
- .describe("Maximum number of results (default: all, max: 100)"),
115
- }).strict().describe("Query transfer list with optional filters (status / direction / token / limit)");
116
- export const BridgeQueryTransferStatusDataSchema = z.object({
117
- transferId: z.string().describe("Transfer ID (br_<timestamp>_<counter>)"),
118
- refresh: z.boolean().optional().default(true)
119
- .describe("Whether to refresh from on-chain state (default true). " +
120
- "true=queries latest on-chain status (takes 5-15s, timeout at 15s on slow RPC). " +
121
- "false=instant response from local cache (no on-chain query). " +
122
- "Recommended: use refresh=true every 1-2 minutes for ongoing transfers; " +
123
- "use refresh=false for quick checks between refreshes."),
124
- }).strict().describe("Query single transfer parameters. " +
125
- "[Wait hint] With refresh=true (default), this call may take 5-15 seconds to query on-chain state. " +
126
- "If on-chain RPC is slow, it will timeout at 15s and return cached state. " +
127
- "Set refresh=false for instant response from local cache. " +
128
- "[Returned fields] The result includes: " +
129
- "(1) record.step/status - high-level lifecycle (deposit/claimed/success); " +
130
- "(2) record.latestState.step/status - fine-grained on-chain progress " +
131
- "(source_tx_pending → source_tx_confirmed → signatures_ready → completed). " +
132
- "Use latestState.confirmations to estimate remaining time (needs 64 for ETH→WOW finalization).");
133
- export const BridgeManageEvmRpcDataSchema = z.discriminatedUnion("op", [
134
- z.object({
135
- op: z.literal("list").describe("List all configured RPC endpoints with health status"),
136
- network: EvmChainSchema
137
- .describe("Target chain (defaults to Ethereum mainnet when omitted — EvmChainSchema carries .default(\"mainnet\"))"),
138
- }).describe("List RPC endpoints (no rpcUrl/rpcUrls needed)"),
139
- z.object({
140
- op: z.literal("add").describe("Append one or more RPC endpoints"),
141
- network: EvmChainSchema
142
- .describe("Target chain (defaults to Ethereum mainnet when omitted — EvmChainSchema carries .default(\"mainnet\"))"),
143
- rpcUrls: z.array(z.string().url()).min(1)
144
- .describe("RPC URL(s) to add"),
145
- }).describe("Add RPC endpoint(s)"),
146
- z.object({
147
- op: z.literal("remove").describe("Remove one or more RPC endpoints"),
148
- network: EvmChainSchema
149
- .describe("Target chain (defaults to Ethereum mainnet when omitted — EvmChainSchema carries .default(\"mainnet\"))"),
150
- rpcUrls: z.array(z.string().url()).min(1)
151
- .describe("RPC URL(s) to remove"),
152
- }).describe("Remove RPC endpoint(s)"),
153
- z.object({
154
- op: z.literal("set").describe("Full replace all RPC endpoints"),
155
- network: EvmChainSchema
156
- .describe("Target chain (defaults to Ethereum mainnet when omitted — EvmChainSchema carries .default(\"mainnet\"))"),
157
- rpcUrls: z.array(z.string().url()).min(1)
158
- .describe("Full RPC list (replaces all existing endpoints)"),
159
- }).describe("Full replace RPC endpoints"),
160
- z.object({
161
- op: z.literal("ping").describe("Health check one or more RPC endpoints"),
162
- network: EvmChainSchema
163
- .describe("Target chain (defaults to Ethereum mainnet when omitted — EvmChainSchema carries .default(\"mainnet\"))"),
164
- rpcUrls: z.array(z.string().url()).optional()
165
- .describe("Specific RPC URLs to ping; if omitted, pings all configured RPCs"),
166
- }).describe("Health check RPC endpoints"),
167
- ]).describe("EVM RPC endpoint management (discriminated by op)");
168
- export const BridgeOperationsSchema = z.preprocess((input) => {
169
- if (typeof input === "object" && input !== null) {
170
- const obj = { ...input };
171
- if (typeof obj.description === "string" && !obj.operation_type) {
172
- try {
173
- const parsed = JSON.parse(obj.description);
174
- if (parsed && typeof parsed === "object" && parsed.operation_type) {
175
- return parsed;
176
- }
177
- }
178
- catch { }
179
- }
180
- if (typeof obj.data === "string") {
181
- try {
182
- obj.data = JSON.parse(obj.data);
183
- }
184
- catch { }
185
- }
186
- if (typeof obj.env === "string") {
187
- try {
188
- obj.env = JSON.parse(obj.env);
189
- }
190
- catch { }
191
- }
192
- return obj;
193
- }
194
- return input;
195
- }, z.discriminatedUnion("operation_type", [
196
- z.object({
197
- operation_type: z.literal("cross_chain_wow_to_evm"),
198
- data: BridgeWowToEvmDataSchema,
199
- env: CallEnvSchema.optional(),
200
- }).describe("WOW→EVM cross-chain (simplified): assets auto-claim to activeEvmAccount; if withdrawTo is provided, an additional transfer is made to that address. [Requires WOW mainnet env]"),
201
- z.object({
202
- operation_type: z.literal("cross_chain_evm_to_wow"),
203
- data: BridgeEvmToWowDataSchema,
204
- env: CallEnvSchema.optional(),
205
- }).describe("EVM→WOW cross-chain (single step): deposit from activeEvmAccount, bridge auto-claims on WOW. No WOW gas needed. [Requires WOW mainnet env]"),
206
- z.object({
207
- operation_type: z.literal("claim_wow_to_evm"),
208
- data: BridgeClaimWowToEvmDataSchema,
209
- env: CallEnvSchema.optional(),
210
- }).describe("WOW→EVM claim (step 2): claim assets on EVM after bridge signed. Requires activeEvmAccount to have EVM gas. [Requires WOW mainnet env]"),
211
- z.object({
212
- operation_type: z.literal("resume_transfer"),
213
- data: BridgeResumeTransferDataSchema,
214
- env: CallEnvSchema.optional(),
215
- }).describe("Resume an interrupted transfer from its current step. Safe to retry. [Requires WOW mainnet env for WOW-side operations]"),
216
- z.object({
217
- operation_type: z.literal("withdraw"),
218
- data: BridgeWithdrawDataSchema,
219
- }).describe("Withdraw from activeEvmAccount to another EVM address (non-cross-chain). [No env needed]"),
220
- z.object({
221
- operation_type: z.literal("query_active_evm_account"),
222
- data: BridgeQueryActiveEvmAccountDataSchema.optional(),
223
- }).describe("Query activeEvmAccount address + balances (per chain or all chains). [No env needed]"),
224
- z.object({
225
- operation_type: z.literal("query_supported_evm_chains"),
226
- }).describe("List currently supported EVM chains (enum value / description / chainId / RPC health). [No env needed, no data required]"),
227
- z.object({
228
- operation_type: z.literal("query_supported_tokens"),
229
- data: BridgeQuerySupportedTokensDataSchema.optional(),
230
- }).describe("List supported Bridge tokens per chain (WOW/EVM contract addresses, decimals, description). [No env needed]"),
231
- z.object({
232
- operation_type: z.literal("query_transfer_list"),
233
- data: BridgeQueryTransferListDataSchema.optional(),
234
- }).describe("Query cross-chain / withdrawal transfer history list (optionally only in-progress). [No env needed]"),
235
- z.object({
236
- operation_type: z.literal("query_transfer_status"),
237
- data: BridgeQueryTransferStatusDataSchema,
238
- }).describe("Query a single transfer's detail by transferId"),
239
- z.object({
240
- operation_type: z.literal("manage_evm_rpc"),
241
- data: BridgeManageEvmRpcDataSchema,
242
- }).describe("Manage EVM RPC endpoints (list/add/remove/set/ping) to mitigate public RPC 429 rate limits. [No env needed]"),
243
- ]));
244
- export const BridgeLatestStateSchema = z.object({
245
- status: z.enum([
246
- "not_started", "pending", "confirmed", "signatures_ready",
247
- "claiming", "completed", "failed",
248
- ]).describe("On-chain status (finer-grained than record.status): " +
249
- "pending=source tx submitted but not confirmed; " +
250
- "confirmed=source tx confirmed, waiting for bridge node signatures; " +
251
- "signatures_ready=nodes signed, ready to claim; " +
252
- "claiming=claim tx submitted, waiting for confirmation; " +
253
- "completed=fully completed, assets arrived on target chain; " +
254
- "failed=on-chain failure"),
255
- step: z.enum([
256
- "not_started", "source_tx_pending", "source_tx_confirmed",
257
- "node_signing", "signatures_ready", "claim_tx_pending",
258
- "completed", "failed",
259
- ]).describe("Detailed step (more granular than status). " +
260
- "source_tx_pending=source chain tx waiting for block confirmation; " +
261
- "source_tx_confirmed=source confirmed, waiting for bridge nodes to approve; " +
262
- "node_signing=nodes collecting signatures; " +
263
- "signatures_ready=sufficient signatures collected, ready to claim on target chain; " +
264
- "claim_tx_pending=claim tx submitted on target chain, waiting for confirmation; " +
265
- "completed=assets arrived on target chain; " +
266
- "failed=error occurred"),
267
- stepDescription: z.string().optional().describe("Human-readable step description (Chinese)"),
268
- direction: z.enum(["wow_to_evm", "evm_to_wow"]).optional(),
269
- sourceTxHash: z.string().optional().describe("Source chain tx hash/digest"),
270
- bridgeSeq: z.string().optional().describe("Bridge sequence number"),
271
- confirmations: z.number().optional().describe("Source chain confirmation count (EVM→WOW only; needs 64 for finalization)"),
272
- claimTxDigest: z.string().optional().describe("WOW claim tx digest (evm_to_wow, when completed)"),
273
- claimReceipt: z.any().optional().describe("EVM claim tx receipt (wow_to_evm, when available)"),
274
- ethReceipt: z.any().optional().describe("EVM source tx receipt (evm_to_wow)"),
275
- wowReceipt: z.any().optional().describe("WOW source tx receipt (wow_to_evm)"),
276
- error: z.string().optional().describe("Error message if step=failed"),
277
- hint: z.string().optional().describe("Hint message for next action (e.g., when claim_wow_to_evm not yet called)"),
278
- updatedAt: z.number().optional().describe("Last on-chain update timestamp (ms)"),
279
- }).describe("Latest on-chain state (from refresh=true query)");
280
- export const BridgeTransferRecordSchema = z.object({
281
- transferId: z.string().describe("Unique ID (br_<timestamp>_<counter>)"),
282
- direction: z.enum(["wow_to_evm", "evm_to_wow", "withdraw"]).describe("Transfer direction"),
283
- token: BridgeTokenSchema.describe("Token identifier"),
284
- amount: z.string().describe("Amount in smallest unit (string to avoid bigint issues)"),
285
- recipientEth: z.string().optional().describe("ETH-side recipient address"),
286
- recipientWow: z.string().optional().describe("WOW-side recipient address"),
287
- intermediateEthAccount: z.string().describe("Intermediate EVM account (activeEvmAccount)"),
288
- idempotencyKey: z.string().optional().describe("Idempotency key used for this transfer (if any)"),
289
- step: z.enum(["init", "deposit", "claimed", "withdraw", "withdrawn"]).describe("Current step in the transfer lifecycle: " +
290
- "init=just created; " +
291
- "deposit=source chain deposit in progress; " +
292
- "claimed=claim completed on target chain (success); " +
293
- "withdraw=intermediate→final withdraw in progress; " +
294
- "withdrawn=withdraw completed"),
295
- status: z.enum(["pending", "in_progress", "success", "failed"]).describe("Transfer status: pending/in_progress=ongoing; success=fully completed; failed=error"),
296
- depositTxHash: z.string().optional().describe("EVM deposit tx hash (evm_to_wow)"),
297
- depositTxDigest: z.string().optional().describe("WOW deposit tx digest (wow_to_evm)"),
298
- bridgeSeq: z.string().optional().describe("Bridge sequence number"),
299
- claimTxHash: z.string().optional().describe("EVM claim tx hash (wow_to_evm)"),
300
- claimTxDigest: z.string().optional().describe("WOW claim tx digest (evm_to_wow)"),
301
- withdrawTxHash: z.string().optional().describe("EVM withdraw tx hash (withdraw step)"),
302
- error: z.string().optional().describe("Error message if status=failed"),
303
- createdAt: z.number().describe("Creation timestamp (ms)"),
304
- updatedAt: z.number().describe("Last update timestamp (ms)"),
305
- latestState: BridgeLatestStateSchema.optional().describe("Latest on-chain state (only present after refresh=true query). " +
306
- "Provides real-time progress: confirmations count, node signing status, claim tx hash, etc. " +
307
- "Use this to estimate remaining time and next action."),
308
- }).strict().describe("Bridge transfer record");
309
- export const BridgeWowToEvmResultSchema = z.object({
310
- depositTxDigest: z.string().describe("WOW deposit tx digest"),
311
- bridgeSeq: z.string().describe("Bridge sequence number"),
312
- activeEvmAccount: z.string().describe("activeEvmAccount address that will receive the assets"),
313
- transferId: z.string().describe("Transfer ID (br_<timestamp>_<counter>). Save this for claim_wow_to_evm (step 2) and query_transfer_status"),
314
- idempotentHit: z.boolean().optional().describe("true if this result was returned from idempotency cache (no new deposit executed)"),
315
- idempotencyKey: z.string().optional().describe("Idempotency key used (if any)"),
316
- }).strict().describe("WOW→EVM cross-chain step 1 result (deposit only, claim pending)");
317
- export const BridgeEvmToWowResultSchema = z.object({
318
- depositTxHash: z.string().describe("EVM deposit tx hash"),
319
- activeEvmAccount: z.string().describe("activeEvmAccount address that initiated the deposit"),
320
- transferId: z.string().describe("Transfer ID (br_<timestamp>_<counter>). Save this for query_transfer_status"),
321
- idempotentHit: z.boolean().optional().describe("true if this result was returned from idempotency cache (no new deposit executed)"),
322
- idempotencyKey: z.string().optional().describe("Idempotency key used (if any)"),
323
- }).strict().describe("EVM→WOW cross-chain result (deposit submitted, auto-claim in progress)");
324
- export const BridgeClaimWowToEvmResultSchema = z.object({
325
- claimTxHash: z.string().describe("EVM claim tx hash"),
326
- transferId: z.string().describe("Transfer ID"),
327
- }).strict().describe("WOW→EVM claim (step 2) result");
328
- export const BridgeWithdrawResultSchema = z.object({
329
- txHash: z.string().describe("EVM withdraw tx hash"),
330
- transferId: z.string().describe("Transfer ID (br_<timestamp>_<counter>)"),
331
- }).strict().describe("Withdraw from activeEvmAccount result");
332
- export const BridgeQueryActiveEvmAccountResultSchema = z.object({
333
- address: z.string().describe("activeEvmAccount address (0x + 40 hex)"),
334
- chains: z.array(z.object({
335
- chainId: z.number().describe("EVM chain ID"),
336
- name: z.string().describe("Chain name"),
337
- nativeBalance: z.string().describe("Native ETH balance (wei, string)"),
338
- tokens: z.array(z.object({
339
- tokenAddress: z.string().describe("ERC20 token contract address"),
340
- balance: z.string().describe("Token balance (smallest unit, string)"),
341
- })).optional().describe("Additional ERC20 token balances (if requested)"),
342
- })).describe("Per-chain balance information"),
343
- }).strict().describe("activeEvmAccount query result");
344
- export const BridgeQuerySupportedEvmChainsResultSchema = z.array(z.object({
345
- chainId: z.number().describe("EVM chain ID"),
346
- name: z.string().describe("Chain name (enum value)"),
347
- description: z.string().describe("Human-readable chain description"),
348
- bridgeChainId: z.number().describe("Bridge protocol chain ID"),
349
- explorerUrl: z.string().describe("Block explorer URL"),
350
- rpcCount: z.number().describe("Total configured RPC endpoints"),
351
- healthyRpcCount: z.number().describe("Currently healthy RPC endpoints"),
352
- })).describe("List of supported EVM chains");
353
- export const BridgeQuerySupportedTokensResultSchema = z.array(z.object({
354
- chainId: z.number().describe("EVM chain ID"),
355
- chainName: z.string().describe("Chain name"),
356
- bridgeChainId: z.number().describe("Bridge protocol chain ID"),
357
- tokens: z.array(z.object({
358
- tokenId: z.number().describe("On-chain token ID"),
359
- symbol: z.string().describe("Token symbol (ETH/WETH/WBTC/USDC/USDT)"),
360
- evmAddress: z.string().describe("EVM-side contract address (0x000...000 for native ETH)"),
361
- evmDecimals: z.number().describe("EVM-side decimals"),
362
- wowTypeTag: z.string().describe("WOW-side type tag"),
363
- wowDecimals: z.number().describe("WOW-side decimals"),
364
- description: z.string().describe("Token description"),
365
- })).describe("Tokens available on this chain"),
366
- })).describe("Supported Bridge tokens per chain");
367
- export const BridgeQueryTransferListResultSchema = z.array(BridgeTransferRecordSchema)
368
- .describe("Transfer history list");
369
- export const BridgeQueryTransferStatusResultSchema = BridgeTransferRecordSchema.nullable()
370
- .describe("Single transfer detail (null if not found)");
371
- export const BridgeManageEvmRpcResultSchema = z.object({
372
- op: z.string().describe("Operation performed (list/add/remove/set/ping)"),
373
- success: z.boolean().describe("Whether the operation succeeded"),
374
- result: z.any().optional().describe("Operation-specific result (list=array of RPC status, ping=health results, add/remove/set=void)"),
375
- }).strict().describe("EVM RPC management result");
376
- export const BridgeOutputSchema = z.discriminatedUnion("operation_type", [
377
- z.object({
378
- operation_type: z.literal("cross_chain_wow_to_evm"),
379
- result: BridgeWowToEvmResultSchema,
380
- message: z.string().optional().describe("Result summary or hint message"),
381
- }).describe("WOW→EVM cross-chain result"),
382
- z.object({
383
- operation_type: z.literal("cross_chain_evm_to_wow"),
384
- result: BridgeEvmToWowResultSchema,
385
- message: z.string().optional().describe("Result summary or hint message"),
386
- }).describe("EVM→WOW cross-chain result"),
387
- z.object({
388
- operation_type: z.literal("claim_wow_to_evm"),
389
- result: BridgeClaimWowToEvmResultSchema,
390
- message: z.string().optional().describe("Result summary or hint message"),
391
- }).describe("WOW→EVM claim (step 2) result"),
392
- z.object({
393
- operation_type: z.literal("resume_transfer"),
394
- result: BridgeTransferRecordSchema,
395
- message: z.string().optional().describe("Result summary or hint message"),
396
- }).describe("Resume interrupted transfer result"),
397
- z.object({
398
- operation_type: z.literal("withdraw"),
399
- result: BridgeWithdrawResultSchema,
400
- message: z.string().optional().describe("Result summary or hint message"),
401
- }).describe("Withdraw from activeEvmAccount result"),
402
- z.object({
403
- operation_type: z.literal("query_active_evm_account"),
404
- result: BridgeQueryActiveEvmAccountResultSchema,
405
- message: z.string().optional().describe("Result summary or hint message"),
406
- }).describe("activeEvmAccount query result"),
407
- z.object({
408
- operation_type: z.literal("query_supported_evm_chains"),
409
- result: BridgeQuerySupportedEvmChainsResultSchema,
410
- message: z.string().optional().describe("Result summary or hint message"),
411
- }).describe("Supported EVM chains result"),
412
- z.object({
413
- operation_type: z.literal("query_supported_tokens"),
414
- result: BridgeQuerySupportedTokensResultSchema,
415
- message: z.string().optional().describe("Result summary or hint message"),
416
- }).describe("Supported Bridge tokens per chain result"),
417
- z.object({
418
- operation_type: z.literal("query_transfer_list"),
419
- result: BridgeQueryTransferListResultSchema,
420
- message: z.string().optional().describe("Result summary or hint message"),
421
- }).describe("Transfer history list result"),
422
- z.object({
423
- operation_type: z.literal("query_transfer_status"),
424
- result: BridgeQueryTransferStatusResultSchema,
425
- message: z.string().optional().describe("Result summary or hint message"),
426
- }).describe("Single transfer detail result"),
427
- z.object({
428
- operation_type: z.literal("manage_evm_rpc"),
429
- result: BridgeManageEvmRpcResultSchema,
430
- message: z.string().optional().describe("Result summary or hint message"),
431
- }).describe("EVM RPC management result"),
432
- ]).describe("Bridge operation result (discriminated by operation_type with per-operation typed result)");
433
- export const BridgeCallOutputSchema = z.object({
434
- message: z.string().optional().describe("Result summary or hint message"),
435
- result: z.discriminatedUnion("type", [
436
- z.object({
437
- type: z.literal("data"),
438
- data: z.unknown().describe("Operation result data (structure varies by operation_type)"),
439
- }).describe("Successful result"),
440
- z.object({
441
- type: z.literal("error"),
442
- error: z.string().describe("Error message"),
443
- error_code: z
444
- .enum([
445
- "invalid_parameter", "guard_rejected", "state_conflict",
446
- "insufficient_balance", "object_not_found", "permission_denied",
447
- "immutable_violation", "network_error", "rate_limit",
448
- "gas_exceeded", "bcs_error", "signature_error",
449
- "config_error", "wip_verification_failed", "unknown",
450
- ])
451
- .optional()
452
- .describe("Error classification for programmatic recovery"),
453
- retryable: z.boolean().optional().describe("Whether the operation can be retried as-is"),
454
- recovery_hint: z.string().optional().describe("Recovery suggestion for AI or user"),
455
- }).describe("Error result"),
456
- ]).describe("Bridge operation result (data or error)"),
457
- semantic: SemanticSummarySchema.optional().describe("Business semantic summary for bridge operation"),
458
- }).describe("Bridge operation output (matches CallOutput structure returned by the handler)");
1
+ import{z}from'zod';import{CallEnvSchema,SemanticSummarySchema}from'./base.js';import{WowAddressSchema}from'../common/index.js';export const BridgeTokenSchema=z['enum'](['ETH','WETH','WBTC','USDC','USDT'])['describe']('Cross-chain\x20token\x20identifier.\x20ETH=native\x20ETH;\x20WETH/WBTC/USDC/USDT=ERC20.\x20Decimals\x20are\x20handled\x20by\x20SDK\x20config.');export const EvmChainSchema=z['enum'](['mainnet'])['default']('mainnet')['describe']('EVM\x20chain\x20identifier.\x20Currently\x20only\x20\x27mainnet\x27\x20(Ethereum\x20mainnet,\x20chainId=1)\x20is\x20supported.\x20Extensible\x20to\x20BSC/Polygon/Arbitrum\x20in\x20the\x20future.');export const EvmAddressSchema=z['string']()['regex'](/^0x[0-9a-fA-F]{40}$/,'Invalid\x20EVM\x20address\x20(must\x20be\x200x\x20+\x2040\x20hex)')['describe']('EVM\x20address\x20(0x\x20+\x2040\x20hex)');export const BridgeAmountSchema=z['string']()['describe']('Cross-chain\x20amount\x20as\x20a\x20string\x20in\x20the\x20smallest\x20unit\x20(e.g.\x20wei\x20/\x20token\x20minimal\x20unit).\x20Example:\x201\x20ETH\x20=\x20\x271000000000000000000\x27');export const BridgeIdempotencyKeySchema=z['string']()['min'](0x1)['max'](0x80)['describe']('Idempotency\x20key\x20(1-128\x20chars).\x20Prevents\x20duplicate\x20transfers\x20on\x20retry.\x20If\x20a\x20successful\x20transfer\x20with\x20this\x20key\x20exists,\x20returns\x20it\x20immediately\x20(idempotentHit=true).');export const BridgeOperationTypeSchema=z['enum'](['cross_chain_wow_to_evm','cross_chain_evm_to_wow','claim_wow_to_evm','resume_transfer','withdraw','query_active_evm_account','query_supported_evm_chains','query_supported_tokens','query_transfer_list','query_transfer_status','manage_evm_rpc'])['describe']('Bridge\x20operation\x20type');export const BridgeWowToEvmDataSchema=z['object']({'token':BridgeTokenSchema['describe']('Cross-chain\x20token\x20type'),'amount':BridgeAmountSchema['describe']('Cross-chain\x20amount\x20(WOW-side\x20smallest\x20unit,\x20wowDecimals)'),'withdrawTo':EvmAddressSchema['optional']()['describe']('Final\x20withdrawal\x20EVM\x20address;\x20if\x20omitted,\x20assets\x20remain\x20in\x20activeEvmAccount.\x20When\x20provided,\x20the\x20SDK\x20uses\x20the\x20activeEvmAccount\x20key\x20to\x20transfer\x20to\x20this\x20address.'),'idempotencyKey':BridgeIdempotencyKeySchema['optional']()['describe']('Idempotency\x20key\x20to\x20prevent\x20duplicate\x20deposits\x20on\x20retry.\x20If\x20a\x20successful\x20transfer\x20with\x20this\x20key\x20exists,\x20returns\x20it\x20immediately\x20(idempotentHit=true).'),'idempotentByParams':z['boolean']()['optional']()['describe']('If\x20true,\x20auto-generates\x20an\x20idempotency\x20key\x20from\x20token+amount+withdrawTo.\x20Use\x20when\x20you\x20want\x20implicit\x20idempotency\x20without\x20managing\x20explicit\x20keys.')})['strict']()['describe']('WOW→EVM\x20cross-chain\x20(step\x201:\x20deposit\x20only).\x20'+'Returns\x20immediately\x20with\x20depositTxDigest\x20+\x20bridgeSeq\x20+\x20transferId.\x20'+'This\x20operation\x20only\x20locks\x20assets\x20on\x20WOW;\x20it\x20does\x20NOT\x20complete\x20the\x20cross-chain.\x20'+'After\x20deposit,\x20bridge\x20nodes\x20need\x20~1-5\x20minutes\x20to\x20sign.\x20'+'Use\x20query_transfer_status\x20to\x20monitor\x20progress;\x20when\x20latestState.step\x20shows\x20\x27signatures_ready\x27,\x20'+'call\x20claim_wow_to_evm\x20(step\x202)\x20to\x20claim\x20assets\x20on\x20EVM.\x20'+'[Gas\x20requirements]\x20Step\x201\x20needs\x20WOW\x20gas;\x20Step\x202\x20(claim_wow_to_evm)\x20needs\x20activeEvmAccount\x20to\x20have\x20target-chain\x20gas.');export const BridgeEvmToWowDataSchema=z['object']({'token':BridgeTokenSchema['describe']('Cross-chain\x20token\x20type\x20(ETH=native\x20ETH,\x20others\x20are\x20ERC20)'),'amount':BridgeAmountSchema['describe']('Cross-chain\x20amount\x20(EVM-side\x20smallest\x20unit,\x20evmDecimals)'),'recipientWowAddress':WowAddressSchema['optional']()['describe']('WOW\x20recipient\x20address\x20or\x20account\x20name;\x20defaults\x20to\x20env.account\x20if\x20omitted'),'idempotencyKey':BridgeIdempotencyKeySchema['optional']()['describe']('Idempotency\x20key\x20to\x20prevent\x20duplicate\x20deposits\x20on\x20retry.\x20If\x20a\x20successful\x20transfer\x20with\x20this\x20key\x20exists,\x20returns\x20it\x20immediately\x20(idempotentHit=true).'),'idempotentByParams':z['boolean']()['optional']()['describe']('If\x20true,\x20auto-generates\x20an\x20idempotency\x20key\x20from\x20token+amount+recipientWowAddress.\x20Use\x20when\x20you\x20want\x20implicit\x20idempotency\x20without\x20managing\x20explicit\x20keys.')})['strict']()['describe']('EVM→WOW\x20cross-chain\x20(single\x20step:\x20deposit).\x20'+'Returns\x20immediately\x20with\x20depositTxHash\x20+\x20transferId.\x20'+'Bridge\x20will\x20automatically\x20claim\x20on\x20WOW\x20(no\x20WOW\x20gas\x20needed,\x20no\x20user\x20action\x20required).\x20'+'[Time\x20estimate]\x20~10-20\x20minutes\x20total:\x20'+'(1)\x2064-block\x20confirmation\x20~12.8\x20min\x20on\x20ETH;\x20'+'(2)\x20bridge\x20node\x20auto-claim\x20~1-5\x20min\x20on\x20WOW.\x20'+'[Status\x20flow]\x20Use\x20query_transfer_status(refresh=true)\x20to\x20monitor:\x20'+'latestState.step:\x20source_tx_pending\x20→\x20source_tx_confirmed\x20→\x20signatures_ready\x20→\x20completed.\x20'+'When\x20latestState.confirmations\x20>=\x2064,\x20deposit\x20is\x20finalized\x20and\x20bridge\x20nodes\x20will\x20sign.\x20'+'[Gas\x20requirements]\x20Only\x20needs\x20activeEvmAccount\x20to\x20have\x20target-chain\x20gas\x20(for\x20deposit).\x20No\x20WOW\x20gas\x20needed.');export const BridgeClaimWowToEvmDataSchema=z['object']({'transferId':z['string']()['describe']('Transfer\x20ID\x20from\x20cross_chain_wow_to_evm\x20(br_<timestamp>_<counter>)')})['strict']()['describe']('WOW→EVM\x20claim\x20(step\x202):\x20claim\x20assets\x20on\x20EVM\x20after\x20bridge\x20nodes\x20have\x20signed.\x20'+'Prerequisite:\x20cross_chain_wow_to_evm\x20(step\x201)\x20must\x20be\x20completed,\x20and\x20query_transfer_status\x20'+'must\x20show\x20latestState.step\x20=\x20\x27signatures_ready\x27\x20or\x20\x27source_tx_confirmed\x27\x20(nodes\x20have\x20approved).\x20'+'Returns\x20claimTxHash\x20on\x20success.\x20'+'After\x20claim_wow_to_evm\x20returns,\x20the\x20claim\x20tx\x20has\x20been\x20submitted\x20and\x20confirmed\x20(1\x20block)\x20on\x20EVM.\x20'+'Use\x20query_transfer_status(refresh=true)\x20to\x20verify\x20latestState.step\x20=\x20\x27completed\x27.\x20'+'[Gas\x20requirements]\x20Requires\x20activeEvmAccount\x20to\x20have\x20target-chain\x20gas\x20(for\x20the\x20claim\x20transaction).');export const BridgeResumeTransferDataSchema=z['object']({'transferId':z['string']()['describe']('Transfer\x20ID\x20to\x20resume\x20(br_<timestamp>_<counter>)')})['strict']()['describe']('Resume\x20an\x20interrupted\x20transfer\x20from\x20its\x20current\x20step.\x20'+'Use\x20this\x20when\x20a\x20transfer\x20was\x20interrupted\x20(e.g.\x20MCP\x20restart,\x20network\x20error)\x20and\x20you\x20want\x20to\x20continue\x20from\x20where\x20it\x20left\x20off.\x20'+'The\x20SDK\x20determines\x20the\x20current\x20step\x20and\x20attempts\x20to\x20advance\x20it:\x20'+'-\x20If\x20deposit\x20step\x20failed:\x20retries\x20the\x20deposit\x20'+'-\x20If\x20deposit\x20is\x20pending/confirmed:\x20waits\x20for\x20bridge\x20signatures\x20and\x20proceeds\x20to\x20claim\x20'+'-\x20If\x20claim\x20step\x20is\x20ready:\x20executes\x20the\x20claim\x20'+'-\x20If\x20transfer\x20is\x20already\x20complete:\x20returns\x20the\x20existing\x20record\x20(idempotentHit=true)\x20'+'[Returns]\x20The\x20updated\x20transfer\x20record\x20after\x20attempting\x20to\x20advance\x20it.\x20'+'[Requires\x20env]\x20WOW\x20env\x20is\x20needed\x20for\x20WOW-side\x20operations;\x20EVM-side\x20operations\x20use\x20activeEvmAccount.');export const BridgeWithdrawDataSchema=z['object']({'to':EvmAddressSchema['describe']('Withdrawal\x20target\x20EVM\x20address'),'amount':BridgeAmountSchema['describe']('Withdrawal\x20amount\x20(smallest\x20unit)'),'token':BridgeTokenSchema['optional']()['describe']('ERC20\x20token\x20identifier;\x20if\x20omitted\x20or\x20ETH,\x20withdraws\x20native\x20ETH'),'tokenAddress':EvmAddressSchema['optional']()['describe']('ERC20\x20contract\x20address\x20(alternative\x20to\x20token;\x20allows\x20withdrawing\x20by\x20contract\x20address)'),'network':EvmChainSchema['describe']('Target\x20chain\x20(defaults\x20to\x20Ethereum\x20mainnet\x20when\x20omitted\x20—\x20EvmChainSchema\x20carries\x20.default(\x22mainnet\x22))')})['strict']()['describe']('Withdraw\x20from\x20activeEvmAccount\x20to\x20another\x20EVM\x20address');export const BridgeQueryActiveEvmAccountDataSchema=z['object']({'network':EvmChainSchema['optional']()['describe']('Specific\x20chain;\x20if\x20omitted,\x20queries\x20all\x20supported\x20chains'),'tokens':z['array'](EvmAddressSchema)['optional']()['describe']('Additional\x20ERC20\x20token\x20contract\x20addresses\x20to\x20query;\x20if\x20omitted,\x20only\x20native\x20ETH\x20balance\x20is\x20queried')})['strict']()['describe']('Query\x20activeEvmAccount\x20parameters');export const BridgeQuerySupportedTokensDataSchema=z['object']({'network':EvmChainSchema['optional']()['describe']('Specific\x20chain;\x20if\x20omitted,\x20returns\x20token\x20lists\x20for\x20all\x20supported\x20chains')})['strict']()['describe']('Query\x20supported\x20Bridge\x20tokens\x20per\x20chain\x20(WOW/EVM\x20addresses,\x20decimals,\x20description)');export const BridgeQueryTransferListDataSchema=z['object']({'onlyActive':z['boolean']()['optional']()['describe']('true\x20returns\x20only\x20in-progress\x20transfers;\x20false/omitted\x20returns\x20all'),'status':z['enum'](['pending','in_progress','success','failed'])['optional']()['describe']('Filter\x20by\x20transfer\x20status'),'direction':z['enum'](['wow_to_evm','evm_to_wow','withdraw'])['optional']()['describe']('Filter\x20by\x20transfer\x20direction'),'token':BridgeTokenSchema['optional']()['describe']('Filter\x20by\x20token\x20type\x20(ETH/WETH/WBTC/USDC/USDT)'),'limit':z['number']()['int']()['positive']()['max'](0x64)['optional']()['describe']('Maximum\x20number\x20of\x20results\x20(default:\x20all,\x20max:\x20100)')})['strict']()['describe']('Query\x20transfer\x20list\x20with\x20optional\x20filters\x20(status\x20/\x20direction\x20/\x20token\x20/\x20limit)');export const BridgeQueryTransferStatusDataSchema=z['object']({'transferId':z['string']()['describe']('Transfer\x20ID\x20(br_<timestamp>_<counter>)'),'refresh':z['boolean']()['optional']()['default'](!![])['describe']('Whether\x20to\x20refresh\x20from\x20on-chain\x20state\x20(default\x20true).\x20'+'true=queries\x20latest\x20on-chain\x20status\x20(takes\x205-15s,\x20timeout\x20at\x2015s\x20on\x20slow\x20RPC).\x20'+'false=instant\x20response\x20from\x20local\x20cache\x20(no\x20on-chain\x20query).\x20'+'Recommended:\x20use\x20refresh=true\x20every\x201-2\x20minutes\x20for\x20ongoing\x20transfers;\x20'+'use\x20refresh=false\x20for\x20quick\x20checks\x20between\x20refreshes.')})['strict']()['describe']('Query\x20single\x20transfer\x20parameters.\x20'+'[Wait\x20hint]\x20With\x20refresh=true\x20(default),\x20this\x20call\x20may\x20take\x205-15\x20seconds\x20to\x20query\x20on-chain\x20state.\x20'+'If\x20on-chain\x20RPC\x20is\x20slow,\x20it\x20will\x20timeout\x20at\x2015s\x20and\x20return\x20cached\x20state.\x20'+'Set\x20refresh=false\x20for\x20instant\x20response\x20from\x20local\x20cache.\x20'+'[Returned\x20fields]\x20The\x20result\x20includes:\x20'+'(1)\x20record.step/status\x20-\x20high-level\x20lifecycle\x20(deposit/claimed/success);\x20'+'(2)\x20record.latestState.step/status\x20-\x20fine-grained\x20on-chain\x20progress\x20'+'(source_tx_pending\x20→\x20source_tx_confirmed\x20→\x20signatures_ready\x20→\x20completed).\x20'+'Use\x20latestState.confirmations\x20to\x20estimate\x20remaining\x20time\x20(needs\x2064\x20for\x20ETH→WOW\x20finalization).');export const BridgeManageEvmRpcDataSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('list')['describe']('List\x20all\x20configured\x20RPC\x20endpoints\x20with\x20health\x20status'),'network':EvmChainSchema['describe']('Target\x20chain\x20(defaults\x20to\x20Ethereum\x20mainnet\x20when\x20omitted\x20—\x20EvmChainSchema\x20carries\x20.default(\x22mainnet\x22))')})['describe']('List\x20RPC\x20endpoints\x20(no\x20rpcUrl/rpcUrls\x20needed)'),z['object']({'op':z['literal']('add')['describe']('Append\x20one\x20or\x20more\x20RPC\x20endpoints'),'network':EvmChainSchema['describe']('Target\x20chain\x20(defaults\x20to\x20Ethereum\x20mainnet\x20when\x20omitted\x20—\x20EvmChainSchema\x20carries\x20.default(\x22mainnet\x22))'),'rpcUrls':z['array'](z['string']()['url']())['min'](0x1)['describe']('RPC\x20URL(s)\x20to\x20add')})['describe']('Add\x20RPC\x20endpoint(s)'),z['object']({'op':z['literal']('remove')['describe']('Remove\x20one\x20or\x20more\x20RPC\x20endpoints'),'network':EvmChainSchema['describe']('Target\x20chain\x20(defaults\x20to\x20Ethereum\x20mainnet\x20when\x20omitted\x20—\x20EvmChainSchema\x20carries\x20.default(\x22mainnet\x22))'),'rpcUrls':z['array'](z['string']()['url']())['min'](0x1)['describe']('RPC\x20URL(s)\x20to\x20remove')})['describe']('Remove\x20RPC\x20endpoint(s)'),z['object']({'op':z['literal']('set')['describe']('Full\x20replace\x20all\x20RPC\x20endpoints'),'network':EvmChainSchema['describe']('Target\x20chain\x20(defaults\x20to\x20Ethereum\x20mainnet\x20when\x20omitted\x20—\x20EvmChainSchema\x20carries\x20.default(\x22mainnet\x22))'),'rpcUrls':z['array'](z['string']()['url']())['min'](0x1)['describe']('Full\x20RPC\x20list\x20(replaces\x20all\x20existing\x20endpoints)')})['describe']('Full\x20replace\x20RPC\x20endpoints'),z['object']({'op':z['literal']('ping')['describe']('Health\x20check\x20one\x20or\x20more\x20RPC\x20endpoints'),'network':EvmChainSchema['describe']('Target\x20chain\x20(defaults\x20to\x20Ethereum\x20mainnet\x20when\x20omitted\x20—\x20EvmChainSchema\x20carries\x20.default(\x22mainnet\x22))'),'rpcUrls':z['array'](z['string']()['url']())['optional']()['describe']('Specific\x20RPC\x20URLs\x20to\x20ping;\x20if\x20omitted,\x20pings\x20all\x20configured\x20RPCs')})['describe']('Health\x20check\x20RPC\x20endpoints')])['describe']('EVM\x20RPC\x20endpoint\x20management\x20(discriminated\x20by\x20op)');export const BridgeOperationsSchema=z['preprocess'](a=>{if(typeof a==='object'&&a!==null){const b={...a};if(typeof b['description']==='string'&&!b['operation_type'])try{const c=JSON['parse'](b['description']);if(c&&typeof c==='object'&&c['operation_type'])return c;}catch{}if(typeof b['data']==='string')try{b['data']=JSON['parse'](b['data']);}catch{}if(typeof b['env']==='string')try{b['env']=JSON['parse'](b['env']);}catch{}return b;}return a;},z['discriminatedUnion']('operation_type',[z['object']({'operation_type':z['literal']('cross_chain_wow_to_evm'),'data':BridgeWowToEvmDataSchema,'env':CallEnvSchema['optional']()})['describe']('WOW→EVM\x20cross-chain\x20(simplified):\x20assets\x20auto-claim\x20to\x20activeEvmAccount;\x20if\x20withdrawTo\x20is\x20provided,\x20an\x20additional\x20transfer\x20is\x20made\x20to\x20that\x20address.\x20[Requires\x20WOW\x20mainnet\x20env]'),z['object']({'operation_type':z['literal']('cross_chain_evm_to_wow'),'data':BridgeEvmToWowDataSchema,'env':CallEnvSchema['optional']()})['describe']('EVM→WOW\x20cross-chain\x20(single\x20step):\x20deposit\x20from\x20activeEvmAccount,\x20bridge\x20auto-claims\x20on\x20WOW.\x20No\x20WOW\x20gas\x20needed.\x20[Requires\x20WOW\x20mainnet\x20env]'),z['object']({'operation_type':z['literal']('claim_wow_to_evm'),'data':BridgeClaimWowToEvmDataSchema,'env':CallEnvSchema['optional']()})['describe']('WOW→EVM\x20claim\x20(step\x202):\x20claim\x20assets\x20on\x20EVM\x20after\x20bridge\x20signed.\x20Requires\x20activeEvmAccount\x20to\x20have\x20EVM\x20gas.\x20[Requires\x20WOW\x20mainnet\x20env]'),z['object']({'operation_type':z['literal']('resume_transfer'),'data':BridgeResumeTransferDataSchema,'env':CallEnvSchema['optional']()})['describe']('Resume\x20an\x20interrupted\x20transfer\x20from\x20its\x20current\x20step.\x20Safe\x20to\x20retry.\x20[Requires\x20WOW\x20mainnet\x20env\x20for\x20WOW-side\x20operations]'),z['object']({'operation_type':z['literal']('withdraw'),'data':BridgeWithdrawDataSchema})['describe']('Withdraw\x20from\x20activeEvmAccount\x20to\x20another\x20EVM\x20address\x20(non-cross-chain).\x20[No\x20env\x20needed]'),z['object']({'operation_type':z['literal']('query_active_evm_account'),'data':BridgeQueryActiveEvmAccountDataSchema['optional']()})['describe']('Query\x20activeEvmAccount\x20address\x20+\x20balances\x20(per\x20chain\x20or\x20all\x20chains).\x20[No\x20env\x20needed]'),z['object']({'operation_type':z['literal']('query_supported_evm_chains')})['describe']('List\x20currently\x20supported\x20EVM\x20chains\x20(enum\x20value\x20/\x20description\x20/\x20chainId\x20/\x20RPC\x20health).\x20[No\x20env\x20needed,\x20no\x20data\x20required]'),z['object']({'operation_type':z['literal']('query_supported_tokens'),'data':BridgeQuerySupportedTokensDataSchema['optional']()})['describe']('List\x20supported\x20Bridge\x20tokens\x20per\x20chain\x20(WOW/EVM\x20contract\x20addresses,\x20decimals,\x20description).\x20[No\x20env\x20needed]'),z['object']({'operation_type':z['literal']('query_transfer_list'),'data':BridgeQueryTransferListDataSchema['optional']()})['describe']('Query\x20cross-chain\x20/\x20withdrawal\x20transfer\x20history\x20list\x20(optionally\x20only\x20in-progress).\x20[No\x20env\x20needed]'),z['object']({'operation_type':z['literal']('query_transfer_status'),'data':BridgeQueryTransferStatusDataSchema})['describe']('Query\x20a\x20single\x20transfer\x27s\x20detail\x20by\x20transferId'),z['object']({'operation_type':z['literal']('manage_evm_rpc'),'data':BridgeManageEvmRpcDataSchema})['describe']('Manage\x20EVM\x20RPC\x20endpoints\x20(list/add/remove/set/ping)\x20to\x20mitigate\x20public\x20RPC\x20429\x20rate\x20limits.\x20[No\x20env\x20needed]')]));export const BridgeLatestStateSchema=z['object']({'status':z['enum'](['not_started','pending','confirmed','signatures_ready','claiming','completed','failed'])['describe']('On-chain\x20status\x20(finer-grained\x20than\x20record.status):\x20'+'pending=source\x20tx\x20submitted\x20but\x20not\x20confirmed;\x20'+'confirmed=source\x20tx\x20confirmed,\x20waiting\x20for\x20bridge\x20node\x20signatures;\x20'+'signatures_ready=nodes\x20signed,\x20ready\x20to\x20claim;\x20'+'claiming=claim\x20tx\x20submitted,\x20waiting\x20for\x20confirmation;\x20'+'completed=fully\x20completed,\x20assets\x20arrived\x20on\x20target\x20chain;\x20'+'failed=on-chain\x20failure'),'step':z['enum'](['not_started','source_tx_pending','source_tx_confirmed','node_signing','signatures_ready','claim_tx_pending','completed','failed'])['describe']('Detailed\x20step\x20(more\x20granular\x20than\x20status).\x20'+'source_tx_pending=source\x20chain\x20tx\x20waiting\x20for\x20block\x20confirmation;\x20'+'source_tx_confirmed=source\x20confirmed,\x20waiting\x20for\x20bridge\x20nodes\x20to\x20approve;\x20'+'node_signing=nodes\x20collecting\x20signatures;\x20'+'signatures_ready=sufficient\x20signatures\x20collected,\x20ready\x20to\x20claim\x20on\x20target\x20chain;\x20'+'claim_tx_pending=claim\x20tx\x20submitted\x20on\x20target\x20chain,\x20waiting\x20for\x20confirmation;\x20'+'completed=assets\x20arrived\x20on\x20target\x20chain;\x20'+'failed=error\x20occurred'),'stepDescription':z['string']()['optional']()['describe']('Human-readable\x20step\x20description\x20(Chinese)'),'direction':z['enum'](['wow_to_evm','evm_to_wow'])['optional'](),'sourceTxHash':z['string']()['optional']()['describe']('Source\x20chain\x20tx\x20hash/digest'),'bridgeSeq':z['string']()['optional']()['describe']('Bridge\x20sequence\x20number'),'confirmations':z['number']()['optional']()['describe']('Source\x20chain\x20confirmation\x20count\x20(EVM→WOW\x20only;\x20needs\x2064\x20for\x20finalization)'),'claimTxDigest':z['string']()['optional']()['describe']('WOW\x20claim\x20tx\x20digest\x20(evm_to_wow,\x20when\x20completed)'),'claimReceipt':z['any']()['optional']()['describe']('EVM\x20claim\x20tx\x20receipt\x20(wow_to_evm,\x20when\x20available)'),'ethReceipt':z['any']()['optional']()['describe']('EVM\x20source\x20tx\x20receipt\x20(evm_to_wow)'),'wowReceipt':z['any']()['optional']()['describe']('WOW\x20source\x20tx\x20receipt\x20(wow_to_evm)'),'error':z['string']()['optional']()['describe']('Error\x20message\x20if\x20step=failed'),'hint':z['string']()['optional']()['describe']('Hint\x20message\x20for\x20next\x20action\x20(e.g.,\x20when\x20claim_wow_to_evm\x20not\x20yet\x20called)'),'updatedAt':z['number']()['optional']()['describe']('Last\x20on-chain\x20update\x20timestamp\x20(ms)')})['describe']('Latest\x20on-chain\x20state\x20(from\x20refresh=true\x20query)');export const BridgeTransferRecordSchema=z['object']({'transferId':z['string']()['describe']('Unique\x20ID\x20(br_<timestamp>_<counter>)'),'direction':z['enum'](['wow_to_evm','evm_to_wow','withdraw'])['describe']('Transfer\x20direction'),'token':BridgeTokenSchema['describe']('Token\x20identifier'),'amount':z['string']()['describe']('Amount\x20in\x20smallest\x20unit\x20(string\x20to\x20avoid\x20bigint\x20issues)'),'recipientEth':z['string']()['optional']()['describe']('ETH-side\x20recipient\x20address'),'recipientWow':z['string']()['optional']()['describe']('WOW-side\x20recipient\x20address'),'intermediateEthAccount':z['string']()['describe']('Intermediate\x20EVM\x20account\x20(activeEvmAccount)'),'idempotencyKey':z['string']()['optional']()['describe']('Idempotency\x20key\x20used\x20for\x20this\x20transfer\x20(if\x20any)'),'step':z['enum'](['init','deposit','claimed','withdraw','withdrawn'])['describe']('Current\x20step\x20in\x20the\x20transfer\x20lifecycle:\x20'+'init=just\x20created;\x20'+'deposit=source\x20chain\x20deposit\x20in\x20progress;\x20'+'claimed=claim\x20completed\x20on\x20target\x20chain\x20(success);\x20'+'withdraw=intermediate→final\x20withdraw\x20in\x20progress;\x20'+'withdrawn=withdraw\x20completed'),'status':z['enum'](['pending','in_progress','success','failed'])['describe']('Transfer\x20status:\x20pending/in_progress=ongoing;\x20success=fully\x20completed;\x20failed=error'),'depositTxHash':z['string']()['optional']()['describe']('EVM\x20deposit\x20tx\x20hash\x20(evm_to_wow)'),'depositTxDigest':z['string']()['optional']()['describe']('WOW\x20deposit\x20tx\x20digest\x20(wow_to_evm)'),'bridgeSeq':z['string']()['optional']()['describe']('Bridge\x20sequence\x20number'),'claimTxHash':z['string']()['optional']()['describe']('EVM\x20claim\x20tx\x20hash\x20(wow_to_evm)'),'claimTxDigest':z['string']()['optional']()['describe']('WOW\x20claim\x20tx\x20digest\x20(evm_to_wow)'),'withdrawTxHash':z['string']()['optional']()['describe']('EVM\x20withdraw\x20tx\x20hash\x20(withdraw\x20step)'),'error':z['string']()['optional']()['describe']('Error\x20message\x20if\x20status=failed'),'createdAt':z['number']()['describe']('Creation\x20timestamp\x20(ms)'),'updatedAt':z['number']()['describe']('Last\x20update\x20timestamp\x20(ms)'),'latestState':BridgeLatestStateSchema['optional']()['describe']('Latest\x20on-chain\x20state\x20(only\x20present\x20after\x20refresh=true\x20query).\x20'+'Provides\x20real-time\x20progress:\x20confirmations\x20count,\x20node\x20signing\x20status,\x20claim\x20tx\x20hash,\x20etc.\x20'+'Use\x20this\x20to\x20estimate\x20remaining\x20time\x20and\x20next\x20action.')})['strict']()['describe']('Bridge\x20transfer\x20record');export const BridgeWowToEvmResultSchema=z['object']({'depositTxDigest':z['string']()['describe']('WOW\x20deposit\x20tx\x20digest'),'bridgeSeq':z['string']()['describe']('Bridge\x20sequence\x20number'),'activeEvmAccount':z['string']()['describe']('activeEvmAccount\x20address\x20that\x20will\x20receive\x20the\x20assets'),'transferId':z['string']()['describe']('Transfer\x20ID\x20(br_<timestamp>_<counter>).\x20Save\x20this\x20for\x20claim_wow_to_evm\x20(step\x202)\x20and\x20query_transfer_status'),'idempotentHit':z['boolean']()['optional']()['describe']('true\x20if\x20this\x20result\x20was\x20returned\x20from\x20idempotency\x20cache\x20(no\x20new\x20deposit\x20executed)'),'idempotencyKey':z['string']()['optional']()['describe']('Idempotency\x20key\x20used\x20(if\x20any)')})['strict']()['describe']('WOW→EVM\x20cross-chain\x20step\x201\x20result\x20(deposit\x20only,\x20claim\x20pending)');export const BridgeEvmToWowResultSchema=z['object']({'depositTxHash':z['string']()['describe']('EVM\x20deposit\x20tx\x20hash'),'activeEvmAccount':z['string']()['describe']('activeEvmAccount\x20address\x20that\x20initiated\x20the\x20deposit'),'transferId':z['string']()['describe']('Transfer\x20ID\x20(br_<timestamp>_<counter>).\x20Save\x20this\x20for\x20query_transfer_status'),'idempotentHit':z['boolean']()['optional']()['describe']('true\x20if\x20this\x20result\x20was\x20returned\x20from\x20idempotency\x20cache\x20(no\x20new\x20deposit\x20executed)'),'idempotencyKey':z['string']()['optional']()['describe']('Idempotency\x20key\x20used\x20(if\x20any)')})['strict']()['describe']('EVM→WOW\x20cross-chain\x20result\x20(deposit\x20submitted,\x20auto-claim\x20in\x20progress)');export const BridgeClaimWowToEvmResultSchema=z['object']({'claimTxHash':z['string']()['describe']('EVM\x20claim\x20tx\x20hash'),'transferId':z['string']()['describe']('Transfer\x20ID')})['strict']()['describe']('WOW→EVM\x20claim\x20(step\x202)\x20result');export const BridgeWithdrawResultSchema=z['object']({'txHash':z['string']()['describe']('EVM\x20withdraw\x20tx\x20hash'),'transferId':z['string']()['describe']('Transfer\x20ID\x20(br_<timestamp>_<counter>)')})['strict']()['describe']('Withdraw\x20from\x20activeEvmAccount\x20result');export const BridgeQueryActiveEvmAccountResultSchema=z['object']({'address':z['string']()['describe']('activeEvmAccount\x20address\x20(0x\x20+\x2040\x20hex)'),'chains':z['array'](z['object']({'chainId':z['number']()['describe']('EVM\x20chain\x20ID'),'name':z['string']()['describe']('Chain\x20name'),'nativeBalance':z['string']()['describe']('Native\x20ETH\x20balance\x20(wei,\x20string)'),'tokens':z['array'](z['object']({'tokenAddress':z['string']()['describe']('ERC20\x20token\x20contract\x20address'),'balance':z['string']()['describe']('Token\x20balance\x20(smallest\x20unit,\x20string)')}))['optional']()['describe']('Additional\x20ERC20\x20token\x20balances\x20(if\x20requested)')}))['describe']('Per-chain\x20balance\x20information')})['strict']()['describe']('activeEvmAccount\x20query\x20result');export const BridgeQuerySupportedEvmChainsResultSchema=z['array'](z['object']({'chainId':z['number']()['describe']('EVM\x20chain\x20ID'),'name':z['string']()['describe']('Chain\x20name\x20(enum\x20value)'),'description':z['string']()['describe']('Human-readable\x20chain\x20description'),'bridgeChainId':z['number']()['describe']('Bridge\x20protocol\x20chain\x20ID'),'explorerUrl':z['string']()['describe']('Block\x20explorer\x20URL'),'rpcCount':z['number']()['describe']('Total\x20configured\x20RPC\x20endpoints'),'healthyRpcCount':z['number']()['describe']('Currently\x20healthy\x20RPC\x20endpoints')}))['describe']('List\x20of\x20supported\x20EVM\x20chains');export const BridgeQuerySupportedTokensResultSchema=z['array'](z['object']({'chainId':z['number']()['describe']('EVM\x20chain\x20ID'),'chainName':z['string']()['describe']('Chain\x20name'),'bridgeChainId':z['number']()['describe']('Bridge\x20protocol\x20chain\x20ID'),'tokens':z['array'](z['object']({'tokenId':z['number']()['describe']('On-chain\x20token\x20ID'),'symbol':z['string']()['describe']('Token\x20symbol\x20(ETH/WETH/WBTC/USDC/USDT)'),'evmAddress':z['string']()['describe']('EVM-side\x20contract\x20address\x20(0x000...000\x20for\x20native\x20ETH)'),'evmDecimals':z['number']()['describe']('EVM-side\x20decimals'),'wowTypeTag':z['string']()['describe']('WOW-side\x20type\x20tag'),'wowDecimals':z['number']()['describe']('WOW-side\x20decimals'),'description':z['string']()['describe']('Token\x20description')}))['describe']('Tokens\x20available\x20on\x20this\x20chain')}))['describe']('Supported\x20Bridge\x20tokens\x20per\x20chain');export const BridgeQueryTransferListResultSchema=z['array'](BridgeTransferRecordSchema)['describe']('Transfer\x20history\x20list');export const BridgeQueryTransferStatusResultSchema=BridgeTransferRecordSchema['nullable']()['describe']('Single\x20transfer\x20detail\x20(null\x20if\x20not\x20found)');export const BridgeManageEvmRpcResultSchema=z['object']({'op':z['string']()['describe']('Operation\x20performed\x20(list/add/remove/set/ping)'),'success':z['boolean']()['describe']('Whether\x20the\x20operation\x20succeeded'),'result':z['any']()['optional']()['describe']('Operation-specific\x20result\x20(list=array\x20of\x20RPC\x20status,\x20ping=health\x20results,\x20add/remove/set=void)')})['strict']()['describe']('EVM\x20RPC\x20management\x20result');export const BridgeOutputSchema=z['discriminatedUnion']('operation_type',[z['object']({'operation_type':z['literal']('cross_chain_wow_to_evm'),'result':BridgeWowToEvmResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('WOW→EVM\x20cross-chain\x20result'),z['object']({'operation_type':z['literal']('cross_chain_evm_to_wow'),'result':BridgeEvmToWowResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('EVM→WOW\x20cross-chain\x20result'),z['object']({'operation_type':z['literal']('claim_wow_to_evm'),'result':BridgeClaimWowToEvmResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('WOW→EVM\x20claim\x20(step\x202)\x20result'),z['object']({'operation_type':z['literal']('resume_transfer'),'result':BridgeTransferRecordSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('Resume\x20interrupted\x20transfer\x20result'),z['object']({'operation_type':z['literal']('withdraw'),'result':BridgeWithdrawResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('Withdraw\x20from\x20activeEvmAccount\x20result'),z['object']({'operation_type':z['literal']('query_active_evm_account'),'result':BridgeQueryActiveEvmAccountResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('activeEvmAccount\x20query\x20result'),z['object']({'operation_type':z['literal']('query_supported_evm_chains'),'result':BridgeQuerySupportedEvmChainsResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('Supported\x20EVM\x20chains\x20result'),z['object']({'operation_type':z['literal']('query_supported_tokens'),'result':BridgeQuerySupportedTokensResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('Supported\x20Bridge\x20tokens\x20per\x20chain\x20result'),z['object']({'operation_type':z['literal']('query_transfer_list'),'result':BridgeQueryTransferListResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('Transfer\x20history\x20list\x20result'),z['object']({'operation_type':z['literal']('query_transfer_status'),'result':BridgeQueryTransferStatusResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('Single\x20transfer\x20detail\x20result'),z['object']({'operation_type':z['literal']('manage_evm_rpc'),'result':BridgeManageEvmRpcResultSchema,'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message')})['describe']('EVM\x20RPC\x20management\x20result')])['describe']('Bridge\x20operation\x20result\x20(discriminated\x20by\x20operation_type\x20with\x20per-operation\x20typed\x20result)');export const BridgeCallOutputSchema=z['object']({'message':z['string']()['optional']()['describe']('Result\x20summary\x20or\x20hint\x20message'),'result':z['discriminatedUnion']('type',[z['object']({'type':z['literal']('data'),'data':z['unknown']()['describe']('Operation\x20result\x20data\x20(structure\x20varies\x20by\x20operation_type)')})['describe']('Successful\x20result'),z['object']({'type':z['literal']('error'),'error':z['string']()['describe']('Error\x20message'),'error_code':z['enum'](['invalid_parameter','guard_rejected','state_conflict','insufficient_balance','object_not_found','permission_denied','immutable_violation','network_error','rate_limit','gas_exceeded','bcs_error','signature_error','config_error','wip_verification_failed','unknown'])['optional']()['describe']('Error\x20classification\x20for\x20programmatic\x20recovery'),'retryable':z['boolean']()['optional']()['describe']('Whether\x20the\x20operation\x20can\x20be\x20retried\x20as-is'),'recovery_hint':z['string']()['optional']()['describe']('Recovery\x20suggestion\x20for\x20AI\x20or\x20user')})['describe']('Error\x20result')])['describe']('Bridge\x20operation\x20result\x20(data\x20or\x20error)'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20for\x20bridge\x20operation')})['describe']('Bridge\x20operation\x20output\x20(matches\x20CallOutput\x20structure\x20returned\x20by\x20the\x20handler)');
@@ -1,37 +1 @@
1
- import { z } from "zod";
2
- import { WithPermissionObjectSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
3
- import { NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, DescriptionSchema, LongNameSchema, NameSchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from "../common/index.js";
4
- export const ImEntrySchema = z.object({
5
- at: NameOrAddressSchema.describe("Contact's account address or name for instant messaging"),
6
- description: LongNameSchema.optional().describe("Optional description or note about this contact"),
7
- }).strict().describe("An instant messaging contact entry with address and optional description");
8
- export const ImsOperationSchema = z.discriminatedUnion("op", [
9
- z.object({
10
- op: z.literal("add").describe("Add new IM contacts to the list"),
11
- im: z.array(ImEntrySchema).describe("List of IM contacts to add"),
12
- }).strict().describe("Add operation: Append new contacts to the existing IM list"),
13
- z.object({
14
- op: z.literal("set").describe("Set/replace all IM contacts"),
15
- im: z.array(ImEntrySchema).describe("Complete list of IM contacts to set"),
16
- }).strict().describe("Set operation: Replace entire IM list with new contacts"),
17
- z.object({
18
- op: z.literal("remove").describe("Remove specific IM contacts"),
19
- im: z.array(NameOrAddressSchema).describe("List of contact addresses or names to remove"),
20
- }).strict().describe("Remove operation: Delete specified contacts from the IM list"),
21
- z.object({
22
- op: z.literal("clear").describe("Clear all IM contacts"),
23
- }).strict().describe("Clear operation: Remove all contacts from the IM list"),
24
- ]).describe("IM list operation: add, set, remove, or clear contacts");
25
- export const CallContact_DataSchema = z.object({
26
- object: WithPermissionObjectSchema,
27
- my_status: NameSchema.optional().describe("Set your status message in this contact list. Only valid if your account is already in the IM list"),
28
- description: DescriptionSchema.optional().describe("Contact object description or public information"),
29
- location: LongNameSchema.optional().describe("Physical or virtual location information for this contact"),
30
- ims: ImsOperationSchema.optional().describe("IM contact list operation: add, set, remove, or clear instant messaging contacts"),
31
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Receive objects sent to this Contact object and unwrap them to the permission owner." + RECEIVE_FORMAT_BLOCK_OBJECTS),
32
- }).strict().describe("On-chain Contact operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Contact. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
33
- export const CallContact_InputSchema = z.object({
34
- data: CallContact_DataSchema.describe("Contact operation data containing object reference and operations to perform"),
35
- env: CallEnvSchema.optional().describe("Call environment parameters including account, network, and cache settings"),
36
- submission: SubmissionCallSchema.optional().describe("Guard submission data for permission verification"),
37
- }).strict().describe("Contact object operation data. Manage on-chain contact information and instant messaging addresses for real-time encrypted communication");
1
+ import{z}from'zod';import{WithPermissionObjectSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,DescriptionSchema,LongNameSchema,NameSchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ImEntrySchema=z['object']({'at':NameOrAddressSchema['describe']('Contact\x27s\x20account\x20address\x20or\x20name\x20for\x20instant\x20messaging'),'description':LongNameSchema['optional']()['describe']('Optional\x20description\x20or\x20note\x20about\x20this\x20contact')})['strict']()['describe']('An\x20instant\x20messaging\x20contact\x20entry\x20with\x20address\x20and\x20optional\x20description');export const ImsOperationSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add')['describe']('Add\x20new\x20IM\x20contacts\x20to\x20the\x20list'),'im':z['array'](ImEntrySchema)['describe']('List\x20of\x20IM\x20contacts\x20to\x20add')})['strict']()['describe']('Add\x20operation:\x20Append\x20new\x20contacts\x20to\x20the\x20existing\x20IM\x20list'),z['object']({'op':z['literal']('set')['describe']('Set/replace\x20all\x20IM\x20contacts'),'im':z['array'](ImEntrySchema)['describe']('Complete\x20list\x20of\x20IM\x20contacts\x20to\x20set')})['strict']()['describe']('Set\x20operation:\x20Replace\x20entire\x20IM\x20list\x20with\x20new\x20contacts'),z['object']({'op':z['literal']('remove')['describe']('Remove\x20specific\x20IM\x20contacts'),'im':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20contact\x20addresses\x20or\x20names\x20to\x20remove')})['strict']()['describe']('Remove\x20operation:\x20Delete\x20specified\x20contacts\x20from\x20the\x20IM\x20list'),z['object']({'op':z['literal']('clear')['describe']('Clear\x20all\x20IM\x20contacts')})['strict']()['describe']('Clear\x20operation:\x20Remove\x20all\x20contacts\x20from\x20the\x20IM\x20list')])['describe']('IM\x20list\x20operation:\x20add,\x20set,\x20remove,\x20or\x20clear\x20contacts');export const CallContact_DataSchema=z['object']({'object':WithPermissionObjectSchema,'my_status':NameSchema['optional']()['describe']('Set\x20your\x20status\x20message\x20in\x20this\x20contact\x20list.\x20Only\x20valid\x20if\x20your\x20account\x20is\x20already\x20in\x20the\x20IM\x20list'),'description':DescriptionSchema['optional']()['describe']('Contact\x20object\x20description\x20or\x20public\x20information'),'location':LongNameSchema['optional']()['describe']('Physical\x20or\x20virtual\x20location\x20information\x20for\x20this\x20contact'),'ims':ImsOperationSchema['optional']()['describe']('IM\x20contact\x20list\x20operation:\x20add,\x20set,\x20remove,\x20or\x20clear\x20instant\x20messaging\x20contacts'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Receive\x20objects\x20sent\x20to\x20this\x20Contact\x20object\x20and\x20unwrap\x20them\x20to\x20the\x20permission\x20owner.'+RECEIVE_FORMAT_BLOCK_OBJECTS)})['strict']()['describe']('On-chain\x20Contact\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Contact.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallContact_InputSchema=z['object']({'data':CallContact_DataSchema['describe']('Contact\x20operation\x20data\x20containing\x20object\x20reference\x20and\x20operations\x20to\x20perform'),'env':CallEnvSchema['optional']()['describe']('Call\x20environment\x20parameters\x20including\x20account,\x20network,\x20and\x20cache\x20settings'),'submission':SubmissionCallSchema['optional']()['describe']('Guard\x20submission\x20data\x20for\x20permission\x20verification')})['strict']()['describe']('Contact\x20object\x20operation\x20data.\x20Manage\x20on-chain\x20contact\x20information\x20and\x20instant\x20messaging\x20addresses\x20for\x20real-time\x20encrypted\x20communication');