@wowok/agent-mcp 2.4.3 → 2.5.1

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 (317) 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.js +21 -0
  6. package/dist/knowledge/allocation-confirm.d.ts +115 -0
  7. package/dist/knowledge/allocation-confirm.js +534 -0
  8. package/dist/knowledge/allocation-context.d.ts +58 -0
  9. package/dist/knowledge/allocation-context.js +249 -0
  10. package/dist/knowledge/allocation-ledger.d.ts +67 -0
  11. package/dist/knowledge/allocation-ledger.js +463 -0
  12. package/dist/knowledge/allocation-puzzle.d.ts +135 -0
  13. package/dist/knowledge/allocation-puzzle.js +298 -0
  14. package/dist/knowledge/allocation-risk.d.ts +78 -0
  15. package/dist/knowledge/allocation-risk.js +568 -0
  16. package/dist/knowledge/allocation-templates.d.ts +38 -0
  17. package/dist/knowledge/allocation-templates.js +970 -0
  18. package/dist/knowledge/allocation-translation.d.ts +72 -0
  19. package/dist/knowledge/allocation-translation.js +585 -0
  20. package/dist/knowledge/arb-risk.d.ts +37 -0
  21. package/dist/knowledge/arb-risk.js +210 -0
  22. package/dist/knowledge/arbitration-confirm.d.ts +135 -0
  23. package/dist/knowledge/arbitration-confirm.js +559 -0
  24. package/dist/knowledge/arbitration-context.d.ts +81 -0
  25. package/dist/knowledge/arbitration-context.js +505 -0
  26. package/dist/knowledge/arbitration-ledger.d.ts +62 -0
  27. package/dist/knowledge/arbitration-ledger.js +521 -0
  28. package/dist/knowledge/arbitration-puzzle.d.ts +84 -0
  29. package/dist/knowledge/arbitration-puzzle.js +304 -0
  30. package/dist/knowledge/arbitration-risk.d.ts +112 -0
  31. package/dist/knowledge/arbitration-risk.js +433 -0
  32. package/dist/knowledge/arbitration-templates.d.ts +38 -0
  33. package/dist/knowledge/arbitration-templates.js +276 -0
  34. package/dist/knowledge/arbitration-translation.d.ts +91 -0
  35. package/dist/knowledge/arbitration-translation.js +487 -0
  36. package/dist/knowledge/bridge-risk.d.ts +36 -0
  37. package/dist/knowledge/bridge-risk.js +263 -0
  38. package/dist/knowledge/contact-risk.d.ts +32 -0
  39. package/dist/knowledge/contact-risk.js +200 -0
  40. package/dist/knowledge/demand-confirm.d.ts +32 -0
  41. package/dist/knowledge/demand-confirm.js +206 -0
  42. package/dist/knowledge/demand-risk.d.ts +30 -0
  43. package/dist/knowledge/demand-risk.js +240 -0
  44. package/dist/knowledge/demand-translation.d.ts +55 -0
  45. package/dist/knowledge/demand-translation.js +354 -0
  46. package/dist/knowledge/deployment-scanner.d.ts +63 -0
  47. package/dist/knowledge/deployment-scanner.js +762 -0
  48. package/dist/knowledge/examples-scanner-cli.d.ts +1 -0
  49. package/dist/knowledge/examples-scanner-cli.js +26 -0
  50. package/dist/knowledge/examples-scanner.d.ts +121 -0
  51. package/dist/knowledge/examples-scanner.js +825 -0
  52. package/dist/knowledge/flywheel-loop.d.ts +3 -0
  53. package/dist/knowledge/flywheel-loop.js +32 -3
  54. package/dist/knowledge/glossary.js +3 -1
  55. package/dist/knowledge/guard-confirm.d.ts +86 -0
  56. package/dist/knowledge/guard-confirm.js +406 -0
  57. package/dist/knowledge/guard-context.d.ts +56 -0
  58. package/dist/knowledge/guard-context.js +287 -0
  59. package/dist/knowledge/guard-design-patterns.d.ts +37 -0
  60. package/dist/knowledge/guard-design-patterns.js +257 -0
  61. package/dist/knowledge/guard-puzzle.js +3 -2
  62. package/dist/knowledge/guard-risk.d.ts +1 -1
  63. package/dist/knowledge/guard-risk.js +12 -14
  64. package/dist/knowledge/guard-templates.js +1 -1
  65. package/dist/knowledge/guard-translation.js +6 -5
  66. package/dist/knowledge/index.d.ts +342 -0
  67. package/dist/knowledge/index.js +344 -0
  68. package/dist/knowledge/machine-confirm.d.ts +102 -0
  69. package/dist/knowledge/machine-confirm.js +559 -0
  70. package/dist/knowledge/machine-context.d.ts +160 -0
  71. package/dist/knowledge/machine-context.js +812 -0
  72. package/dist/knowledge/machine-ledger.d.ts +41 -0
  73. package/dist/knowledge/machine-ledger.js +315 -0
  74. package/dist/knowledge/machine-puzzle.d.ts +206 -0
  75. package/dist/knowledge/machine-puzzle.js +494 -0
  76. package/dist/knowledge/machine-risk.d.ts +75 -0
  77. package/dist/knowledge/machine-risk.js +644 -0
  78. package/dist/knowledge/machine-templates.d.ts +92 -0
  79. package/dist/knowledge/machine-templates.js +1592 -0
  80. package/dist/knowledge/machine-topology.d.ts +57 -0
  81. package/dist/knowledge/machine-topology.js +234 -0
  82. package/dist/knowledge/machine-translation.d.ts +96 -0
  83. package/dist/knowledge/machine-translation.js +513 -0
  84. package/dist/knowledge/mcp-schema-audit-cli.d.ts +1 -0
  85. package/dist/knowledge/mcp-schema-audit-cli.js +45 -0
  86. package/dist/knowledge/mcp-schema-audit.d.ts +90 -0
  87. package/dist/knowledge/mcp-schema-audit.js +772 -0
  88. package/dist/knowledge/onchain-constants.d.ts +4 -0
  89. package/dist/knowledge/onchain-constants.js +35 -0
  90. package/dist/knowledge/order-confirm.d.ts +115 -0
  91. package/dist/knowledge/order-confirm.js +573 -0
  92. package/dist/knowledge/order-context.d.ts +66 -0
  93. package/dist/knowledge/order-context.js +390 -0
  94. package/dist/knowledge/order-ledger.d.ts +69 -0
  95. package/dist/knowledge/order-ledger.js +341 -0
  96. package/dist/knowledge/order-puzzle.d.ts +159 -0
  97. package/dist/knowledge/order-puzzle.js +255 -0
  98. package/dist/knowledge/order-risk.d.ts +66 -0
  99. package/dist/knowledge/order-risk.js +653 -0
  100. package/dist/knowledge/order-templates.d.ts +50 -0
  101. package/dist/knowledge/order-templates.js +368 -0
  102. package/dist/knowledge/order-translation.d.ts +78 -0
  103. package/dist/knowledge/order-translation.js +550 -0
  104. package/dist/knowledge/passport-confirm.d.ts +130 -0
  105. package/dist/knowledge/passport-confirm.js +531 -0
  106. package/dist/knowledge/passport-context.d.ts +59 -0
  107. package/dist/knowledge/passport-context.js +306 -0
  108. package/dist/knowledge/passport-ledger.d.ts +48 -0
  109. package/dist/knowledge/passport-ledger.js +282 -0
  110. package/dist/knowledge/passport-puzzle.d.ts +108 -0
  111. package/dist/knowledge/passport-puzzle.js +333 -0
  112. package/dist/knowledge/passport-risk.d.ts +70 -0
  113. package/dist/knowledge/passport-risk.js +450 -0
  114. package/dist/knowledge/passport-templates.d.ts +40 -0
  115. package/dist/knowledge/passport-templates.js +568 -0
  116. package/dist/knowledge/passport-translation.d.ts +68 -0
  117. package/dist/knowledge/passport-translation.js +516 -0
  118. package/dist/knowledge/payment-risk.d.ts +33 -0
  119. package/dist/knowledge/payment-risk.js +182 -0
  120. package/dist/knowledge/permission-confirm.d.ts +110 -0
  121. package/dist/knowledge/permission-confirm.js +426 -0
  122. package/dist/knowledge/permission-context.d.ts +58 -0
  123. package/dist/knowledge/permission-context.js +224 -0
  124. package/dist/knowledge/permission-ledger.d.ts +38 -0
  125. package/dist/knowledge/permission-ledger.js +403 -0
  126. package/dist/knowledge/permission-puzzle.d.ts +122 -0
  127. package/dist/knowledge/permission-puzzle.js +173 -0
  128. package/dist/knowledge/permission-risk.d.ts +76 -0
  129. package/dist/knowledge/permission-risk.js +411 -0
  130. package/dist/knowledge/permission-templates.d.ts +38 -0
  131. package/dist/knowledge/permission-templates.js +234 -0
  132. package/dist/knowledge/permission-translation.d.ts +57 -0
  133. package/dist/knowledge/permission-translation.js +350 -0
  134. package/dist/knowledge/personal-risk.d.ts +36 -0
  135. package/dist/knowledge/personal-risk.js +212 -0
  136. package/dist/knowledge/progress-confirm.d.ts +108 -0
  137. package/dist/knowledge/progress-confirm.js +456 -0
  138. package/dist/knowledge/progress-context.d.ts +123 -0
  139. package/dist/knowledge/progress-context.js +452 -0
  140. package/dist/knowledge/progress-ledger.d.ts +63 -0
  141. package/dist/knowledge/progress-ledger.js +327 -0
  142. package/dist/knowledge/progress-puzzle.d.ts +82 -0
  143. package/dist/knowledge/progress-puzzle.js +219 -0
  144. package/dist/knowledge/progress-risk.d.ts +74 -0
  145. package/dist/knowledge/progress-risk.js +461 -0
  146. package/dist/knowledge/progress-templates.d.ts +38 -0
  147. package/dist/knowledge/progress-templates.js +228 -0
  148. package/dist/knowledge/progress-translation.d.ts +52 -0
  149. package/dist/knowledge/progress-translation.js +401 -0
  150. package/dist/knowledge/proof-confirm.d.ts +31 -0
  151. package/dist/knowledge/proof-confirm.js +187 -0
  152. package/dist/knowledge/proof-risk.d.ts +33 -0
  153. package/dist/knowledge/proof-risk.js +207 -0
  154. package/dist/knowledge/proof-translation.d.ts +52 -0
  155. package/dist/knowledge/proof-translation.js +283 -0
  156. package/dist/knowledge/registrar-risk.d.ts +34 -0
  157. package/dist/knowledge/registrar-risk.js +217 -0
  158. package/dist/knowledge/repository-confirm.d.ts +36 -0
  159. package/dist/knowledge/repository-confirm.js +242 -0
  160. package/dist/knowledge/repository-risk.d.ts +40 -0
  161. package/dist/knowledge/repository-risk.js +312 -0
  162. package/dist/knowledge/repository-translation.d.ts +58 -0
  163. package/dist/knowledge/repository-translation.js +422 -0
  164. package/dist/knowledge/resource-risk.d.ts +32 -0
  165. package/dist/knowledge/resource-risk.js +157 -0
  166. package/dist/knowledge/reward-confirm.d.ts +113 -0
  167. package/dist/knowledge/reward-confirm.js +496 -0
  168. package/dist/knowledge/reward-context.d.ts +127 -0
  169. package/dist/knowledge/reward-context.js +504 -0
  170. package/dist/knowledge/reward-ledger.d.ts +96 -0
  171. package/dist/knowledge/reward-ledger.js +502 -0
  172. package/dist/knowledge/reward-puzzle.d.ts +97 -0
  173. package/dist/knowledge/reward-puzzle.js +288 -0
  174. package/dist/knowledge/reward-risk.d.ts +84 -0
  175. package/dist/knowledge/reward-risk.js +545 -0
  176. package/dist/knowledge/reward-translation.d.ts +58 -0
  177. package/dist/knowledge/reward-translation.js +501 -0
  178. package/dist/knowledge/safety-rules.js +11 -3
  179. package/dist/knowledge/scenario-modes.d.ts +53 -0
  180. package/dist/knowledge/scenario-modes.js +302 -0
  181. package/dist/knowledge/service-confirm.d.ts +152 -0
  182. package/dist/knowledge/service-confirm.js +699 -0
  183. package/dist/knowledge/service-context.d.ts +66 -0
  184. package/dist/knowledge/service-context.js +403 -0
  185. package/dist/knowledge/service-ledger.d.ts +71 -0
  186. package/dist/knowledge/service-ledger.js +609 -0
  187. package/dist/knowledge/service-puzzle.d.ts +158 -0
  188. package/dist/knowledge/service-puzzle.js +236 -0
  189. package/dist/knowledge/service-risk.d.ts +108 -0
  190. package/dist/knowledge/service-risk.js +615 -0
  191. package/dist/knowledge/service-templates.d.ts +39 -0
  192. package/dist/knowledge/service-templates.js +418 -0
  193. package/dist/knowledge/service-translation.d.ts +103 -0
  194. package/dist/knowledge/service-translation.js +622 -0
  195. package/dist/knowledge/tools-reference.d.ts +17 -0
  196. package/dist/knowledge/tools-reference.js +151 -0
  197. package/dist/knowledge/treasury-confirm.d.ts +133 -0
  198. package/dist/knowledge/treasury-confirm.js +512 -0
  199. package/dist/knowledge/treasury-context.d.ts +64 -0
  200. package/dist/knowledge/treasury-context.js +363 -0
  201. package/dist/knowledge/treasury-ledger.d.ts +42 -0
  202. package/dist/knowledge/treasury-ledger.js +300 -0
  203. package/dist/knowledge/treasury-puzzle.d.ts +163 -0
  204. package/dist/knowledge/treasury-puzzle.js +216 -0
  205. package/dist/knowledge/treasury-risk.d.ts +86 -0
  206. package/dist/knowledge/treasury-risk.js +440 -0
  207. package/dist/knowledge/treasury-templates.d.ts +38 -0
  208. package/dist/knowledge/treasury-templates.js +316 -0
  209. package/dist/knowledge/treasury-translation.d.ts +78 -0
  210. package/dist/knowledge/treasury-translation.js +498 -0
  211. package/dist/knowledge/util-risk.d.ts +30 -0
  212. package/dist/knowledge/util-risk.js +135 -0
  213. package/dist/project/business-puzzle.d.ts +47 -0
  214. package/dist/project/business-puzzle.js +372 -0
  215. package/dist/project/deployment-doc.d.ts +61 -0
  216. package/dist/project/deployment-doc.js +432 -0
  217. package/dist/project/risk-aggregator.d.ts +50 -0
  218. package/dist/project/risk-aggregator.js +280 -0
  219. package/dist/project/substep-trace.d.ts +130 -0
  220. package/dist/project/substep-trace.js +332 -0
  221. package/dist/schema/call/allocation.d.ts +34 -34
  222. package/dist/schema/call/arbitration.d.ts +141 -141
  223. package/dist/schema/call/base.d.ts +386 -386
  224. package/dist/schema/call/base.js +3 -3
  225. package/dist/schema/call/bridge-handler.d.ts +5 -2
  226. package/dist/schema/call/bridge.d.ts +159 -159
  227. package/dist/schema/call/contact.d.ts +110 -110
  228. package/dist/schema/call/demand.d.ts +76 -76
  229. package/dist/schema/call/handler.d.ts +2 -3
  230. package/dist/schema/call/handler.js +1 -1
  231. package/dist/schema/call/machine.d.ts +58 -58
  232. package/dist/schema/call/order.d.ts +98 -110
  233. package/dist/schema/call/permission-handler.d.ts +5 -0
  234. package/dist/schema/call/permission-handler.js +54 -0
  235. package/dist/schema/call/permission.d.ts +108 -108
  236. package/dist/schema/call/personal.d.ts +14 -14
  237. package/dist/schema/call/progress.d.ts +57 -72
  238. package/dist/schema/call/progress.js +7 -4
  239. package/dist/schema/call/proof.d.ts +18 -18
  240. package/dist/schema/call/proof.js +12 -7
  241. package/dist/schema/call/repository.d.ts +154 -154
  242. package/dist/schema/call/reward.d.ts +55 -55
  243. package/dist/schema/call/service.d.ts +231 -231
  244. package/dist/schema/call/treasury.d.ts +93 -93
  245. package/dist/schema/config/index.d.ts +178 -5
  246. package/dist/schema/config/index.js +52 -1
  247. package/dist/schema/local/index.d.ts +3554 -836
  248. package/dist/schema/local/index.js +2 -1
  249. package/dist/schema/messenger/index.d.ts +162 -162
  250. package/dist/schema/operations.d.ts +1058 -1074
  251. package/dist/schema/operations.js +7 -1
  252. package/dist/schema/project/index.d.ts +1412 -6
  253. package/dist/schema/project/index.js +441 -3
  254. package/dist/schema/query/index.d.ts +672 -672
  255. package/dist/schema/schema-query/index.d.ts +23 -3
  256. package/dist/schema/schema-query/index.js +13 -2
  257. package/dist/schema/sync-layer4.d.ts +21 -0
  258. package/dist/schema/sync-layer4.js +261 -0
  259. package/dist/schema/trust/index.d.ts +26 -26
  260. package/dist/schemas/account_operation.output.json +718 -0
  261. package/dist/schemas/config_operation.output.json +173 -0
  262. package/dist/schemas/index.json +9 -1
  263. package/dist/schemas/local_info_operation.output.json +718 -0
  264. package/dist/schemas/local_mark_operation.output.json +718 -0
  265. package/dist/schemas/onchain_operations.output.json +3 -2
  266. package/dist/schemas/onchain_operations.schema.json +1809 -336
  267. package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
  268. package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
  269. package/dist/schemas/onchain_operations_contact.schema.json +2 -1
  270. package/dist/schemas/onchain_operations_demand.schema.json +2 -1
  271. package/dist/schemas/onchain_operations_gen_passport.schema.json +878 -872
  272. package/dist/schemas/onchain_operations_gen_proof.schema.json +273 -0
  273. package/dist/schemas/onchain_operations_guard.schema.json +578 -579
  274. package/dist/schemas/onchain_operations_machine.schema.json +2 -1
  275. package/dist/schemas/onchain_operations_order.schema.json +13 -9
  276. package/dist/schemas/onchain_operations_payment.schema.json +0 -514
  277. package/dist/schemas/onchain_operations_permission.schema.json +0 -514
  278. package/dist/schemas/onchain_operations_personal.schema.json +0 -514
  279. package/dist/schemas/onchain_operations_progress.schema.json +14 -10
  280. package/dist/schemas/onchain_operations_proof.schema.json +699 -0
  281. package/dist/schemas/onchain_operations_repository.schema.json +2 -1
  282. package/dist/schemas/onchain_operations_reward.schema.json +2 -1
  283. package/dist/schemas/onchain_operations_service.schema.json +2 -1
  284. package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
  285. package/dist/schemas/onchain_table_data.schema.json +32 -1
  286. package/dist/schemas/project_operation.output.json +918 -0
  287. package/dist/schemas/project_operation.schema.json +474 -3
  288. package/dist/schemas/query_toolkit.output.json +14906 -6
  289. package/dist/schemas/schema_query.output.json +38 -1
  290. package/dist/telemetry/index.d.ts +1 -1
  291. package/dist/tools/handlers/config.d.ts +1 -1
  292. package/dist/tools/handlers/config.js +21 -18
  293. package/dist/tools/handlers/file-export.d.ts +2 -2
  294. package/dist/tools/handlers/local.d.ts +3 -30
  295. package/dist/tools/handlers/local.js +14 -3
  296. package/dist/tools/handlers/messenger.d.ts +1 -1
  297. package/dist/tools/handlers/messenger.js +2 -1
  298. package/dist/tools/handlers/onchain.d.ts +1 -1
  299. package/dist/tools/handlers/onchain.js +24 -22
  300. package/dist/tools/handlers/project.d.ts +1 -1
  301. package/dist/tools/handlers/project.js +262 -18
  302. package/dist/tools/handlers/query.d.ts +4 -4
  303. package/dist/tools/handlers/schema-query.d.ts +1 -1
  304. package/dist/tools/handlers/schema-query.js +21 -20
  305. package/dist/tools/handlers/trust.d.ts +1 -1
  306. package/dist/tools/handlers/trust.js +2 -2
  307. package/dist/tools/handlers/wip.d.ts +1 -1
  308. package/dist/tools/handlers/wip.js +1 -1
  309. package/dist/tools/index.d.ts +1 -1
  310. package/dist/tools/index.js +96 -25
  311. package/dist/tools/rules-hook.d.ts +1 -1
  312. package/dist/tools/rules-hook.js +3 -2
  313. package/dist/tools/shared.d.ts +13 -22
  314. package/dist/tools/types.d.ts +5 -5
  315. package/dist/tools/wrap.d.ts +10 -2
  316. package/dist/tools/wrap.js +212 -0
  317. package/package.json +3 -3
@@ -0,0 +1,263 @@
1
+ import { BRIDGE_MESSAGE_VERSION, BRIDGE_EVM_ADDRESS_LENGTH, BRIDGE_CURRENT_VERSION, } from "@wowok/wowok";
2
+ const SUPPORTED_TOKENS = ["ETH", "WETH", "WBTC", "USDC", "USDT"];
3
+ const MAX_IDEMPOTENCY_KEY_LENGTH = 128;
4
+ const BRIDGE_ERROR_CODE_COUNT = 20;
5
+ const R_B_01 = {
6
+ rule: {
7
+ id: "R-BRIDGE-01",
8
+ level: "CRITICAL",
9
+ category: "permission",
10
+ title: "Cross-chain asset security — committee signature verification is the single trust root",
11
+ description: "Bridge committee signatures are the only thing preventing forged cross-chain messages " +
12
+ "from minting tokens out of thin air (bridge.move:60). If a committee key is " +
13
+ "compromised, or if the verification logic has a bug, an attacker can claim arbitrary " +
14
+ "amounts of ETH/WETH/WBTC/USDC/USDT. The TransferLimiter caps single-transfer amounts " +
15
+ "but does not prevent repeated small attacks.",
16
+ affected_stakeholders: ["user", "committee", "system"],
17
+ scenario: "Committee private key leaks; attacker forges an approved transfer and claims funds",
18
+ mitigation: "Committee members MUST use HSM-backed multi-sig. Rotate keys on a schedule. Audit " +
19
+ "committee membership and signature verification logic on every release. Monitor " +
20
+ "limiter utilization for suspicious patterns. Have an EmergencyOp pause plan ready.",
21
+ auto_fixable: false,
22
+ },
23
+ check: (ctx) => {
24
+ if (!ctx.assumes_committee_infallible)
25
+ return null;
26
+ return { ...R_B_01.rule, evidence: "assumes_committee_infallible=true (trust root is single-point)" };
27
+ },
28
+ };
29
+ const R_B_02 = {
30
+ rule: {
31
+ id: "R-BRIDGE-02",
32
+ level: "HIGH",
33
+ category: "cross_object",
34
+ title: "Bridge is mainnet-only — testnet operations will fail",
35
+ description: "The Bridge is only configured on mainnet. testnet nodes do not have the bridge " +
36
+ "role configured, so any cross-chain operation (cross_chain_wow_to_evm, " +
37
+ "cross_chain_evm_to_wow, claim_wow_to_evm, etc.) will abort. Developers who test on " +
38
+ "testnet will see EBridgeUnavailable (8) and may misdiagnose it as a code bug.",
39
+ affected_stakeholders: ["user", "operator"],
40
+ scenario: "Developer runs cross_chain_wow_to_evm on testnet; aborts with EBridgeUnavailable",
41
+ mitigation: "MCP layer MUST validate mainnet environment before submitting Bridge ops. Document " +
42
+ "the mainnet-only restriction prominently. For testing, use mainnet small-amount " +
43
+ "transactions or fork tests.",
44
+ related_move_error: "EBridgeUnavailable (8)",
45
+ auto_fixable: false,
46
+ },
47
+ check: (ctx) => {
48
+ if (!ctx.is_non_mainnet)
49
+ return null;
50
+ return { ...R_B_02.rule, evidence: "is_non_mainnet=true (Bridge unavailable)" };
51
+ },
52
+ };
53
+ const R_B_03 = {
54
+ rule: {
55
+ id: "R-BRIDGE-03",
56
+ level: "HIGH",
57
+ category: "structural",
58
+ title: "TransferLimiter caps single and cumulative transfer amounts — large transfers reject",
59
+ description: "The TransferLimiter (bridge.move:64) enforces both per-transfer and cumulative " +
60
+ "transfer caps per token type. A transfer that exceeds the cap aborts with " +
61
+ "ETokenAlreadyClaimedOrHitLimit (15) or similar. Users attempting large cross-chain " +
62
+ "moves will see their transactions rejected and may misdiagnose it as a bug.",
63
+ affected_stakeholders: ["user"],
64
+ scenario: "User attempts to bridge 1000 ETH; limiter rejects the transfer",
65
+ mitigation: "Document the limiter semantics. Before submitting, query the current limiter " +
66
+ "utilization. For large amounts, split into batches across multiple transactions " +
67
+ "and/or time windows. Surface the remaining cap in the UI.",
68
+ related_move_error: "ETokenAlreadyClaimedOrHitLimit (15)",
69
+ auto_fixable: false,
70
+ },
71
+ check: (ctx) => null,
72
+ };
73
+ const R_B_04 = {
74
+ rule: {
75
+ id: "R-BRIDGE-04",
76
+ level: "MEDIUM",
77
+ category: "permission",
78
+ title: "activeEvmAccount is a single global EVM account — key leak affects all assets",
79
+ description: "Bridge uses a single global activeEvmAccount that is auto-generated and transparent " +
80
+ "to users. All cross-chain EVM-side operations flow through this one account. If its " +
81
+ "private key leaks, every supported token (ETH/WETH/WBTC/USDC/USDT) on every " +
82
+ "supported chain is at risk. There is no per-user EVM account isolation.",
83
+ affected_stakeholders: ["user", "system"],
84
+ scenario: "activeEvmAccount private key leaks; attacker drains all bridged EVM assets",
85
+ mitigation: "Store the activeEvmAccount key in an HSM. Rotate the key on a schedule and via " +
86
+ "Versioned upgrade. Monitor EVM-side balances for anomalous outflows. Have an " +
87
+ "EmergencyOp pause plan ready.",
88
+ auto_fixable: false,
89
+ },
90
+ check: (ctx) => {
91
+ if (!ctx.assumes_per_user_evm_account)
92
+ return null;
93
+ return { ...R_B_04.rule, evidence: "assumes_per_user_evm_account=true (it is global)" };
94
+ },
95
+ };
96
+ const R_B_05 = {
97
+ rule: {
98
+ id: "R-BRIDGE-05",
99
+ level: "MEDIUM",
100
+ category: "cross_object",
101
+ title: "Public EVM RPCs may rate-limit (HTTP 429) — cross-chain ops stall",
102
+ description: "Bridge ops that query EVM state (query_active_evm_account, query_supported_evm_chains, " +
103
+ "query_transfer_status, etc.) depend on an EVM RPC. Public RPCs (e.g. Infura free tier, " +
104
+ "Alchemy free tier) frequently return HTTP 429 under load. A 429 mid-flow stalls the " +
105
+ "cross-chain operation and may confuse the user. manage_evm_rpc supports multi-RPC " +
106
+ "rotation, but it must be configured in advance.",
107
+ affected_stakeholders: ["user", "operator"],
108
+ scenario: "User queries transfer status; public RPC returns 429; UI shows generic error",
109
+ mitigation: "Configure multiple EVM RPCs via manage_evm_rpc and enable failover. Use a paid RPC " +
110
+ "tier for production. Surface 429 as 'RPC busy, retry' rather than 'operation failed'.",
111
+ auto_fixable: false,
112
+ },
113
+ check: (ctx) => {
114
+ if (!ctx.uses_public_evm_rpc)
115
+ return null;
116
+ return { ...R_B_05.rule, evidence: "uses_public_evm_rpc=true (429 risk)" };
117
+ },
118
+ };
119
+ const R_B_06 = {
120
+ rule: {
121
+ id: "R-BRIDGE-06",
122
+ level: "MEDIUM",
123
+ category: "lifecycle",
124
+ title: "EmergencyOp can pause the Bridge — assets lock during pause",
125
+ description: "EmergencyOp (bridge.move:89-91) can pause the entire Bridge. While paused, no " +
126
+ "cross-chain operations proceed — assets in flight cannot be claimed, new transfers " +
127
+ "cannot be initiated. The pause is intended for incident response, but a prolonged " +
128
+ "pause locks user funds for the duration.",
129
+ affected_stakeholders: ["user", "operator"],
130
+ scenario: "Bridge is paused for incident response; users cannot claim in-flight transfers",
131
+ mitigation: "Document the pause scenario and the emergency plan. Provide a status page showing " +
132
+ "pause state. Set expectations on pause duration and recovery. Operators should " +
133
+ "practice un-pause drills.",
134
+ auto_fixable: false,
135
+ },
136
+ check: (ctx) => {
137
+ if (!ctx.is_paused)
138
+ return null;
139
+ return { ...R_B_06.rule, evidence: "is_paused=true (assets locked)" };
140
+ },
141
+ };
142
+ const R_B_07 = {
143
+ rule: {
144
+ id: "R-BRIDGE-07",
145
+ level: "LOW",
146
+ category: "structural",
147
+ title: `Only ${SUPPORTED_TOKENS.length} tokens supported — unsupported tokens cannot bridge`,
148
+ description: `Bridge supports exactly ${SUPPORTED_TOKENS.length} tokens: ${SUPPORTED_TOKENS.join(", ")}. ` +
149
+ `Any other token (e.g. DAI, LINK, custom tokens) cannot be bridged. Users holding ` +
150
+ `unsupported tokens will see their transfer rejected with EUnexpectedTokenType (3).`,
151
+ affected_stakeholders: ["user"],
152
+ scenario: "User attempts to bridge DAI; aborts with EUnexpectedTokenType",
153
+ mitigation: "Document the supported token list prominently. UI should filter the token picker to " +
154
+ "supported tokens only. For unsupported tokens, recommend an alternative bridge.",
155
+ related_move_error: "EUnexpectedTokenType (3)",
156
+ auto_fixable: false,
157
+ },
158
+ check: (ctx) => {
159
+ if (!ctx.unsupported_token)
160
+ return null;
161
+ return { ...R_B_07.rule, evidence: `unsupported_token=${ctx.unsupported_token} (supported: ${SUPPORTED_TOKENS.join(",")})` };
162
+ },
163
+ };
164
+ const R_B_08 = {
165
+ rule: {
166
+ id: "R-BRIDGE-08",
167
+ level: "MEDIUM",
168
+ category: "structural",
169
+ title: `Idempotency key max ${MAX_IDEMPOTENCY_KEY_LENGTH} chars — long keys truncate or reject`,
170
+ description: `BridgeIdempotencyKeySchema accepts strings of length 1-${MAX_IDEMPOTENCY_KEY_LENGTH}. ` +
171
+ `Callers who generate idempotency keys from long sources (e.g. full JSON payloads, ` +
172
+ `UUIDs with prefixes) may exceed the limit and see the operation rejected. The limit ` +
173
+ `exists to keep on-chain storage bounded.`,
174
+ affected_stakeholders: ["user"],
175
+ scenario: "Caller uses a 200-char idempotency key; operation rejected",
176
+ mitigation: "Generate idempotency keys from a hash (e.g. keccak256 of the payload, hex-encoded = " +
177
+ "66 chars) or a UUID (36 chars). Validate length client-side before submission.",
178
+ auto_fixable: true,
179
+ },
180
+ check: (ctx) => {
181
+ if (ctx.idempotency_key_length === undefined)
182
+ return null;
183
+ if (ctx.idempotency_key_length <= MAX_IDEMPOTENCY_KEY_LENGTH)
184
+ return null;
185
+ return { ...R_B_08.rule, evidence: `idempotency_key_length=${ctx.idempotency_key_length}, limit=${MAX_IDEMPOTENCY_KEY_LENGTH}` };
186
+ },
187
+ };
188
+ const R_B_09 = {
189
+ rule: {
190
+ id: "R-BRIDGE-09",
191
+ level: "LOW",
192
+ category: "structural",
193
+ title: `${BRIDGE_ERROR_CODE_COUNT} error codes — debugging requires a lookup table`,
194
+ description: `Bridge defines ${BRIDGE_ERROR_CODE_COUNT} error codes (EUnexpectedMessageType=0 ` +
195
+ `through ETokenValueIsZero=19). Debugging an abort requires mapping the numeric code ` +
196
+ `back to its name and meaning. New contributors often misread codes because they ` +
197
+ `are not enumerated in the abort message.`,
198
+ affected_stakeholders: ["user", "operator"],
199
+ scenario: "Bridge aborts with code 15; developer does not know what ETokenAlreadyClaimedOrHitLimit means",
200
+ mitigation: "Publish an error-code lookup table in the docs. SDK should decode abort codes into " +
201
+ "human-readable strings. MCP layer should surface the decoded name in error messages.",
202
+ auto_fixable: false,
203
+ },
204
+ check: (ctx) => {
205
+ if (!ctx.expects_simple_error_codes)
206
+ return null;
207
+ return { ...R_B_09.rule, evidence: `expects_simple_error_codes=true (there are ${BRIDGE_ERROR_CODE_COUNT})` };
208
+ },
209
+ };
210
+ const R_B_10 = {
211
+ rule: {
212
+ id: "R-BRIDGE-10",
213
+ level: "MEDIUM",
214
+ category: "lifecycle",
215
+ title: `Versioned upgrade (current=${BRIDGE_CURRENT_VERSION}) can brick the Bridge if botched`,
216
+ description: `Bridge uses Versioned to wrap BridgeInner (bridge.move:49), supporting schema upgrades. ` +
217
+ `The current version is BRIDGE_CURRENT_VERSION=${BRIDGE_CURRENT_VERSION}. An upgrade ` +
218
+ `that mishandles the inner version migration can permanently brick the Bridge — ` +
219
+ `funds in flight would be locked, and recovery requires a new package version. The ` +
220
+ `message_version (current=${BRIDGE_MESSAGE_VERSION}) and EVM address length ` +
221
+ `(${BRIDGE_EVM_ADDRESS_LENGTH} bytes) are also versioned.`,
222
+ affected_stakeholders: ["user", "operator", "system"],
223
+ scenario: "Upgrade mishandles BridgeInner migration; Bridge becomes unusable",
224
+ mitigation: "Test upgrades on a fork with full state replay. Keep a rollback package version " +
225
+ "ready. Stage upgrades with a pause window so users can complete in-flight ops. " +
226
+ "Audit message_version and EVM address length compatibility on every upgrade.",
227
+ related_move_error: "EWrongInnerVersion (7)",
228
+ auto_fixable: false,
229
+ },
230
+ check: (ctx) => {
231
+ if (!ctx.versioned_upgrade_in_progress)
232
+ return null;
233
+ return { ...R_B_10.rule, evidence: `versioned_upgrade_in_progress=true (current=${BRIDGE_CURRENT_VERSION})` };
234
+ },
235
+ };
236
+ export const BRIDGE_RISK_RULES = [
237
+ R_B_01,
238
+ R_B_02,
239
+ R_B_03,
240
+ R_B_04,
241
+ R_B_05,
242
+ R_B_06,
243
+ R_B_07,
244
+ R_B_08,
245
+ R_B_09,
246
+ R_B_10,
247
+ ];
248
+ export const BRIDGE_RISK_VERSION = "1.0.0";
249
+ export function checkBridgeRisks(ctx) {
250
+ const risks = [];
251
+ for (const rule of BRIDGE_RISK_RULES) {
252
+ const r = rule.check(ctx);
253
+ if (r)
254
+ risks.push(r);
255
+ }
256
+ if (!risks.find(r => r.id === "R-BRIDGE-03")) {
257
+ risks.push(R_B_03.rule);
258
+ }
259
+ return risks;
260
+ }
261
+ export function getBridgeRiskById(id) {
262
+ return BRIDGE_RISK_RULES.find(r => r.rule.id === id)?.rule;
263
+ }
@@ -0,0 +1,32 @@
1
+ export type ContactRiskLevel = "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "INFO";
2
+ export type ContactRiskCategory = "structural" | "semantic" | "lifecycle" | "permission" | "cross_object" | "knowledge";
3
+ export type ContactStakeholder = "creator" | "im_member" | "consumer" | "system";
4
+ export interface ContactRisk {
5
+ id: string;
6
+ level: ContactRiskLevel;
7
+ category: ContactRiskCategory;
8
+ title: string;
9
+ description: string;
10
+ affected_stakeholders: ContactStakeholder[];
11
+ scenario: string;
12
+ mitigation: string;
13
+ evidence?: string;
14
+ related_move_error?: string;
15
+ auto_fixable: boolean;
16
+ }
17
+ export interface ContactRiskCheckContext {
18
+ im_count?: number;
19
+ my_status_from_non_member?: boolean;
20
+ location_empty?: boolean;
21
+ im_add_description_uses_long_name?: boolean;
22
+ bound_to_permission_um?: boolean;
23
+ change_status_no_permission?: boolean;
24
+ constants_synced?: boolean;
25
+ }
26
+ export declare const CONTACT_RISK_RULES: {
27
+ rule: ContactRisk;
28
+ check: (ctx: ContactRiskCheckContext) => ContactRisk | null;
29
+ }[];
30
+ export declare const CONTACT_RISK_VERSION = "1.0.0";
31
+ export declare function checkContactRisks(ctx: ContactRiskCheckContext): ContactRisk[];
32
+ export declare function getContactRiskById(id: string): ContactRisk | undefined;
@@ -0,0 +1,200 @@
1
+ import { MAX_IM_COUNT } from "@wowok/wowok";
2
+ const R_C_01 = {
3
+ rule: {
4
+ id: "R-CONTACT-01",
5
+ level: "MEDIUM",
6
+ category: "permission",
7
+ title: "change_status has no permission check — IM list pollution risk",
8
+ description: "change_status lets any IM member self-update their status string without Permission " +
9
+ "verification (contact.move:32-43). If an attacker's address is added to the ims list " +
10
+ "(via im_add, which requires permission index 453), the attacker can freely pollute " +
11
+ "their status field (e.g. set status to 'fraud'). The risk is bounded by the im_add " +
12
+ "permission gate, but a misconfigured Permission could expose the IM list.",
13
+ affected_stakeholders: ["creator", "im_member"],
14
+ scenario: "Contact's IM list is misconfigured to allow public adds; attacker pollutes status",
15
+ mitigation: "Restrict permission index 453 (CONTACT_IM) to trusted guardians. Audit the IM list " +
16
+ "periodically. Business layer may validate status strings against an allowlist.",
17
+ auto_fixable: false,
18
+ },
19
+ check: (ctx) => {
20
+ if (!ctx.change_status_no_permission)
21
+ return null;
22
+ return { ...R_C_01.rule, evidence: "change_status_no_permission=true" };
23
+ },
24
+ };
25
+ const R_C_02 = {
26
+ rule: {
27
+ id: "R-CONTACT-02",
28
+ level: "LOW",
29
+ category: "structural",
30
+ title: `MAX_IM_COUNT=${MAX_IM_COUNT} is permissive — on-chain storage cost`,
31
+ description: `A single Contact may hold up to MAX_IM_COUNT=${MAX_IM_COUNT} IM entries (contact.move:14). ` +
32
+ `Aborting with E_IM_COUNT_EXCEEDED (1) only triggers at the boundary. 200 entries is ` +
33
+ `relatively permissive for a social scenario; loading the full list on every read ` +
34
+ `increases gas and storage cost.`,
35
+ affected_stakeholders: ["creator"],
36
+ scenario: "Caller adds 200 IM entries to a single Contact",
37
+ mitigation: "Business layer should self-limit IM count well below 200. For high-volume contact " +
38
+ "lists, shard across multiple Contact objects and aggregate off-chain.",
39
+ related_move_error: "E_IM_COUNT_EXCEEDED (1)",
40
+ auto_fixable: false,
41
+ },
42
+ check: (ctx) => {
43
+ if (ctx.im_count === undefined)
44
+ return null;
45
+ if (ctx.im_count < MAX_IM_COUNT)
46
+ return null;
47
+ return { ...R_C_02.rule, evidence: `im_count=${ctx.im_count}, limit=${MAX_IM_COUNT}` };
48
+ },
49
+ };
50
+ const R_C_03 = {
51
+ rule: {
52
+ id: "R-CONTACT-03",
53
+ level: "MEDIUM",
54
+ category: "semantic",
55
+ title: "IM list mutations emit no events — external indexers must poll",
56
+ description: "im_add / im_remove / im_clear do not emit events (contact.move:70-100). External " +
57
+ "indexers and notification systems cannot rely on event streams to track IM list " +
58
+ "changes; they must poll the ims field directly, increasing latency and RPC cost.",
59
+ affected_stakeholders: ["creator", "consumer"],
60
+ scenario: "Indexer expects an event on im_add but none is emitted; UI fails to refresh",
61
+ mitigation: "External indexers should poll the Contact.ims field on a cadence. A future version " +
62
+ "may add IMEvent; until then, do not build critical UX on IM event streams.",
63
+ auto_fixable: false,
64
+ },
65
+ check: (ctx) => null,
66
+ };
67
+ const R_C_04 = {
68
+ rule: {
69
+ id: "R-CONTACT-04",
70
+ level: "LOW",
71
+ category: "semantic",
72
+ title: "location defaults to empty string — may be misread as 'unset'",
73
+ description: "A freshly created Contact has location=\"\" (empty String). The Move type does not " +
74
+ "distinguish 'unset' from 'empty', so consumers may misinterpret an empty location " +
75
+ "as 'globally applicable' or as 'missing data'.",
76
+ affected_stakeholders: ["creator", "consumer"],
77
+ scenario: "Consumer reads location=\"\" and treats the Contact as global when it was never set",
78
+ mitigation: "Document that empty location means 'not specified'. If a default region is required, " +
79
+ "set location explicitly at creation time.",
80
+ auto_fixable: true,
81
+ },
82
+ check: (ctx) => {
83
+ if (!ctx.location_empty)
84
+ return null;
85
+ return { ...R_C_04.rule, evidence: "location=\"\" (empty, default)" };
86
+ },
87
+ };
88
+ const R_C_05 = {
89
+ rule: {
90
+ id: "R-CONTACT-05",
91
+ level: "MEDIUM",
92
+ category: "lifecycle",
93
+ title: "my_status silently fails for non-IM-members",
94
+ description: "my_status only updates the caller's status entry if the caller is in the ims list " +
95
+ "(contact.move:35-42). For a non-IM-member, the call silently succeeds without any " +
96
+ "state change — there is no abort and no event. Users get no feedback, making it " +
97
+ "impossible to distinguish 'status updated' from 'operation ignored'.",
98
+ affected_stakeholders: ["im_member"],
99
+ scenario: "Non-IM-member calls my_status expecting an error; operation is silently ignored",
100
+ mitigation: "SDK layer should pre-validate IM membership before submitting my_status and return a " +
101
+ "clear error. UI should show 'not an IM member' instead of 'success'.",
102
+ auto_fixable: false,
103
+ },
104
+ check: (ctx) => {
105
+ if (!ctx.my_status_from_non_member)
106
+ return null;
107
+ return { ...R_C_05.rule, evidence: "my_status_from_non_member=true (will be silently ignored)" };
108
+ },
109
+ };
110
+ const R_C_06 = {
111
+ rule: {
112
+ id: "R-CONTACT-06",
113
+ level: "LOW",
114
+ category: "semantic",
115
+ title: "im_add description uses LONG_NAME (not DESCRIPTION) — different length cap",
116
+ description: "im_add's description parameter is validated with common::LONG_NAME rather than " +
117
+ "common::DESCRIPTION (contact.move:70-86). The two validators have different length " +
118
+ "limits; callers expecting DESCRIPTION semantics may submit overly long strings and " +
119
+ "hit an unexpected abort.",
120
+ affected_stakeholders: ["creator"],
121
+ scenario: "Caller submits an im_add description sized for DESCRIPTION but hits LONG_NAME limit",
122
+ mitigation: "Document that im_add description uses LONG_NAME validation. SDK should expose the " +
123
+ "exact limit so callers size their strings correctly.",
124
+ auto_fixable: false,
125
+ },
126
+ check: (ctx) => {
127
+ if (!ctx.im_add_description_uses_long_name)
128
+ return null;
129
+ return { ...R_C_06.rule, evidence: "im_add description validated with LONG_NAME" };
130
+ },
131
+ };
132
+ const R_C_07 = {
133
+ rule: {
134
+ id: "R-CONTACT-07",
135
+ level: "MEDIUM",
136
+ category: "cross_object",
137
+ title: "permission_um_set creates Contact ↔ Permission bidirectional dependency",
138
+ description: "When Contact is set as a Permission's um via permission_um_set (contact.move:207-209), " +
139
+ "a bidirectional dependency forms: Permission.um → Contact, and Contact.permission → " +
140
+ "Permission. Deleting the Contact without first clearing the um reference leaves a " +
141
+ "dangling pointer in Permission.um.",
142
+ affected_stakeholders: ["creator", "consumer"],
143
+ scenario: "Contact is deleted while still bound as Permission.um; Permission.um becomes dangling",
144
+ mitigation: "Document the deletion order: (1) clear Permission.um via permission_um_set(null) " +
145
+ "first, (2) then delete the Contact. SDK should refuse to delete a Contact that is " +
146
+ "still bound as a um.",
147
+ auto_fixable: false,
148
+ },
149
+ check: (ctx) => {
150
+ if (!ctx.bound_to_permission_um)
151
+ return null;
152
+ return { ...R_C_07.rule, evidence: "bound_to_permission_um=true (deletion requires unbinding)" };
153
+ },
154
+ };
155
+ const R_C_08 = {
156
+ rule: {
157
+ id: "R-CONTACT-08",
158
+ level: "LOW",
159
+ category: "knowledge",
160
+ title: "Knowledge layer & constant sync — RESOLVED",
161
+ description: `MAX_IM_COUNT is now synced to onchain-constants.ts (${MAX_IM_COUNT}). The MCP ` +
162
+ `Knowledge layer now includes contact-risk.ts. This risk rule is retained for ` +
163
+ `historical audit and to detect future regressions.`,
164
+ affected_stakeholders: ["system"],
165
+ scenario: "Future regression: someone removes MAX_IM_COUNT from onchain-constants.ts",
166
+ mitigation: "Run the onchain-constants sync test to detect drift.",
167
+ auto_fixable: false,
168
+ },
169
+ check: (ctx) => {
170
+ if (ctx.constants_synced)
171
+ return null;
172
+ return { ...R_C_08.rule, evidence: "constants_synced=false" };
173
+ },
174
+ };
175
+ export const CONTACT_RISK_RULES = [
176
+ R_C_01,
177
+ R_C_02,
178
+ R_C_03,
179
+ R_C_04,
180
+ R_C_05,
181
+ R_C_06,
182
+ R_C_07,
183
+ R_C_08,
184
+ ];
185
+ export const CONTACT_RISK_VERSION = "1.0.0";
186
+ export function checkContactRisks(ctx) {
187
+ const risks = [];
188
+ for (const rule of CONTACT_RISK_RULES) {
189
+ const r = rule.check(ctx);
190
+ if (r)
191
+ risks.push(r);
192
+ }
193
+ if (!risks.find(r => r.id === "R-CONTACT-03")) {
194
+ risks.push(R_C_03.rule);
195
+ }
196
+ return risks;
197
+ }
198
+ export function getContactRiskById(id) {
199
+ return CONTACT_RISK_RULES.find(r => r.rule.id === id)?.rule;
200
+ }
@@ -0,0 +1,32 @@
1
+ export type ConfirmSeverity = "block" | "warn" | "info";
2
+ export interface DemandConfirmItem {
3
+ id: string;
4
+ severity: ConfirmSeverity;
5
+ title: string;
6
+ description: string;
7
+ passed: boolean;
8
+ evidence?: string;
9
+ fix_hint?: string;
10
+ }
11
+ export interface DemandCreationCheckInput {
12
+ description?: string;
13
+ location?: string;
14
+ rewards?: string[];
15
+ guards?: string[];
16
+ feedback?: string[];
17
+ service_identifier?: number | null;
18
+ by_guard?: string | null;
19
+ permission_set_available?: boolean;
20
+ namedNew?: {
21
+ name: string;
22
+ tag?: string;
23
+ } | null;
24
+ }
25
+ export declare function preCheckDemandCreation(input: DemandCreationCheckInput): DemandConfirmItem[];
26
+ export declare function canCreateDemand(input: DemandCreationCheckInput): {
27
+ canCreate: boolean;
28
+ blockers: DemandConfirmItem[];
29
+ warnings: DemandConfirmItem[];
30
+ info: DemandConfirmItem[];
31
+ };
32
+ export declare function formatDemandCreationSummary(input: DemandCreationCheckInput): string;