@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,193 +1 @@
1
- import { z } from 'zod';
2
- import { WithPermissionObjectSchema, NamedObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema, } from './base.js';
3
- import { MachineNodeSchema, MachineForwardSchema } from '../query/index.js';
4
- import { ManyAccountOrMark_AddressSchema, NameOrAddressSchema, NameSchema, NotEmptyNameSchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from '../common/index.js';
5
- function validateEntryForward(nodes) {
6
- for (const node of nodes) {
7
- if (!node.pairs)
8
- continue;
9
- for (const pair of node.pairs) {
10
- if (pair.prev_node === "") {
11
- return true;
12
- }
13
- }
14
- }
15
- return false;
16
- }
17
- const ENTRY_FORWARD_ERROR_MESSAGE = "Machine has no entry forward. At least one node must have a pair with prev_node=\"\" (empty string), " +
18
- "which defines how Progress advances from the initial state (current=\"\") to the first node. " +
19
- "Without an entry forward, the workflow will be permanently stuck. " +
20
- "Example: {name: 'Subscribed', pairs: [{prev_node: '', forwards: [{name: 'Subscribe', weight: 1}]}]}";
21
- export const ProgressNamedOperatorSchema = z.object({
22
- op: z.union([z.literal('add'), z.literal('set'), z.literal('remove')]),
23
- name: NotEmptyNameSchema,
24
- operators: ManyAccountOrMark_AddressSchema,
25
- }).strict();
26
- export const ProgressNewSchema = z.object({
27
- task: z.union([NameOrAddressSchema, z.null()]).optional().describe('Task bound to the Progress object. It is an object ID or name'),
28
- repository: ObjectsSchema.optional().describe('Set repository list for the Progress object. Used for consensus data management.'),
29
- progress_namedOperator: ProgressNamedOperatorSchema.optional().describe('Add, set, and remove operators for the permission namespace of the Progress object.'),
30
- namedNew: NamedObjectSchema.optional(),
31
- }).strict();
32
- export const NodeAddForwardDataSchema = z.object({
33
- prior_node_name: NameSchema.describe('Name of the previous node.'),
34
- node_name: NameSchema.describe('Name of the next node.'),
35
- forward: z.array(MachineForwardSchema).describe('List of operations between the previous and next nodes.'),
36
- threshold: z.union([z.number().int().min(0), z.null()]).optional().describe('Threshold of operations that need to be completed to migrate from the previous node to the next node.'),
37
- }).strict();
38
- export const NodeRemoveForwardDataSchema = z.object({
39
- prior_node_name: NameSchema.describe('Name of the previous node.'),
40
- node_name: NameSchema.describe('Name of the next node.'),
41
- forward_name: z.array(NameSchema).describe('List of operation names to delete.'),
42
- }).strict();
43
- export const NodeRemovePriorNodeDataSchema = z.object({
44
- prior_node_name: z.array(NameSchema).describe('List of previous node names to delete.'),
45
- node_name: NameSchema.describe('Name of the next node.'),
46
- }).strict();
47
- export const NodeSchema = z.discriminatedUnion('op', [
48
- z.object({
49
- op: z.literal('add'),
50
- nodes: z.array(MachineNodeSchema).describe('List of nodes to add or set.'),
51
- bReplace: z.boolean().optional().describe('Whether to replace existing nodes. If true, existing nodes will be replaced; if false, nodes will be added by merging.'),
52
- }).strict().describe('Add nodes.'),
53
- z.object({
54
- op: z.literal('set'),
55
- nodes: z.array(MachineNodeSchema).describe('List of nodes to add or set.'),
56
- bReplace: z.boolean().optional().describe('Whether to replace existing nodes. If true, existing nodes will be replaced; if false, nodes will be added by merging.'),
57
- }).strict().describe('Set nodes.'),
58
- z.object({
59
- op: z.literal('remove'),
60
- nodes: z.array(NameSchema).describe('List of node names to delete.'),
61
- }).strict().describe('Delete nodes.'),
62
- z.object({
63
- op: z.literal('clear'),
64
- }).strict().describe('Clear all nodes.'),
65
- z.object({
66
- op: z.literal('exchange'),
67
- node_one: NameSchema.describe('Name of the first node.'),
68
- node_other: NameSchema.describe('Name of the second node.'),
69
- }).strict().describe('Exchange the positions of two nodes.'),
70
- z.object({
71
- op: z.literal('rename'),
72
- node_name_old: NameSchema.describe('Name of thenode.'),
73
- node_name_new: NameSchema.describe('New name of the node.'),
74
- }).strict().describe('Rename node.'),
75
- z.object({
76
- op: z.literal('remove prior node'),
77
- pairs: z.array(NodeRemovePriorNodeDataSchema).describe('List of previous-next node pairs to delete.'),
78
- }).strict().describe('Delete previous-next node pairs.'),
79
- z.object({
80
- op: z.literal('add forward'),
81
- data: z.array(NodeAddForwardDataSchema).describe('List of operations to add.'),
82
- }).strict().describe('Add operations.'),
83
- z.object({
84
- op: z.literal('remove forward'),
85
- data: z.array(NodeRemoveForwardDataSchema).describe('List of operations to delete.'),
86
- }).strict().describe('Delete operations.'),
87
- ])
88
- .superRefine((data, ctx) => {
89
- if ((data.op === 'add' || data.op === 'set') && data.bReplace === true) {
90
- if (!validateEntryForward(data.nodes)) {
91
- ctx.addIssue({
92
- code: z.ZodIssueCode.custom,
93
- message: ENTRY_FORWARD_ERROR_MESSAGE,
94
- });
95
- }
96
- }
97
- });
98
- export const NodeJsonOrMarkdownFileSchema = z.object({
99
- json_or_markdown_file: z.string().describe(`Path to a JSON or Markdown file containing node array for COMPLETE REPLACEMENT of all nodes.
100
-
101
- **File Format Requirements:**
102
- - Must contain a JSON ARRAY of node objects: [{"name": "...", "pairs": [...]}, {...}]
103
- - NOT an operation object with "op" field (use NodeSchema for operations)
104
- - Supports JSON or Markdown (with \`\`\`json code blocks)
105
-
106
- **Node Structure:**
107
- Each node is a directed graph element representing workflow states and transitions:
108
- - name: Node identifier
109
- - pairs: Array of {prior_node, forwards, threshold} defining connections
110
- - forwards: Operations available from this node
111
- - threshold: Required weight to advance
112
-
113
- **Behavior:**
114
- - COMPLETELY REPLACES all existing nodes (equivalent to "set" with bReplace=true)
115
- - Auto-detects format based on file content
116
- - If parsing fails, error includes line number and column information`),
117
- }).strict();
118
- export const NodeFieldSchema = z.union([
119
- NodeSchema,
120
- NodeJsonOrMarkdownFileSchema,
121
- ]);
122
- export const CallMachine_DataSchema = z.object({
123
- object: WithPermissionObjectSchema,
124
- progress_new: ProgressNewSchema.optional().describe('Generate new Progress object.'),
125
- description: z.string().optional().describe('Description of the object.'),
126
- repository: ObjectsSchema.optional().describe('Set repository list for the object. Used for consensus data management.'),
127
- node: NodeFieldSchema.optional().describe(`CRITICAL: Choose ONE of two mutually exclusive modes:
128
-
129
- **Mode 1: NodeSchema (incremental operations)**
130
- Use for partial modifications: add, set, remove, clear, exchange, rename, remove prior node, add forward, remove forward.
131
- Format: { "op": "add", "nodes": [...], "bReplace": false }
132
- This mode modifies existing nodes incrementally.
133
-
134
- **Mode 2: NodeJsonOrMarkdownFileSchema (complete replacement)**
135
- Use for complete node redefinition from file.
136
- Format: { "json_or_markdown_file": "/path/to/nodes.json" }
137
- IMPORTANT: This COMPLETELY REPLACES all existing nodes. File must contain node array [{...}, {...}], NOT an operation object with "op" field.
138
- Supported formats: JSON array or Markdown with code blocks.
139
- If parsing fails, error includes line number and column information.`),
140
- pause: z.boolean().optional().describe('Whether to pause generating new Progress objects.'),
141
- publish: z.boolean().optional().describe('Whether to publish the object. After the object is published, new Progress objects can be generated; and node settings will no longer be changeable.'),
142
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this Machine object and send them to the owner of its Permission object.' + RECEIVE_FORMAT_BLOCK_OBJECTS),
143
- um: z.union([NameOrAddressSchema, z.null()]).optional().describe('Contact object ID or name.'),
144
- }).strict()
145
- .refine((data) => {
146
- if (data.publish !== true)
147
- return true;
148
- if (!data.node)
149
- return true;
150
- if ('json_or_markdown_file' in data.node)
151
- return true;
152
- if ('nodes' in data.node && Array.isArray(data.node.nodes)) {
153
- const isCreatingNew = typeof data.object === 'object' && data.object !== null;
154
- const isReplace = data.node.bReplace === true;
155
- if (isCreatingNew || isReplace) {
156
- const nodes = data.node.nodes;
157
- if (Array.isArray(nodes) && nodes.length > 0 && typeof nodes[0] === 'object') {
158
- return validateEntryForward(nodes);
159
- }
160
- }
161
- }
162
- return true;
163
- }, { message: ENTRY_FORWARD_ERROR_MESSAGE })
164
- .describe("On-chain Machine operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Machine. 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.");
165
- export const CallMachine_InputSchema = z.object({
166
- data: CallMachine_DataSchema,
167
- env: CallEnvSchema.optional(),
168
- submission: SubmissionCallSchema.optional(),
169
- }).strict();
170
- export const MachineNode2File_InputSchema = z.object({
171
- machine: NameOrAddressSchema.describe("Machine object ID or name to export"),
172
- file_path: z.string().describe("Output file path (absolute or relative)"),
173
- format: z.enum(["json", "markdown"]).optional().default("json").describe("Output format: 'json' (default) or 'markdown'"),
174
- env: CallEnvSchema.optional(),
175
- }).strict().describe("Query a Machine object from the blockchain and export its node definition to a JSON or Markdown file. The exported file can be edited and used to create new Machine objects.");
176
- export const MachineNode2File_OutputSchema = z.discriminatedUnion("status", [
177
- z.object({
178
- status: z.literal("success"),
179
- data: z.object({
180
- file_path: z.string().describe("Absolute path of the exported file"),
181
- format: z.enum(["json", "markdown"]).describe("Export format"),
182
- machine_object: NameOrAddressSchema.describe("Machine object ID"),
183
- node_count: z.number().describe("Number of nodes exported"),
184
- }).strict().describe("Success result data"),
185
- }).strict(),
186
- z.object({
187
- status: z.literal("error"),
188
- error: z.string().describe("Error message"),
189
- }).strict(),
190
- ]).describe("MachineNode2File operation output");
191
- export const MachineNode2File_OutputWrappedSchema = z.object({
192
- result: MachineNode2File_OutputSchema,
193
- }).strict().describe("MachineNode2File operation output wrapped schema");
1
+ import{z}from'zod';import{WithPermissionObjectSchema,NamedObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{MachineNodeSchema,MachineForwardSchema}from'../query/index.js';import{ManyAccountOrMark_AddressSchema,NameOrAddressSchema,NameSchema,NotEmptyNameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';function validateEntryForward(a){for(const b of a){if(!b['pairs'])continue;for(const c of b['pairs']){if(c['prev_node']==='')return!![];}}return![];}const ENTRY_FORWARD_ERROR_MESSAGE='Machine\x20has\x20no\x20entry\x20forward.\x20At\x20least\x20one\x20node\x20must\x20have\x20a\x20pair\x20with\x20prev_node=\x22\x22\x20(empty\x20string),\x20'+'which\x20defines\x20how\x20Progress\x20advances\x20from\x20the\x20initial\x20state\x20(current=\x22\x22)\x20to\x20the\x20first\x20node.\x20'+'Without\x20an\x20entry\x20forward,\x20the\x20workflow\x20will\x20be\x20permanently\x20stuck.\x20'+'Example:\x20{name:\x20\x27Subscribed\x27,\x20pairs:\x20[{prev_node:\x20\x27\x27,\x20forwards:\x20[{name:\x20\x27Subscribe\x27,\x20weight:\x201}]}]}';export const ProgressNamedOperatorSchema=z['object']({'op':z['union']([z['literal']('add'),z['literal']('set'),z['literal']('remove')]),'name':NotEmptyNameSchema,'operators':ManyAccountOrMark_AddressSchema})['strict']();export const ProgressNewSchema=z['object']({'task':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Task\x20bound\x20to\x20the\x20Progress\x20object.\x20It\x20is\x20an\x20object\x20ID\x20or\x20name'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20Progress\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Add,\x20set,\x20and\x20remove\x20operators\x20for\x20the\x20permission\x20namespace\x20of\x20the\x20Progress\x20object.'),'namedNew':NamedObjectSchema['optional']()})['strict']();export const NodeAddForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward':z['array'](MachineForwardSchema)['describe']('List\x20of\x20operations\x20between\x20the\x20previous\x20and\x20next\x20nodes.'),'threshold':z['union']([z['number']()['int']()['min'](0x0),z['null']()])['optional']()['describe']('Threshold\x20of\x20operations\x20that\x20need\x20to\x20be\x20completed\x20to\x20migrate\x20from\x20the\x20previous\x20node\x20to\x20the\x20next\x20node.')})['strict']();export const NodeRemoveForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward_name':z['array'](NameSchema)['describe']('List\x20of\x20operation\x20names\x20to\x20delete.')})['strict']();export const NodeRemovePriorNodeDataSchema=z['object']({'prior_node_name':z['array'](NameSchema)['describe']('List\x20of\x20previous\x20node\x20names\x20to\x20delete.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.')})['strict']();export const NodeSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Add\x20nodes.'),z['object']({'op':z['literal']('set'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Set\x20nodes.'),z['object']({'op':z['literal']('remove'),'nodes':z['array'](NameSchema)['describe']('List\x20of\x20node\x20names\x20to\x20delete.')})['strict']()['describe']('Delete\x20nodes.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20nodes.'),z['object']({'op':z['literal']('exchange'),'node_one':NameSchema['describe']('Name\x20of\x20the\x20first\x20node.'),'node_other':NameSchema['describe']('Name\x20of\x20the\x20second\x20node.')})['strict']()['describe']('Exchange\x20the\x20positions\x20of\x20two\x20nodes.'),z['object']({'op':z['literal']('rename'),'node_name_old':NameSchema['describe']('Name\x20of\x20thenode.'),'node_name_new':NameSchema['describe']('New\x20name\x20of\x20the\x20node.')})['strict']()['describe']('Rename\x20node.'),z['object']({'op':z['literal']('remove\x20prior\x20node'),'pairs':z['array'](NodeRemovePriorNodeDataSchema)['describe']('List\x20of\x20previous-next\x20node\x20pairs\x20to\x20delete.')})['strict']()['describe']('Delete\x20previous-next\x20node\x20pairs.'),z['object']({'op':z['literal']('add\x20forward'),'data':z['array'](NodeAddForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20add.')})['strict']()['describe']('Add\x20operations.'),z['object']({'op':z['literal']('remove\x20forward'),'data':z['array'](NodeRemoveForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20delete.')})['strict']()['describe']('Delete\x20operations.')])['superRefine']((a,b)=>{(a['op']==='add'||a['op']==='set')&&a['bReplace']===!![]&&(!validateEntryForward(a['nodes'])&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':ENTRY_FORWARD_ERROR_MESSAGE}));});export const NodeJsonOrMarkdownFileSchema=z['object']({'json_or_markdown_file':z['string']()['describe']('Path\x20to\x20a\x20JSON\x20or\x20Markdown\x20file\x20containing\x20node\x20array\x20for\x20COMPLETE\x20REPLACEMENT\x20of\x20all\x20nodes.\x0a\x0a**File\x20Format\x20Requirements:**\x0a-\x20Must\x20contain\x20a\x20JSON\x20ARRAY\x20of\x20node\x20objects:\x20[{\x22name\x22:\x20\x22...\x22,\x20\x22pairs\x22:\x20[...]},\x20{...}]\x0a-\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field\x20(use\x20NodeSchema\x20for\x20operations)\x0a-\x20Supports\x20JSON\x20or\x20Markdown\x20(with\x20```json\x20code\x20blocks)\x0a\x0a**Node\x20Structure:**\x0aEach\x20node\x20is\x20a\x20directed\x20graph\x20element\x20representing\x20workflow\x20states\x20and\x20transitions:\x0a-\x20name:\x20Node\x20identifier\x0a-\x20pairs:\x20Array\x20of\x20{prior_node,\x20forwards,\x20threshold}\x20defining\x20connections\x0a-\x20forwards:\x20Operations\x20available\x20from\x20this\x20node\x0a-\x20threshold:\x20Required\x20weight\x20to\x20advance\x0a\x0a**Behavior:**\x0a-\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes\x20(equivalent\x20to\x20\x22set\x22\x20with\x20bReplace=true)\x0a-\x20Auto-detects\x20format\x20based\x20on\x20file\x20content\x0a-\x20If\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information')})['strict']();export const NodeFieldSchema=z['union']([NodeSchema,NodeJsonOrMarkdownFileSchema]);export const CallMachine_DataSchema=z['object']({'object':WithPermissionObjectSchema,'progress_new':ProgressNewSchema['optional']()['describe']('Generate\x20new\x20Progress\x20object.'),'description':z['string']()['optional']()['describe']('Description\x20of\x20the\x20object.'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'node':NodeFieldSchema['optional']()['describe']('CRITICAL:\x20Choose\x20ONE\x20of\x20two\x20mutually\x20exclusive\x20modes:\x0a\x0a**Mode\x201:\x20NodeSchema\x20(incremental\x20operations)**\x0aUse\x20for\x20partial\x20modifications:\x20add,\x20set,\x20remove,\x20clear,\x20exchange,\x20rename,\x20remove\x20prior\x20node,\x20add\x20forward,\x20remove\x20forward.\x0aFormat:\x20{\x20\x22op\x22:\x20\x22add\x22,\x20\x22nodes\x22:\x20[...],\x20\x22bReplace\x22:\x20false\x20}\x0aThis\x20mode\x20modifies\x20existing\x20nodes\x20incrementally.\x0a\x0a**Mode\x202:\x20NodeJsonOrMarkdownFileSchema\x20(complete\x20replacement)**\x0aUse\x20for\x20complete\x20node\x20redefinition\x20from\x20file.\x0aFormat:\x20{\x20\x22json_or_markdown_file\x22:\x20\x22/path/to/nodes.json\x22\x20}\x0aIMPORTANT:\x20This\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes.\x20File\x20must\x20contain\x20node\x20array\x20[{...},\x20{...}],\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field.\x0aSupported\x20formats:\x20JSON\x20array\x20or\x20Markdown\x20with\x20code\x20blocks.\x0aIf\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20generating\x20new\x20Progress\x20objects.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['refine'](a=>{if(a['publish']!==!![])return!![];if(!a['node'])return!![];if('json_or_markdown_file'in a['node'])return!![];if('nodes'in a['node']&&Array['isArray'](a['node']['nodes'])){const b=typeof a['object']==='object'&&a['object']!==null,c=a['node']['bReplace']===!![];if(b||c){const d=a['node']['nodes'];if(Array['isArray'](d)&&d['length']>0x0&&typeof d[0x0]==='object')return validateEntryForward(d);}}return!![];},{'message':ENTRY_FORWARD_ERROR_MESSAGE})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\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 CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative)'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Machine\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20node\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Machine\x20objects.');export const MachineNode2File_OutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':z['object']({'file_path':z['string']()['describe']('Absolute\x20path\x20of\x20the\x20exported\x20file'),'format':z['enum'](['json','markdown'])['describe']('Export\x20format'),'machine_object':NameOrAddressSchema['describe']('Machine\x20object\x20ID'),'node_count':z['number']()['describe']('Number\x20of\x20nodes\x20exported')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('MachineNode2File\x20operation\x20output');export const MachineNode2File_OutputWrappedSchema=z['object']({'result':MachineNode2File_OutputSchema})['strict']()['describe']('MachineNode2File\x20operation\x20output\x20wrapped\x20schema');
@@ -1,35 +1 @@
1
- import { z } from "zod";
2
- import { CallEnvSchema, SubmissionCallSchema } from "./base.js";
3
- import { OperateSchema } from "./progress.js";
4
- import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from "../common/index.js";
5
- export const ArbConfirmSchema = z.object({
6
- arb: NameOrAddressSchema.describe("Arb object ID or name."),
7
- confirm: z.boolean().describe("Whether to confirm that the submitted arbitration materials are valid for arbitration."),
8
- description: DescriptionSchema.optional().describe("Message description for compensation application."),
9
- proposition: z.array(LongNameSchema).optional().describe("Compensation claims.")
10
- }).strict();
11
- export const ArbObjectionSchema = z.object({
12
- arb: NameOrAddressSchema.describe("Arb object ID or name."),
13
- objection: DescriptionSchema.describe("Oppose and appeal the arbitration result, request re-arbitration"),
14
- }).strict();
15
- export const ArbClaimCompensationSchema = z.object({
16
- arb: NameOrAddressSchema.describe("Arb object ID or name."),
17
- }).strict();
18
- export const CallOrder_DataSchema = z.object({
19
- object: NameOrAddressSchema.describe("Order object ID or name."),
20
- agent: ManyAccountOrMark_AddressSchema.optional().describe("Order agent. Agents can operate the order, such as canceling the order, modifying the order status, etc.; but cannot receive the funds received by the order."),
21
- required_info: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID (recipient) or WTS Proof object (delivery proof) that information has been delivered via Wowok Messenger."),
22
- progress: OperateSchema.optional().describe("Advance order process"),
23
- arb_confirm: ArbConfirmSchema.optional().describe("Submit compensation request and apply for arbitration"),
24
- arb_objection: ArbObjectionSchema.optional().describe("Oppose and appeal the arbitration result, request re-arbitration."),
25
- arb_claim_compensation: ArbClaimCompensationSchema.optional().describe("Specify the adjudicated Arb object to obtain order compensation."),
26
- receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects or other objects received by the order and transfer them to the order owner. " +
27
- "Consistent with `owner_receive` on other objects (arbitration/contact/demand/machine/permission/repository/reward/service/treasury)." +
28
- RECEIVE_FORMAT_BLOCK_OBJECTS),
29
- transfer_to: AccountOrMark_AddressSchema.optional().describe("Set new owner of the order. Requires order owner permission to set."),
30
- }).strict().describe("On-chain, operate on an Order object.");
31
- export const CallOrder_InputSchema = z.object({
32
- data: CallOrder_DataSchema,
33
- env: CallEnvSchema.optional(),
34
- submission: SubmissionCallSchema.optional(),
35
- }).strict();
1
+ import{z}from'zod';import{CallEnvSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agent':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agent.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20(recipient)\x20or\x20WTS\x20Proof\x20object\x20(delivery\x20proof)\x20that\x20information\x20has\x20been\x20delivered\x20via\x20Wowok\x20Messenger.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('Submit\x20compensation\x20request\x20and\x20apply\x20for\x20arbitration'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.'),'receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner.\x20'+'Consistent\x20with\x20`owner_receive`\x20on\x20other\x20objects\x20(arbitration/contact/demand/machine/permission/repository/reward/service/treasury).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -1,37 +1 @@
1
- import { z } from "zod";
2
- import { PaymentInfoSchema } from "../query/index.js";
3
- import { CoinParamSchema, CallEnvSchema, TypeNamedObjectSchema } from "./base.js";
4
- import { AccountOrMark_AddressSchema, NameOrAddressSchema } from "../common/index.js";
5
- export const RevenueSchema = z.object({
6
- recipient: AccountOrMark_AddressSchema,
7
- amount: CoinParamSchema
8
- }).strict().describe("Payment recipient and amount");
9
- export const CallPayment_CreateSchema = z.object({
10
- object: TypeNamedObjectSchema,
11
- revenue: z.array(RevenueSchema).describe("Array of payment recipients and amounts"),
12
- info: PaymentInfoSchema
13
- }).strict().describe("Create a new Payment. USAGE: Set 'object' field with {name, type, ...} to create a named Payment. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. Payment is an immutable object - it can only be created, not modified. The 'object' field is CRITICAL and REQUIRED.");
14
- export const CallPayment_ReceiveSchema = z.object({
15
- object: NameOrAddressSchema.describe("CoinWrapper object ID (0x...) or local name to unwrap. " +
16
- "Find received CoinWrappers via query_toolkit with query_type='onchain_received'."),
17
- receive: z.literal(true).describe("Set to true to activate receive mode. " +
18
- "CoinWrapper objects ARE transferred to recipients via transfer::public_transfer (they arrive as owned objects), " +
19
- "but they are NOT spendable coins. This mode unwraps a CoinWrapper into actual coins in your wallet " +
20
- "via payment::unwrap_to_myself. The caller must be the CoinWrapper's owner (the recipient " +
21
- "specified in the Allocation's revenue split)."),
22
- type_parameter: z.string().optional().describe("Coin type of the CoinWrapper, e.g. '0x2::wow::WOW'. " +
23
- "OPTIONAL: when omitted it is auto-derived from the CoinWrapper's own on-chain type " +
24
- "(the inner T of `CoinWrapper<T>`), so {object, receive:true} alone unwraps to spendable coins. " +
25
- "Only provide it explicitly when auto-derivation fails."),
26
- }).strict().describe("Receive mode: unwrap a CoinWrapper to the caller's wallet. Use after Allocation's alloc_by_guard creates a Payment with your address as a revenue recipient. The CoinWrapper holds your share — call this to convert it to actual coins in your wallet.");
27
- export const CallPayment_DataSchema = z.union([
28
- CallPayment_CreateSchema,
29
- CallPayment_ReceiveSchema,
30
- ]).describe("On-chain Payment operations. TWO modes:\n" +
31
- "(1) CREATE: Set 'object' with {name, type_parameter, ...}, 'revenue', and 'info' to create a new Payment.\n" +
32
- "(2) RECEIVE: Set {object: '<coinwrapper_id_or_name>', receive: true} to unwrap a CoinWrapper to your wallet (type_parameter optional — auto-derived from the CoinWrapper's type).\n" +
33
- "The 'object' field is CRITICAL and REQUIRED in both modes. STRING for receive (CoinWrapper ID/name), OBJECT for create.");
34
- export const CallPayment_InputSchema = z.object({
35
- data: CallPayment_DataSchema,
36
- env: CallEnvSchema.optional(),
37
- }).strict();
1
+ import{z}from'zod';import{PaymentInfoSchema}from'../query/index.js';import{CoinParamSchema,CallEnvSchema,TypeNamedObjectSchema}from'./base.js';import{AccountOrMark_AddressSchema,NameOrAddressSchema}from'../common/index.js';export const RevenueSchema=z['object']({'recipient':AccountOrMark_AddressSchema,'amount':CoinParamSchema})['strict']()['describe']('Payment\x20recipient\x20and\x20amount');export const CallPayment_CreateSchema=z['object']({'object':TypeNamedObjectSchema,'revenue':z['array'](RevenueSchema)['describe']('Array\x20of\x20payment\x20recipients\x20and\x20amounts'),'info':PaymentInfoSchema})['strict']()['describe']('Create\x20a\x20new\x20Payment.\x20USAGE:\x20Set\x20\x27object\x27\x20field\x20with\x20{name,\x20type,\x20...}\x20to\x20create\x20a\x20named\x20Payment.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20Payment\x20is\x20an\x20immutable\x20object\x20-\x20it\x20can\x20only\x20be\x20created,\x20not\x20modified.\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED.');export const CallPayment_ReceiveSchema=z['object']({'object':NameOrAddressSchema['describe']('CoinWrapper\x20object\x20ID\x20(0x...)\x20or\x20local\x20name\x20to\x20unwrap.\x20'+'Find\x20received\x20CoinWrappers\x20via\x20query_toolkit\x20with\x20query_type=\x27onchain_received\x27.'),'receive':z['literal'](!![])['describe']('Set\x20to\x20true\x20to\x20activate\x20receive\x20mode.\x20'+'CoinWrapper\x20objects\x20ARE\x20transferred\x20to\x20recipients\x20via\x20transfer::public_transfer\x20(they\x20arrive\x20as\x20owned\x20objects),\x20'+'but\x20they\x20are\x20NOT\x20spendable\x20coins.\x20This\x20mode\x20unwraps\x20a\x20CoinWrapper\x20into\x20actual\x20coins\x20in\x20your\x20wallet\x20'+'via\x20payment::unwrap_to_myself.\x20The\x20caller\x20must\x20be\x20the\x20CoinWrapper\x27s\x20owner\x20(the\x20recipient\x20'+'specified\x20in\x20the\x20Allocation\x27s\x20revenue\x20split).'),'type_parameter':z['string']()['optional']()['describe']('Coin\x20type\x20of\x20the\x20CoinWrapper,\x20e.g.\x20\x270x2::wow::WOW\x27.\x20'+'OPTIONAL:\x20when\x20omitted\x20it\x20is\x20auto-derived\x20from\x20the\x20CoinWrapper\x27s\x20own\x20on-chain\x20type\x20'+'(the\x20inner\x20T\x20of\x20`CoinWrapper<T>`),\x20so\x20{object,\x20receive:true}\x20alone\x20unwraps\x20to\x20spendable\x20coins.\x20'+'Only\x20provide\x20it\x20explicitly\x20when\x20auto-derivation\x20fails.')})['strict']()['describe']('Receive\x20mode:\x20unwrap\x20a\x20CoinWrapper\x20to\x20the\x20caller\x27s\x20wallet.\x20Use\x20after\x20Allocation\x27s\x20alloc_by_guard\x20creates\x20a\x20Payment\x20with\x20your\x20address\x20as\x20a\x20revenue\x20recipient.\x20The\x20CoinWrapper\x20holds\x20your\x20share\x20—\x20call\x20this\x20to\x20convert\x20it\x20to\x20actual\x20coins\x20in\x20your\x20wallet.');export const CallPayment_DataSchema=z['union']([CallPayment_CreateSchema,CallPayment_ReceiveSchema])['describe']('On-chain\x20Payment\x20operations.\x20TWO\x20modes:\x0a'+'(1)\x20CREATE:\x20Set\x20\x27object\x27\x20with\x20{name,\x20type_parameter,\x20...},\x20\x27revenue\x27,\x20and\x20\x27info\x27\x20to\x20create\x20a\x20new\x20Payment.\x0a'+'(2)\x20RECEIVE:\x20Set\x20{object:\x20\x27<coinwrapper_id_or_name>\x27,\x20receive:\x20true}\x20to\x20unwrap\x20a\x20CoinWrapper\x20to\x20your\x20wallet\x20(type_parameter\x20optional\x20—\x20auto-derived\x20from\x20the\x20CoinWrapper\x27s\x20type).\x0a'+'The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20modes.\x20STRING\x20for\x20receive\x20(CoinWrapper\x20ID/name),\x20OBJECT\x20for\x20create.');export const CallPayment_InputSchema=z['object']({'data':CallPayment_DataSchema,'env':CallEnvSchema['optional']()})['strict']();
@@ -1,54 +1 @@
1
- import { CallPermission } from "@wowok/wowok";
2
- import { handleCallResult } from "./handler.js";
3
- import { isValidPermissionIndex } from "../utils/permission-index-utils.js";
4
- function validatePermissionIndexes(data) {
5
- const collected = [];
6
- if (data.table) {
7
- const table = data.table;
8
- switch (table.op) {
9
- case "add perm by index":
10
- case "set perm by index":
11
- case "remove perm by index":
12
- collected.push({ index: table.index, path: `table.${table.op}.index` });
13
- break;
14
- case "add perm by entity":
15
- case "set perm by entity":
16
- case "remove perm by entity":
17
- for (let i = 0; i < table.index.length; i++) {
18
- collected.push({
19
- index: table.index[i],
20
- path: `table.${table.op}.index[${i}]`,
21
- });
22
- }
23
- break;
24
- }
25
- }
26
- if (data.remark && (data.remark.op === "set" || data.remark.op === "remove")) {
27
- collected.push({ index: data.remark.index, path: `remark.${data.remark.op}.index` });
28
- }
29
- for (const { index, path } of collected) {
30
- if (!isValidPermissionIndex(index)) {
31
- throw new Error(`Invalid permission index ${index} at '${path}'. ` +
32
- `Builtin indexes must be valid BuiltinPermissionIndex values; ` +
33
- `user-defined indexes must be in [1000, 65535].`);
34
- }
35
- }
36
- }
37
- function validateEntityOps(data) {
38
- if (!data.entity)
39
- return;
40
- const e = data.entity;
41
- if (e.op === "swap" || e.op === "replace" || e.op === "copy") {
42
- if (e.entity1 === e.entity2) {
43
- throw new Error(`Invalid entity ${e.op} operation: entity1 and entity2 are the same (` +
44
- `'${e.entity1}'). ${e.op} requires two distinct entities.`);
45
- }
46
- }
47
- }
48
- export async function handlePermissionOperations(data, env, buildCtx) {
49
- validatePermissionIndexes(data);
50
- validateEntityOps(data);
51
- const callPermission = new CallPermission(data);
52
- const result = await callPermission.call(env);
53
- return handleCallResult(result, buildCtx(data));
54
- }
1
+ import{CallPermission}from'@wowok/wowok';import{handleCallResult}from'./handler.js';import{isValidPermissionIndex}from'../utils/permission-index-utils.js';function validatePermissionIndexes(a){const b=[];if(a['table']){const c=a['table'];switch(c['op']){case'add\x20perm\x20by\x20index':case'set\x20perm\x20by\x20index':case'remove\x20perm\x20by\x20index':b['push']({'index':c['index'],'path':'table.'+c['op']+'.index'});break;case'add\x20perm\x20by\x20entity':case'set\x20perm\x20by\x20entity':case'remove\x20perm\x20by\x20entity':for(let d=0x0;d<c['index']['length'];d++){b['push']({'index':c['index'][d],'path':'table.'+c['op']+'.index['+d+']'});}break;}}a['remark']&&(a['remark']['op']==='set'||a['remark']['op']==='remove')&&b['push']({'index':a['remark']['index'],'path':'remark.'+a['remark']['op']+'.index'});for(const {index:e,path:f}of b){if(!isValidPermissionIndex(e))throw new Error('Invalid\x20permission\x20index\x20'+e+'\x20at\x20\x27'+f+'\x27.\x20'+'Builtin\x20indexes\x20must\x20be\x20valid\x20BuiltinPermissionIndex\x20values;\x20'+'user-defined\x20indexes\x20must\x20be\x20in\x20[1000,\x2065535].');}}function validateEntityOps(a){if(!a['entity'])return;const b=a['entity'];if(b['op']==='swap'||b['op']==='replace'||b['op']==='copy'){if(b['entity1']===b['entity2'])throw new Error('Invalid\x20entity\x20'+b['op']+'\x20operation:\x20entity1\x20and\x20entity2\x20are\x20the\x20same\x20('+('\x27'+b['entity1']+'\x27).\x20'+b['op']+'\x20requires\x20two\x20distinct\x20entities.'));}}export async function handlePermissionOperations(a,b,c){validatePermissionIndexes(a),validateEntityOps(a);const d=new CallPermission(a),e=await d['call'](b);return handleCallResult(e,c(a));}
@@ -1,105 +1 @@
1
- import { z } from "zod";
2
- import { PermissionIndexTypeSchema } from "../query/index.js";
3
- import { CallEnvSchema, SubmissionCallSchema, NormalObjectSchema } from "./base.js";
4
- import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from "../common/index.js";
5
- export const RemarkSetSchema = z.object({
6
- op: z.literal("set"),
7
- index: PermissionIndexTypeSchema,
8
- remark: LongNameSchema.describe("Permission remark.")
9
- }).strict().describe("Set remark for a permission.");
10
- export const RemarkRemoveSchema = z.object({
11
- op: z.literal("remove"),
12
- index: PermissionIndexTypeSchema
13
- }).strict().describe("Remove remark for a permission.");
14
- export const RemarkClearSchema = z.object({
15
- op: z.literal("clear")
16
- }).strict().describe("Clear remarks for all permissions.");
17
- export const RemarkSchema = z.discriminatedUnion("op", [
18
- RemarkSetSchema,
19
- RemarkRemoveSchema,
20
- RemarkClearSchema
21
- ]).describe("Set remarks for permissions.");
22
- export const TablePermByIndexSchema = z.discriminatedUnion("op", [
23
- z.object({
24
- op: z.literal("add perm by index"),
25
- index: PermissionIndexTypeSchema,
26
- entity: ManyAccountOrMark_AddressSchema
27
- }).strict().describe("Grant a specific permission to multiple entities at once. USE WHEN: You need to assign the SAME permission to MULTIPLE users/Guards. Example: Give 'create service' permission to Alice, Bob, and Carol simultaneously."),
28
- z.object({
29
- op: z.literal("set perm by index"),
30
- index: PermissionIndexTypeSchema,
31
- entity: ManyAccountOrMark_AddressSchema
32
- }).strict().describe("Replace the entity list for a specific permission with a new set of entities. USE WHEN: You want to completely redefine WHO has this permission. WARNING: This overwrites the existing entity list for this permission."),
33
- z.object({
34
- op: z.literal("remove perm by index"),
35
- index: PermissionIndexTypeSchema,
36
- entity: ManyAccountOrMark_AddressSchema
37
- }).strict().describe("Revoke a specific permission from multiple entities at once. USE WHEN: You need to remove the SAME permission from MULTIPLE users/Guards. Example: Remove 'create service' permission from Alice, Bob, and Carol simultaneously."),
38
- ]).describe("Permission-centric operations: Manage WHO has a specific permission. Best for batch-assigning one permission to many users. Structure: {op: 'add|set|remove perm by index', index: permission_id, entity: [user1, user2, ...]}");
39
- export const TablePermByEntitySchema = z.discriminatedUnion("op", [
40
- z.object({
41
- op: z.literal("add perm by entity"),
42
- entity: AccountOrMark_AddressSchema,
43
- index: z.array(PermissionIndexTypeSchema)
44
- }).strict().describe("Grant multiple permissions to a single entity. USE WHEN: You need to give ONE user/Guard MANY permissions at once. Example: Give Alice all Machine-related permissions (create, edit, publish, pause, etc.) in one call."),
45
- z.object({
46
- op: z.literal("set perm by entity"),
47
- entity: AccountOrMark_AddressSchema,
48
- index: z.array(PermissionIndexTypeSchema)
49
- }).strict().describe("Replace all permissions of a single entity with a new permission set. USE WHEN: You want to completely redefine WHAT permissions a user/Guard has. WARNING: This overwrites all existing permissions for this entity."),
50
- z.object({
51
- op: z.literal("remove perm by entity"),
52
- entity: AccountOrMark_AddressSchema,
53
- index: z.array(PermissionIndexTypeSchema)
54
- }).strict().describe("Revoke multiple permissions from a single entity. USE WHEN: You need to remove MANY permissions from ONE user/Guard at once. Example: Remove all Machine-related permissions from Alice."),
55
- ]).describe("Entity-centric operations: Manage WHAT permissions a specific user/Guard has. Best for assigning many permissions to one user. Structure: {op: 'add|set|remove perm by entity', entity: user_id, index: [perm1, perm2, ...]}");
56
- export const TableSchema = z.discriminatedUnion("op", [
57
- ...TablePermByIndexSchema.options,
58
- ...TablePermByEntitySchema.options
59
- ]).describe("Manage permission assignments using two complementary approaches. CHOOSE THE RIGHT APPROACH: (1) 'perm by index' - Use when granting ONE permission to MANY users (permission-centric). Example: Give 'create service' permission to Alice, Bob, and Carol. (2) 'perm by entity' - Use when granting MANY permissions to ONE user (entity-centric). Example: Give Alice all Machine-related permissions. Both approaches support add/set/remove operations. Requires admin permission.");
60
- export const EntitySwapReplaceCopySchema = z.discriminatedUnion("op", [
61
- z.object({
62
- op: z.literal("swap"),
63
- entity1: AccountOrMark_AddressSchema,
64
- entity2: AccountOrMark_AddressSchema
65
- }).strict().describe("Swap all permission indexes between two entities."),
66
- z.object({
67
- op: z.literal("replace"),
68
- entity1: AccountOrMark_AddressSchema,
69
- entity2: AccountOrMark_AddressSchema
70
- }).strict().describe("Remove all permission indexes from entity1 and add them to entity2's permission indexes."),
71
- z.object({
72
- op: z.literal("copy"),
73
- entity1: AccountOrMark_AddressSchema,
74
- entity2: AccountOrMark_AddressSchema
75
- }).strict().describe("Add all permission indexes from entity1 to entity2's permission indexes."),
76
- ]);
77
- export const EntityDelSchema = z.object({
78
- op: z.literal("del"),
79
- entity: AccountOrMark_AddressSchema
80
- }).strict().describe("Delete all permission indexes from an entity.");
81
- export const EntitySchema = z.discriminatedUnion("op", [
82
- ...EntitySwapReplaceCopySchema.options,
83
- EntityDelSchema
84
- ]);
85
- export const AdminSchema = z.object({
86
- op: z.enum(["add", "remove", "set"]).describe("Admin operations: add, remove, set."),
87
- addresses: ManyAccountOrMark_AddressSchema.describe("List of admin addresses.")
88
- }).strict();
89
- export const CallPermission_DataSchema = z.object({
90
- object: NormalObjectSchema.optional(),
91
- description: DescriptionSchema.optional(),
92
- remark: RemarkSchema.optional(),
93
- table: TableSchema.optional().describe("Manage permission assignments using two approaches: (1) By Permission Index - add/set/remove entity IDs for a specific permission; (2) By Entity - add/set/remove permission indexes for a specific entity. Requires admin permission."),
94
- entity: EntitySchema.optional().describe("Advanced entity permission operations: swap permissions between two entities, replace one entity's permissions with another's, copy permissions from one entity to another, or delete all permissions of an entity. Entity can be a user ID or Guard object ID. Requires admin permission."),
95
- admin: AdminSchema.optional().describe("Manage Permission object admins: add new admins, remove existing admins, or set the complete admin list. Only the Permission object owner (builder) can perform this operation. The creator automatically becomes an admin with full permissions."),
96
- apply: z.array(NameOrAddressSchema).optional().describe("Array of object IDs or names to operate on, apply the Permission object to these objects' permission control. Note: The signer must be the owner of the existing Permission objects for these objects"),
97
- builder: AccountOrMark_AddressSchema.optional().describe("Set or transfer ownership of the Permission object to the specified user ID. The creator automatically becomes the builder; only the builder can transfer ownership to other users."),
98
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this Permission object and send them to the builder(owner).' + RECEIVE_FORMAT_BLOCK_OBJECTS),
99
- um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name."),
100
- }).strict().describe("On-chain Permission operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, tags?, ...} to create a Permission. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. (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.");
101
- export const CallPermission_InputSchema = z.object({
102
- data: CallPermission_DataSchema,
103
- env: CallEnvSchema.optional(),
104
- submission: SubmissionCallSchema.optional(),
105
- }).strict();
1
+ import{z}from'zod';import{PermissionIndexTypeSchema}from'../query/index.js';import{CallEnvSchema,SubmissionCallSchema,NormalObjectSchema}from'./base.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const RemarkSetSchema=z['object']({'op':z['literal']('set'),'index':PermissionIndexTypeSchema,'remark':LongNameSchema['describe']('Permission\x20remark.')})['strict']()['describe']('Set\x20remark\x20for\x20a\x20permission.');export const RemarkRemoveSchema=z['object']({'op':z['literal']('remove'),'index':PermissionIndexTypeSchema})['strict']()['describe']('Remove\x20remark\x20for\x20a\x20permission.');export const RemarkClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20remarks\x20for\x20all\x20permissions.');export const RemarkSchema=z['discriminatedUnion']('op',[RemarkSetSchema,RemarkRemoveSchema,RemarkClearSchema])['describe']('Set\x20remarks\x20for\x20permissions.');export const TablePermByIndexSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add\x20perm\x20by\x20index'),'index':PermissionIndexTypeSchema,'entity':ManyAccountOrMark_AddressSchema})['strict']()['describe']('Grant\x20a\x20specific\x20permission\x20to\x20multiple\x20entities\x20at\x20once.\x20USE\x20WHEN:\x20You\x20need\x20to\x20assign\x20the\x20SAME\x20permission\x20to\x20MULTIPLE\x20users/Guards.\x20Example:\x20Give\x20\x27create\x20service\x27\x20permission\x20to\x20Alice,\x20Bob,\x20and\x20Carol\x20simultaneously.'),z['object']({'op':z['literal']('set\x20perm\x20by\x20index'),'index':PermissionIndexTypeSchema,'entity':ManyAccountOrMark_AddressSchema})['strict']()['describe']('Replace\x20the\x20entity\x20list\x20for\x20a\x20specific\x20permission\x20with\x20a\x20new\x20set\x20of\x20entities.\x20USE\x20WHEN:\x20You\x20want\x20to\x20completely\x20redefine\x20WHO\x20has\x20this\x20permission.\x20WARNING:\x20This\x20overwrites\x20the\x20existing\x20entity\x20list\x20for\x20this\x20permission.'),z['object']({'op':z['literal']('remove\x20perm\x20by\x20index'),'index':PermissionIndexTypeSchema,'entity':ManyAccountOrMark_AddressSchema})['strict']()['describe']('Revoke\x20a\x20specific\x20permission\x20from\x20multiple\x20entities\x20at\x20once.\x20USE\x20WHEN:\x20You\x20need\x20to\x20remove\x20the\x20SAME\x20permission\x20from\x20MULTIPLE\x20users/Guards.\x20Example:\x20Remove\x20\x27create\x20service\x27\x20permission\x20from\x20Alice,\x20Bob,\x20and\x20Carol\x20simultaneously.')])['describe']('Permission-centric\x20operations:\x20Manage\x20WHO\x20has\x20a\x20specific\x20permission.\x20Best\x20for\x20batch-assigning\x20one\x20permission\x20to\x20many\x20users.\x20Structure:\x20{op:\x20\x27add|set|remove\x20perm\x20by\x20index\x27,\x20index:\x20permission_id,\x20entity:\x20[user1,\x20user2,\x20...]}');export const TablePermByEntitySchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add\x20perm\x20by\x20entity'),'entity':AccountOrMark_AddressSchema,'index':z['array'](PermissionIndexTypeSchema)})['strict']()['describe']('Grant\x20multiple\x20permissions\x20to\x20a\x20single\x20entity.\x20USE\x20WHEN:\x20You\x20need\x20to\x20give\x20ONE\x20user/Guard\x20MANY\x20permissions\x20at\x20once.\x20Example:\x20Give\x20Alice\x20all\x20Machine-related\x20permissions\x20(create,\x20edit,\x20publish,\x20pause,\x20etc.)\x20in\x20one\x20call.'),z['object']({'op':z['literal']('set\x20perm\x20by\x20entity'),'entity':AccountOrMark_AddressSchema,'index':z['array'](PermissionIndexTypeSchema)})['strict']()['describe']('Replace\x20all\x20permissions\x20of\x20a\x20single\x20entity\x20with\x20a\x20new\x20permission\x20set.\x20USE\x20WHEN:\x20You\x20want\x20to\x20completely\x20redefine\x20WHAT\x20permissions\x20a\x20user/Guard\x20has.\x20WARNING:\x20This\x20overwrites\x20all\x20existing\x20permissions\x20for\x20this\x20entity.'),z['object']({'op':z['literal']('remove\x20perm\x20by\x20entity'),'entity':AccountOrMark_AddressSchema,'index':z['array'](PermissionIndexTypeSchema)})['strict']()['describe']('Revoke\x20multiple\x20permissions\x20from\x20a\x20single\x20entity.\x20USE\x20WHEN:\x20You\x20need\x20to\x20remove\x20MANY\x20permissions\x20from\x20ONE\x20user/Guard\x20at\x20once.\x20Example:\x20Remove\x20all\x20Machine-related\x20permissions\x20from\x20Alice.')])['describe']('Entity-centric\x20operations:\x20Manage\x20WHAT\x20permissions\x20a\x20specific\x20user/Guard\x20has.\x20Best\x20for\x20assigning\x20many\x20permissions\x20to\x20one\x20user.\x20Structure:\x20{op:\x20\x27add|set|remove\x20perm\x20by\x20entity\x27,\x20entity:\x20user_id,\x20index:\x20[perm1,\x20perm2,\x20...]}');export const TableSchema=z['discriminatedUnion']('op',[...TablePermByIndexSchema['options'],...TablePermByEntitySchema['options']])['describe']('Manage\x20permission\x20assignments\x20using\x20two\x20complementary\x20approaches.\x20CHOOSE\x20THE\x20RIGHT\x20APPROACH:\x20(1)\x20\x27perm\x20by\x20index\x27\x20-\x20Use\x20when\x20granting\x20ONE\x20permission\x20to\x20MANY\x20users\x20(permission-centric).\x20Example:\x20Give\x20\x27create\x20service\x27\x20permission\x20to\x20Alice,\x20Bob,\x20and\x20Carol.\x20(2)\x20\x27perm\x20by\x20entity\x27\x20-\x20Use\x20when\x20granting\x20MANY\x20permissions\x20to\x20ONE\x20user\x20(entity-centric).\x20Example:\x20Give\x20Alice\x20all\x20Machine-related\x20permissions.\x20Both\x20approaches\x20support\x20add/set/remove\x20operations.\x20Requires\x20admin\x20permission.');export const EntitySwapReplaceCopySchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('swap'),'entity1':AccountOrMark_AddressSchema,'entity2':AccountOrMark_AddressSchema})['strict']()['describe']('Swap\x20all\x20permission\x20indexes\x20between\x20two\x20entities.'),z['object']({'op':z['literal']('replace'),'entity1':AccountOrMark_AddressSchema,'entity2':AccountOrMark_AddressSchema})['strict']()['describe']('Remove\x20all\x20permission\x20indexes\x20from\x20entity1\x20and\x20add\x20them\x20to\x20entity2\x27s\x20permission\x20indexes.'),z['object']({'op':z['literal']('copy'),'entity1':AccountOrMark_AddressSchema,'entity2':AccountOrMark_AddressSchema})['strict']()['describe']('Add\x20all\x20permission\x20indexes\x20from\x20entity1\x20to\x20entity2\x27s\x20permission\x20indexes.')]);export const EntityDelSchema=z['object']({'op':z['literal']('del'),'entity':AccountOrMark_AddressSchema})['strict']()['describe']('Delete\x20all\x20permission\x20indexes\x20from\x20an\x20entity.');export const EntitySchema=z['discriminatedUnion']('op',[...EntitySwapReplaceCopySchema['options'],EntityDelSchema]);export const AdminSchema=z['object']({'op':z['enum'](['add','remove','set'])['describe']('Admin\x20operations:\x20add,\x20remove,\x20set.'),'addresses':ManyAccountOrMark_AddressSchema['describe']('List\x20of\x20admin\x20addresses.')})['strict']();export const CallPermission_DataSchema=z['object']({'object':NormalObjectSchema['optional'](),'description':DescriptionSchema['optional'](),'remark':RemarkSchema['optional'](),'table':TableSchema['optional']()['describe']('Manage\x20permission\x20assignments\x20using\x20two\x20approaches:\x20(1)\x20By\x20Permission\x20Index\x20-\x20add/set/remove\x20entity\x20IDs\x20for\x20a\x20specific\x20permission;\x20(2)\x20By\x20Entity\x20-\x20add/set/remove\x20permission\x20indexes\x20for\x20a\x20specific\x20entity.\x20Requires\x20admin\x20permission.'),'entity':EntitySchema['optional']()['describe']('Advanced\x20entity\x20permission\x20operations:\x20swap\x20permissions\x20between\x20two\x20entities,\x20replace\x20one\x20entity\x27s\x20permissions\x20with\x20another\x27s,\x20copy\x20permissions\x20from\x20one\x20entity\x20to\x20another,\x20or\x20delete\x20all\x20permissions\x20of\x20an\x20entity.\x20Entity\x20can\x20be\x20a\x20user\x20ID\x20or\x20Guard\x20object\x20ID.\x20Requires\x20admin\x20permission.'),'admin':AdminSchema['optional']()['describe']('Manage\x20Permission\x20object\x20admins:\x20add\x20new\x20admins,\x20remove\x20existing\x20admins,\x20or\x20set\x20the\x20complete\x20admin\x20list.\x20Only\x20the\x20Permission\x20object\x20owner\x20(builder)\x20can\x20perform\x20this\x20operation.\x20The\x20creator\x20automatically\x20becomes\x20an\x20admin\x20with\x20full\x20permissions.'),'apply':z['array'](NameOrAddressSchema)['optional']()['describe']('Array\x20of\x20object\x20IDs\x20or\x20names\x20to\x20operate\x20on,\x20apply\x20the\x20Permission\x20object\x20to\x20these\x20objects\x27\x20permission\x20control.\x20Note:\x20The\x20signer\x20must\x20be\x20the\x20owner\x20of\x20the\x20existing\x20Permission\x20objects\x20for\x20these\x20objects'),'builder':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20or\x20transfer\x20ownership\x20of\x20the\x20Permission\x20object\x20to\x20the\x20specified\x20user\x20ID.\x20The\x20creator\x20automatically\x20becomes\x20the\x20builder;\x20only\x20the\x20builder\x20can\x20transfer\x20ownership\x20to\x20other\x20users.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Permission\x20object\x20and\x20send\x20them\x20to\x20the\x20builder(owner).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['describe']('On-chain\x20Permission\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20tags?,\x20...}\x20to\x20create\x20a\x20Permission.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\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 CallPermission_InputSchema=z['object']({'data':CallPermission_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -1,78 +1 @@
1
- import { z } from "zod";
2
- import { AccountOrMark_AddressAISchema, AccountOrMark_AddressSchema, DescriptionSchema, ManyAccountOrMark_AddressAISchema, NameSchema } from "../common/index.js";
3
- import { RecordsInEntitySchema } from "../query/index.js";
4
- import { CallEnvSchema } from "./base.js";
5
- export const InformationAddSchema = z.object({
6
- op: z.literal("add"),
7
- data: z.array(RecordsInEntitySchema)
8
- }).strict().describe("PUBLIC: Add personal info on-chain. Safe: social handles, URLs, public email. NEVER: phone, address, private keys.");
9
- export const InformationRemoveSchema = z.object({
10
- op: z.literal("remove"),
11
- name: z.array(NameSchema)
12
- }).strict().describe("PUBLIC: Remove specified personal info records from your public profile.");
13
- export const InformationClearSchema = z.object({
14
- op: z.literal("clear")
15
- }).strict().describe("PUBLIC: Clear ALL personal info from your public profile.");
16
- export const InformationSchema = z.discriminatedUnion("op", [
17
- InformationAddSchema,
18
- InformationRemoveSchema,
19
- InformationClearSchema
20
- ]);
21
- export const MarkAddSchema = z.object({
22
- op: z.literal("add"),
23
- data: z.array(z.object({
24
- address: AccountOrMark_AddressAISchema,
25
- name: NameSchema.optional(),
26
- tags: z.array(NameSchema).optional()
27
- }).strict()),
28
- }).strict().describe("PUBLIC: Add ID name and tags on-chain for public identity. For private marks, use 'local' tool.");
29
- export const MarkRemoveSchema = z.object({
30
- op: z.literal("remove"),
31
- data: z.array(z.object({
32
- address: AccountOrMark_AddressAISchema,
33
- tags: z.array(NameSchema).optional()
34
- }).strict())
35
- }).strict().describe("PUBLIC: Remove specified tags from your on-chain identity mark.");
36
- export const MarkClearSchema = z.object({
37
- op: z.literal("clear"),
38
- address: ManyAccountOrMark_AddressAISchema
39
- }).strict().describe("PUBLIC: Clear ALL tags from specified on-chain identity marks.");
40
- export const MarkLikeSchema = z.object({
41
- op: z.literal("like"),
42
- address: AccountOrMark_AddressAISchema
43
- }).strict().describe("PUBLIC REPUTATION VOTE: Like an address (0x...) or LocalMark name. Goes through registrar::like — toggles off if already liked, auto-flips an existing dislike, and increments the target's PUBLIC aggregate like count (queryable via query personal / Guard entity_voted_record). Do NOT emulate with mark.add tags:['like'] — manual tags stay private in your Resource and never affect the aggregate count.");
44
- export const MarkDislikeSchema = z.object({
45
- op: z.literal("dislike"),
46
- address: AccountOrMark_AddressAISchema
47
- }).strict().describe("PUBLIC REPUTATION VOTE: Dislike an address (0x...) or LocalMark name. Goes through registrar::dislike — toggles off if already disliked, auto-flips an existing like, and increments the target's PUBLIC aggregate dislike count. Same manual-tag caveat as 'like'.");
48
- export const MarkTransferSchema = z.object({
49
- op: z.literal("transfer"),
50
- to: AccountOrMark_AddressAISchema
51
- }).strict().describe("PUBLIC: Transfer your on-chain identity mark to another address.");
52
- export const MarkReplaceSchema = z.object({
53
- op: z.literal("replace"),
54
- new_mark_object: z.string().describe("New personal ID tag object ID.")
55
- }).strict().describe("PUBLIC: Replace your on-chain identity mark with a new object.");
56
- export const MarkDestroySchema = z.object({
57
- op: z.literal("destroy")
58
- }).strict().describe("PUBLIC: Destroy your on-chain identity mark permanently.");
59
- export const MarkSchema = z.discriminatedUnion("op", [
60
- MarkAddSchema,
61
- MarkRemoveSchema,
62
- MarkClearSchema,
63
- MarkLikeSchema,
64
- MarkDislikeSchema,
65
- MarkTransferSchema,
66
- MarkReplaceSchema,
67
- MarkDestroySchema
68
- ]);
69
- export const CallPersonal_DataSchema = z.object({
70
- description: DescriptionSchema.optional(),
71
- referrer: z.union([z.string(), AccountOrMark_AddressSchema, z.null()]).optional().describe("Referrer ID (name or address) for joining the on-chain network."),
72
- information: InformationSchema.optional().describe("PUBLIC: Personal info on-chain. Safe: social handles, URLs. NEVER: phone, address, private keys."),
73
- mark: MarkSchema.optional().describe("PUBLIC: On-chain identity mark. For PRIVATE marks, use 'local' tool.")
74
- }).strict();
75
- export const CallPersonal_InputSchema = z.object({
76
- data: CallPersonal_DataSchema,
77
- env: CallEnvSchema.optional(),
78
- }).strict();
1
+ import{z}from'zod';import{AccountOrMark_AddressAISchema,AccountOrMark_AddressSchema,DescriptionSchema,ManyAccountOrMark_AddressAISchema,NameSchema}from'../common/index.js';import{RecordsInEntitySchema}from'../query/index.js';import{CallEnvSchema}from'./base.js';export const InformationAddSchema=z['object']({'op':z['literal']('add'),'data':z['array'](RecordsInEntitySchema)})['strict']()['describe']('PUBLIC:\x20Add\x20personal\x20info\x20on-chain.\x20Safe:\x20social\x20handles,\x20URLs,\x20public\x20email.\x20NEVER:\x20phone,\x20address,\x20private\x20keys.');export const InformationRemoveSchema=z['object']({'op':z['literal']('remove'),'name':z['array'](NameSchema)})['strict']()['describe']('PUBLIC:\x20Remove\x20specified\x20personal\x20info\x20records\x20from\x20your\x20public\x20profile.');export const InformationClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('PUBLIC:\x20Clear\x20ALL\x20personal\x20info\x20from\x20your\x20public\x20profile.');export const InformationSchema=z['discriminatedUnion']('op',[InformationAddSchema,InformationRemoveSchema,InformationClearSchema]);export const MarkAddSchema=z['object']({'op':z['literal']('add'),'data':z['array'](z['object']({'address':AccountOrMark_AddressAISchema,'name':NameSchema['optional'](),'tags':z['array'](NameSchema)['optional']()})['strict']())})['strict']()['describe']('PUBLIC:\x20Add\x20ID\x20name\x20and\x20tags\x20on-chain\x20for\x20public\x20identity.\x20For\x20private\x20marks,\x20use\x20\x27local\x27\x20tool.');export const MarkRemoveSchema=z['object']({'op':z['literal']('remove'),'data':z['array'](z['object']({'address':AccountOrMark_AddressAISchema,'tags':z['array'](NameSchema)['optional']()})['strict']())})['strict']()['describe']('PUBLIC:\x20Remove\x20specified\x20tags\x20from\x20your\x20on-chain\x20identity\x20mark.');export const MarkClearSchema=z['object']({'op':z['literal']('clear'),'address':ManyAccountOrMark_AddressAISchema})['strict']()['describe']('PUBLIC:\x20Clear\x20ALL\x20tags\x20from\x20specified\x20on-chain\x20identity\x20marks.');export const MarkLikeSchema=z['object']({'op':z['literal']('like'),'address':AccountOrMark_AddressAISchema})['strict']()['describe']('PUBLIC\x20REPUTATION\x20VOTE:\x20Like\x20an\x20address\x20(0x...)\x20or\x20LocalMark\x20name.\x20Goes\x20through\x20registrar::like\x20—\x20toggles\x20off\x20if\x20already\x20liked,\x20auto-flips\x20an\x20existing\x20dislike,\x20and\x20increments\x20the\x20target\x27s\x20PUBLIC\x20aggregate\x20like\x20count\x20(queryable\x20via\x20query\x20personal\x20/\x20Guard\x20entity_voted_record).\x20Do\x20NOT\x20emulate\x20with\x20mark.add\x20tags:[\x27like\x27]\x20—\x20manual\x20tags\x20stay\x20private\x20in\x20your\x20Resource\x20and\x20never\x20affect\x20the\x20aggregate\x20count.');export const MarkDislikeSchema=z['object']({'op':z['literal']('dislike'),'address':AccountOrMark_AddressAISchema})['strict']()['describe']('PUBLIC\x20REPUTATION\x20VOTE:\x20Dislike\x20an\x20address\x20(0x...)\x20or\x20LocalMark\x20name.\x20Goes\x20through\x20registrar::dislike\x20—\x20toggles\x20off\x20if\x20already\x20disliked,\x20auto-flips\x20an\x20existing\x20like,\x20and\x20increments\x20the\x20target\x27s\x20PUBLIC\x20aggregate\x20dislike\x20count.\x20Same\x20manual-tag\x20caveat\x20as\x20\x27like\x27.');export const MarkTransferSchema=z['object']({'op':z['literal']('transfer'),'to':AccountOrMark_AddressAISchema})['strict']()['describe']('PUBLIC:\x20Transfer\x20your\x20on-chain\x20identity\x20mark\x20to\x20another\x20address.');export const MarkReplaceSchema=z['object']({'op':z['literal']('replace'),'new_mark_object':z['string']()['describe']('New\x20personal\x20ID\x20tag\x20object\x20ID.')})['strict']()['describe']('PUBLIC:\x20Replace\x20your\x20on-chain\x20identity\x20mark\x20with\x20a\x20new\x20object.');export const MarkDestroySchema=z['object']({'op':z['literal']('destroy')})['strict']()['describe']('PUBLIC:\x20Destroy\x20your\x20on-chain\x20identity\x20mark\x20permanently.');export const MarkSchema=z['discriminatedUnion']('op',[MarkAddSchema,MarkRemoveSchema,MarkClearSchema,MarkLikeSchema,MarkDislikeSchema,MarkTransferSchema,MarkReplaceSchema,MarkDestroySchema]);export const CallPersonal_DataSchema=z['object']({'description':DescriptionSchema['optional'](),'referrer':z['union']([z['string'](),AccountOrMark_AddressSchema,z['null']()])['optional']()['describe']('Referrer\x20ID\x20(name\x20or\x20address)\x20for\x20joining\x20the\x20on-chain\x20network.'),'information':InformationSchema['optional']()['describe']('PUBLIC:\x20Personal\x20info\x20on-chain.\x20Safe:\x20social\x20handles,\x20URLs.\x20NEVER:\x20phone,\x20address,\x20private\x20keys.'),'mark':MarkSchema['optional']()['describe']('PUBLIC:\x20On-chain\x20identity\x20mark.\x20For\x20PRIVATE\x20marks,\x20use\x20\x27local\x27\x20tool.')})['strict']();export const CallPersonal_InputSchema=z['object']({'data':CallPersonal_DataSchema,'env':CallEnvSchema['optional']()})['strict']();