@wowok/agent-mcp 2.4.1 → 2.5.0

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 (348) hide show
  1. package/dist/config/runtime.d.ts +4 -0
  2. package/dist/config/runtime.js +29 -5
  3. package/dist/harness/auto-escalation.d.ts +27 -0
  4. package/dist/harness/auto-escalation.js +68 -0
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +29 -1621
  7. package/dist/knowledge/allocation-confirm.d.ts +115 -0
  8. package/dist/knowledge/allocation-confirm.js +534 -0
  9. package/dist/knowledge/allocation-context.d.ts +58 -0
  10. package/dist/knowledge/allocation-context.js +249 -0
  11. package/dist/knowledge/allocation-ledger.d.ts +67 -0
  12. package/dist/knowledge/allocation-ledger.js +463 -0
  13. package/dist/knowledge/allocation-puzzle.d.ts +135 -0
  14. package/dist/knowledge/allocation-puzzle.js +298 -0
  15. package/dist/knowledge/allocation-risk.d.ts +78 -0
  16. package/dist/knowledge/allocation-risk.js +568 -0
  17. package/dist/knowledge/allocation-templates.d.ts +38 -0
  18. package/dist/knowledge/allocation-templates.js +970 -0
  19. package/dist/knowledge/allocation-translation.d.ts +72 -0
  20. package/dist/knowledge/allocation-translation.js +585 -0
  21. package/dist/knowledge/arb-risk.d.ts +37 -0
  22. package/dist/knowledge/arb-risk.js +210 -0
  23. package/dist/knowledge/arbitration-confirm.d.ts +135 -0
  24. package/dist/knowledge/arbitration-confirm.js +559 -0
  25. package/dist/knowledge/arbitration-context.d.ts +81 -0
  26. package/dist/knowledge/arbitration-context.js +505 -0
  27. package/dist/knowledge/arbitration-ledger.d.ts +62 -0
  28. package/dist/knowledge/arbitration-ledger.js +521 -0
  29. package/dist/knowledge/arbitration-puzzle.d.ts +84 -0
  30. package/dist/knowledge/arbitration-puzzle.js +304 -0
  31. package/dist/knowledge/arbitration-risk.d.ts +112 -0
  32. package/dist/knowledge/arbitration-risk.js +433 -0
  33. package/dist/knowledge/arbitration-templates.d.ts +38 -0
  34. package/dist/knowledge/arbitration-templates.js +276 -0
  35. package/dist/knowledge/arbitration-translation.d.ts +91 -0
  36. package/dist/knowledge/arbitration-translation.js +487 -0
  37. package/dist/knowledge/bridge-risk.d.ts +36 -0
  38. package/dist/knowledge/bridge-risk.js +263 -0
  39. package/dist/knowledge/contact-risk.d.ts +32 -0
  40. package/dist/knowledge/contact-risk.js +200 -0
  41. package/dist/knowledge/demand-confirm.d.ts +32 -0
  42. package/dist/knowledge/demand-confirm.js +206 -0
  43. package/dist/knowledge/demand-risk.d.ts +30 -0
  44. package/dist/knowledge/demand-risk.js +240 -0
  45. package/dist/knowledge/demand-translation.d.ts +55 -0
  46. package/dist/knowledge/demand-translation.js +354 -0
  47. package/dist/knowledge/deployment-scanner.d.ts +63 -0
  48. package/dist/knowledge/deployment-scanner.js +762 -0
  49. package/dist/knowledge/examples-scanner-cli.d.ts +1 -0
  50. package/dist/knowledge/examples-scanner-cli.js +26 -0
  51. package/dist/knowledge/examples-scanner.d.ts +121 -0
  52. package/dist/knowledge/examples-scanner.js +825 -0
  53. package/dist/knowledge/flywheel-loop.d.ts +3 -0
  54. package/dist/knowledge/flywheel-loop.js +32 -3
  55. package/dist/knowledge/glossary.js +3 -1
  56. package/dist/knowledge/guard-confirm.d.ts +86 -0
  57. package/dist/knowledge/guard-confirm.js +406 -0
  58. package/dist/knowledge/guard-context.d.ts +56 -0
  59. package/dist/knowledge/guard-context.js +287 -0
  60. package/dist/knowledge/guard-design-patterns.d.ts +37 -0
  61. package/dist/knowledge/guard-design-patterns.js +257 -0
  62. package/dist/knowledge/guard-ledger.js +14 -0
  63. package/dist/knowledge/guard-lint.d.ts +1 -0
  64. package/dist/knowledge/guard-lint.js +83 -3
  65. package/dist/knowledge/guard-migration.d.ts +48 -0
  66. package/dist/knowledge/guard-migration.js +228 -0
  67. package/dist/knowledge/guard-puzzle.js +3 -2
  68. package/dist/knowledge/guard-risk.d.ts +3 -1
  69. package/dist/knowledge/guard-risk.js +832 -64
  70. package/dist/knowledge/guard-templates.d.ts +1 -0
  71. package/dist/knowledge/guard-templates.js +278 -2
  72. package/dist/knowledge/guard-translation.js +6 -5
  73. package/dist/knowledge/index.d.ts +342 -0
  74. package/dist/knowledge/index.js +344 -0
  75. package/dist/knowledge/machine-confirm.d.ts +102 -0
  76. package/dist/knowledge/machine-confirm.js +559 -0
  77. package/dist/knowledge/machine-context.d.ts +160 -0
  78. package/dist/knowledge/machine-context.js +812 -0
  79. package/dist/knowledge/machine-ledger.d.ts +41 -0
  80. package/dist/knowledge/machine-ledger.js +315 -0
  81. package/dist/knowledge/machine-puzzle.d.ts +206 -0
  82. package/dist/knowledge/machine-puzzle.js +494 -0
  83. package/dist/knowledge/machine-risk.d.ts +75 -0
  84. package/dist/knowledge/machine-risk.js +644 -0
  85. package/dist/knowledge/machine-templates.d.ts +92 -0
  86. package/dist/knowledge/machine-templates.js +1592 -0
  87. package/dist/knowledge/machine-topology.d.ts +57 -0
  88. package/dist/knowledge/machine-topology.js +234 -0
  89. package/dist/knowledge/machine-translation.d.ts +96 -0
  90. package/dist/knowledge/machine-translation.js +513 -0
  91. package/dist/knowledge/mcp-schema-audit-cli.d.ts +1 -0
  92. package/dist/knowledge/mcp-schema-audit-cli.js +45 -0
  93. package/dist/knowledge/mcp-schema-audit.d.ts +90 -0
  94. package/dist/knowledge/mcp-schema-audit.js +772 -0
  95. package/dist/knowledge/onchain-constants.d.ts +4 -0
  96. package/dist/knowledge/onchain-constants.js +35 -0
  97. package/dist/knowledge/order-confirm.d.ts +115 -0
  98. package/dist/knowledge/order-confirm.js +573 -0
  99. package/dist/knowledge/order-context.d.ts +66 -0
  100. package/dist/knowledge/order-context.js +390 -0
  101. package/dist/knowledge/order-ledger.d.ts +69 -0
  102. package/dist/knowledge/order-ledger.js +341 -0
  103. package/dist/knowledge/order-puzzle.d.ts +159 -0
  104. package/dist/knowledge/order-puzzle.js +255 -0
  105. package/dist/knowledge/order-risk.d.ts +66 -0
  106. package/dist/knowledge/order-risk.js +653 -0
  107. package/dist/knowledge/order-templates.d.ts +50 -0
  108. package/dist/knowledge/order-templates.js +368 -0
  109. package/dist/knowledge/order-translation.d.ts +78 -0
  110. package/dist/knowledge/order-translation.js +550 -0
  111. package/dist/knowledge/passport-confirm.d.ts +130 -0
  112. package/dist/knowledge/passport-confirm.js +531 -0
  113. package/dist/knowledge/passport-context.d.ts +59 -0
  114. package/dist/knowledge/passport-context.js +306 -0
  115. package/dist/knowledge/passport-ledger.d.ts +48 -0
  116. package/dist/knowledge/passport-ledger.js +282 -0
  117. package/dist/knowledge/passport-puzzle.d.ts +108 -0
  118. package/dist/knowledge/passport-puzzle.js +333 -0
  119. package/dist/knowledge/passport-risk.d.ts +70 -0
  120. package/dist/knowledge/passport-risk.js +450 -0
  121. package/dist/knowledge/passport-templates.d.ts +40 -0
  122. package/dist/knowledge/passport-templates.js +568 -0
  123. package/dist/knowledge/passport-translation.d.ts +68 -0
  124. package/dist/knowledge/passport-translation.js +516 -0
  125. package/dist/knowledge/payment-risk.d.ts +33 -0
  126. package/dist/knowledge/payment-risk.js +182 -0
  127. package/dist/knowledge/permission-confirm.d.ts +110 -0
  128. package/dist/knowledge/permission-confirm.js +426 -0
  129. package/dist/knowledge/permission-context.d.ts +58 -0
  130. package/dist/knowledge/permission-context.js +224 -0
  131. package/dist/knowledge/permission-ledger.d.ts +38 -0
  132. package/dist/knowledge/permission-ledger.js +403 -0
  133. package/dist/knowledge/permission-puzzle.d.ts +122 -0
  134. package/dist/knowledge/permission-puzzle.js +173 -0
  135. package/dist/knowledge/permission-risk.d.ts +76 -0
  136. package/dist/knowledge/permission-risk.js +411 -0
  137. package/dist/knowledge/permission-templates.d.ts +38 -0
  138. package/dist/knowledge/permission-templates.js +234 -0
  139. package/dist/knowledge/permission-translation.d.ts +57 -0
  140. package/dist/knowledge/permission-translation.js +350 -0
  141. package/dist/knowledge/personal-risk.d.ts +36 -0
  142. package/dist/knowledge/personal-risk.js +212 -0
  143. package/dist/knowledge/progress-confirm.d.ts +108 -0
  144. package/dist/knowledge/progress-confirm.js +456 -0
  145. package/dist/knowledge/progress-context.d.ts +123 -0
  146. package/dist/knowledge/progress-context.js +452 -0
  147. package/dist/knowledge/progress-ledger.d.ts +63 -0
  148. package/dist/knowledge/progress-ledger.js +327 -0
  149. package/dist/knowledge/progress-puzzle.d.ts +82 -0
  150. package/dist/knowledge/progress-puzzle.js +219 -0
  151. package/dist/knowledge/progress-risk.d.ts +74 -0
  152. package/dist/knowledge/progress-risk.js +461 -0
  153. package/dist/knowledge/progress-templates.d.ts +38 -0
  154. package/dist/knowledge/progress-templates.js +228 -0
  155. package/dist/knowledge/progress-translation.d.ts +52 -0
  156. package/dist/knowledge/progress-translation.js +401 -0
  157. package/dist/knowledge/proof-confirm.d.ts +31 -0
  158. package/dist/knowledge/proof-confirm.js +187 -0
  159. package/dist/knowledge/proof-risk.d.ts +33 -0
  160. package/dist/knowledge/proof-risk.js +207 -0
  161. package/dist/knowledge/proof-translation.d.ts +52 -0
  162. package/dist/knowledge/proof-translation.js +283 -0
  163. package/dist/knowledge/registrar-risk.d.ts +34 -0
  164. package/dist/knowledge/registrar-risk.js +217 -0
  165. package/dist/knowledge/repository-confirm.d.ts +36 -0
  166. package/dist/knowledge/repository-confirm.js +242 -0
  167. package/dist/knowledge/repository-risk.d.ts +40 -0
  168. package/dist/knowledge/repository-risk.js +312 -0
  169. package/dist/knowledge/repository-translation.d.ts +58 -0
  170. package/dist/knowledge/repository-translation.js +422 -0
  171. package/dist/knowledge/resource-risk.d.ts +32 -0
  172. package/dist/knowledge/resource-risk.js +157 -0
  173. package/dist/knowledge/reward-confirm.d.ts +113 -0
  174. package/dist/knowledge/reward-confirm.js +496 -0
  175. package/dist/knowledge/reward-context.d.ts +127 -0
  176. package/dist/knowledge/reward-context.js +504 -0
  177. package/dist/knowledge/reward-ledger.d.ts +96 -0
  178. package/dist/knowledge/reward-ledger.js +502 -0
  179. package/dist/knowledge/reward-puzzle.d.ts +97 -0
  180. package/dist/knowledge/reward-puzzle.js +288 -0
  181. package/dist/knowledge/reward-risk.d.ts +84 -0
  182. package/dist/knowledge/reward-risk.js +545 -0
  183. package/dist/knowledge/reward-translation.d.ts +58 -0
  184. package/dist/knowledge/reward-translation.js +501 -0
  185. package/dist/knowledge/safety-rules.js +11 -3
  186. package/dist/knowledge/scenario-modes.d.ts +53 -0
  187. package/dist/knowledge/scenario-modes.js +302 -0
  188. package/dist/knowledge/service-confirm.d.ts +152 -0
  189. package/dist/knowledge/service-confirm.js +699 -0
  190. package/dist/knowledge/service-context.d.ts +66 -0
  191. package/dist/knowledge/service-context.js +403 -0
  192. package/dist/knowledge/service-ledger.d.ts +71 -0
  193. package/dist/knowledge/service-ledger.js +609 -0
  194. package/dist/knowledge/service-puzzle.d.ts +158 -0
  195. package/dist/knowledge/service-puzzle.js +236 -0
  196. package/dist/knowledge/service-risk.d.ts +108 -0
  197. package/dist/knowledge/service-risk.js +615 -0
  198. package/dist/knowledge/service-templates.d.ts +39 -0
  199. package/dist/knowledge/service-templates.js +418 -0
  200. package/dist/knowledge/service-translation.d.ts +103 -0
  201. package/dist/knowledge/service-translation.js +622 -0
  202. package/dist/knowledge/tools-reference.d.ts +17 -0
  203. package/dist/knowledge/tools-reference.js +151 -0
  204. package/dist/knowledge/treasury-confirm.d.ts +133 -0
  205. package/dist/knowledge/treasury-confirm.js +512 -0
  206. package/dist/knowledge/treasury-context.d.ts +64 -0
  207. package/dist/knowledge/treasury-context.js +363 -0
  208. package/dist/knowledge/treasury-ledger.d.ts +42 -0
  209. package/dist/knowledge/treasury-ledger.js +300 -0
  210. package/dist/knowledge/treasury-puzzle.d.ts +163 -0
  211. package/dist/knowledge/treasury-puzzle.js +216 -0
  212. package/dist/knowledge/treasury-risk.d.ts +86 -0
  213. package/dist/knowledge/treasury-risk.js +440 -0
  214. package/dist/knowledge/treasury-templates.d.ts +38 -0
  215. package/dist/knowledge/treasury-templates.js +316 -0
  216. package/dist/knowledge/treasury-translation.d.ts +78 -0
  217. package/dist/knowledge/treasury-translation.js +498 -0
  218. package/dist/knowledge/util-risk.d.ts +30 -0
  219. package/dist/knowledge/util-risk.js +135 -0
  220. package/dist/project/business-puzzle.d.ts +47 -0
  221. package/dist/project/business-puzzle.js +372 -0
  222. package/dist/project/deployment-doc.d.ts +61 -0
  223. package/dist/project/deployment-doc.js +432 -0
  224. package/dist/project/graph.d.ts +1 -0
  225. package/dist/project/graph.js +27 -1
  226. package/dist/project/index.d.ts +1 -0
  227. package/dist/project/index.js +39 -2
  228. package/dist/project/namespace.d.ts +11 -1
  229. package/dist/project/namespace.js +27 -2
  230. package/dist/project/query.d.ts +2 -0
  231. package/dist/project/query.js +56 -15
  232. package/dist/project/risk-aggregator.d.ts +50 -0
  233. package/dist/project/risk-aggregator.js +280 -0
  234. package/dist/project/substep-trace.d.ts +130 -0
  235. package/dist/project/substep-trace.js +332 -0
  236. package/dist/rules.d.ts +12 -0
  237. package/dist/rules.js +9 -0
  238. package/dist/schema/call/allocation.d.ts +44 -44
  239. package/dist/schema/call/arbitration.d.ts +141 -141
  240. package/dist/schema/call/base.d.ts +386 -386
  241. package/dist/schema/call/base.js +6 -6
  242. package/dist/schema/call/bridge-handler.d.ts +5 -2
  243. package/dist/schema/call/bridge.d.ts +159 -159
  244. package/dist/schema/call/contact.d.ts +110 -110
  245. package/dist/schema/call/demand.d.ts +76 -76
  246. package/dist/schema/call/handler.d.ts +2 -3
  247. package/dist/schema/call/handler.js +1 -1
  248. package/dist/schema/call/machine.d.ts +96 -96
  249. package/dist/schema/call/order.d.ts +98 -110
  250. package/dist/schema/call/permission-handler.d.ts +5 -0
  251. package/dist/schema/call/permission-handler.js +54 -0
  252. package/dist/schema/call/permission.d.ts +108 -108
  253. package/dist/schema/call/personal.d.ts +14 -14
  254. package/dist/schema/call/progress.d.ts +57 -72
  255. package/dist/schema/call/progress.js +7 -4
  256. package/dist/schema/call/proof.d.ts +18 -18
  257. package/dist/schema/call/proof.js +12 -7
  258. package/dist/schema/call/repository.d.ts +154 -154
  259. package/dist/schema/call/reward.d.ts +55 -55
  260. package/dist/schema/call/semantic.js +1 -1
  261. package/dist/schema/call/service.d.ts +238 -238
  262. package/dist/schema/call/treasury.d.ts +93 -93
  263. package/dist/schema/config/index.d.ts +178 -5
  264. package/dist/schema/config/index.js +52 -1
  265. package/dist/schema/local/index.d.ts +3554 -836
  266. package/dist/schema/local/index.js +2 -1
  267. package/dist/schema/messenger/index.d.ts +162 -162
  268. package/dist/schema/operations.d.ts +1102 -1118
  269. package/dist/schema/operations.js +7 -1
  270. package/dist/schema/project/index.d.ts +1392 -6
  271. package/dist/schema/project/index.js +426 -2
  272. package/dist/schema/query/index.d.ts +818 -818
  273. package/dist/schema/query/index.js +15 -9
  274. package/dist/schema/schema-query/index.d.ts +23 -3
  275. package/dist/schema/schema-query/index.js +13 -2
  276. package/dist/schema/sync-layer4.d.ts +21 -0
  277. package/dist/schema/sync-layer4.js +261 -0
  278. package/dist/schema/trust/index.d.ts +26 -26
  279. package/dist/schema/utils/guard-query-utils.d.ts +7 -0
  280. package/dist/schema/utils/guard-query-utils.js +14 -1
  281. package/dist/schemas/account_operation.output.json +718 -0
  282. package/dist/schemas/bridge_operation.output.json +1 -1
  283. package/dist/schemas/config_operation.output.json +173 -0
  284. package/dist/schemas/index.json +9 -1
  285. package/dist/schemas/local_info_operation.output.json +718 -0
  286. package/dist/schemas/local_mark_operation.output.json +718 -0
  287. package/dist/schemas/messenger_operation.output.json +1 -1
  288. package/dist/schemas/onchain_events.output.json +1 -1
  289. package/dist/schemas/onchain_operations.output.json +5 -4
  290. package/dist/schemas/onchain_operations.schema.json +1813 -333
  291. package/dist/schemas/onchain_operations_allocation.schema.json +9 -11
  292. package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
  293. package/dist/schemas/onchain_operations_contact.schema.json +2 -1
  294. package/dist/schemas/onchain_operations_demand.schema.json +2 -1
  295. package/dist/schemas/onchain_operations_gen_passport.schema.json +878 -872
  296. package/dist/schemas/onchain_operations_gen_proof.schema.json +273 -0
  297. package/dist/schemas/onchain_operations_guard.schema.json +584 -70
  298. package/dist/schemas/onchain_operations_machine.schema.json +4 -6
  299. package/dist/schemas/onchain_operations_order.schema.json +13 -9
  300. package/dist/schemas/onchain_operations_payment.schema.json +2 -1
  301. package/dist/schemas/onchain_operations_permission.schema.json +2 -1
  302. package/dist/schemas/onchain_operations_personal.schema.json +2 -1
  303. package/dist/schemas/onchain_operations_progress.schema.json +14 -10
  304. package/dist/schemas/onchain_operations_proof.schema.json +699 -0
  305. package/dist/schemas/onchain_operations_repository.schema.json +2 -1
  306. package/dist/schemas/onchain_operations_reward.schema.json +2 -1
  307. package/dist/schemas/onchain_operations_service.schema.json +4 -6
  308. package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
  309. package/dist/schemas/onchain_table_data.output.json +6 -12
  310. package/dist/schemas/onchain_table_data.schema.json +32 -1
  311. package/dist/schemas/project_operation.output.json +879 -0
  312. package/dist/schemas/project_operation.schema.json +473 -2
  313. package/dist/schemas/query_toolkit.output.json +14906 -6
  314. package/dist/schemas/schema_query.output.json +38 -1
  315. package/dist/telemetry/index.d.ts +1 -1
  316. package/dist/tools/handlers/bridge.d.ts +1 -0
  317. package/dist/tools/handlers/bridge.js +1 -0
  318. package/dist/tools/handlers/config.d.ts +2 -0
  319. package/dist/tools/handlers/config.js +74 -0
  320. package/dist/tools/handlers/file-export.d.ts +3 -0
  321. package/dist/tools/handlers/file-export.js +90 -0
  322. package/dist/tools/handlers/local.d.ts +3 -0
  323. package/dist/tools/handlers/local.js +38 -0
  324. package/dist/tools/handlers/messenger.d.ts +16 -0
  325. package/dist/tools/handlers/messenger.js +188 -0
  326. package/dist/tools/handlers/onchain.d.ts +2 -0
  327. package/dist/tools/handlers/onchain.js +248 -0
  328. package/dist/tools/handlers/project.d.ts +2 -0
  329. package/dist/tools/handlers/project.js +293 -0
  330. package/dist/tools/handlers/query.d.ts +5 -0
  331. package/dist/tools/handlers/query.js +256 -0
  332. package/dist/tools/handlers/schema-query.d.ts +2 -0
  333. package/dist/tools/handlers/schema-query.js +93 -0
  334. package/dist/tools/handlers/trust.d.ts +2 -0
  335. package/dist/tools/handlers/trust.js +194 -0
  336. package/dist/tools/handlers/wip.d.ts +2 -0
  337. package/dist/tools/handlers/wip.js +44 -0
  338. package/dist/tools/index.d.ts +13 -0
  339. package/dist/tools/index.js +526 -0
  340. package/dist/tools/rules-hook.d.ts +2 -0
  341. package/dist/tools/rules-hook.js +23 -0
  342. package/dist/tools/shared.d.ts +20 -0
  343. package/dist/tools/shared.js +130 -0
  344. package/dist/tools/types.d.ts +35 -0
  345. package/dist/tools/types.js +1 -0
  346. package/dist/tools/wrap.d.ts +14 -0
  347. package/dist/tools/wrap.js +267 -0
  348. package/package.json +20 -6
@@ -71,25 +71,22 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
71
71
  forward: string;
72
72
  next_node_name: string;
73
73
  }>;
74
- hold: z.ZodOptional<z.ZodBoolean>;
75
- adminUnhold: z.ZodOptional<z.ZodBoolean>;
74
+ op: z.ZodEnum<["next", "hold", "unhold", "adminUnhold"]>;
76
75
  message: z.ZodOptional<z.ZodString>;
77
76
  }, "strict", z.ZodTypeAny, {
77
+ op: "next" | "hold" | "unhold" | "adminUnhold";
78
78
  operation: {
79
79
  forward: string;
80
80
  next_node_name: string;
81
81
  };
82
82
  message?: string | undefined;
83
- hold?: boolean | undefined;
84
- adminUnhold?: boolean | undefined;
85
83
  }, {
84
+ op: "next" | "hold" | "unhold" | "adminUnhold";
86
85
  operation: {
87
86
  forward: string;
88
87
  next_node_name: string;
89
88
  };
90
89
  message?: string | undefined;
91
- hold?: boolean | undefined;
92
- adminUnhold?: boolean | undefined;
93
90
  }>>;
94
91
  arb_confirm: z.ZodOptional<z.ZodObject<{
95
92
  arb: z.ZodEffects<z.ZodString, string, string>;
@@ -212,13 +209,27 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
212
209
  }, "strict", z.ZodTypeAny, {
213
210
  object: string;
214
211
  progress?: {
212
+ op: "next" | "hold" | "unhold" | "adminUnhold";
215
213
  operation: {
216
214
  forward: string;
217
215
  next_node_name: string;
218
216
  };
219
217
  message?: string | undefined;
220
- hold?: boolean | undefined;
221
- adminUnhold?: boolean | undefined;
218
+ } | undefined;
219
+ receive?: {
220
+ result: {
221
+ received: {
222
+ id: string;
223
+ balance: string | number;
224
+ payment: string;
225
+ }[];
226
+ balance: string | number;
227
+ token_type: string;
228
+ } | {
229
+ type: string;
230
+ id: string;
231
+ content_raw?: any;
232
+ }[];
222
233
  } | undefined;
223
234
  agent?: {
224
235
  entities: {
@@ -241,6 +252,20 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
241
252
  arb_claim_compensation?: {
242
253
  arb: string;
243
254
  } | undefined;
255
+ transfer_to?: {
256
+ name_or_address?: string | undefined;
257
+ local_mark_first?: boolean | undefined;
258
+ } | undefined;
259
+ }, {
260
+ object: string;
261
+ progress?: {
262
+ op: "next" | "hold" | "unhold" | "adminUnhold";
263
+ operation: {
264
+ forward: string;
265
+ next_node_name: string;
266
+ };
267
+ message?: string | undefined;
268
+ } | undefined;
244
269
  receive?: {
245
270
  result: {
246
271
  received: {
@@ -256,21 +281,6 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
256
281
  content_raw?: any;
257
282
  }[];
258
283
  } | undefined;
259
- transfer_to?: {
260
- name_or_address?: string | undefined;
261
- local_mark_first?: boolean | undefined;
262
- } | undefined;
263
- }, {
264
- object: string;
265
- progress?: {
266
- operation: {
267
- forward: string;
268
- next_node_name: string;
269
- };
270
- message?: string | undefined;
271
- hold?: boolean | undefined;
272
- adminUnhold?: boolean | undefined;
273
- } | undefined;
274
284
  agent?: {
275
285
  entities: {
276
286
  name_or_address?: string | undefined;
@@ -292,21 +302,6 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
292
302
  arb_claim_compensation?: {
293
303
  arb: string;
294
304
  } | undefined;
295
- receive?: {
296
- result: {
297
- received: {
298
- id: string;
299
- balance: string | number;
300
- payment: string;
301
- }[];
302
- balance: string | number;
303
- token_type: string;
304
- } | {
305
- type: string;
306
- id: string;
307
- content_raw?: any;
308
- }[];
309
- } | undefined;
310
305
  transfer_to?: {
311
306
  name_or_address?: string | undefined;
312
307
  local_mark_first?: boolean | undefined;
@@ -352,25 +347,22 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
352
347
  forward: string;
353
348
  next_node_name: string;
354
349
  }>;
355
- hold: z.ZodOptional<z.ZodBoolean>;
356
- adminUnhold: z.ZodOptional<z.ZodBoolean>;
350
+ op: z.ZodEnum<["next", "hold", "unhold", "adminUnhold"]>;
357
351
  message: z.ZodOptional<z.ZodString>;
358
352
  }, "strict", z.ZodTypeAny, {
353
+ op: "next" | "hold" | "unhold" | "adminUnhold";
359
354
  operation: {
360
355
  forward: string;
361
356
  next_node_name: string;
362
357
  };
363
358
  message?: string | undefined;
364
- hold?: boolean | undefined;
365
- adminUnhold?: boolean | undefined;
366
359
  }, {
360
+ op: "next" | "hold" | "unhold" | "adminUnhold";
367
361
  operation: {
368
362
  forward: string;
369
363
  next_node_name: string;
370
364
  };
371
365
  message?: string | undefined;
372
- hold?: boolean | undefined;
373
- adminUnhold?: boolean | undefined;
374
366
  }>>;
375
367
  arb_confirm: z.ZodOptional<z.ZodObject<{
376
368
  arb: z.ZodEffects<z.ZodString, string, string>;
@@ -493,13 +485,27 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
493
485
  }, "strict", z.ZodTypeAny, {
494
486
  object: string;
495
487
  progress?: {
488
+ op: "next" | "hold" | "unhold" | "adminUnhold";
496
489
  operation: {
497
490
  forward: string;
498
491
  next_node_name: string;
499
492
  };
500
493
  message?: string | undefined;
501
- hold?: boolean | undefined;
502
- adminUnhold?: boolean | undefined;
494
+ } | undefined;
495
+ receive?: {
496
+ result: {
497
+ received: {
498
+ id: string;
499
+ balance: string | number;
500
+ payment: string;
501
+ }[];
502
+ balance: string | number;
503
+ token_type: string;
504
+ } | {
505
+ type: string;
506
+ id: string;
507
+ content_raw?: any;
508
+ }[];
503
509
  } | undefined;
504
510
  agent?: {
505
511
  entities: {
@@ -522,6 +528,20 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
522
528
  arb_claim_compensation?: {
523
529
  arb: string;
524
530
  } | undefined;
531
+ transfer_to?: {
532
+ name_or_address?: string | undefined;
533
+ local_mark_first?: boolean | undefined;
534
+ } | undefined;
535
+ }, {
536
+ object: string;
537
+ progress?: {
538
+ op: "next" | "hold" | "unhold" | "adminUnhold";
539
+ operation: {
540
+ forward: string;
541
+ next_node_name: string;
542
+ };
543
+ message?: string | undefined;
544
+ } | undefined;
525
545
  receive?: {
526
546
  result: {
527
547
  received: {
@@ -537,21 +557,6 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
537
557
  content_raw?: any;
538
558
  }[];
539
559
  } | undefined;
540
- transfer_to?: {
541
- name_or_address?: string | undefined;
542
- local_mark_first?: boolean | undefined;
543
- } | undefined;
544
- }, {
545
- object: string;
546
- progress?: {
547
- operation: {
548
- forward: string;
549
- next_node_name: string;
550
- };
551
- message?: string | undefined;
552
- hold?: boolean | undefined;
553
- adminUnhold?: boolean | undefined;
554
- } | undefined;
555
560
  agent?: {
556
561
  entities: {
557
562
  name_or_address?: string | undefined;
@@ -573,21 +578,6 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
573
578
  arb_claim_compensation?: {
574
579
  arb: string;
575
580
  } | undefined;
576
- receive?: {
577
- result: {
578
- received: {
579
- id: string;
580
- balance: string | number;
581
- payment: string;
582
- }[];
583
- balance: string | number;
584
- token_type: string;
585
- } | {
586
- type: string;
587
- id: string;
588
- content_raw?: any;
589
- }[];
590
- } | undefined;
591
581
  transfer_to?: {
592
582
  name_or_address?: string | undefined;
593
583
  local_mark_first?: boolean | undefined;
@@ -811,13 +801,27 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
811
801
  data: {
812
802
  object: string;
813
803
  progress?: {
804
+ op: "next" | "hold" | "unhold" | "adminUnhold";
814
805
  operation: {
815
806
  forward: string;
816
807
  next_node_name: string;
817
808
  };
818
809
  message?: string | undefined;
819
- hold?: boolean | undefined;
820
- adminUnhold?: boolean | undefined;
810
+ } | undefined;
811
+ receive?: {
812
+ result: {
813
+ received: {
814
+ id: string;
815
+ balance: string | number;
816
+ payment: string;
817
+ }[];
818
+ balance: string | number;
819
+ token_type: string;
820
+ } | {
821
+ type: string;
822
+ id: string;
823
+ content_raw?: any;
824
+ }[];
821
825
  } | undefined;
822
826
  agent?: {
823
827
  entities: {
@@ -840,21 +844,6 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
840
844
  arb_claim_compensation?: {
841
845
  arb: string;
842
846
  } | undefined;
843
- receive?: {
844
- result: {
845
- received: {
846
- id: string;
847
- balance: string | number;
848
- payment: string;
849
- }[];
850
- balance: string | number;
851
- token_type: string;
852
- } | {
853
- type: string;
854
- id: string;
855
- content_raw?: any;
856
- }[];
857
- } | undefined;
858
847
  transfer_to?: {
859
848
  name_or_address?: string | undefined;
860
849
  local_mark_first?: boolean | undefined;
@@ -903,13 +892,27 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
903
892
  data: {
904
893
  object: string;
905
894
  progress?: {
895
+ op: "next" | "hold" | "unhold" | "adminUnhold";
906
896
  operation: {
907
897
  forward: string;
908
898
  next_node_name: string;
909
899
  };
910
900
  message?: string | undefined;
911
- hold?: boolean | undefined;
912
- adminUnhold?: boolean | undefined;
901
+ } | undefined;
902
+ receive?: {
903
+ result: {
904
+ received: {
905
+ id: string;
906
+ balance: string | number;
907
+ payment: string;
908
+ }[];
909
+ balance: string | number;
910
+ token_type: string;
911
+ } | {
912
+ type: string;
913
+ id: string;
914
+ content_raw?: any;
915
+ }[];
913
916
  } | undefined;
914
917
  agent?: {
915
918
  entities: {
@@ -932,21 +935,6 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
932
935
  arb_claim_compensation?: {
933
936
  arb: string;
934
937
  } | undefined;
935
- receive?: {
936
- result: {
937
- received: {
938
- id: string;
939
- balance: string | number;
940
- payment: string;
941
- }[];
942
- balance: string | number;
943
- token_type: string;
944
- } | {
945
- type: string;
946
- id: string;
947
- content_raw?: any;
948
- }[];
949
- } | undefined;
950
938
  transfer_to?: {
951
939
  name_or_address?: string | undefined;
952
940
  local_mark_first?: boolean | undefined;
@@ -0,0 +1,5 @@
1
+ import type { CallEnv } from "@wowok/wowok";
2
+ import { handleCallResult } from "./handler.js";
3
+ import type { SemanticContext } from "./semantic.js";
4
+ import type { CallPermission_Data } from "./permission.js";
5
+ export declare function handlePermissionOperations(data: CallPermission_Data, env: CallEnv, buildCtx: (data: unknown) => SemanticContext): Promise<ReturnType<typeof handleCallResult>>;
@@ -0,0 +1,54 @@
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
+ }