@wowok/agent-mcp 2.7.1 → 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 (375) 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.js +1 -397
  13. package/dist/customer/types.js +1 -13
  14. package/dist/customer/user-preferences.js +1 -460
  15. package/dist/evaluation/arbitration-game.d.ts +9 -2
  16. package/dist/evaluation/arbitration-game.js +1 -48
  17. package/dist/evaluation/builtins/demand-match.js +1 -153
  18. package/dist/evaluation/builtins/index.js +1 -10
  19. package/dist/evaluation/builtins/service-risk.js +1 -55
  20. package/dist/evaluation/capability.js +1 -13
  21. package/dist/evaluation/composer.js +1 -40
  22. package/dist/evaluation/engine.js +1 -175
  23. package/dist/evaluation/extract.js +1 -115
  24. package/dist/evaluation/game-strategy.d.ts +27 -0
  25. package/dist/evaluation/game-strategy.js +1 -0
  26. package/dist/evaluation/gap.js +1 -100
  27. package/dist/evaluation/index.d.ts +1 -0
  28. package/dist/evaluation/index.js +1 -11
  29. package/dist/evaluation/node-game.d.ts +31 -3
  30. package/dist/evaluation/node-game.js +1 -57
  31. package/dist/evaluation/region.js +1 -36
  32. package/dist/evaluation/types.d.ts +1 -0
  33. package/dist/evaluation/types.js +1 -1
  34. package/dist/evaluation/user-injection.js +1 -27
  35. package/dist/experience/experience-reuse.js +1 -103
  36. package/dist/experience/index.js +1 -5
  37. package/dist/experience/intent-distill.js +1 -83
  38. package/dist/experience/realtime-feedback.js +1 -94
  39. package/dist/experience/types.js +1 -1
  40. package/dist/experience/user-profile.js +1 -171
  41. package/dist/extensions/business-modules.js +1 -287
  42. package/dist/extensions/capability-manifest.js +1 -781
  43. package/dist/extensions/constraint-registry.js +1 -198
  44. package/dist/extensions/index.js +1 -6
  45. package/dist/extensions/metric-registry.js +1 -257
  46. package/dist/extensions/mode-evaluator.js +1 -170
  47. package/dist/extensions/modes.js +1 -499
  48. package/dist/extensions/registry.js +1 -717
  49. package/dist/extensions/types.js +1 -1
  50. package/dist/harness/auto-escalation.js +1 -68
  51. package/dist/harness/checkpoint.js +1 -129
  52. package/dist/harness/index.js +1 -78
  53. package/dist/harness/plan.js +1 -315
  54. package/dist/harness/recover.js +1 -139
  55. package/dist/harness/types.js +1 -1
  56. package/dist/harness/verify.js +1 -237
  57. package/dist/index.js +1 -273
  58. package/dist/intent/enrich.js +1 -67
  59. package/dist/intent/index.js +1 -60
  60. package/dist/intent/matcher.js +1 -81
  61. package/dist/intent/store.js +1 -55
  62. package/dist/intent/types.js +1 -10
  63. package/dist/knowledge/acquisition-flywheel.js +1 -192
  64. package/dist/knowledge/allocation-confirm.js +1 -534
  65. package/dist/knowledge/allocation-context.js +1 -249
  66. package/dist/knowledge/allocation-ledger.js +1 -463
  67. package/dist/knowledge/allocation-puzzle.js +1 -298
  68. package/dist/knowledge/allocation-risk.js +1 -568
  69. package/dist/knowledge/allocation-templates.js +1 -970
  70. package/dist/knowledge/allocation-translation.js +1 -585
  71. package/dist/knowledge/arb-risk.js +1 -210
  72. package/dist/knowledge/arbitration-confirm.js +1 -559
  73. package/dist/knowledge/arbitration-context.js +1 -505
  74. package/dist/knowledge/arbitration-ledger.js +1 -521
  75. package/dist/knowledge/arbitration-puzzle.js +1 -304
  76. package/dist/knowledge/arbitration-risk.js +1 -423
  77. package/dist/knowledge/arbitration-templates.js +1 -276
  78. package/dist/knowledge/arbitration-translation.js +1 -487
  79. package/dist/knowledge/arbitration-trust.js +1 -117
  80. package/dist/knowledge/audit-rules.js +1 -141
  81. package/dist/knowledge/bridge-risk.js +1 -263
  82. package/dist/knowledge/contact-risk.js +1 -200
  83. package/dist/knowledge/contact-templates.js +1 -60
  84. package/dist/knowledge/demand-confirm.js +1 -206
  85. package/dist/knowledge/demand-matching.js +1 -132
  86. package/dist/knowledge/demand-risk.js +1 -240
  87. package/dist/knowledge/demand-translation.js +1 -354
  88. package/dist/knowledge/deployment-scanner.js +1 -823
  89. package/dist/knowledge/dynamic-pricing.js +1 -87
  90. package/dist/knowledge/examples-scanner-cli.js +1 -26
  91. package/dist/knowledge/examples-scanner.js +1 -843
  92. package/dist/knowledge/flywheel-loop.js +1 -404
  93. package/dist/knowledge/fund-layer.js +1 -973
  94. package/dist/knowledge/glossary.js +1 -211
  95. package/dist/knowledge/guard-confirm.js +1 -406
  96. package/dist/knowledge/guard-context.js +1 -287
  97. package/dist/knowledge/guard-design-patterns.js +1 -360
  98. package/dist/knowledge/guard-ledger.js +1 -260
  99. package/dist/knowledge/guard-lint.js +1 -670
  100. package/dist/knowledge/guard-migration.js +1 -228
  101. package/dist/knowledge/guard-puzzle.js +1 -805
  102. package/dist/knowledge/guard-render.js +1 -700
  103. package/dist/knowledge/guard-risk.js +1 -1879
  104. package/dist/knowledge/guard-submission-prompt.js +1 -171
  105. package/dist/knowledge/guard-templates.js +1 -1105
  106. package/dist/knowledge/guard-translation.js +1 -1119
  107. package/dist/knowledge/index.js +1 -436
  108. package/dist/knowledge/industry-evolution.js +1 -323
  109. package/dist/knowledge/industry-generalizer.js +1 -381
  110. package/dist/knowledge/industry-registry.js +1 -174
  111. package/dist/knowledge/intent-metrics.d.ts +4 -3
  112. package/dist/knowledge/intent-metrics.js +1 -566
  113. package/dist/knowledge/machine-confirm.js +1 -559
  114. package/dist/knowledge/machine-context.js +1 -833
  115. package/dist/knowledge/machine-ledger.js +1 -338
  116. package/dist/knowledge/machine-puzzle.js +1 -494
  117. package/dist/knowledge/machine-render.js +1 -565
  118. package/dist/knowledge/machine-risk.js +1 -669
  119. package/dist/knowledge/machine-templates.js +1 -1597
  120. package/dist/knowledge/machine-topology.js +1 -234
  121. package/dist/knowledge/machine-translation.js +1 -513
  122. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  123. package/dist/knowledge/mcp-schema-audit.js +1 -777
  124. package/dist/knowledge/onchain-constants.js +1 -35
  125. package/dist/knowledge/order-confirm.js +1 -573
  126. package/dist/knowledge/order-context.js +1 -390
  127. package/dist/knowledge/order-ledger.js +1 -341
  128. package/dist/knowledge/order-puzzle.js +1 -255
  129. package/dist/knowledge/order-risk.js +1 -653
  130. package/dist/knowledge/order-templates.js +1 -368
  131. package/dist/knowledge/order-translation.js +1 -550
  132. package/dist/knowledge/overrides-loader.js +1 -65
  133. package/dist/knowledge/passport-confirm.js +1 -531
  134. package/dist/knowledge/passport-context.js +1 -306
  135. package/dist/knowledge/passport-ledger.js +1 -282
  136. package/dist/knowledge/passport-puzzle.js +1 -333
  137. package/dist/knowledge/passport-risk.js +1 -450
  138. package/dist/knowledge/passport-templates.js +1 -568
  139. package/dist/knowledge/passport-translation.js +1 -516
  140. package/dist/knowledge/payment-risk.js +1 -249
  141. package/dist/knowledge/permission-confirm.js +1 -426
  142. package/dist/knowledge/permission-context.js +1 -224
  143. package/dist/knowledge/permission-ledger.js +1 -403
  144. package/dist/knowledge/permission-puzzle.js +1 -173
  145. package/dist/knowledge/permission-risk.js +1 -411
  146. package/dist/knowledge/permission-templates.js +1 -234
  147. package/dist/knowledge/permission-translation.js +1 -350
  148. package/dist/knowledge/personal-risk.js +1 -212
  149. package/dist/knowledge/process-model.js +1 -160
  150. package/dist/knowledge/progress-confirm.js +1 -456
  151. package/dist/knowledge/progress-context.js +1 -452
  152. package/dist/knowledge/progress-ledger.js +1 -330
  153. package/dist/knowledge/progress-puzzle.js +1 -219
  154. package/dist/knowledge/progress-risk.js +1 -461
  155. package/dist/knowledge/progress-templates.js +1 -228
  156. package/dist/knowledge/progress-translation.js +1 -405
  157. package/dist/knowledge/proof-confirm.js +1 -187
  158. package/dist/knowledge/proof-risk.js +1 -207
  159. package/dist/knowledge/proof-translation.js +1 -283
  160. package/dist/knowledge/registrar-risk.js +1 -217
  161. package/dist/knowledge/repository-confirm.js +1 -286
  162. package/dist/knowledge/repository-risk.js +1 -373
  163. package/dist/knowledge/repository-translation.js +1 -445
  164. package/dist/knowledge/reputation-rules.js +1 -99
  165. package/dist/knowledge/resource-risk.js +1 -157
  166. package/dist/knowledge/reward-confirm.js +1 -526
  167. package/dist/knowledge/reward-context.js +1 -504
  168. package/dist/knowledge/reward-ledger.js +1 -502
  169. package/dist/knowledge/reward-puzzle.js +1 -300
  170. package/dist/knowledge/reward-risk.js +1 -627
  171. package/dist/knowledge/reward-templates.js +1 -197
  172. package/dist/knowledge/reward-translation.js +1 -501
  173. package/dist/knowledge/safety-rules.js +1 -404
  174. package/dist/knowledge/scenario-modes.js +1 -321
  175. package/dist/knowledge/service-confirm.js +1 -807
  176. package/dist/knowledge/service-context.js +1 -403
  177. package/dist/knowledge/service-ledger.js +1 -609
  178. package/dist/knowledge/service-puzzle.js +1 -236
  179. package/dist/knowledge/service-risk.js +1 -651
  180. package/dist/knowledge/service-templates.js +1 -456
  181. package/dist/knowledge/service-translation.js +1 -622
  182. package/dist/knowledge/template-registry.js +1 -353
  183. package/dist/knowledge/tool-constraints.js +1 -195
  184. package/dist/knowledge/tools-reference.js +1 -178
  185. package/dist/knowledge/treasury-confirm.js +1 -512
  186. package/dist/knowledge/treasury-context.js +1 -363
  187. package/dist/knowledge/treasury-ledger.js +1 -300
  188. package/dist/knowledge/treasury-puzzle.js +1 -216
  189. package/dist/knowledge/treasury-risk.js +1 -440
  190. package/dist/knowledge/treasury-templates.js +1 -358
  191. package/dist/knowledge/treasury-translation.js +1 -498
  192. package/dist/knowledge/trust-metrics.js +1 -198
  193. package/dist/knowledge/util-risk.js +1 -135
  194. package/dist/loop-engineering/aggregate.js +1 -132
  195. package/dist/loop-engineering/context-collect.js +1 -83
  196. package/dist/loop-engineering/diagnose.js +1 -273
  197. package/dist/loop-engineering/improve.js +1 -405
  198. package/dist/loop-engineering/index.js +1 -4
  199. package/dist/loop-engineering/pipeline.js +1 -56
  200. package/dist/mode-market/index.js +1 -3
  201. package/dist/mode-market/registry.js +1 -124
  202. package/dist/mode-market/review.js +1 -214
  203. package/dist/mode-market/submission.js +1 -85
  204. package/dist/participation/collaborator-interest.d.ts +23 -0
  205. package/dist/participation/collaborator-interest.js +1 -0
  206. package/dist/participation/customer-interest.d.ts +25 -0
  207. package/dist/participation/customer-interest.js +1 -0
  208. package/dist/participation/merchant-interest.js +1 -100
  209. package/dist/participation/radar-core.d.ts +13 -3
  210. package/dist/participation/radar-core.js +1 -269
  211. package/dist/participation/supplier-interest.d.ts +25 -0
  212. package/dist/participation/supplier-interest.js +1 -0
  213. package/dist/persona/analyzer.js +1 -66
  214. package/dist/persona/bridge.js +1 -86
  215. package/dist/persona/defaults.js +1 -195
  216. package/dist/persona/experience-bridge.js +1 -23
  217. package/dist/persona/index.js +1 -71
  218. package/dist/persona/model.js +1 -111
  219. package/dist/persona/store.js +1 -62
  220. package/dist/persona/types.d.ts +3 -1
  221. package/dist/persona/types.js +1 -5
  222. package/dist/project/business-puzzle.js +1 -383
  223. package/dist/project/context-assembly.js +1 -254
  224. package/dist/project/deployment-bridge.js +1 -120
  225. package/dist/project/deployment-doc.js +1 -1126
  226. package/dist/project/edit-planner.js +1 -1342
  227. package/dist/project/evaluation.js +1 -2011
  228. package/dist/project/game-theory.js +1 -177
  229. package/dist/project/graph-builder.js +1 -656
  230. package/dist/project/graph.js +1 -340
  231. package/dist/project/handlers.js +1 -1784
  232. package/dist/project/index.d.ts +1 -0
  233. package/dist/project/index.js +1 -301
  234. package/dist/project/intent-analyzer.js +1 -149
  235. package/dist/project/machine-nodes.js +1 -36
  236. package/dist/project/merchant-guide.js +1 -264
  237. package/dist/project/migration.js +1 -125
  238. package/dist/project/mode-actions.js +1 -309
  239. package/dist/project/namespace.js +1 -206
  240. package/dist/project/participation-radar.js +1 -428
  241. package/dist/project/pipeline-actions.js +1 -109
  242. package/dist/project/project-store.js +1 -422
  243. package/dist/project/query.js +1 -153
  244. package/dist/project/reverse-mapping.d.ts +34 -0
  245. package/dist/project/reverse-mapping.js +1 -0
  246. package/dist/project/risk-aggregator.js +1 -295
  247. package/dist/project/rollback-policy.js +1 -290
  248. package/dist/project/semantic-assembler.js +1 -345
  249. package/dist/project/semantic-graph.js +1 -292
  250. package/dist/project/stage-gate.js +1 -369
  251. package/dist/project/substep-trace.js +1 -332
  252. package/dist/project/task-tracker.js +1 -78
  253. package/dist/role/derivation.d.ts +18 -0
  254. package/dist/role/derivation.js +1 -0
  255. package/dist/role/index.d.ts +5 -0
  256. package/dist/role/index.js +1 -0
  257. package/dist/role/model.d.ts +8 -0
  258. package/dist/role/model.js +1 -0
  259. package/dist/role/resolution.d.ts +11 -0
  260. package/dist/role/resolution.js +1 -0
  261. package/dist/role/types.d.ts +11 -0
  262. package/dist/role/types.js +1 -0
  263. package/dist/rules.js +1 -52
  264. package/dist/safety/confirm-gate.js +1 -88
  265. package/dist/safety/index.js +1 -3
  266. package/dist/safety/preview.js +1 -52
  267. package/dist/schema/call/allocation.js +1 -34
  268. package/dist/schema/call/arbitration.js +1 -113
  269. package/dist/schema/call/base.d.ts +15 -15
  270. package/dist/schema/call/base.js +1 -370
  271. package/dist/schema/call/bridge-handler.js +1 -265
  272. package/dist/schema/call/bridge.d.ts +7 -7
  273. package/dist/schema/call/bridge.js +1 -458
  274. package/dist/schema/call/contact.js +1 -37
  275. package/dist/schema/call/demand.js +1 -47
  276. package/dist/schema/call/guard.js +1 -161
  277. package/dist/schema/call/handler.js +1 -322
  278. package/dist/schema/call/index.js +1 -20
  279. package/dist/schema/call/machine.js +1 -193
  280. package/dist/schema/call/order.js +1 -35
  281. package/dist/schema/call/payment.js +1 -37
  282. package/dist/schema/call/permission-handler.js +1 -54
  283. package/dist/schema/call/permission.js +1 -105
  284. package/dist/schema/call/personal.js +1 -78
  285. package/dist/schema/call/progress.js +1 -47
  286. package/dist/schema/call/proof.js +1 -33
  287. package/dist/schema/call/repository.js +1 -77
  288. package/dist/schema/call/reward.js +1 -30
  289. package/dist/schema/call/semantic.js +1 -1679
  290. package/dist/schema/call/service.js +1 -184
  291. package/dist/schema/call/treasury.js +1 -71
  292. package/dist/schema/common/index.js +1 -407
  293. package/dist/schema/config/index.js +1 -68
  294. package/dist/schema/evaluation/index.d.ts +213 -16
  295. package/dist/schema/evaluation/index.js +1 -356
  296. package/dist/schema/index.js +1 -17
  297. package/dist/schema/intent-radar/index.d.ts +13 -13
  298. package/dist/schema/intent-radar/index.js +1 -89
  299. package/dist/schema/local/index.d.ts +21 -21
  300. package/dist/schema/local/index.js +1 -927
  301. package/dist/schema/local/wip.js +1 -187
  302. package/dist/schema/messenger/index.d.ts +7 -7
  303. package/dist/schema/messenger/index.js +1 -475
  304. package/dist/schema/operations.d.ts +7 -7
  305. package/dist/schema/operations.js +1 -520
  306. package/dist/schema/persona/index.d.ts +54 -54
  307. package/dist/schema/persona/index.js +1 -148
  308. package/dist/schema/project/index.d.ts +94 -48
  309. package/dist/schema/project/index.js +1 -2057
  310. package/dist/schema/query/index.d.ts +423 -7
  311. package/dist/schema/query/index.js +1 -1646
  312. package/dist/schema/schema-query/index.js +1 -104
  313. package/dist/schema/schema-version.js +1 -76
  314. package/dist/schema/sync-layer4.js +1 -286
  315. package/dist/schema/task-status.js +1 -36
  316. package/dist/schema/trust/index.js +1 -314
  317. package/dist/schema/utils/guard-parser.js +1 -419
  318. package/dist/schema/utils/guard-query-utils.js +1 -46
  319. package/dist/schema/utils/node-parser.js +1 -369
  320. package/dist/schema/utils/object-type-utils.js +1 -35
  321. package/dist/schema/utils/permission-index-utils.js +1 -7
  322. package/dist/schema/utils/permission-machine-check.js +1 -121
  323. package/dist/schema/utils/skills-recommendation.js +1 -77
  324. package/dist/schema-query/index.js +1 -810
  325. package/dist/schemas/account_operation.output.json +5 -2
  326. package/dist/schemas/bridge_operation.output.json +5 -2
  327. package/dist/schemas/evaluation_operation.output.json +112 -7
  328. package/dist/schemas/evaluation_operation.schema.json +93 -6
  329. package/dist/schemas/index.json +1 -1
  330. package/dist/schemas/intent_radar.output.json +4 -1
  331. package/dist/schemas/intent_radar.schema.json +4 -1
  332. package/dist/schemas/local_info_operation.output.json +5 -2
  333. package/dist/schemas/local_mark_operation.output.json +5 -2
  334. package/dist/schemas/messenger_operation.output.json +5 -2
  335. package/dist/schemas/onchain_events.output.json +5 -2
  336. package/dist/schemas/onchain_operations.output.json +5 -2
  337. package/dist/schemas/onchain_operations.schema.json +4 -4
  338. package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
  339. package/dist/schemas/onchain_operations_machine.schema.json +2 -2
  340. package/dist/schemas/onchain_operations_service.schema.json +1 -1
  341. package/dist/schemas/onchain_table_data.output.json +6 -3
  342. package/dist/schemas/persona_operation.output.json +4 -1
  343. package/dist/schemas/persona_operation.schema.json +4 -1
  344. package/dist/schemas/project_operation.output.json +28 -8
  345. package/dist/schemas/query_toolkit.output.json +8 -5
  346. package/dist/schemas/wowok_buildin_info.output.json +132 -0
  347. package/dist/schemas/wowok_buildin_info.schema.json +14 -0
  348. package/dist/telemetry/index.js +1 -112
  349. package/dist/telemetry/redact.js +1 -23
  350. package/dist/telemetry/storage.js +1 -80
  351. package/dist/tools/handlers/bridge.js +1 -1
  352. package/dist/tools/handlers/config.js +1 -74
  353. package/dist/tools/handlers/evaluation.js +1 -123
  354. package/dist/tools/handlers/file-export.js +1 -90
  355. package/dist/tools/handlers/intent-radar.js +1 -76
  356. package/dist/tools/handlers/local.js +1 -53
  357. package/dist/tools/handlers/messenger.js +1 -188
  358. package/dist/tools/handlers/onchain.js +1 -1180
  359. package/dist/tools/handlers/persona.js +1 -89
  360. package/dist/tools/handlers/project.js +1 -211
  361. package/dist/tools/handlers/query.js +1 -434
  362. package/dist/tools/handlers/schema-query.js +1 -176
  363. package/dist/tools/handlers/task-status.js +1 -26
  364. package/dist/tools/handlers/trust.js +1 -380
  365. package/dist/tools/handlers/wip.js +1 -90
  366. package/dist/tools/index.js +1 -1382
  367. package/dist/tools/retry.js +1 -85
  368. package/dist/tools/rules-hook.js +1 -23
  369. package/dist/tools/shared.js +1 -130
  370. package/dist/tools/types.js +1 -1
  371. package/dist/tools/upgrade-check.d.ts +19 -0
  372. package/dist/tools/upgrade-check.js +1 -0
  373. package/dist/tools/wip-deploy-assist.js +1 -306
  374. package/dist/tools/wrap.js +1 -500
  375. package/package.json +4 -2
@@ -1,407 +1 @@
1
- import { z } from "zod";
2
- import { isValidAddress, ValueType as WowValueType, ObjectType as WowObjectType, ENTRYPOINT, isValidWowAddress, isValidName, isValidDescription, MAX_DESCRIPTION_LENGTH, isValidLongName, MAX_LONG_NAME_LENGTH } from "@wowok/wowok";
3
- const isValidMoveIdentifier = (s) => {
4
- if (s.length === 0)
5
- return false;
6
- const firstChar = s[0];
7
- if (firstChar === '_') {
8
- return s.length > 1 && /^[a-zA-Z0-9_]+$/.test(s.slice(1));
9
- }
10
- if (/^[a-zA-Z]$/.test(firstChar)) {
11
- return /^[a-zA-Z0-9_]*$/.test(s.slice(1));
12
- }
13
- return false;
14
- };
15
- export const DescriptionSchema = z
16
- .string()
17
- .refine(isValidDescription, {
18
- message: `Description string (max ${MAX_DESCRIPTION_LENGTH} bcs characters)`
19
- })
20
- .describe(`Description string (max ${MAX_DESCRIPTION_LENGTH} bcs characters)`);
21
- export const LongNameSchema = z
22
- .string()
23
- .refine(isValidLongName, {
24
- message: `max ${MAX_LONG_NAME_LENGTH} bcs characters`
25
- });
26
- export const WowAddressSchema = z
27
- .string()
28
- .refine(isValidAddress, {
29
- message: "Invalid ID format: must be '0x' prefix followed by 64 hex characters"
30
- })
31
- .describe("Valid ID: 0x prefix + 64 hex characters, or builtin ID (0x5-0x9, 0xa, 0xc, 0xd, 0x403, 0xaaa, 0xaab, 0xacc)");
32
- const WOW_TOKEN_TYPE = "0x2::wow::WOW";
33
- export const TokenTypeSchema = z
34
- .string()
35
- .refine((val) => {
36
- if (val === WOW_TOKEN_TYPE)
37
- return true;
38
- const parts = val.split("::");
39
- if (parts.length !== 3)
40
- return false;
41
- const [address, module, structName] = parts;
42
- if (!isValidWowAddress(address))
43
- return false;
44
- if (!isValidMoveIdentifier(module))
45
- return false;
46
- if (!isValidMoveIdentifier(structName))
47
- return false;
48
- return true;
49
- }, {
50
- message: "Invalid token type format. Expected: {address}::{module}::{struct} where address is 0x+64hex, module/struct are valid Move identifiers, or '0x2::wow::WOW'"
51
- })
52
- .describe("Token type in format: {address}::{module}::{struct}. e.g. '0x2::wow::WOW' (WOW), '0x...::usdt::USDT' (USDT), '0x...::eth::ETH' (ETH). To discover all available tokens and their type tags, query 'mainnet bridge tokens' via wowok_buildin_info and use the returned `wowTypeTag` here.");
53
- export const TokenTypeWithDefaultSchema = TokenTypeSchema
54
- .default(WOW_TOKEN_TYPE)
55
- .describe("Token type in format: {address}::{module}::{struct}. Default: '0x2::wow::WOW'. Other examples: '0x...::usdt::USDT' (USDT), '0x...::eth::ETH' (ETH). To discover all available tokens and their type tags, query 'mainnet bridge tokens' via wowok_buildin_info and use the returned `wowTypeTag` here.");
56
- export const NameSchema = z
57
- .string()
58
- .refine(isValidName, "Name string (max 64 bcs characters, must not start with '0x')");
59
- export const NotEmptyNameSchema = z.string().nonempty()
60
- .refine(isValidName, "Name string (at least 1 character, max length 64 bcs characters)");
61
- export const NameOrAddressSchema = z
62
- .string()
63
- .refine((val) => {
64
- if (isValidAddress(val))
65
- return true;
66
- if (isValidName(val))
67
- return true;
68
- return false;
69
- }, {
70
- message: "Invalid ID format: must be '0x' prefix, or a builtin ID (0x5-0x9, 0xa, 0xc, 0xd, 0x403, 0xaaa, 0xaab, 0xacc)"
71
- }).describe("Account/Object name or ID. If specifying an account, use empty string '' for the default account. " +
72
- "If it starts with '0x', it will be treated as an ID. " +
73
- "Otherwise, it will be treated as a name (max 64 bcs characters).");
74
- export const AccountOrMark_AddressSchema = z.object({
75
- name_or_address: NameOrAddressSchema.optional(),
76
- local_mark_first: z.boolean().optional().describe("Whether to prioritize local marks, if true, prioritize local marks, otherwise prioritize global marks"),
77
- }).strict().describe("Account or address lookup object. Use this to specify which account to use for an operation. " +
78
- "EXAMPLE: { name_or_address: 'testor2' } - looks up account by name; " +
79
- "EXAMPLE: { name_or_address: '0x1234...' } - uses address directly; " +
80
- "If name_or_address is empty string '', uses the default local account.");
81
- export const ManyAccountOrMark_AddressSchema = z.object({
82
- entities: z.array(AccountOrMark_AddressSchema),
83
- check_all_founded: z.boolean().optional().describe("Whether to check all entities are found, if true, all entities must be found (abort and throw exception if any ID not found); if false, only return found IDs"),
84
- }).strict().describe("Used to batch find account or object IDs by name");
85
- export const AccountOrMark_AddressAISchema = z.union([
86
- NameOrAddressSchema.transform(s => ({ name_or_address: s, local_mark_first: true })).describe("Account name, address (0x...), or mark name. " +
87
- "When using string format, local marks are searched first. " +
88
- "EXAMPLE: 'alice' - searches local marks first, then global; " +
89
- "EXAMPLE: '0x2...' (64 hex chars) - uses address directly; " +
90
- "EXAMPLE: '' - uses the default local account"),
91
- AccountOrMark_AddressSchema
92
- ]).describe("Account or address lookup. Can be a simple string (recommended for AI) " +
93
- "or full object with explicit local_mark_first control. " +
94
- "String form auto-converts to { name_or_address: <string>, local_mark_first: true }.");
95
- export const ManyAccountOrMark_AddressAISchema = z.union([
96
- z.array(NameOrAddressSchema).transform(arr => ({
97
- entities: arr.map(s => ({ name_or_address: s, local_mark_first: true })),
98
- check_all_founded: true,
99
- })).describe("Array of account names, addresses, or mark names. " +
100
- "Local marks are searched first for each entry. " +
101
- "EXAMPLE: ['alice', '0x2...', 'bob']"),
102
- ManyAccountOrMark_AddressSchema
103
- ]).describe("Batch account or address lookup. Can be an array of strings (recommended for AI) " +
104
- "or full object with explicit control. " +
105
- "Array form auto-converts to { entities: [...], check_all_founded: true }.");
106
- export const ObjectOwnerSchema = z.union([
107
- z.object({
108
- AddressOwner: z.string().describe("Address owner"),
109
- }).strict(),
110
- z.object({
111
- ObjectOwner: z.string().describe("Object owner"),
112
- }).strict(),
113
- z.object({
114
- Shared: z.object({
115
- initial_shared_version: z.union([z.string(), z.number()]).describe("Version when object became shared"),
116
- }).strict().describe("Shared object"),
117
- }).strict(),
118
- z.literal("Immutable"),
119
- z.object({
120
- ConsensusAddressOwner: z.object({
121
- owner: z.string().describe("Consensus ID owner"),
122
- start_version: z.union([z.string(), z.number()]).describe("Version when object recently became consensus object"),
123
- }).strict().describe("Consensus ID owner"),
124
- }).strict(),
125
- ]).describe("Object owner");
126
- const ValueTypeStringNames = [
127
- "Bool", "Address", "String", "U8", "U16", "U32", "U64", "U128", "U256",
128
- "VecBool", "VecAddress", "VecString", "VecU8", "VecU16", "VecU32", "VecU64", "VecU128", "VecU256", "VecVecU8"
129
- ];
130
- export const ValueTypeUserSchema = z.union([
131
- z.literal(WowValueType.Bool).describe("Bool (0)"),
132
- z.literal(WowValueType.Address).describe("Address (1)"),
133
- z.literal(WowValueType.String).describe("String (2)"),
134
- z.literal(WowValueType.U8).describe("U8 (3)"),
135
- z.literal(WowValueType.U16).describe("U16 (4)"),
136
- z.literal(WowValueType.U32).describe("U32 (5)"),
137
- z.literal(WowValueType.U64).describe("U64 (6)"),
138
- z.literal(WowValueType.U128).describe("U128 (7)"),
139
- z.literal(WowValueType.U256).describe("U256 (8)"),
140
- z.literal(WowValueType.VecBool).describe("VecBool (9)"),
141
- z.literal(WowValueType.VecAddress).describe("VecAddress (10)"),
142
- z.literal(WowValueType.VecString).describe("VecString (11)"),
143
- z.literal(WowValueType.VecU8).describe("VecU8 (12)"),
144
- z.literal(WowValueType.VecU16).describe("VecU16 (13)"),
145
- z.literal(WowValueType.VecU32).describe("VecU32 (14)"),
146
- z.literal(WowValueType.VecU64).describe("VecU64 (15)"),
147
- z.literal(WowValueType.VecU128).describe("VecU128 (16)"),
148
- z.literal(WowValueType.VecU256).describe("VecU256 (17)"),
149
- z.literal(WowValueType.VecVecU8).describe("VecVecU8 (18)"),
150
- z.literal("Bool").describe("Bool"),
151
- z.literal("Address").describe("Address"),
152
- z.literal("String").describe("String"),
153
- z.literal("U8").describe("U8"),
154
- z.literal("U16").describe("U16"),
155
- z.literal("U32").describe("U32"),
156
- z.literal("U64").describe("U64"),
157
- z.literal("U128").describe("U128"),
158
- z.literal("U256").describe("U256"),
159
- z.literal("VecBool").describe("VecBool"),
160
- z.literal("VecAddress").describe("VecAddress"),
161
- z.literal("VecString").describe("VecString"),
162
- z.literal("VecU8").describe("VecU8"),
163
- z.literal("VecU16").describe("VecU16"),
164
- z.literal("VecU32").describe("VecU32"),
165
- z.literal("VecU64").describe("VecU64"),
166
- z.literal("VecU128").describe("VecU128"),
167
- z.literal("VecU256").describe("VecU256"),
168
- z.literal("VecVecU8").describe("VecVecU8"),
169
- z.literal("bool").describe("bool"),
170
- z.literal("address").describe("address"),
171
- z.literal("string").describe("string"),
172
- z.literal("u8").describe("u8"),
173
- z.literal("u16").describe("u16"),
174
- z.literal("u32").describe("u32"),
175
- z.literal("u64").describe("u64"),
176
- z.literal("u128").describe("u128"),
177
- z.literal("u256").describe("u256"),
178
- z.literal("vecbool").describe("vecbool"),
179
- z.literal("vecaddress").describe("vecaddress"),
180
- z.literal("vecstring").describe("vecstring"),
181
- z.literal("vecu8").describe("vecu8"),
182
- z.literal("vecu16").describe("vecu16"),
183
- z.literal("vecu32").describe("vecu32"),
184
- z.literal("vecu64").describe("vecu64"),
185
- z.literal("vecu128").describe("vecu128"),
186
- z.literal("vecu256").describe("vecu256"),
187
- z.literal("vecvecu8").describe("vecvecu8"),
188
- ]).describe("User available value type (number or string, e.g., 6 or 'U64' or 'u64')");
189
- export const ValueTypeSchema = ValueTypeUserSchema.or(z.literal(WowValueType.Value).describe("Value (19)")).or(z.literal("Value").describe("Value"))
190
- .describe("Value type (number or string, e.g., 6 or 'U64')");
191
- export const ObjectTypeSchema = z.enum([
192
- WowObjectType.Permission,
193
- WowObjectType.Repository,
194
- WowObjectType.Arb,
195
- WowObjectType.Arbitration,
196
- WowObjectType.Service,
197
- WowObjectType.Machine,
198
- WowObjectType.Order,
199
- WowObjectType.Progress,
200
- WowObjectType.Payment,
201
- WowObjectType.Treasury,
202
- WowObjectType.Guard,
203
- WowObjectType.Demand,
204
- WowObjectType.Passport,
205
- WowObjectType.Allocation,
206
- WowObjectType.Resource,
207
- WowObjectType.Reward,
208
- WowObjectType.Discount,
209
- WowObjectType.EntityRegistrar,
210
- WowObjectType.EntityLinker,
211
- WowObjectType.Proof,
212
- WowObjectType.WReceivedObject,
213
- WowObjectType.Contact,
214
- WowObjectType.TableItem_ProgressHistory,
215
- WowObjectType.TableItem_PermissionPerm,
216
- WowObjectType.TableItem_DemandPresenter,
217
- WowObjectType.TableItem_MachineNode,
218
- WowObjectType.TableItem_TreasuryHistory,
219
- WowObjectType.TableItem_RepositoryData,
220
- WowObjectType.TableItem_RewardRecord,
221
- WowObjectType.TableItem_EntityLinker,
222
- WowObjectType.TableItem_AddressMark,
223
- WowObjectType.TableItem_EntityRegistrar,
224
- ]).describe("Wowok object type");
225
- export const BalanceTypeSchema = z.union([z.number(), z.string()]).describe("A coin/balance amount. Accepts three formats: " +
226
- "(1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — " +
227
- "auto-converted to smallest units via the Fund Processing Layer (token precision resolved " +
228
- "from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. " +
229
- "(2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. " +
230
- "(3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). " +
231
- "PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. " +
232
- "Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). " +
233
- "For custom tokens: use display format with the token's symbol, or pass smallest units directly. " +
234
- "MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. " +
235
- "If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. " +
236
- "Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). " +
237
- "Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities.");
238
- export const QueryIdSchema = z.number().int().min(0).describe("Query ID");
239
- export const CacheExpireTypeSchema = z.union([z.number(), z.literal("INFINITE")]).describe("Cache expiration time type");
240
- export const ValueContainerSchema = z.lazy(() => z.object({
241
- valueType: ValueTypeSchema.describe("Value type"),
242
- value: SupportedValueSchema.describe("Value"),
243
- }).strict().describe("Value container with type and value"));
244
- export const SupportedValueUserSchema = z.union([
245
- z.boolean(),
246
- z.union([AccountOrMark_AddressSchema, z.string()]),
247
- z.string(),
248
- z.number(),
249
- z.array(z.boolean()),
250
- z.union([ManyAccountOrMark_AddressSchema, z.array(z.string())]),
251
- z.array(z.string()),
252
- z.array(z.number()),
253
- z.array(z.array(z.number())),
254
- ]).describe("User available supported value type");
255
- export const SupportedValueSchema = SupportedValueUserSchema.or(ValueContainerSchema).describe("Supported value type");
256
- export const GuardIdentifierSchema = z.number().int().min(0).max(255).describe("Identifier (0-255) for data lookup in Guard table.");
257
- export const GuardTableItemBaseSchema = z.object({
258
- identifier: GuardIdentifierSchema,
259
- b_submission: z.boolean().describe("Whether this table item's value is submitted dynamically at Guard trigger time (alloc_by_guard call). " +
260
- "\n\n" +
261
- "true = value is submitted by the caller when triggering the Guard. " +
262
- "Use for runtime-context-dependent values like order address, user address. " +
263
- "The 'value' field is ignored when b_submission=true; the caller must provide it via submissions[]. " +
264
- "\n\n" +
265
- "false = value is static, set at Guard creation time. " +
266
- "Use for values known when the Guard is created: expected node names, expected merchant address, expected service address. " +
267
- "The 'value' field must be populated and will be stored on-chain permanently. " +
268
- "\n\n" +
269
- "Rule of thumb: if the value is the SAME for all future Guard triggers, use false. " +
270
- "If the value DIFFERS per trigger (e.g., which order to release funds for), use true."),
271
- value_type: ValueTypeUserSchema.describe("Type of the value stored in `value`. One of: Bool(0), Address(1), String(2), U8(3), U16(4), U32(5), U64(6), U128(7), U256(8), VecBool(9), VecAddress(10), VecString(11), VecU8(12), VecU16(13), VecU32(14), VecU64(15), VecU128(16), VecU256(17), VecVecU8(18). " +
272
- "When value_type=Address (1), the `value` field accepts a hex address string, a LocalMark name, or an AccountOrMark_Address object — see `value` field description for details."),
273
- value: SupportedValueUserSchema.optional().describe("The actual value data. Format depends on `value_type`:\n" +
274
- "• Bool: true/false (boolean)\n" +
275
- "• Address (CRITICAL — string 'Address' is NOT a placeholder): a hex address (e.g. '0x1234...'), a LocalMark name (e.g. 'my-service' — resolved to address at evaluation time), an AccountOrMark_Address object (e.g. {name_or_address:'my-service'}), or system shorthand ('0xaaa' = EntityLinker, '0xaab' = EntityRegistrar). The literal string 'Address' itself is INVALID — it would be treated as a non-existent LocalMark name and fail. Example: value='0x2::wow::WOW<address>' or value='my-permission'.\n" +
276
- "• String: any string\n" +
277
- "• U8/U16/U32/U64/U128/U256: number or numeric string (e.g. 42 or '42')\n" +
278
- "• Vec* types: arrays of the corresponding element type\n" +
279
- "REQUIRED when b_submission=false. OPTIONAL when b_submission=true (value is supplied at evaluation time by user submission)."),
280
- name: z.string().default("").describe("Data name identifier. MAX 64 BCS characters (Chinese chars count as 3-4 BCS bytes each). " +
281
- "Use short identifiers like 'order_id', 'delivery_node'. " +
282
- "Put longer descriptions in the Guard's 'description' field, NOT here."),
283
- }).strict().describe("Guard table item (INPUT/CREATION form). DO NOT include `object_type` field — it is query-output only and will be rejected here.");
284
- export const GuardTableItemSchema = GuardTableItemBaseSchema.extend({
285
- object_type: ObjectTypeSchema.optional().describe("OUTPUT-ONLY (query side): Object type when value_type is Address and represents a specific object. Auto-derived by the system — DO NOT set this field at Guard creation."),
286
- }).strict().describe("Guard table item (QUERY/OUTPUT form — includes auto-derived object_type field)");
287
- export const EntrypointSchema = z.enum([
288
- ENTRYPOINT.Localnet,
289
- ENTRYPOINT.Testnet,
290
- ENTRYPOINT.Mainnet,
291
- ]).describe("Network entrypoint: Specifies which network the operation occurs on. " +
292
- "FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). " +
293
- "When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names " +
294
- "to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the " +
295
- "project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy.");
296
- export const FaucetNetworkSchema = z.enum([
297
- ENTRYPOINT.Localnet,
298
- ENTRYPOINT.Testnet,
299
- ]).describe("Network entrypoint for Faucet: Specifies which network the operation occurs on");
300
- export const ObjectBaseSchema = z.object({
301
- object: z.string().describe("Object ID"),
302
- type: ObjectTypeSchema.optional().describe("Object type"),
303
- type_raw: z.string().optional().describe("Raw object type"),
304
- owner: z.union([ObjectOwnerSchema, z.null()]).optional().describe("Object owner"),
305
- version: z.union([z.string(), z.number()]).optional().describe("Object version"),
306
- previousTransaction: z.string().optional().describe("Previous transaction ID"),
307
- cache_expire: CacheExpireTypeSchema.optional().describe("Cache expiration time"),
308
- query_name: z.string().optional().describe("Original query name or address used to retrieve this object"),
309
- content_raw: z.any().optional().describe("Raw content data for unknown object types"),
310
- _guard_node_comments: z.array(z.object({
311
- type: z.string(),
312
- description: z.string()
313
- })).optional().describe("Additional comments for Guard node instructions"),
314
- }).passthrough().describe("Object base information");
315
- export const QueryEnvSchema = z.object({
316
- no_cache: z.boolean().optional().describe("Whether to disable cache"),
317
- network: EntrypointSchema.optional(),
318
- }).strict().describe("Query environment parameters");
319
- export const ReceivedBalanceObjectSchema = z.object({
320
- id: z.string().describe("Received CoinWrapper object ID"),
321
- balance: BalanceTypeSchema,
322
- payment: z.string().describe("Payment object ID"),
323
- }).strict().describe("Received CoinWrapper object record");
324
- export const CoinWrapperTokenTypeSchema = z
325
- .string()
326
- .refine((val) => {
327
- const match = val.match(/^CoinWrapper<(.+)>$/);
328
- if (match) {
329
- const inner = match[1];
330
- if (inner === WOW_TOKEN_TYPE)
331
- return true;
332
- const parts = inner.split("::");
333
- if (parts.length !== 3)
334
- return false;
335
- const [address, module, structName] = parts;
336
- if (!isValidWowAddress(address))
337
- return false;
338
- if (!isValidMoveIdentifier(module))
339
- return false;
340
- if (!isValidMoveIdentifier(structName))
341
- return false;
342
- return true;
343
- }
344
- if (val === WOW_TOKEN_TYPE)
345
- return true;
346
- const parts = val.split("::");
347
- if (parts.length !== 3)
348
- return false;
349
- const [address, module, structName] = parts;
350
- if (!isValidWowAddress(address))
351
- return false;
352
- if (!isValidMoveIdentifier(module))
353
- return false;
354
- if (!isValidMoveIdentifier(structName))
355
- return false;
356
- return true;
357
- }, {
358
- message: "Invalid token type format. Expected: CoinWrapper<{address}::{module}::{struct}> or {address}::{module}::{struct}. Example: CoinWrapper<0x2::wow::WOW> or 0x2::wow::WOW"
359
- })
360
- .describe("Token type in format: CoinWrapper<{address}::{module}::{struct}> or {address}::{module}::{struct}. Example: CoinWrapper<0x2::wow::WOW>");
361
- export const ReceivedBalanceSchema = z.object({
362
- balance: BalanceTypeSchema,
363
- token_type: CoinWrapperTokenTypeSchema.describe("Asset type of Coin objects. Supports CoinWrapper<...> format for order receive operations."),
364
- received: z.array(ReceivedBalanceObjectSchema).describe("Received records of Coin objects"),
365
- }).strict().describe("Received record of Coin objects");
366
- export const ReceivedBalanceOrRecentlySchema = z.union([
367
- ReceivedBalanceSchema,
368
- z.literal("recently")
369
- ]).describe("Specified received balance record or all recently received balance record");
370
- export const ReceivedNormalSchema = z.object({
371
- id: z.string().nonempty().describe("Received object ID"),
372
- type: z.string().nonempty().describe("Object type"),
373
- content_raw: z.any().optional().describe("Raw content data")
374
- }).strict().describe("Received normal object record");
375
- export const ReceivedObjectsOrRecentlySchema = z.union([
376
- z.array(ReceivedNormalSchema),
377
- ReceivedBalanceSchema,
378
- z.literal("recently"),
379
- ]).describe("Specified received object records or all recently received object records");
380
- export const RECEIVE_FORMAT_BLOCK_OBJECTS = "\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n" +
381
- "• 'recently' (string literal) — auto-query and receive ALL recently received objects.\n" +
382
- " Use this for the common case: \"withdraw everything the object has received.\"\n" +
383
- " Example: receive: 'recently'\n" +
384
- "• ReceivedNormal[] (array) — explicit list of received objects to unwrap.\n" +
385
- " Use this when you want to receive specific objects only (not all).\n" +
386
- " Example: receive: [{id: '0xobj1', type: '0x2::coin::Coin<0x2::sui::SUI>'}]\n" +
387
- "• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n" +
388
- " receive a balance record from a specific Payment/payer.\n" +
389
- " Use this for precise balance targeting (advanced — usually after querying\n" +
390
- " the object's received history via query_received).\n" +
391
- " Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\n" +
392
- "ANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly.";
393
- export const RECEIVE_FORMAT_BLOCK_BALANCE = "\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n" +
394
- "• 'recently' (string literal) — auto-query and receive ALL recently received balance.\n" +
395
- " Use this for the common case: \"deposit all recently received coins into pending balance.\"\n" +
396
- " Example: receive: 'recently'\n" +
397
- "• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n" +
398
- " receive a specific balance record from a Payment/payer.\n" +
399
- " Use this when targeting a specific received balance (advanced).\n" +
400
- " Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\n" +
401
- "ANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly.";
402
- export const QueryReceivedResultSchema = z.object({
403
- result: z.union([
404
- ReceivedBalanceSchema,
405
- z.array(ReceivedNormalSchema),
406
- ]).describe("Received CoinWrapper object record or received other objects array")
407
- }).strict().describe("Query received result");
1
+ import{z}from'zod';import{isValidAddress,ValueType as a271a,ObjectType as a271b,ENTRYPOINT,isValidWowAddress,isValidName,isValidDescription,MAX_DESCRIPTION_LENGTH,isValidLongName,MAX_LONG_NAME_LENGTH}from'@wowok/wowok';const isValidMoveIdentifier=a=>{if(a['length']===0x0)return![];const b=a[0x0];if(b==='_')return a['length']>0x1&&/^[a-zA-Z0-9_]+$/['test'](a['slice'](0x1));if(/^[a-zA-Z]$/['test'](b))return/^[a-zA-Z0-9_]*$/['test'](a['slice'](0x1));return![];};export const DescriptionSchema=z['string']()['refine'](isValidDescription,{'message':'Description\x20string\x20(max\x20'+MAX_DESCRIPTION_LENGTH+'\x20bcs\x20characters)'})['describe']('Description\x20string\x20(max\x20'+MAX_DESCRIPTION_LENGTH+'\x20bcs\x20characters)');export const LongNameSchema=z['string']()['refine'](isValidLongName,{'message':'max\x20'+MAX_LONG_NAME_LENGTH+'\x20bcs\x20characters'});export const WowAddressSchema=z['string']()['refine'](isValidAddress,{'message':'Invalid\x20ID\x20format:\x20must\x20be\x20\x270x\x27\x20prefix\x20followed\x20by\x2064\x20hex\x20characters'})['describe']('Valid\x20ID:\x200x\x20prefix\x20+\x2064\x20hex\x20characters,\x20or\x20builtin\x20ID\x20(0x5-0x9,\x200xa,\x200xc,\x200xd,\x200x403,\x200xaaa,\x200xaab,\x200xacc)');const WOW_TOKEN_TYPE='0x2::wow::WOW';export const TokenTypeSchema=z['string']()['refine'](a=>{if(a===WOW_TOKEN_TYPE)return!![];const b=a['split']('::');if(b['length']!==0x3)return![];const [c,d,e]=b;if(!isValidWowAddress(c))return![];if(!isValidMoveIdentifier(d))return![];if(!isValidMoveIdentifier(e))return![];return!![];},{'message':'Invalid\x20token\x20type\x20format.\x20Expected:\x20{address}::{module}::{struct}\x20where\x20address\x20is\x200x+64hex,\x20module/struct\x20are\x20valid\x20Move\x20identifiers,\x20or\x20\x270x2::wow::WOW\x27'})['describe']('Token\x20type\x20in\x20format:\x20{address}::{module}::{struct}.\x20e.g.\x20\x270x2::wow::WOW\x27\x20(WOW),\x20\x270x...::usdt::USDT\x27\x20(USDT),\x20\x270x...::eth::ETH\x27\x20(ETH).\x20To\x20discover\x20all\x20available\x20tokens\x20and\x20their\x20type\x20tags,\x20query\x20\x27mainnet\x20bridge\x20tokens\x27\x20via\x20wowok_buildin_info\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20here.');export const TokenTypeWithDefaultSchema=TokenTypeSchema['default'](WOW_TOKEN_TYPE)['describe']('Token\x20type\x20in\x20format:\x20{address}::{module}::{struct}.\x20Default:\x20\x270x2::wow::WOW\x27.\x20Other\x20examples:\x20\x270x...::usdt::USDT\x27\x20(USDT),\x20\x270x...::eth::ETH\x27\x20(ETH).\x20To\x20discover\x20all\x20available\x20tokens\x20and\x20their\x20type\x20tags,\x20query\x20\x27mainnet\x20bridge\x20tokens\x27\x20via\x20wowok_buildin_info\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20here.');export const NameSchema=z['string']()['refine'](isValidName,'Name\x20string\x20(max\x2064\x20bcs\x20characters,\x20must\x20not\x20start\x20with\x20\x270x\x27)');export const NotEmptyNameSchema=z['string']()['nonempty']()['refine'](isValidName,'Name\x20string\x20(at\x20least\x201\x20character,\x20max\x20length\x2064\x20bcs\x20characters)');export const NameOrAddressSchema=z['string']()['refine'](a=>{if(isValidAddress(a))return!![];if(isValidName(a))return!![];return![];},{'message':'Invalid\x20ID\x20format:\x20must\x20be\x20\x270x\x27\x20prefix,\x20or\x20a\x20builtin\x20ID\x20(0x5-0x9,\x200xa,\x200xc,\x200xd,\x200x403,\x200xaaa,\x200xaab,\x200xacc)'})['describe']('Account/Object\x20name\x20or\x20ID.\x20If\x20specifying\x20an\x20account,\x20use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20'+'If\x20it\x20starts\x20with\x20\x270x\x27,\x20it\x20will\x20be\x20treated\x20as\x20an\x20ID.\x20'+'Otherwise,\x20it\x20will\x20be\x20treated\x20as\x20a\x20name\x20(max\x2064\x20bcs\x20characters).');export const AccountOrMark_AddressSchema=z['object']({'name_or_address':NameOrAddressSchema['optional'](),'local_mark_first':z['boolean']()['optional']()['describe']('Whether\x20to\x20prioritize\x20local\x20marks,\x20if\x20true,\x20prioritize\x20local\x20marks,\x20otherwise\x20prioritize\x20global\x20marks')})['strict']()['describe']('Account\x20or\x20address\x20lookup\x20object.\x20Use\x20this\x20to\x20specify\x20which\x20account\x20to\x20use\x20for\x20an\x20operation.\x20'+'EXAMPLE:\x20{\x20name_or_address:\x20\x27testor2\x27\x20}\x20-\x20looks\x20up\x20account\x20by\x20name;\x20'+'EXAMPLE:\x20{\x20name_or_address:\x20\x270x1234...\x27\x20}\x20-\x20uses\x20address\x20directly;\x20'+'If\x20name_or_address\x20is\x20empty\x20string\x20\x27\x27,\x20uses\x20the\x20default\x20local\x20account.');export const ManyAccountOrMark_AddressSchema=z['object']({'entities':z['array'](AccountOrMark_AddressSchema),'check_all_founded':z['boolean']()['optional']()['describe']('Whether\x20to\x20check\x20all\x20entities\x20are\x20found,\x20if\x20true,\x20all\x20entities\x20must\x20be\x20found\x20(abort\x20and\x20throw\x20exception\x20if\x20any\x20ID\x20not\x20found);\x20if\x20false,\x20only\x20return\x20found\x20IDs')})['strict']()['describe']('Used\x20to\x20batch\x20find\x20account\x20or\x20object\x20IDs\x20by\x20name');export const AccountOrMark_AddressAISchema=z['union']([NameOrAddressSchema['transform'](a=>({'name_or_address':a,'local_mark_first':!![]}))['describe']('Account\x20name,\x20address\x20(0x...),\x20or\x20mark\x20name.\x20'+'When\x20using\x20string\x20format,\x20local\x20marks\x20are\x20searched\x20first.\x20'+'EXAMPLE:\x20\x27alice\x27\x20-\x20searches\x20local\x20marks\x20first,\x20then\x20global;\x20'+'EXAMPLE:\x20\x270x2...\x27\x20(64\x20hex\x20chars)\x20-\x20uses\x20address\x20directly;\x20'+'EXAMPLE:\x20\x27\x27\x20-\x20uses\x20the\x20default\x20local\x20account'),AccountOrMark_AddressSchema])['describe']('Account\x20or\x20address\x20lookup.\x20Can\x20be\x20a\x20simple\x20string\x20(recommended\x20for\x20AI)\x20'+'or\x20full\x20object\x20with\x20explicit\x20local_mark_first\x20control.\x20'+'String\x20form\x20auto-converts\x20to\x20{\x20name_or_address:\x20<string>,\x20local_mark_first:\x20true\x20}.');export const ManyAccountOrMark_AddressAISchema=z['union']([z['array'](NameOrAddressSchema)['transform'](a=>({'entities':a['map'](b=>({'name_or_address':b,'local_mark_first':!![]})),'check_all_founded':!![]}))['describe']('Array\x20of\x20account\x20names,\x20addresses,\x20or\x20mark\x20names.\x20'+'Local\x20marks\x20are\x20searched\x20first\x20for\x20each\x20entry.\x20'+'EXAMPLE:\x20[\x27alice\x27,\x20\x270x2...\x27,\x20\x27bob\x27]'),ManyAccountOrMark_AddressSchema])['describe']('Batch\x20account\x20or\x20address\x20lookup.\x20Can\x20be\x20an\x20array\x20of\x20strings\x20(recommended\x20for\x20AI)\x20'+'or\x20full\x20object\x20with\x20explicit\x20control.\x20'+'Array\x20form\x20auto-converts\x20to\x20{\x20entities:\x20[...],\x20check_all_founded:\x20true\x20}.');export const ObjectOwnerSchema=z['union']([z['object']({'AddressOwner':z['string']()['describe']('Address\x20owner')})['strict'](),z['object']({'ObjectOwner':z['string']()['describe']('Object\x20owner')})['strict'](),z['object']({'Shared':z['object']({'initial_shared_version':z['union']([z['string'](),z['number']()])['describe']('Version\x20when\x20object\x20became\x20shared')})['strict']()['describe']('Shared\x20object')})['strict'](),z['literal']('Immutable'),z['object']({'ConsensusAddressOwner':z['object']({'owner':z['string']()['describe']('Consensus\x20ID\x20owner'),'start_version':z['union']([z['string'](),z['number']()])['describe']('Version\x20when\x20object\x20recently\x20became\x20consensus\x20object')})['strict']()['describe']('Consensus\x20ID\x20owner')})['strict']()])['describe']('Object\x20owner');const ValueTypeStringNames=['Bool','Address','String','U8','U16','U32','U64','U128','U256','VecBool','VecAddress','VecString','VecU8','VecU16','VecU32','VecU64','VecU128','VecU256','VecVecU8'];export const ValueTypeUserSchema=z['union']([z['literal'](a271a['Bool'])['describe']('Bool\x20(0)'),z['literal'](a271a['Address'])['describe']('Address\x20(1)'),z['literal'](a271a['String'])['describe']('String\x20(2)'),z['literal'](a271a['U8'])['describe']('U8\x20(3)'),z['literal'](a271a['U16'])['describe']('U16\x20(4)'),z['literal'](a271a['U32'])['describe']('U32\x20(5)'),z['literal'](a271a['U64'])['describe']('U64\x20(6)'),z['literal'](a271a['U128'])['describe']('U128\x20(7)'),z['literal'](a271a['U256'])['describe']('U256\x20(8)'),z['literal'](a271a['VecBool'])['describe']('VecBool\x20(9)'),z['literal'](a271a['VecAddress'])['describe']('VecAddress\x20(10)'),z['literal'](a271a['VecString'])['describe']('VecString\x20(11)'),z['literal'](a271a['VecU8'])['describe']('VecU8\x20(12)'),z['literal'](a271a['VecU16'])['describe']('VecU16\x20(13)'),z['literal'](a271a['VecU32'])['describe']('VecU32\x20(14)'),z['literal'](a271a['VecU64'])['describe']('VecU64\x20(15)'),z['literal'](a271a['VecU128'])['describe']('VecU128\x20(16)'),z['literal'](a271a['VecU256'])['describe']('VecU256\x20(17)'),z['literal'](a271a['VecVecU8'])['describe']('VecVecU8\x20(18)'),z['literal']('Bool')['describe']('Bool'),z['literal']('Address')['describe']('Address'),z['literal']('String')['describe']('String'),z['literal']('U8')['describe']('U8'),z['literal']('U16')['describe']('U16'),z['literal']('U32')['describe']('U32'),z['literal']('U64')['describe']('U64'),z['literal']('U128')['describe']('U128'),z['literal']('U256')['describe']('U256'),z['literal']('VecBool')['describe']('VecBool'),z['literal']('VecAddress')['describe']('VecAddress'),z['literal']('VecString')['describe']('VecString'),z['literal']('VecU8')['describe']('VecU8'),z['literal']('VecU16')['describe']('VecU16'),z['literal']('VecU32')['describe']('VecU32'),z['literal']('VecU64')['describe']('VecU64'),z['literal']('VecU128')['describe']('VecU128'),z['literal']('VecU256')['describe']('VecU256'),z['literal']('VecVecU8')['describe']('VecVecU8'),z['literal']('bool')['describe']('bool'),z['literal']('address')['describe']('address'),z['literal']('string')['describe']('string'),z['literal']('u8')['describe']('u8'),z['literal']('u16')['describe']('u16'),z['literal']('u32')['describe']('u32'),z['literal']('u64')['describe']('u64'),z['literal']('u128')['describe']('u128'),z['literal']('u256')['describe']('u256'),z['literal']('vecbool')['describe']('vecbool'),z['literal']('vecaddress')['describe']('vecaddress'),z['literal']('vecstring')['describe']('vecstring'),z['literal']('vecu8')['describe']('vecu8'),z['literal']('vecu16')['describe']('vecu16'),z['literal']('vecu32')['describe']('vecu32'),z['literal']('vecu64')['describe']('vecu64'),z['literal']('vecu128')['describe']('vecu128'),z['literal']('vecu256')['describe']('vecu256'),z['literal']('vecvecu8')['describe']('vecvecu8')])['describe']('User\x20available\x20value\x20type\x20(number\x20or\x20string,\x20e.g.,\x206\x20or\x20\x27U64\x27\x20or\x20\x27u64\x27)');export const ValueTypeSchema=ValueTypeUserSchema['or'](z['literal'](a271a['Value'])['describe']('Value\x20(19)'))['or'](z['literal']('Value')['describe']('Value'))['describe']('Value\x20type\x20(number\x20or\x20string,\x20e.g.,\x206\x20or\x20\x27U64\x27)');export const ObjectTypeSchema=z['enum']([a271b['Permission'],a271b['Repository'],a271b['Arb'],a271b['Arbitration'],a271b['Service'],a271b['Machine'],a271b['Order'],a271b['Progress'],a271b['Payment'],a271b['Treasury'],a271b['Guard'],a271b['Demand'],a271b['Passport'],a271b['Allocation'],a271b['Resource'],a271b['Reward'],a271b['Discount'],a271b['EntityRegistrar'],a271b['EntityLinker'],a271b['Proof'],a271b['WReceivedObject'],a271b['Contact'],a271b['TableItem_ProgressHistory'],a271b['TableItem_PermissionPerm'],a271b['TableItem_DemandPresenter'],a271b['TableItem_MachineNode'],a271b['TableItem_TreasuryHistory'],a271b['TableItem_RepositoryData'],a271b['TableItem_RewardRecord'],a271b['TableItem_EntityLinker'],a271b['TableItem_AddressMark'],a271b['TableItem_EntityRegistrar']])['describe']('Wowok\x20object\x20type');export const BalanceTypeSchema=z['union']([z['number'](),z['string']()])['describe']('A\x20coin/balance\x20amount.\x20Accepts\x20three\x20formats:\x20'+'(1)\x20DISPLAY\x20FORMAT\x20with\x20token\x20symbol:\x20\x222.5WOW\x22,\x20\x2210USDC\x22,\x20\x220.05SUI\x22\x20—\x20'+'auto-converted\x20to\x20smallest\x20units\x20via\x20the\x20Fund\x20Processing\x20Layer\x20(token\x20precision\x20resolved\x20'+'from\x20official\x20registry\x20→\x20cache\x20→\x20on-chain).\x20The\x20symbol\x20MUST\x20match\x20the\x20token\x27s\x20type_parameter.\x20'+'(2)\x20SMALLEST\x20UNIT\x20(numeric\x20string):\x20\x2210000000000\x22\x20—\x20used\x20as-is,\x20no\x20conversion.\x20'+'(3)\x20SMALLEST\x20UNIT\x20(number):\x2010000000000\x20—\x20used\x20as-is\x20(loses\x20precision\x20above\x202^53).\x20'+'PRECISION\x20RULE:\x20for\x20values\x20exceeding\x202^53,\x20ALWAYS\x20use\x20format\x20(1)\x20or\x20(2)\x20—\x20JS\x20numbers\x20lose\x20precision.\x20'+'Default\x20token:\x20WOW\x20(9\x20decimals,\x201\x20WOW\x20=\x2010^9\x20MIST).\x20'+'For\x20custom\x20tokens:\x20use\x20display\x20format\x20with\x20the\x20token\x27s\x20symbol,\x20or\x20pass\x20smallest\x20units\x20directly.\x20'+'MONEY\x20CONFIRMATION:\x20all\x20monetary\x20fields\x20trigger\x20user\x20confirmation\x20via\x20the\x20Fund\x20Processing\x20Layer.\x20'+'If\x20multiple\x20tokens\x20share\x20a\x20symbol\x20(ambiguity),\x20specify\x20the\x20full\x20type\x20string\x20in\x20type_parameter.\x20'+'Examples:\x20\x222.5WOW\x22\x20(display\x20→\x202500000000),\x2010000000000\x20(number,\x20smallest\x20unit),\x20\x2250000000000\x22\x20(string,\x20smallest\x20unit).\x20'+'Used\x20for:\x20Service.sale.price,\x20Service.compensation_fund_add\x20balance,\x20Treasury.deposit,\x20Arbitration.fee,\x20Reward.amount,\x20stock\x20quantities.');export const QueryIdSchema=z['number']()['int']()['min'](0x0)['describe']('Query\x20ID');export const CacheExpireTypeSchema=z['union']([z['number'](),z['literal']('INFINITE')])['describe']('Cache\x20expiration\x20time\x20type');export const ValueContainerSchema=z['lazy'](()=>z['object']({'valueType':ValueTypeSchema['describe']('Value\x20type'),'value':SupportedValueSchema['describe']('Value')})['strict']()['describe']('Value\x20container\x20with\x20type\x20and\x20value'));export const SupportedValueUserSchema=z['union']([z['boolean'](),z['union']([AccountOrMark_AddressSchema,z['string']()]),z['string'](),z['number'](),z['array'](z['boolean']()),z['union']([ManyAccountOrMark_AddressSchema,z['array'](z['string']())]),z['array'](z['string']()),z['array'](z['number']()),z['array'](z['array'](z['number']()))])['describe']('User\x20available\x20supported\x20value\x20type');export const SupportedValueSchema=SupportedValueUserSchema['or'](ValueContainerSchema)['describe']('Supported\x20value\x20type');export const GuardIdentifierSchema=z['number']()['int']()['min'](0x0)['max'](0xff)['describe']('Identifier\x20(0-255)\x20for\x20data\x20lookup\x20in\x20Guard\x20table.');export const GuardTableItemBaseSchema=z['object']({'identifier':GuardIdentifierSchema,'b_submission':z['boolean']()['describe']('Whether\x20this\x20table\x20item\x27s\x20value\x20is\x20submitted\x20dynamically\x20at\x20Guard\x20trigger\x20time\x20(alloc_by_guard\x20call).\x20'+'\x0a\x0a'+'true\x20=\x20value\x20is\x20submitted\x20by\x20the\x20caller\x20when\x20triggering\x20the\x20Guard.\x20'+'Use\x20for\x20runtime-context-dependent\x20values\x20like\x20order\x20address,\x20user\x20address.\x20'+'The\x20\x27value\x27\x20field\x20is\x20ignored\x20when\x20b_submission=true;\x20the\x20caller\x20must\x20provide\x20it\x20via\x20submissions[].\x20'+'\x0a\x0a'+'false\x20=\x20value\x20is\x20static,\x20set\x20at\x20Guard\x20creation\x20time.\x20'+'Use\x20for\x20values\x20known\x20when\x20the\x20Guard\x20is\x20created:\x20expected\x20node\x20names,\x20expected\x20merchant\x20address,\x20expected\x20service\x20address.\x20'+'The\x20\x27value\x27\x20field\x20must\x20be\x20populated\x20and\x20will\x20be\x20stored\x20on-chain\x20permanently.\x20'+'\x0a\x0a'+'Rule\x20of\x20thumb:\x20if\x20the\x20value\x20is\x20the\x20SAME\x20for\x20all\x20future\x20Guard\x20triggers,\x20use\x20false.\x20'+'If\x20the\x20value\x20DIFFERS\x20per\x20trigger\x20(e.g.,\x20which\x20order\x20to\x20release\x20funds\x20for),\x20use\x20true.'),'value_type':ValueTypeUserSchema['describe']('Type\x20of\x20the\x20value\x20stored\x20in\x20`value`.\x20One\x20of:\x20Bool(0),\x20Address(1),\x20String(2),\x20U8(3),\x20U16(4),\x20U32(5),\x20U64(6),\x20U128(7),\x20U256(8),\x20VecBool(9),\x20VecAddress(10),\x20VecString(11),\x20VecU8(12),\x20VecU16(13),\x20VecU32(14),\x20VecU64(15),\x20VecU128(16),\x20VecU256(17),\x20VecVecU8(18).\x20'+'When\x20value_type=Address\x20(1),\x20the\x20`value`\x20field\x20accepts\x20a\x20hex\x20address\x20string,\x20a\x20LocalMark\x20name,\x20or\x20an\x20AccountOrMark_Address\x20object\x20—\x20see\x20`value`\x20field\x20description\x20for\x20details.'),'value':SupportedValueUserSchema['optional']()['describe']('The\x20actual\x20value\x20data.\x20Format\x20depends\x20on\x20`value_type`:\x0a'+'•\x20Bool:\x20true/false\x20(boolean)\x0a'+'•\x20Address\x20(CRITICAL\x20—\x20string\x20\x27Address\x27\x20is\x20NOT\x20a\x20placeholder):\x20a\x20hex\x20address\x20(e.g.\x20\x270x1234...\x27),\x20a\x20LocalMark\x20name\x20(e.g.\x20\x27my-service\x27\x20—\x20resolved\x20to\x20address\x20at\x20evaluation\x20time),\x20an\x20AccountOrMark_Address\x20object\x20(e.g.\x20{name_or_address:\x27my-service\x27}),\x20or\x20system\x20shorthand\x20(\x270xaaa\x27\x20=\x20EntityLinker,\x20\x270xaab\x27\x20=\x20EntityRegistrar).\x20The\x20literal\x20string\x20\x27Address\x27\x20itself\x20is\x20INVALID\x20—\x20it\x20would\x20be\x20treated\x20as\x20a\x20non-existent\x20LocalMark\x20name\x20and\x20fail.\x20Example:\x20value=\x270x2::wow::WOW<address>\x27\x20or\x20value=\x27my-permission\x27.\x0a'+'•\x20String:\x20any\x20string\x0a'+'•\x20U8/U16/U32/U64/U128/U256:\x20number\x20or\x20numeric\x20string\x20(e.g.\x2042\x20or\x20\x2742\x27)\x0a'+'•\x20Vec*\x20types:\x20arrays\x20of\x20the\x20corresponding\x20element\x20type\x0a'+'REQUIRED\x20when\x20b_submission=false.\x20OPTIONAL\x20when\x20b_submission=true\x20(value\x20is\x20supplied\x20at\x20evaluation\x20time\x20by\x20user\x20submission).'),'name':z['string']()['default']('')['describe']('Data\x20name\x20identifier.\x20MAX\x2064\x20BCS\x20characters\x20(Chinese\x20chars\x20count\x20as\x203-4\x20BCS\x20bytes\x20each).\x20'+'Use\x20short\x20identifiers\x20like\x20\x27order_id\x27,\x20\x27delivery_node\x27.\x20'+'Put\x20longer\x20descriptions\x20in\x20the\x20Guard\x27s\x20\x27description\x27\x20field,\x20NOT\x20here.')})['strict']()['describe']('Guard\x20table\x20item\x20(INPUT/CREATION\x20form).\x20DO\x20NOT\x20include\x20`object_type`\x20field\x20—\x20it\x20is\x20query-output\x20only\x20and\x20will\x20be\x20rejected\x20here.');export const GuardTableItemSchema=GuardTableItemBaseSchema['extend']({'object_type':ObjectTypeSchema['optional']()['describe']('OUTPUT-ONLY\x20(query\x20side):\x20Object\x20type\x20when\x20value_type\x20is\x20Address\x20and\x20represents\x20a\x20specific\x20object.\x20Auto-derived\x20by\x20the\x20system\x20—\x20DO\x20NOT\x20set\x20this\x20field\x20at\x20Guard\x20creation.')})['strict']()['describe']('Guard\x20table\x20item\x20(QUERY/OUTPUT\x20form\x20—\x20includes\x20auto-derived\x20object_type\x20field)');export const EntrypointSchema=z['enum']([ENTRYPOINT['Localnet'],ENTRYPOINT['Testnet'],ENTRYPOINT['Mainnet']])['describe']('Network\x20entrypoint:\x20Specifies\x20which\x20network\x20the\x20operation\x20occurs\x20on.\x20'+'FIX-010\x20cross-network\x20note:\x20LocalMark\x20names\x20are\x20scoped\x20per\x20network\x20(testnet\x20marks\x20are\x20invisible\x20on\x20mainnet\x20and\x20vice\x20versa).\x20'+'When\x20migrating\x20from\x20testnet\x20to\x20mainnet,\x20recreate\x20all\x20objects\x20on\x20mainnet\x20and\x20re-register\x20LocalMark\x20names\x20with\x20the\x20SAME\x20names\x20'+'to\x20keep\x20name-based\x20references\x20working\x20across\x20networks.\x20Use\x20project_operation\x20action=\x27clone_project_to_network\x27\x20to\x20clone\x20the\x20'+'project\x20blueprint\x20to\x20the\x20target\x20network,\x20then\x20re-run\x20onchain_operations\x20with\x20env.network=target_network\x20to\x20deploy.');export const FaucetNetworkSchema=z['enum']([ENTRYPOINT['Localnet'],ENTRYPOINT['Testnet']])['describe']('Network\x20entrypoint\x20for\x20Faucet:\x20Specifies\x20which\x20network\x20the\x20operation\x20occurs\x20on');export const ObjectBaseSchema=z['object']({'object':z['string']()['describe']('Object\x20ID'),'type':ObjectTypeSchema['optional']()['describe']('Object\x20type'),'type_raw':z['string']()['optional']()['describe']('Raw\x20object\x20type'),'owner':z['union']([ObjectOwnerSchema,z['null']()])['optional']()['describe']('Object\x20owner'),'version':z['union']([z['string'](),z['number']()])['optional']()['describe']('Object\x20version'),'previousTransaction':z['string']()['optional']()['describe']('Previous\x20transaction\x20ID'),'cache_expire':CacheExpireTypeSchema['optional']()['describe']('Cache\x20expiration\x20time'),'query_name':z['string']()['optional']()['describe']('Original\x20query\x20name\x20or\x20address\x20used\x20to\x20retrieve\x20this\x20object'),'content_raw':z['any']()['optional']()['describe']('Raw\x20content\x20data\x20for\x20unknown\x20object\x20types'),'_guard_node_comments':z['array'](z['object']({'type':z['string'](),'description':z['string']()}))['optional']()['describe']('Additional\x20comments\x20for\x20Guard\x20node\x20instructions')})['passthrough']()['describe']('Object\x20base\x20information');export const QueryEnvSchema=z['object']({'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20cache'),'network':EntrypointSchema['optional']()})['strict']()['describe']('Query\x20environment\x20parameters');export const ReceivedBalanceObjectSchema=z['object']({'id':z['string']()['describe']('Received\x20CoinWrapper\x20object\x20ID'),'balance':BalanceTypeSchema,'payment':z['string']()['describe']('Payment\x20object\x20ID')})['strict']()['describe']('Received\x20CoinWrapper\x20object\x20record');export const CoinWrapperTokenTypeSchema=z['string']()['refine'](a=>{const b=a['match'](/^CoinWrapper<(.+)>$/);if(b){const g=b[0x1];if(g===WOW_TOKEN_TYPE)return!![];const h=g['split']('::');if(h['length']!==0x3)return![];const [i,j,k]=h;if(!isValidWowAddress(i))return![];if(!isValidMoveIdentifier(j))return![];if(!isValidMoveIdentifier(k))return![];return!![];}if(a===WOW_TOKEN_TYPE)return!![];const c=a['split']('::');if(c['length']!==0x3)return![];const [d,e,f]=c;if(!isValidWowAddress(d))return![];if(!isValidMoveIdentifier(e))return![];if(!isValidMoveIdentifier(f))return![];return!![];},{'message':'Invalid\x20token\x20type\x20format.\x20Expected:\x20CoinWrapper<{address}::{module}::{struct}>\x20or\x20{address}::{module}::{struct}.\x20Example:\x20CoinWrapper<0x2::wow::WOW>\x20or\x200x2::wow::WOW'})['describe']('Token\x20type\x20in\x20format:\x20CoinWrapper<{address}::{module}::{struct}>\x20or\x20{address}::{module}::{struct}.\x20Example:\x20CoinWrapper<0x2::wow::WOW>');export const ReceivedBalanceSchema=z['object']({'balance':BalanceTypeSchema,'token_type':CoinWrapperTokenTypeSchema['describe']('Asset\x20type\x20of\x20Coin\x20objects.\x20Supports\x20CoinWrapper<...>\x20format\x20for\x20order\x20receive\x20operations.'),'received':z['array'](ReceivedBalanceObjectSchema)['describe']('Received\x20records\x20of\x20Coin\x20objects')})['strict']()['describe']('Received\x20record\x20of\x20Coin\x20objects');export const ReceivedBalanceOrRecentlySchema=z['union']([ReceivedBalanceSchema,z['literal']('recently')])['describe']('Specified\x20received\x20balance\x20record\x20or\x20all\x20recently\x20received\x20balance\x20record');export const ReceivedNormalSchema=z['object']({'id':z['string']()['nonempty']()['describe']('Received\x20object\x20ID'),'type':z['string']()['nonempty']()['describe']('Object\x20type'),'content_raw':z['any']()['optional']()['describe']('Raw\x20content\x20data')})['strict']()['describe']('Received\x20normal\x20object\x20record');export const ReceivedObjectsOrRecentlySchema=z['union']([z['array'](ReceivedNormalSchema),ReceivedBalanceSchema,z['literal']('recently')])['describe']('Specified\x20received\x20object\x20records\x20or\x20all\x20recently\x20received\x20object\x20records');export const RECEIVE_FORMAT_BLOCK_OBJECTS='\x0a\x0aACCEPTED\x20FORMATS\x20(F-06\x20unified\x20receive\x20operation\x20block):\x0a'+'•\x20\x27recently\x27\x20(string\x20literal)\x20—\x20auto-query\x20and\x20receive\x20ALL\x20recently\x20received\x20objects.\x0a'+'\x20\x20Use\x20this\x20for\x20the\x20common\x20case:\x20\x22withdraw\x20everything\x20the\x20object\x20has\x20received.\x22\x0a'+'\x20\x20Example:\x20receive:\x20\x27recently\x27\x0a'+'•\x20ReceivedNormal[]\x20(array)\x20—\x20explicit\x20list\x20of\x20received\x20objects\x20to\x20unwrap.\x0a'+'\x20\x20Use\x20this\x20when\x20you\x20want\x20to\x20receive\x20specific\x20objects\x20only\x20(not\x20all).\x0a'+'\x20\x20Example:\x20receive:\x20[{id:\x20\x270xobj1\x27,\x20type:\x20\x270x2::coin::Coin<0x2::sui::SUI>\x27}]\x0a'+'•\x20ReceivedBalance\x20({token_type,\x20balance,\x20received:\x20[{id,\x20balance,\x20payment}]})\x20—\x0a'+'\x20\x20receive\x20a\x20balance\x20record\x20from\x20a\x20specific\x20Payment/payer.\x0a'+'\x20\x20Use\x20this\x20for\x20precise\x20balance\x20targeting\x20(advanced\x20—\x20usually\x20after\x20querying\x0a'+'\x20\x20the\x20object\x27s\x20received\x20history\x20via\x20query_received).\x0a'+'\x20\x20Example:\x20receive:\x20{token_type:\x20\x270x2::sui::SUI\x27,\x20balance:\x201000000,\x20received:\x20[{id:\x20\x270xrec1\x27,\x20balance:\x201000000,\x20payment:\x20\x270xpay1\x27}]}\x0a'+'ANTI-PATTERN:\x20do\x20NOT\x20wrap\x20in\x20{result:\x20...}\x20—\x20pass\x20the\x20value\x20directly.';export const RECEIVE_FORMAT_BLOCK_BALANCE='\x0a\x0aACCEPTED\x20FORMATS\x20(F-06\x20unified\x20receive\x20operation\x20block):\x0a'+'•\x20\x27recently\x27\x20(string\x20literal)\x20—\x20auto-query\x20and\x20receive\x20ALL\x20recently\x20received\x20balance.\x0a'+'\x20\x20Use\x20this\x20for\x20the\x20common\x20case:\x20\x22deposit\x20all\x20recently\x20received\x20coins\x20into\x20pending\x20balance.\x22\x0a'+'\x20\x20Example:\x20receive:\x20\x27recently\x27\x0a'+'•\x20ReceivedBalance\x20({token_type,\x20balance,\x20received:\x20[{id,\x20balance,\x20payment}]})\x20—\x0a'+'\x20\x20receive\x20a\x20specific\x20balance\x20record\x20from\x20a\x20Payment/payer.\x0a'+'\x20\x20Use\x20this\x20when\x20targeting\x20a\x20specific\x20received\x20balance\x20(advanced).\x0a'+'\x20\x20Example:\x20receive:\x20{token_type:\x20\x270x2::sui::SUI\x27,\x20balance:\x201000000,\x20received:\x20[{id:\x20\x270xrec1\x27,\x20balance:\x201000000,\x20payment:\x20\x270xpay1\x27}]}\x0a'+'ANTI-PATTERN:\x20do\x20NOT\x20wrap\x20in\x20{result:\x20...}\x20—\x20pass\x20the\x20value\x20directly.';export const QueryReceivedResultSchema=z['object']({'result':z['union']([ReceivedBalanceSchema,z['array'](ReceivedNormalSchema)])['describe']('Received\x20CoinWrapper\x20object\x20record\x20or\x20received\x20other\x20objects\x20array')})['strict']()['describe']('Query\x20received\x20result');
@@ -1,68 +1 @@
1
- import { z } from "zod";
2
- export const ConfigOperationInputSchema = z
3
- .object({
4
- action: z
5
- .enum(["list", "toggle", "enable", "disable", "reset", "info"])
6
- .describe("Config action to perform"),
7
- service: z
8
- .string()
9
- .optional()
10
- .describe("Service name (required for toggle/enable/disable/reset/info)"),
11
- })
12
- .strict();
13
- const ServiceReminder = z
14
- .string()
15
- .optional()
16
- .describe("Human-readable note about the service's behavior or side effects.");
17
- const ServiceField = z.string().describe("Service name that the action applied to.");
18
- const EnabledField = z.boolean().describe("Whether the service is now enabled.");
19
- export const ConfigOperationOutputSchema = z
20
- .object({
21
- result: z.discriminatedUnion("action", [
22
- z.object({
23
- action: z.literal("list"),
24
- services: z
25
- .array(z.object({
26
- name: z.string().describe("Service identifier (e.g. 'harness', 'project')."),
27
- enabled: z.boolean().describe("Whether the service is currently enabled."),
28
- reminder: ServiceReminder,
29
- }))
30
- .describe("List of all runtime services and their current state."),
31
- }),
32
- z.object({
33
- action: z.literal("toggle"),
34
- service: ServiceField,
35
- enabled: EnabledField,
36
- reminder: ServiceReminder,
37
- }),
38
- z.object({
39
- action: z.literal("enable"),
40
- service: ServiceField,
41
- enabled: EnabledField,
42
- reminder: ServiceReminder,
43
- }),
44
- z.object({
45
- action: z.literal("disable"),
46
- service: ServiceField,
47
- enabled: EnabledField,
48
- reminder: ServiceReminder,
49
- }),
50
- z.object({
51
- action: z.literal("reset"),
52
- service: ServiceField,
53
- enabled: z
54
- .boolean()
55
- .optional()
56
- .describe("Post-reset enabled state (reflects default config)."),
57
- reset: z.literal(true).describe("Always true — confirms a reset was performed."),
58
- reminder: ServiceReminder,
59
- }),
60
- z.object({
61
- action: z.literal("info"),
62
- service: ServiceField,
63
- enabled: z.boolean().optional().describe("Whether the service is currently enabled."),
64
- reminder: ServiceReminder,
65
- }).catchall(z.unknown()),
66
- ]).describe("Config result — shape depends on action"),
67
- })
68
- .strict();
1
+ import{z}from'zod';export const ConfigOperationInputSchema=z['object']({'action':z['enum'](['list','toggle','enable','disable','reset','info'])['describe']('Config\x20action\x20to\x20perform'),'service':z['string']()['optional']()['describe']('Service\x20name\x20(required\x20for\x20toggle/enable/disable/reset/info)')})['strict']();const ServiceReminder=z['string']()['optional']()['describe']('Human-readable\x20note\x20about\x20the\x20service\x27s\x20behavior\x20or\x20side\x20effects.'),ServiceField=z['string']()['describe']('Service\x20name\x20that\x20the\x20action\x20applied\x20to.'),EnabledField=z['boolean']()['describe']('Whether\x20the\x20service\x20is\x20now\x20enabled.');export const ConfigOperationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[z['object']({'action':z['literal']('list'),'services':z['array'](z['object']({'name':z['string']()['describe']('Service\x20identifier\x20(e.g.\x20\x27harness\x27,\x20\x27project\x27).'),'enabled':z['boolean']()['describe']('Whether\x20the\x20service\x20is\x20currently\x20enabled.'),'reminder':ServiceReminder}))['describe']('List\x20of\x20all\x20runtime\x20services\x20and\x20their\x20current\x20state.')}),z['object']({'action':z['literal']('toggle'),'service':ServiceField,'enabled':EnabledField,'reminder':ServiceReminder}),z['object']({'action':z['literal']('enable'),'service':ServiceField,'enabled':EnabledField,'reminder':ServiceReminder}),z['object']({'action':z['literal']('disable'),'service':ServiceField,'enabled':EnabledField,'reminder':ServiceReminder}),z['object']({'action':z['literal']('reset'),'service':ServiceField,'enabled':z['boolean']()['optional']()['describe']('Post-reset\x20enabled\x20state\x20(reflects\x20default\x20config).'),'reset':z['literal'](!![])['describe']('Always\x20true\x20—\x20confirms\x20a\x20reset\x20was\x20performed.'),'reminder':ServiceReminder}),z['object']({'action':z['literal']('info'),'service':ServiceField,'enabled':z['boolean']()['optional']()['describe']('Whether\x20the\x20service\x20is\x20currently\x20enabled.'),'reminder':ServiceReminder})['catchall'](z['unknown']())])['describe']('Config\x20result\x20—\x20shape\x20depends\x20on\x20action')})['strict']();