@wowok/agent-mcp 2.7.1 → 2.7.3

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 (597) hide show
  1. package/dist/config/index.js +1 -1
  2. package/dist/config/runtime.js +1 -238
  3. package/dist/customer/account-events.d.ts +32 -0
  4. package/dist/customer/account-events.js +1 -0
  5. package/dist/customer/customer-advice.d.ts +1 -0
  6. package/dist/customer/customer-advice.js +1 -130
  7. package/dist/customer/index.js +1 -11
  8. package/dist/customer/industry-risks.js +1 -438
  9. package/dist/customer/info-puzzle.js +1 -681
  10. package/dist/customer/order-monitor.js +1 -328
  11. package/dist/customer/order-strategy.d.ts +1 -1
  12. package/dist/customer/order-strategy.js +1 -373
  13. package/dist/customer/post-purchase.js +1 -351
  14. package/dist/customer/preorder-compare.js +1 -34
  15. package/dist/customer/reminder-system.d.ts +2 -0
  16. package/dist/customer/reminder-system.js +1 -316
  17. package/dist/customer/risk-assessment.d.ts +1 -0
  18. package/dist/customer/risk-assessment.js +1 -397
  19. package/dist/customer/types.d.ts +2 -0
  20. package/dist/customer/types.js +1 -13
  21. package/dist/customer/user-preferences.js +1 -460
  22. package/dist/evaluation/arbitration-game.d.ts +9 -2
  23. package/dist/evaluation/arbitration-game.js +1 -48
  24. package/dist/evaluation/builtins/arbitration-score.d.ts +41 -0
  25. package/dist/evaluation/builtins/arbitration-score.js +1 -0
  26. package/dist/evaluation/builtins/demand-match.js +1 -153
  27. package/dist/evaluation/builtins/index.d.ts +1 -0
  28. package/dist/evaluation/builtins/index.js +1 -10
  29. package/dist/evaluation/builtins/service-risk.js +1 -55
  30. package/dist/evaluation/capability.js +1 -13
  31. package/dist/evaluation/category-match-rules.d.ts +30 -0
  32. package/dist/evaluation/category-match-rules.js +1 -0
  33. package/dist/evaluation/composer.js +1 -40
  34. package/dist/evaluation/engine.js +1 -175
  35. package/dist/evaluation/extract.js +1 -115
  36. package/dist/evaluation/game-strategy.d.ts +27 -0
  37. package/dist/evaluation/game-strategy.js +1 -0
  38. package/dist/evaluation/gap.js +1 -100
  39. package/dist/evaluation/index.d.ts +2 -0
  40. package/dist/evaluation/index.js +1 -11
  41. package/dist/evaluation/location-match.d.ts +42 -0
  42. package/dist/evaluation/location-match.js +1 -0
  43. package/dist/evaluation/node-game.d.ts +31 -3
  44. package/dist/evaluation/node-game.js +1 -57
  45. package/dist/evaluation/path-reasoning.d.ts +35 -0
  46. package/dist/evaluation/path-reasoning.js +1 -0
  47. package/dist/evaluation/region.d.ts +6 -0
  48. package/dist/evaluation/region.js +1 -36
  49. package/dist/evaluation/types.d.ts +18 -0
  50. package/dist/evaluation/types.js +1 -1
  51. package/dist/evaluation/user-injection.js +1 -27
  52. package/dist/experience/experience-reuse.js +1 -103
  53. package/dist/experience/index.js +1 -5
  54. package/dist/experience/intent-distill.js +1 -83
  55. package/dist/experience/realtime-feedback.js +1 -94
  56. package/dist/experience/types.js +1 -1
  57. package/dist/experience/user-profile.d.ts +1 -1
  58. package/dist/experience/user-profile.js +1 -171
  59. package/dist/extensions/business-modules.js +1 -287
  60. package/dist/extensions/capability-manifest.js +1 -781
  61. package/dist/extensions/constraint-registry.js +1 -198
  62. package/dist/extensions/index.d.ts +6 -0
  63. package/dist/extensions/index.js +1 -6
  64. package/dist/extensions/industry-layers.d.ts +75 -0
  65. package/dist/extensions/industry-layers.js +1 -0
  66. package/dist/extensions/industry-pack.d.ts +105 -0
  67. package/dist/extensions/industry-pack.js +1 -0
  68. package/dist/extensions/metric-registry.js +1 -257
  69. package/dist/extensions/mode-evaluator.d.ts +1 -1
  70. package/dist/extensions/mode-evaluator.js +1 -170
  71. package/dist/extensions/modes.js +1 -499
  72. package/dist/extensions/registry.d.ts +1 -0
  73. package/dist/extensions/registry.js +1 -717
  74. package/dist/extensions/types.js +1 -1
  75. package/dist/graph/base.d.ts +8 -0
  76. package/dist/graph/base.js +1 -0
  77. package/dist/harness/auto-escalation.js +1 -68
  78. package/dist/harness/checkpoint.js +1 -129
  79. package/dist/harness/index.d.ts +1 -0
  80. package/dist/harness/index.js +1 -78
  81. package/dist/harness/plan.d.ts +2 -0
  82. package/dist/harness/plan.js +1 -315
  83. package/dist/harness/recover.d.ts +1 -1
  84. package/dist/harness/recover.js +1 -139
  85. package/dist/harness/types.d.ts +2 -3
  86. package/dist/harness/types.js +1 -1
  87. package/dist/harness/verify.js +1 -237
  88. package/dist/index.js +1 -273
  89. package/dist/intent/enrich.js +1 -67
  90. package/dist/intent/index.js +1 -60
  91. package/dist/intent/matcher.js +1 -81
  92. package/dist/intent/store.js +1 -55
  93. package/dist/intent/types.js +1 -10
  94. package/dist/knowledge/acquisition-flywheel.js +1 -192
  95. package/dist/knowledge/allocation-confirm.js +1 -534
  96. package/dist/knowledge/allocation-context.js +1 -249
  97. package/dist/knowledge/allocation-ledger.js +1 -463
  98. package/dist/knowledge/allocation-puzzle.js +1 -298
  99. package/dist/knowledge/allocation-risk.js +1 -568
  100. package/dist/knowledge/allocation-templates.js +1 -970
  101. package/dist/knowledge/allocation-translation.js +1 -585
  102. package/dist/knowledge/anti-cheat.d.ts +37 -0
  103. package/dist/knowledge/anti-cheat.js +1 -0
  104. package/dist/knowledge/arb-confirm.d.ts +28 -0
  105. package/dist/knowledge/arb-confirm.js +1 -0
  106. package/dist/knowledge/arb-risk.js +1 -210
  107. package/dist/knowledge/arb-translation.d.ts +48 -0
  108. package/dist/knowledge/arb-translation.js +1 -0
  109. package/dist/knowledge/arbitration-confirm.js +1 -559
  110. package/dist/knowledge/arbitration-context.js +1 -505
  111. package/dist/knowledge/arbitration-ledger.js +1 -521
  112. package/dist/knowledge/arbitration-puzzle.js +1 -304
  113. package/dist/knowledge/arbitration-risk.js +1 -423
  114. package/dist/knowledge/arbitration-templates.js +1 -276
  115. package/dist/knowledge/arbitration-translation.js +1 -487
  116. package/dist/knowledge/audit-rules.js +1 -141
  117. package/dist/knowledge/bridge-confirm.d.ts +26 -0
  118. package/dist/knowledge/bridge-confirm.js +1 -0
  119. package/dist/knowledge/bridge-risk.js +1 -263
  120. package/dist/knowledge/bridge-translation.d.ts +37 -0
  121. package/dist/knowledge/bridge-translation.js +1 -0
  122. package/dist/knowledge/contact-confirm.d.ts +27 -0
  123. package/dist/knowledge/contact-confirm.js +1 -0
  124. package/dist/knowledge/contact-risk.js +1 -200
  125. package/dist/knowledge/contact-templates.js +1 -60
  126. package/dist/knowledge/contact-translation.d.ts +39 -0
  127. package/dist/knowledge/contact-translation.js +1 -0
  128. package/dist/knowledge/demand-confirm.js +1 -206
  129. package/dist/knowledge/demand-context.d.ts +17 -0
  130. package/dist/knowledge/demand-context.js +1 -0
  131. package/dist/knowledge/demand-ledger.d.ts +26 -0
  132. package/dist/knowledge/demand-ledger.js +1 -0
  133. package/dist/knowledge/demand-matching.js +1 -132
  134. package/dist/knowledge/demand-puzzle.d.ts +29 -0
  135. package/dist/knowledge/demand-puzzle.js +1 -0
  136. package/dist/knowledge/demand-risk.js +1 -240
  137. package/dist/knowledge/demand-templates.d.ts +12 -0
  138. package/dist/knowledge/demand-templates.js +1 -0
  139. package/dist/knowledge/demand-translation.js +1 -354
  140. package/dist/knowledge/deployment-scanner.js +1 -823
  141. package/dist/knowledge/dynamic-pricing.js +1 -87
  142. package/dist/knowledge/evidence-review.d.ts +12 -0
  143. package/dist/knowledge/evidence-review.js +1 -0
  144. package/dist/knowledge/examples-scanner-cli.js +1 -26
  145. package/dist/knowledge/examples-scanner.js +1 -843
  146. package/dist/knowledge/flywheel-loop.d.ts +0 -1
  147. package/dist/knowledge/flywheel-loop.js +1 -404
  148. package/dist/knowledge/fund-layer.js +1 -973
  149. package/dist/knowledge/glossary.js +1 -211
  150. package/dist/knowledge/guard-confirm.js +1 -406
  151. package/dist/knowledge/guard-context.js +1 -287
  152. package/dist/knowledge/guard-design-patterns.js +1 -360
  153. package/dist/knowledge/guard-ledger.js +1 -260
  154. package/dist/knowledge/guard-lint.js +1 -670
  155. package/dist/knowledge/guard-migration.d.ts +1 -1
  156. package/dist/knowledge/guard-migration.js +1 -228
  157. package/dist/knowledge/guard-puzzle.js +1 -805
  158. package/dist/knowledge/guard-render.js +1 -700
  159. package/dist/knowledge/guard-risk.js +1 -1879
  160. package/dist/knowledge/guard-submission-prompt.js +1 -171
  161. package/dist/knowledge/guard-templates.js +1 -1105
  162. package/dist/knowledge/guard-translation.js +1 -1119
  163. package/dist/knowledge/index.d.ts +71 -3
  164. package/dist/knowledge/index.js +1 -436
  165. package/dist/knowledge/industry-evolution.js +1 -323
  166. package/dist/knowledge/industry-generalizer.js +1 -381
  167. package/dist/knowledge/industry-registry.js +1 -174
  168. package/dist/knowledge/intent-metrics.d.ts +4 -3
  169. package/dist/knowledge/intent-metrics.js +1 -566
  170. package/dist/knowledge/machine-confirm.js +1 -559
  171. package/dist/knowledge/machine-context.js +1 -833
  172. package/dist/knowledge/machine-ledger.js +1 -338
  173. package/dist/knowledge/machine-puzzle.js +1 -494
  174. package/dist/knowledge/machine-render.js +1 -565
  175. package/dist/knowledge/machine-risk.js +1 -669
  176. package/dist/knowledge/machine-templates.js +1 -1597
  177. package/dist/knowledge/machine-topology.js +1 -234
  178. package/dist/knowledge/machine-translation.js +1 -513
  179. package/dist/knowledge/market-metrics.d.ts +12 -0
  180. package/dist/knowledge/market-metrics.js +1 -0
  181. package/dist/knowledge/market-operations.d.ts +46 -0
  182. package/dist/knowledge/market-operations.js +1 -0
  183. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  184. package/dist/knowledge/mcp-schema-audit.d.ts +22 -22
  185. package/dist/knowledge/mcp-schema-audit.js +1 -777
  186. package/dist/knowledge/onchain-constants.js +1 -35
  187. package/dist/knowledge/order-confirm.js +1 -573
  188. package/dist/knowledge/order-context.js +1 -390
  189. package/dist/knowledge/order-ledger.js +1 -341
  190. package/dist/knowledge/order-puzzle.js +1 -255
  191. package/dist/knowledge/order-risk.js +1 -653
  192. package/dist/knowledge/order-templates.js +1 -368
  193. package/dist/knowledge/order-translation.js +1 -550
  194. package/dist/knowledge/overrides-loader.js +1 -65
  195. package/dist/knowledge/passport-confirm.js +1 -531
  196. package/dist/knowledge/passport-context.js +1 -306
  197. package/dist/knowledge/passport-ledger.js +1 -282
  198. package/dist/knowledge/passport-puzzle.js +1 -333
  199. package/dist/knowledge/passport-risk.js +1 -450
  200. package/dist/knowledge/passport-templates.js +1 -568
  201. package/dist/knowledge/passport-translation.js +1 -516
  202. package/dist/knowledge/payment-confirm.d.ts +26 -0
  203. package/dist/knowledge/payment-confirm.js +1 -0
  204. package/dist/knowledge/payment-risk.js +1 -249
  205. package/dist/knowledge/payment-translation.d.ts +37 -0
  206. package/dist/knowledge/payment-translation.js +1 -0
  207. package/dist/knowledge/permission-confirm.js +1 -426
  208. package/dist/knowledge/permission-context.js +1 -224
  209. package/dist/knowledge/permission-ledger.d.ts +11 -0
  210. package/dist/knowledge/permission-ledger.js +1 -403
  211. package/dist/knowledge/permission-puzzle.js +1 -173
  212. package/dist/knowledge/permission-risk.js +1 -411
  213. package/dist/knowledge/permission-templates.js +1 -234
  214. package/dist/knowledge/permission-translation.js +1 -350
  215. package/dist/knowledge/personal-confirm.d.ts +29 -0
  216. package/dist/knowledge/personal-confirm.js +1 -0
  217. package/dist/knowledge/personal-risk.js +1 -212
  218. package/dist/knowledge/personal-translation.d.ts +37 -0
  219. package/dist/knowledge/personal-translation.js +1 -0
  220. package/dist/knowledge/process-model.d.ts +1 -11
  221. package/dist/knowledge/process-model.js +1 -160
  222. package/dist/knowledge/progress-confirm.js +1 -456
  223. package/dist/knowledge/progress-context.js +1 -452
  224. package/dist/knowledge/progress-ledger.js +1 -330
  225. package/dist/knowledge/progress-puzzle.js +1 -219
  226. package/dist/knowledge/progress-risk.js +1 -461
  227. package/dist/knowledge/progress-templates.js +1 -228
  228. package/dist/knowledge/progress-translation.js +1 -405
  229. package/dist/knowledge/proof-confirm.js +1 -187
  230. package/dist/knowledge/proof-context.d.ts +17 -0
  231. package/dist/knowledge/proof-context.js +1 -0
  232. package/dist/knowledge/proof-ledger.d.ts +34 -0
  233. package/dist/knowledge/proof-ledger.js +1 -0
  234. package/dist/knowledge/proof-puzzle.d.ts +35 -0
  235. package/dist/knowledge/proof-puzzle.js +1 -0
  236. package/dist/knowledge/proof-risk.js +1 -207
  237. package/dist/knowledge/proof-templates.d.ts +22 -0
  238. package/dist/knowledge/proof-templates.js +1 -0
  239. package/dist/knowledge/proof-translation.js +1 -283
  240. package/dist/knowledge/registrar-confirm.d.ts +26 -0
  241. package/dist/knowledge/registrar-confirm.js +1 -0
  242. package/dist/knowledge/registrar-risk.js +1 -217
  243. package/dist/knowledge/registrar-translation.d.ts +37 -0
  244. package/dist/knowledge/registrar-translation.js +1 -0
  245. package/dist/knowledge/repository-confirm.js +1 -286
  246. package/dist/knowledge/repository-context.d.ts +12 -0
  247. package/dist/knowledge/repository-context.js +1 -0
  248. package/dist/knowledge/repository-ledger.d.ts +25 -0
  249. package/dist/knowledge/repository-ledger.js +1 -0
  250. package/dist/knowledge/repository-puzzle.d.ts +30 -0
  251. package/dist/knowledge/repository-puzzle.js +1 -0
  252. package/dist/knowledge/repository-risk.js +1 -373
  253. package/dist/knowledge/repository-templates.d.ts +14 -0
  254. package/dist/knowledge/repository-templates.js +1 -0
  255. package/dist/knowledge/repository-translation.js +1 -445
  256. package/dist/knowledge/reputation-rules.js +1 -99
  257. package/dist/knowledge/resource-confirm.d.ts +25 -0
  258. package/dist/knowledge/resource-confirm.js +1 -0
  259. package/dist/knowledge/resource-risk.js +1 -157
  260. package/dist/knowledge/resource-translation.d.ts +37 -0
  261. package/dist/knowledge/resource-translation.js +1 -0
  262. package/dist/knowledge/reward-confirm.js +1 -526
  263. package/dist/knowledge/reward-context.d.ts +2 -2
  264. package/dist/knowledge/reward-context.js +1 -504
  265. package/dist/knowledge/reward-ledger.js +1 -502
  266. package/dist/knowledge/reward-puzzle.js +1 -300
  267. package/dist/knowledge/reward-risk.js +1 -627
  268. package/dist/knowledge/reward-templates.js +1 -197
  269. package/dist/knowledge/reward-translation.js +1 -501
  270. package/dist/knowledge/safety-rules.d.ts +1 -0
  271. package/dist/knowledge/safety-rules.js +1 -404
  272. package/dist/knowledge/scenario-modes.js +1 -321
  273. package/dist/knowledge/service-confirm.js +1 -807
  274. package/dist/knowledge/service-context.js +1 -403
  275. package/dist/knowledge/service-ledger.js +1 -609
  276. package/dist/knowledge/service-puzzle.js +1 -236
  277. package/dist/knowledge/service-risk.d.ts +1 -1
  278. package/dist/knowledge/service-risk.js +1 -651
  279. package/dist/knowledge/service-templates.js +1 -456
  280. package/dist/knowledge/service-translation.js +1 -622
  281. package/dist/knowledge/template-registry.js +1 -353
  282. package/dist/knowledge/tool-constraints.js +1 -195
  283. package/dist/knowledge/tools-reference.js +1 -178
  284. package/dist/knowledge/treasury-confirm.js +1 -512
  285. package/dist/knowledge/treasury-context.js +1 -363
  286. package/dist/knowledge/treasury-ledger.js +1 -300
  287. package/dist/knowledge/treasury-puzzle.js +1 -216
  288. package/dist/knowledge/treasury-risk.js +1 -440
  289. package/dist/knowledge/treasury-templates.js +1 -358
  290. package/dist/knowledge/treasury-translation.js +1 -498
  291. package/dist/knowledge/trust-metrics.js +1 -198
  292. package/dist/knowledge/universal-template.d.ts +22 -0
  293. package/dist/knowledge/universal-template.js +1 -0
  294. package/dist/knowledge/util-confirm.d.ts +24 -0
  295. package/dist/knowledge/util-confirm.js +1 -0
  296. package/dist/knowledge/util-risk.js +1 -135
  297. package/dist/knowledge/util-translation.d.ts +38 -0
  298. package/dist/knowledge/util-translation.js +1 -0
  299. package/dist/knowledge/workflow-guidance.d.ts +116 -0
  300. package/dist/knowledge/workflow-guidance.js +1 -0
  301. package/dist/loop-engineering/aggregate.js +1 -132
  302. package/dist/loop-engineering/context-collect.js +1 -83
  303. package/dist/loop-engineering/diagnose.js +1 -273
  304. package/dist/loop-engineering/improve.js +1 -405
  305. package/dist/loop-engineering/index.js +1 -4
  306. package/dist/loop-engineering/pipeline.js +1 -56
  307. package/dist/mode-market/index.js +1 -3
  308. package/dist/mode-market/registry.js +1 -124
  309. package/dist/mode-market/review.js +1 -214
  310. package/dist/mode-market/submission.js +1 -85
  311. package/dist/participation/collaborator-interest.d.ts +23 -0
  312. package/dist/participation/collaborator-interest.js +1 -0
  313. package/dist/participation/customer-interest.d.ts +25 -0
  314. package/dist/participation/customer-interest.js +1 -0
  315. package/dist/participation/employee-kpi.d.ts +25 -0
  316. package/dist/participation/employee-kpi.js +1 -0
  317. package/dist/participation/employee-store.d.ts +16 -0
  318. package/dist/participation/employee-store.js +1 -0
  319. package/dist/participation/index.d.ts +2 -0
  320. package/dist/participation/index.js +1 -0
  321. package/dist/participation/merchant-interest.js +1 -100
  322. package/dist/participation/radar-core.d.ts +13 -3
  323. package/dist/participation/radar-core.js +1 -269
  324. package/dist/participation/supplier-interest.d.ts +25 -0
  325. package/dist/participation/supplier-interest.js +1 -0
  326. package/dist/persona/analyzer.js +1 -66
  327. package/dist/persona/bridge.js +1 -86
  328. package/dist/persona/defaults.js +1 -195
  329. package/dist/persona/experience-bridge.js +1 -23
  330. package/dist/persona/index.d.ts +9 -2
  331. package/dist/persona/index.js +1 -71
  332. package/dist/persona/local-region.d.ts +20 -0
  333. package/dist/persona/local-region.js +1 -0
  334. package/dist/persona/model.js +1 -111
  335. package/dist/persona/overrides.d.ts +10 -0
  336. package/dist/persona/overrides.js +1 -0
  337. package/dist/persona/pack-personae.d.ts +11 -0
  338. package/dist/persona/pack-personae.js +1 -0
  339. package/dist/persona/store.js +1 -62
  340. package/dist/persona/strategy-intent.d.ts +20 -0
  341. package/dist/persona/strategy-intent.js +1 -0
  342. package/dist/persona/types.d.ts +6 -2
  343. package/dist/persona/types.js +1 -5
  344. package/dist/project/business-puzzle.d.ts +1 -1
  345. package/dist/project/business-puzzle.js +1 -383
  346. package/dist/project/context-assembly.js +1 -254
  347. package/dist/project/deployment-bridge.js +1 -120
  348. package/dist/project/deployment-doc.js +1 -1126
  349. package/dist/project/edit-planner.js +1 -1342
  350. package/dist/project/evaluation.d.ts +37 -1
  351. package/dist/project/evaluation.js +1 -2011
  352. package/dist/project/game-theory.js +1 -177
  353. package/dist/project/graph-builder.js +1 -656
  354. package/dist/project/graph.d.ts +3 -6
  355. package/dist/project/graph.js +1 -340
  356. package/dist/project/handlers.d.ts +33 -2
  357. package/dist/project/handlers.js +1 -1784
  358. package/dist/project/index.d.ts +2 -0
  359. package/dist/project/index.js +1 -301
  360. package/dist/project/intent-analyzer.js +1 -149
  361. package/dist/project/machine-nodes.js +1 -36
  362. package/dist/project/merchant-guide.d.ts +19 -0
  363. package/dist/project/merchant-guide.js +1 -264
  364. package/dist/project/migration.js +1 -125
  365. package/dist/project/mode-actions.js +1 -309
  366. package/dist/project/namespace.js +1 -206
  367. package/dist/project/participation-radar.js +1 -428
  368. package/dist/project/pipeline-actions.js +1 -109
  369. package/dist/project/project-store.js +1 -422
  370. package/dist/project/query.js +1 -153
  371. package/dist/project/reverse-mapping.d.ts +34 -0
  372. package/dist/project/reverse-mapping.js +1 -0
  373. package/dist/project/risk-aggregator.js +1 -295
  374. package/dist/project/rollback-policy.js +1 -290
  375. package/dist/project/semantic-assembler.js +1 -345
  376. package/dist/project/semantic-graph.d.ts +3 -5
  377. package/dist/project/semantic-graph.js +1 -292
  378. package/dist/project/stage-gate.js +1 -369
  379. package/dist/project/substep-trace.js +1 -332
  380. package/dist/project/task-tracker.js +1 -78
  381. package/dist/project/workflow-design-assessment.d.ts +24 -0
  382. package/dist/project/workflow-design-assessment.js +1 -0
  383. package/dist/role/derivation.d.ts +18 -0
  384. package/dist/role/derivation.js +1 -0
  385. package/dist/role/index.d.ts +5 -0
  386. package/dist/role/index.js +1 -0
  387. package/dist/role/model.d.ts +8 -0
  388. package/dist/role/model.js +1 -0
  389. package/dist/role/resolution.d.ts +11 -0
  390. package/dist/role/resolution.js +1 -0
  391. package/dist/role/types.d.ts +11 -0
  392. package/dist/role/types.js +1 -0
  393. package/dist/rules.js +1 -52
  394. package/dist/safety/confirm-gate.d.ts +1 -1
  395. package/dist/safety/confirm-gate.js +1 -88
  396. package/dist/safety/index.js +1 -3
  397. package/dist/safety/preview.js +1 -52
  398. package/dist/schema/call/allocation.d.ts +186 -1385
  399. package/dist/schema/call/allocation.js +1 -34
  400. package/dist/schema/call/arbitration.d.ts +272 -1871
  401. package/dist/schema/call/arbitration.js +1 -113
  402. package/dist/schema/call/base.d.ts +1831 -9076
  403. package/dist/schema/call/base.js +1 -370
  404. package/dist/schema/call/bridge.d.ts +911 -3171
  405. package/dist/schema/call/bridge.js +1 -458
  406. package/dist/schema/call/contact.d.ts +135 -931
  407. package/dist/schema/call/contact.js +1 -37
  408. package/dist/schema/call/demand.d.ts +164 -1194
  409. package/dist/schema/call/demand.js +1 -47
  410. package/dist/schema/call/guard.d.ts +298 -1140
  411. package/dist/schema/call/guard.js +1 -161
  412. package/dist/schema/call/handler.js +1 -322
  413. package/dist/schema/call/index.js +1 -20
  414. package/dist/schema/call/machine.d.ts +459 -5403
  415. package/dist/schema/call/machine.js +1 -193
  416. package/dist/schema/call/order.d.ts +137 -844
  417. package/dist/schema/call/order.js +1 -35
  418. package/dist/schema/call/payment.d.ts +74 -561
  419. package/dist/schema/call/payment.js +1 -37
  420. package/dist/schema/call/permission-handler.js +1 -54
  421. package/dist/schema/call/permission.d.ts +335 -2791
  422. package/dist/schema/call/permission.js +1 -105
  423. package/dist/schema/call/personal.d.ts +227 -1814
  424. package/dist/schema/call/personal.js +1 -78
  425. package/dist/schema/call/progress.d.ts +140 -843
  426. package/dist/schema/call/progress.js +1 -47
  427. package/dist/schema/call/proof.d.ts +42 -258
  428. package/dist/schema/call/proof.js +1 -33
  429. package/dist/schema/call/repository.d.ts +324 -2222
  430. package/dist/schema/call/repository.js +1 -77
  431. package/dist/schema/call/reward.d.ts +153 -1183
  432. package/dist/schema/call/reward.js +1 -30
  433. package/dist/schema/call/semantic.js +1 -1679
  434. package/dist/schema/call/service.d.ts +376 -3431
  435. package/dist/schema/call/service.js +1 -184
  436. package/dist/schema/call/treasury.d.ts +252 -2158
  437. package/dist/schema/call/treasury.js +1 -71
  438. package/dist/schema/common/index.d.ts +222 -697
  439. package/dist/schema/common/index.js +1 -407
  440. package/dist/schema/config/index.d.ts +18 -161
  441. package/dist/schema/config/index.js +1 -68
  442. package/dist/schema/employee/index.d.ts +99 -0
  443. package/dist/schema/employee/index.js +1 -0
  444. package/dist/schema/evaluation/index.d.ts +1062 -3748
  445. package/dist/schema/evaluation/index.js +1 -356
  446. package/dist/schema/index.d.ts +3 -0
  447. package/dist/schema/index.js +1 -17
  448. package/dist/schema/industry-pack/index.d.ts +132 -0
  449. package/dist/schema/industry-pack/index.js +1 -0
  450. package/dist/schema/intent-radar/index.d.ts +92 -245
  451. package/dist/schema/intent-radar/index.js +1 -89
  452. package/dist/schema/local/index.d.ts +2045 -18080
  453. package/dist/schema/local/index.js +1 -927
  454. package/dist/schema/local/wip.d.ts +61 -651
  455. package/dist/schema/local/wip.js +1 -187
  456. package/dist/schema/messenger/index.d.ts +949 -5557
  457. package/dist/schema/messenger/index.js +1 -475
  458. package/dist/schema/operations.d.ts +2969 -26518
  459. package/dist/schema/operations.js +1 -520
  460. package/dist/schema/persona/index.d.ts +469 -1820
  461. package/dist/schema/persona/index.js +1 -148
  462. package/dist/schema/project/index.d.ts +1027 -8408
  463. package/dist/schema/project/index.js +1 -2057
  464. package/dist/schema/query/index.d.ts +12041 -75261
  465. package/dist/schema/query/index.js +1 -1646
  466. package/dist/schema/schema-query/index.d.ts +35 -98
  467. package/dist/schema/schema-query/index.js +1 -104
  468. package/dist/schema/schema-version.js +1 -76
  469. package/dist/schema/task-status.d.ts +26 -132
  470. package/dist/schema/task-status.js +1 -36
  471. package/dist/schema/trust/index.d.ts +194 -1290
  472. package/dist/schema/trust/index.js +1 -314
  473. package/dist/schema/utils/guard-parser.js +1 -419
  474. package/dist/schema/utils/guard-query-utils.js +1 -46
  475. package/dist/schema/utils/node-parser.js +1 -369
  476. package/dist/schema/utils/object-type-utils.js +1 -35
  477. package/dist/schema/utils/permission-index-utils.js +1 -7
  478. package/dist/schema/utils/permission-machine-check.js +1 -121
  479. package/dist/schema/utils/skills-recommendation.d.ts +1 -0
  480. package/dist/schema/utils/skills-recommendation.js +1 -77
  481. package/dist/schema/workspace/index.d.ts +69 -0
  482. package/dist/schema/workspace/index.js +1 -0
  483. package/dist/schema-query-impl/index.js +1 -0
  484. package/dist/schemas/account_operation.output.json +3147 -1652
  485. package/dist/schemas/account_operation.schema.json +225 -218
  486. package/dist/schemas/bridge_operation.output.json +1168 -650
  487. package/dist/schemas/bridge_operation.schema.json +736 -504
  488. package/dist/schemas/config_operation.output.json +185 -179
  489. package/dist/schemas/config_operation.schema.json +21 -26
  490. package/dist/schemas/employee_operation.output.json +207 -0
  491. package/dist/schemas/employee_operation.schema.json +176 -0
  492. package/dist/schemas/evaluation_operation.output.json +2329 -557
  493. package/dist/schemas/evaluation_operation.schema.json +2939 -720
  494. package/dist/schemas/guard2file.output.json +58 -64
  495. package/dist/schemas/guard2file.schema.json +79 -81
  496. package/dist/schemas/index.json +29 -11
  497. package/dist/schemas/industry_pack_operation.output.json +594 -0
  498. package/dist/schemas/industry_pack_operation.schema.json +55 -0
  499. package/dist/schemas/intent_radar.output.json +275 -200
  500. package/dist/schemas/intent_radar.schema.json +124 -123
  501. package/dist/schemas/local_info_operation.output.json +1174 -657
  502. package/dist/schemas/local_info_operation.schema.json +119 -125
  503. package/dist/schemas/local_mark_operation.output.json +1239 -689
  504. package/dist/schemas/local_mark_operation.schema.json +91 -96
  505. package/dist/schemas/machineNode2file.output.json +63 -69
  506. package/dist/schemas/machineNode2file.schema.json +79 -81
  507. package/dist/schemas/messenger_operation.output.json +2722 -1528
  508. package/dist/schemas/messenger_operation.schema.json +1482 -1264
  509. package/dist/schemas/onchain_events.output.json +2590 -975
  510. package/dist/schemas/onchain_events.schema.json +117 -99
  511. package/dist/schemas/onchain_operations.output.json +3957 -2309
  512. package/dist/schemas/onchain_operations.schema.json +20799 -9285
  513. package/dist/schemas/onchain_operations_allocation.schema.json +172 -108
  514. package/dist/schemas/onchain_operations_arbitration.schema.json +233 -146
  515. package/dist/schemas/onchain_operations_contact.schema.json +129 -90
  516. package/dist/schemas/onchain_operations_demand.schema.json +170 -112
  517. package/dist/schemas/onchain_operations_gen_passport.schema.json +61 -646
  518. package/dist/schemas/onchain_operations_gen_proof.schema.json +40 -172
  519. package/dist/schemas/onchain_operations_guard.schema.json +3765 -294
  520. package/dist/schemas/onchain_operations_machine.schema.json +537 -164
  521. package/dist/schemas/onchain_operations_order.schema.json +126 -96
  522. package/dist/schemas/onchain_operations_payment.schema.json +82 -67
  523. package/dist/schemas/onchain_operations_permission.schema.json +331 -93
  524. package/dist/schemas/onchain_operations_personal.schema.json +636 -96
  525. package/dist/schemas/onchain_operations_progress.schema.json +125 -92
  526. package/dist/schemas/onchain_operations_proof.schema.json +76 -69
  527. package/dist/schemas/onchain_operations_repository.schema.json +636 -249
  528. package/dist/schemas/onchain_operations_reward.schema.json +218 -108
  529. package/dist/schemas/onchain_operations_service.schema.json +679 -221
  530. package/dist/schemas/onchain_operations_treasury.schema.json +401 -135
  531. package/dist/schemas/onchain_table_data.output.json +6018 -2430
  532. package/dist/schemas/onchain_table_data.schema.json +544 -430
  533. package/dist/schemas/persona_operation.output.json +1568 -265
  534. package/dist/schemas/persona_operation.schema.json +346 -202
  535. package/dist/schemas/project_operation.output.json +6957 -5147
  536. package/dist/schemas/project_operation.schema.json +1050 -1020
  537. package/dist/schemas/query_task_status.output.json +195 -99
  538. package/dist/schemas/query_task_status.schema.json +12 -18
  539. package/dist/schemas/query_toolkit.output.json +18870 -14566
  540. package/dist/schemas/query_toolkit.schema.json +614 -522
  541. package/dist/schemas/schema_query.output.json +127 -129
  542. package/dist/schemas/schema_query.schema.json +64 -69
  543. package/dist/schemas/trust_score.output.json +678 -587
  544. package/dist/schemas/trust_score.schema.json +289 -277
  545. package/dist/schemas/wip_file.output.json +116 -124
  546. package/dist/schemas/wip_file.schema.json +142 -143
  547. package/dist/schemas/workspace_operation.output.json +277 -0
  548. package/dist/schemas/workspace_operation.schema.json +45 -0
  549. package/dist/schemas/wowok_buildin_info.output.json +1693 -723
  550. package/dist/schemas/wowok_buildin_info.schema.json +576 -512
  551. package/dist/telemetry/index.js +1 -112
  552. package/dist/telemetry/redact.js +1 -23
  553. package/dist/telemetry/storage.js +1 -80
  554. package/dist/tools/handlers/bridge.d.ts +8 -1
  555. package/dist/tools/handlers/bridge.js +1 -1
  556. package/dist/tools/handlers/config.js +1 -74
  557. package/dist/tools/handlers/employee.d.ts +2 -0
  558. package/dist/tools/handlers/employee.js +1 -0
  559. package/dist/tools/handlers/evaluation.js +1 -123
  560. package/dist/tools/handlers/file-export.js +1 -90
  561. package/dist/tools/handlers/industry-pack.d.ts +2 -0
  562. package/dist/tools/handlers/industry-pack.js +1 -0
  563. package/dist/tools/handlers/intent-radar.js +1 -76
  564. package/dist/tools/handlers/local.js +1 -53
  565. package/dist/tools/handlers/messenger.js +1 -188
  566. package/dist/tools/handlers/onchain.js +1 -1180
  567. package/dist/tools/handlers/persona.js +1 -89
  568. package/dist/tools/handlers/project.js +1 -211
  569. package/dist/tools/handlers/query.js +1 -434
  570. package/dist/tools/handlers/schema-query.js +1 -176
  571. package/dist/tools/handlers/task-status.js +1 -26
  572. package/dist/tools/handlers/trust.js +1 -380
  573. package/dist/tools/handlers/wip.js +1 -90
  574. package/dist/tools/handlers/workspace.d.ts +2 -0
  575. package/dist/tools/handlers/workspace.js +1 -0
  576. package/dist/tools/index.d.ts +2 -1
  577. package/dist/tools/index.js +1 -1382
  578. package/dist/tools/retry.js +1 -85
  579. package/dist/tools/rules-hook.d.ts +1 -1
  580. package/dist/tools/rules-hook.js +1 -23
  581. package/dist/tools/shared.d.ts +1 -1
  582. package/dist/tools/shared.js +1 -130
  583. package/dist/tools/types.d.ts +2 -1
  584. package/dist/tools/types.js +1 -1
  585. package/dist/tools/upgrade-check.d.ts +19 -0
  586. package/dist/tools/upgrade-check.js +1 -0
  587. package/dist/tools/wip-deploy-assist.js +1 -306
  588. package/dist/tools/wrap.js +1 -500
  589. package/package.json +7 -6
  590. package/dist/knowledge/arbitration-trust.d.ts +0 -24
  591. package/dist/knowledge/arbitration-trust.js +0 -117
  592. package/dist/schema/call/bridge-handler.d.ts +0 -8
  593. package/dist/schema/call/bridge-handler.js +0 -265
  594. package/dist/schema/sync-layer4.d.ts +0 -21
  595. package/dist/schema/sync-layer4.js +0 -286
  596. package/dist/schema-query/index.js +0 -810
  597. /package/dist/{schema-query → schema-query-impl}/index.d.ts +0 -0
@@ -1,187 +1 @@
1
- import { MAX_PROOF_SIZE, MAX_SERVER_PUBKEY_SIZE, MAX_SERVER_SIGNATURE_SIZE, WOWOK_WTS_PROOF_TYPE, } from "@wowok/wowok";
2
- function checkDescription(input) {
3
- const passed = !!input.description && input.description.length > 0;
4
- return {
5
- id: "C-PROOF-01",
6
- severity: passed ? "info" : "warn",
7
- title: "description is provided and non-empty",
8
- description: "description is a REQUIRED field (PF-D-2=A). Move contract stores it as String; SDK enforces isValidDescription. " +
9
- "Empty string (\"\") is technically valid but makes the Proof hard to identify in queries.",
10
- passed,
11
- evidence: input.description === undefined ? "undefined" : `length=${input.description.length}`,
12
- fix_hint: "Provide a one-line description like \"KYC attestation for user 0xabc\".",
13
- };
14
- }
15
- function checkProofContent(input) {
16
- const len = input.proof?.length ?? 0;
17
- const passed = len > 0 && len <= MAX_PROOF_SIZE;
18
- return {
19
- id: "C-PROOF-02",
20
- severity: passed ? "info" : "block",
21
- title: `proof content within MAX_PROOF_SIZE (${MAX_PROOF_SIZE} bytes)`,
22
- description: "The 'proof' string field must be non-empty and ≤ MAX_PROOF_SIZE bytes. Move aborts with E_MAX_PROOF_SIZE (1) on overflow. " +
23
- "Typically holds a merkle root or compact digest — large data should go in a Repository.",
24
- passed,
25
- evidence: `length=${len}, limit=${MAX_PROOF_SIZE}`,
26
- fix_hint: `Keep proof content compact. Current overflow: ${Math.max(0, len - MAX_PROOF_SIZE)} bytes.`,
27
- };
28
- }
29
- function checkServerPubkey(input) {
30
- const len = input.server_pubkey?.length ?? 0;
31
- const passed = len > 0 && len <= MAX_SERVER_PUBKEY_SIZE;
32
- return {
33
- id: "C-PROOF-03",
34
- severity: passed ? "info" : "block",
35
- title: `server_pubkey within MAX_SERVER_PUBKEY_SIZE (${MAX_SERVER_PUBKEY_SIZE} bytes)`,
36
- description: "server_pubkey must be non-empty and ≤ MAX_SERVER_PUBKEY_SIZE bytes. Move aborts with E_MAX_SERVER_PUBKEY_SIZE (2). " +
37
- "Submit raw public key bytes (hex-encoded), not a certificate chain.",
38
- passed,
39
- evidence: `length=${len}, limit=${MAX_SERVER_PUBKEY_SIZE}`,
40
- fix_hint: "Submit only the raw public key (Ed25519=32B, RSA-2048=256B, BLS12-381 G1=48B, G2=96B).",
41
- };
42
- }
43
- function checkServerSignature(input) {
44
- const len = input.server_signature?.length ?? 0;
45
- const passed = len > 0 && len <= MAX_SERVER_SIGNATURE_SIZE;
46
- return {
47
- id: "C-PROOF-04",
48
- severity: passed ? "info" : "block",
49
- title: `server_signature within MAX_SERVER_SIGNATURE_SIZE (${MAX_SERVER_SIGNATURE_SIZE} bytes)`,
50
- description: "server_signature must be non-empty and ≤ MAX_SERVER_SIGNATURE_SIZE bytes. Move aborts with E_MAX_SERVER_SIGNATURE_SIZE (3). " +
51
- "Submit raw signature bytes, not bundled metadata.",
52
- passed,
53
- evidence: `length=${len}, limit=${MAX_SERVER_SIGNATURE_SIZE}`,
54
- fix_hint: "Submit only the raw signature (Ed25519=64B, ECDSA=64-72B, BLS12-381=96B, RSA-2048=256B).",
55
- };
56
- }
57
- function checkProofType(input) {
58
- if (input.proof_type === undefined || input.proof_type === null) {
59
- return {
60
- id: "C-PROOF-05",
61
- severity: "block",
62
- title: "proof_type is provided",
63
- description: `proof_type is a required u64. ${WOWOK_WTS_PROOF_TYPE}=WOWOK_WTS_PROOF_TYPE (WTS proof); 2-100 reserved for Wowok; >100 user-defined.`,
64
- passed: false,
65
- evidence: "undefined",
66
- fix_hint: `Use ${WOWOK_WTS_PROOF_TYPE} for WTS proofs, or >100 for custom types.`,
67
- };
68
- }
69
- const n = typeof input.proof_type === "string" ? BigInt(input.proof_type) : BigInt(input.proof_type);
70
- const passed = n >= 1n;
71
- const severity = passed
72
- ? (n > 1n && n <= 100n ? "warn" : "info")
73
- : "block";
74
- return {
75
- id: "C-PROOF-05",
76
- severity,
77
- title: `proof_type valid (${WOWOK_WTS_PROOF_TYPE}=WTS, 2-100 reserved, >100 user-defined)`,
78
- description: `proof_type must be ≥ 1 (P-PROOF-P2-2). Value ${WOWOK_WTS_PROOF_TYPE}=WOWOK_WTS_PROOF_TYPE (WTS proof signed by off-chain server). ` +
79
- `Values 2-100 are reserved for future Wowok-defined types — using them without authority creates semantic confusion.`,
80
- passed,
81
- evidence: `proof_type=${input.proof_type}`,
82
- fix_hint: passed ? undefined : `Use ≥ 1. For custom types, use > 100.`,
83
- };
84
- }
85
- function checkAboutAddress(input) {
86
- const addr = input.about_address;
87
- if (addr === null || addr === undefined || addr === "") {
88
- return {
89
- id: "C-PROOF-06",
90
- severity: "info",
91
- title: "about_address is null → free-standing Proof (no on-chain entity binding)",
92
- description: "about_address=null is valid (PF-D-1=A, SDK sends Option::none). Use this for free-standing cryptographic statements. " +
93
- "For entity-bound attestations, set about_address to the on-chain entity address (raw 0x-prefixed, not a name).",
94
- passed: true,
95
- evidence: "null/empty → Option::none",
96
- };
97
- }
98
- const isValid = /^0x[0-9a-fA-F]{64}$/.test(addr);
99
- return {
100
- id: "C-PROOF-06",
101
- severity: isValid ? "info" : "block",
102
- title: "about_address is a valid raw 0x-prefixed address (or null)",
103
- description: "When provided, about_address must be a raw address (NOT a name). SDK isValidAddress check enforces 0x-prefixed 64-hex format. " +
104
- "Name resolution is NOT performed at the SDK layer for this field.",
105
- passed: isValid,
106
- evidence: `about_address=${addr.substring(0, 10)}...`,
107
- fix_hint: "Use 0x-prefixed 64-hex address. Names are not accepted.",
108
- };
109
- }
110
- function checkItemCount(input) {
111
- if (input.item_count === undefined || input.item_count === null) {
112
- return {
113
- id: "C-PROOF-07",
114
- severity: "info",
115
- title: "item_count is optional (null → Option::none)",
116
- description: "item_count is an optional u64. Use it to indicate the number of items in the off-chain data structure (e.g. merkle tree leaf count). " +
117
- "When null, SDK sends Option::none to Move.",
118
- passed: true,
119
- evidence: "optional/none",
120
- };
121
- }
122
- const n = typeof input.item_count === "string" ? BigInt(input.item_count) : BigInt(input.item_count);
123
- const passed = n >= 0n;
124
- return {
125
- id: "C-PROOF-07",
126
- severity: passed ? "info" : "block",
127
- title: "item_count is a non-negative u64 (or null)",
128
- description: "When provided, item_count must be ≥ 0. Used to indicate off-chain data structure size (e.g. merkle leaf count).",
129
- passed,
130
- evidence: `item_count=${input.item_count}`,
131
- };
132
- }
133
- function checkNamedNew(input) {
134
- const has = !!input.namedNew;
135
- return {
136
- id: "C-PROOF-08",
137
- severity: has ? "info" : "warn",
138
- title: "namedNew is provided (recommended for discoverability)",
139
- description: "namedNew={name, tag?} is optional but recommended. Without it, the Proof is created without a local mark, " +
140
- "making it harder to reference in subsequent operations. The 'name' should be descriptive (e.g. \"kyc_user_abc\").",
141
- passed: has,
142
- evidence: has ? `name=${input.namedNew.name}` : "not provided",
143
- fix_hint: "Provide namedNew={name: \"descriptive_name\"} for easier subsequent reference.",
144
- };
145
- }
146
- export function preCheckProofCreation(input) {
147
- return [
148
- checkDescription(input),
149
- checkProofContent(input),
150
- checkServerPubkey(input),
151
- checkServerSignature(input),
152
- checkProofType(input),
153
- checkAboutAddress(input),
154
- checkItemCount(input),
155
- checkNamedNew(input),
156
- ];
157
- }
158
- export function canCreateProof(input) {
159
- const items = preCheckProofCreation(input);
160
- return {
161
- canCreate: items.every(i => i.severity !== "block" || i.passed),
162
- blockers: items.filter(i => i.severity === "block" && !i.passed),
163
- warnings: items.filter(i => i.severity === "warn" && !i.passed),
164
- info: items.filter(i => i.severity === "info"),
165
- };
166
- }
167
- export function formatProofCreationSummary(input) {
168
- const { canCreate, blockers, warnings, info } = canCreateProof(input);
169
- const lines = [];
170
- lines.push(canCreate ? "✓ Proof creation pre-check PASSED" : "✗ Proof creation pre-check FAILED");
171
- lines.push("");
172
- if (blockers.length > 0) {
173
- lines.push("BLOCKERS (must fix before creation):");
174
- blockers.forEach(b => lines.push(` [${b.id}] ${b.title} — ${b.evidence ?? ""}`));
175
- lines.push("");
176
- }
177
- if (warnings.length > 0) {
178
- lines.push("WARNINGS (review recommended):");
179
- warnings.forEach(w => lines.push(` [${w.id}] ${w.title} — ${w.evidence ?? ""}`));
180
- lines.push("");
181
- }
182
- if (info.length > 0) {
183
- lines.push("INFO:");
184
- info.forEach(i => lines.push(` [${i.id}] ${i.title}`));
185
- }
186
- return lines.join("\n");
187
- }
1
+ import{MAX_PROOF_SIZE,MAX_SERVER_PUBKEY_SIZE,MAX_SERVER_SIGNATURE_SIZE,WOWOK_WTS_PROOF_TYPE}from'@wowok/wowok';function checkDescription(a){const b=!!a['description']&&a['description']['length']>0x0;return{'id':'C-PROOF-01','severity':b?'info':'warn','title':'description\x20is\x20provided\x20and\x20non-empty','description':'description\x20is\x20a\x20REQUIRED\x20field\x20(PF-D-2=A).\x20Move\x20contract\x20stores\x20it\x20as\x20String;\x20SDK\x20enforces\x20isValidDescription.\x20'+'Empty\x20string\x20(\x22\x22)\x20is\x20technically\x20valid\x20but\x20makes\x20the\x20Proof\x20hard\x20to\x20identify\x20in\x20queries.','passed':b,'evidence':a['description']===undefined?'undefined':'length='+a['description']['length'],'fix_hint':'Provide\x20a\x20one-line\x20description\x20like\x20\x22KYC\x20attestation\x20for\x20user\x200xabc\x22.'};}function checkProofContent(a){const b=a['proof']?.['length']??0x0,c=b>0x0&&b<=MAX_PROOF_SIZE;return{'id':'C-PROOF-02','severity':c?'info':'block','title':'proof\x20content\x20within\x20MAX_PROOF_SIZE\x20('+MAX_PROOF_SIZE+'\x20bytes)','description':'The\x20\x27proof\x27\x20string\x20field\x20must\x20be\x20non-empty\x20and\x20≤\x20MAX_PROOF_SIZE\x20bytes.\x20Move\x20aborts\x20with\x20E_MAX_PROOF_SIZE\x20(1)\x20on\x20overflow.\x20'+'Typically\x20holds\x20a\x20merkle\x20root\x20or\x20compact\x20digest\x20—\x20large\x20data\x20should\x20go\x20in\x20a\x20Repository.','passed':c,'evidence':'length='+b+',\x20limit='+MAX_PROOF_SIZE,'fix_hint':'Keep\x20proof\x20content\x20compact.\x20Current\x20overflow:\x20'+Math['max'](0x0,b-MAX_PROOF_SIZE)+'\x20bytes.'};}function checkServerPubkey(a){const b=a['server_pubkey']?.['length']??0x0,c=b>0x0&&b<=MAX_SERVER_PUBKEY_SIZE;return{'id':'C-PROOF-03','severity':c?'info':'block','title':'server_pubkey\x20within\x20MAX_SERVER_PUBKEY_SIZE\x20('+MAX_SERVER_PUBKEY_SIZE+'\x20bytes)','description':'server_pubkey\x20must\x20be\x20non-empty\x20and\x20≤\x20MAX_SERVER_PUBKEY_SIZE\x20bytes.\x20Move\x20aborts\x20with\x20E_MAX_SERVER_PUBKEY_SIZE\x20(2).\x20'+'Submit\x20raw\x20public\x20key\x20bytes\x20(hex-encoded),\x20not\x20a\x20certificate\x20chain.','passed':c,'evidence':'length='+b+',\x20limit='+MAX_SERVER_PUBKEY_SIZE,'fix_hint':'Submit\x20only\x20the\x20raw\x20public\x20key\x20(Ed25519=32B,\x20RSA-2048=256B,\x20BLS12-381\x20G1=48B,\x20G2=96B).'};}function checkServerSignature(a){const b=a['server_signature']?.['length']??0x0,c=b>0x0&&b<=MAX_SERVER_SIGNATURE_SIZE;return{'id':'C-PROOF-04','severity':c?'info':'block','title':'server_signature\x20within\x20MAX_SERVER_SIGNATURE_SIZE\x20('+MAX_SERVER_SIGNATURE_SIZE+'\x20bytes)','description':'server_signature\x20must\x20be\x20non-empty\x20and\x20≤\x20MAX_SERVER_SIGNATURE_SIZE\x20bytes.\x20Move\x20aborts\x20with\x20E_MAX_SERVER_SIGNATURE_SIZE\x20(3).\x20'+'Submit\x20raw\x20signature\x20bytes,\x20not\x20bundled\x20metadata.','passed':c,'evidence':'length='+b+',\x20limit='+MAX_SERVER_SIGNATURE_SIZE,'fix_hint':'Submit\x20only\x20the\x20raw\x20signature\x20(Ed25519=64B,\x20ECDSA=64-72B,\x20BLS12-381=96B,\x20RSA-2048=256B).'};}function checkProofType(a){if(a['proof_type']===undefined||a['proof_type']===null)return{'id':'C-PROOF-05','severity':'block','title':'proof_type\x20is\x20provided','description':'proof_type\x20is\x20a\x20required\x20u64.\x20'+WOWOK_WTS_PROOF_TYPE+'=WOWOK_WTS_PROOF_TYPE\x20(WTS\x20proof);\x202-100\x20reserved\x20for\x20Wowok;\x20>100\x20user-defined.','passed':![],'evidence':'undefined','fix_hint':'Use\x20'+WOWOK_WTS_PROOF_TYPE+'\x20for\x20WTS\x20proofs,\x20or\x20>100\x20for\x20custom\x20types.'};const b=typeof a['proof_type']==='string'?BigInt(a['proof_type']):BigInt(a['proof_type']),c=b>=0x1n,d=c?b>0x1n&&b<=0x64n?'warn':'info':'block';return{'id':'C-PROOF-05','severity':d,'title':'proof_type\x20valid\x20('+WOWOK_WTS_PROOF_TYPE+'=WTS,\x202-100\x20reserved,\x20>100\x20user-defined)','description':'proof_type\x20must\x20be\x20≥\x201\x20(P-PROOF-P2-2).\x20Value\x20'+WOWOK_WTS_PROOF_TYPE+'=WOWOK_WTS_PROOF_TYPE\x20(WTS\x20proof\x20signed\x20by\x20off-chain\x20server).\x20'+'Values\x202-100\x20are\x20reserved\x20for\x20future\x20Wowok-defined\x20types\x20—\x20using\x20them\x20without\x20authority\x20creates\x20semantic\x20confusion.','passed':c,'evidence':'proof_type='+a['proof_type'],'fix_hint':c?undefined:'Use\x20≥\x201.\x20For\x20custom\x20types,\x20use\x20>\x20100.'};}function checkAboutAddress(a){const b=a['about_address'];if(b===null||b===undefined||b==='')return{'id':'C-PROOF-06','severity':'info','title':'about_address\x20is\x20null\x20→\x20free-standing\x20Proof\x20(no\x20on-chain\x20entity\x20binding)','description':'about_address=null\x20is\x20valid\x20(PF-D-1=A,\x20SDK\x20sends\x20Option::none).\x20Use\x20this\x20for\x20free-standing\x20cryptographic\x20statements.\x20'+'For\x20entity-bound\x20attestations,\x20set\x20about_address\x20to\x20the\x20on-chain\x20entity\x20address\x20(raw\x200x-prefixed,\x20not\x20a\x20name).','passed':!![],'evidence':'null/empty\x20→\x20Option::none'};const c=/^0x[0-9a-fA-F]{64}$/['test'](b);return{'id':'C-PROOF-06','severity':c?'info':'block','title':'about_address\x20is\x20a\x20valid\x20raw\x200x-prefixed\x20address\x20(or\x20null)','description':'When\x20provided,\x20about_address\x20must\x20be\x20a\x20raw\x20address\x20(NOT\x20a\x20name).\x20SDK\x20isValidAddress\x20check\x20enforces\x200x-prefixed\x2064-hex\x20format.\x20'+'Name\x20resolution\x20is\x20NOT\x20performed\x20at\x20the\x20SDK\x20layer\x20for\x20this\x20field.','passed':c,'evidence':'about_address='+b['substring'](0x0,0xa)+'...','fix_hint':'Use\x200x-prefixed\x2064-hex\x20address.\x20Names\x20are\x20not\x20accepted.'};}function checkItemCount(a){if(a['item_count']===undefined||a['item_count']===null)return{'id':'C-PROOF-07','severity':'info','title':'item_count\x20is\x20optional\x20(null\x20→\x20Option::none)','description':'item_count\x20is\x20an\x20optional\x20u64.\x20Use\x20it\x20to\x20indicate\x20the\x20number\x20of\x20items\x20in\x20the\x20off-chain\x20data\x20structure\x20(e.g.\x20merkle\x20tree\x20leaf\x20count).\x20'+'When\x20null,\x20SDK\x20sends\x20Option::none\x20to\x20Move.','passed':!![],'evidence':'optional/none'};const b=typeof a['item_count']==='string'?BigInt(a['item_count']):BigInt(a['item_count']),c=b>=0x0n;return{'id':'C-PROOF-07','severity':c?'info':'block','title':'item_count\x20is\x20a\x20non-negative\x20u64\x20(or\x20null)','description':'When\x20provided,\x20item_count\x20must\x20be\x20≥\x200.\x20Used\x20to\x20indicate\x20off-chain\x20data\x20structure\x20size\x20(e.g.\x20merkle\x20leaf\x20count).','passed':c,'evidence':'item_count='+a['item_count']};}function checkNamedNew(a){const b=!!a['namedNew'];return{'id':'C-PROOF-08','severity':b?'info':'warn','title':'namedNew\x20is\x20provided\x20(recommended\x20for\x20discoverability)','description':'namedNew={name,\x20tag?}\x20is\x20optional\x20but\x20recommended.\x20Without\x20it,\x20the\x20Proof\x20is\x20created\x20without\x20a\x20local\x20mark,\x20'+'making\x20it\x20harder\x20to\x20reference\x20in\x20subsequent\x20operations.\x20The\x20\x27name\x27\x20should\x20be\x20descriptive\x20(e.g.\x20\x22kyc_user_abc\x22).','passed':b,'evidence':b?'name='+a['namedNew']['name']:'not\x20provided','fix_hint':'Provide\x20namedNew={name:\x20\x22descriptive_name\x22}\x20for\x20easier\x20subsequent\x20reference.'};}export function preCheckProofCreation(a){return[checkDescription(a),checkProofContent(a),checkServerPubkey(a),checkServerSignature(a),checkProofType(a),checkAboutAddress(a),checkItemCount(a),checkNamedNew(a)];}export function canCreateProof(a){const b=preCheckProofCreation(a);return{'canCreate':b['every'](c=>c['severity']!=='block'||c['passed']),'blockers':b['filter'](c=>c['severity']==='block'&&!c['passed']),'warnings':b['filter'](c=>c['severity']==='warn'&&!c['passed']),'info':b['filter'](c=>c['severity']==='info')};}export function formatProofCreationSummary(a){const {canCreate:b,blockers:c,warnings:d,info:e}=canCreateProof(a),f=[];return f['push'](b?'✓\x20Proof\x20creation\x20pre-check\x20PASSED':'✗\x20Proof\x20creation\x20pre-check\x20FAILED'),f['push'](''),c['length']>0x0&&(f['push']('BLOCKERS\x20(must\x20fix\x20before\x20creation):'),c['forEach'](g=>f['push']('\x20\x20['+g['id']+']\x20'+g['title']+'\x20—\x20'+(g['evidence']??''))),f['push']('')),d['length']>0x0&&(f['push']('WARNINGS\x20(review\x20recommended):'),d['forEach'](g=>f['push']('\x20\x20['+g['id']+']\x20'+g['title']+'\x20—\x20'+(g['evidence']??''))),f['push']('')),e['length']>0x0&&(f['push']('INFO:'),e['forEach'](g=>f['push']('\x20\x20['+g['id']+']\x20'+g['title']))),f['join']('\x0a');}
@@ -0,0 +1,17 @@
1
+ import { type ProofScene } from "./proof-ledger.js";
2
+ export declare const PROOF_CONTEXT_VERSION = "1.0.0";
3
+ export interface ProofContextBundle {
4
+ scene?: ProofScene;
5
+ binding: "entity_bound" | "free_standing";
6
+ immutable: true;
7
+ summary: string;
8
+ }
9
+ export interface BuildProofContextInput {
10
+ proof_type?: number | bigint | string;
11
+ about_address?: string | null;
12
+ description?: string;
13
+ proof?: string;
14
+ }
15
+ export declare function buildProofContext(input: BuildProofContextInput): ProofContextBundle;
16
+ export declare function getProofContextSummary(ctx: ProofContextBundle): string;
17
+ export declare function isWtsProof(proofType: number | bigint | string): boolean;
@@ -0,0 +1 @@
1
+ import{WOWOK_WTS_PROOF_TYPE}from'@wowok/wowok';import{getProofSceneByType}from'./proof-ledger.js';export const PROOF_CONTEXT_VERSION='1.0.0';export function buildProofContext(a){const b=a['proof_type']!==undefined?getProofSceneByType(a['proof_type']):undefined,c=a['about_address']?'entity_bound':'free_standing',d=[];return b?d['push']('proof_type\x20'+b['proof_type_range']+'\x20('+b['semantic']+')'):d['push']('proof_type\x20not\x20classified'),a['description']&&d['push']('description\x20\x22'+a['description']+'\x22'),d['push'](c==='entity_bound'?'bound\x20to\x20on-chain\x20entity':'free-standing\x20attestation'),d['push']('immutable\x20(freeze_object)'),{'scene':b,'binding':c,'immutable':!![],'summary':d['join']('\x20·\x20')};}export function getProofContextSummary(a){return a['summary'];}export function isWtsProof(a){const b=typeof a==='string'?BigInt(a):BigInt(a);return b===BigInt(WOWOK_WTS_PROOF_TYPE);}
@@ -0,0 +1,34 @@
1
+ export declare const PROOF_LEDGER_VERSION = "1.0.0";
2
+ export type ProofFieldMutability = "immutable";
3
+ export interface ProofFieldEntry {
4
+ field: string;
5
+ move_field?: string;
6
+ value_type: string;
7
+ semantic: string;
8
+ required: boolean;
9
+ mutability: ProofFieldMutability;
10
+ error_code?: string;
11
+ }
12
+ export declare const PROOF_FIELDS: ProofFieldEntry[];
13
+ export interface ProofErrorEntry {
14
+ code: string;
15
+ value: number;
16
+ description: string;
17
+ related_field: string;
18
+ }
19
+ export declare const PROOF_ERROR_CODES: ProofErrorEntry[];
20
+ export type ProofSceneClassification = "wts" | "custom_reserved" | "custom_user";
21
+ export interface ProofScene {
22
+ id: string;
23
+ classification: ProofSceneClassification;
24
+ proof_type_range: string;
25
+ semantic: string;
26
+ recommended: boolean;
27
+ }
28
+ export declare const PROOF_SCENES: ProofScene[];
29
+ export declare function getProofField(field: string): ProofFieldEntry | undefined;
30
+ export declare function getProofFieldsCount(): number;
31
+ export declare function getProofErrorByCode(code: string): ProofErrorEntry | undefined;
32
+ export declare function getProofErrorByValue(value: number): ProofErrorEntry | undefined;
33
+ export declare function getProofSceneByType(proofType: number | bigint | string): ProofScene | undefined;
34
+ export declare function inferProofSceneFromIntent(intent: string): ProofScene | undefined;
@@ -0,0 +1 @@
1
+ import{WOWOK_WTS_PROOF_TYPE,MAX_PROOF_SIZE,MAX_SERVER_PUBKEY_SIZE,MAX_SERVER_SIGNATURE_SIZE}from'@wowok/wowok';export const PROOF_LEDGER_VERSION='1.0.0';export const PROOF_FIELDS=[{'field':'description','value_type':'string','semantic':'Human-readable\x20one-line\x20summary\x20(audit/discoverability).','required':!![],'mutability':'immutable'},{'field':'proof','value_type':'string\x20(hex-encoded)','semantic':'Cryptographic\x20proof\x20content\x20(merkle\x20root\x20/\x20hash\x20digest\x20/\x20compact\x20attestation).','required':!![],'mutability':'immutable','error_code':'E_MAX_PROOF_SIZE'},{'field':'server_pubkey','value_type':'string\x20(hex-encoded)','semantic':'Raw\x20public\x20key\x20of\x20the\x20off-chain\x20signing\x20server\x20(not\x20a\x20certificate).','required':!![],'mutability':'immutable','error_code':'E_MAX_SERVER_PUBKEY_SIZE'},{'field':'server_signature','value_type':'string\x20(hex-encoded)','semantic':'Signature\x20produced\x20by\x20the\x20off-chain\x20server\x20over\x20`proof`\x20(or\x20documented\x20pre-image).','required':!![],'mutability':'immutable','error_code':'E_MAX_SERVER_SIGNATURE_SIZE'},{'field':'proof_type','value_type':'u64','semantic':'Proof\x20verification\x20classification\x20(1=WTS,\x202-100\x20reserved,\x20>100\x20user-defined).','required':!![],'mutability':'immutable'},{'field':'about_address','move_field':'about','value_type':'Option<address>','semantic':'On-chain\x20entity\x20this\x20proof\x20attests\x20to;\x20null\x20=\x20free-standing\x20statement.','required':![],'mutability':'immutable'},{'field':'item_count','move_field':'item_count','value_type':'Option<u64>','semantic':'Optional\x20count\x20of\x20items\x20in\x20the\x20off-chain\x20data\x20structure\x20(e.g.\x20merkle\x20leaf\x20count).','required':![],'mutability':'immutable'},{'field':'signer','value_type':'address','semantic':'The\x20tx\x20sender\x20who\x20created\x20the\x20proof\x20(frozen\x20at\x20creation).','required':!![],'mutability':'immutable'},{'field':'time','value_type':'u64\x20(timestamp\x20ms)','semantic':'Creation\x20timestamp\x20(clock::timestamp_ms).','required':!![],'mutability':'immutable'}];export const PROOF_ERROR_CODES=[{'code':'E_MAX_PROOF_SIZE','value':0x1,'description':'proof\x20string\x20length\x20exceeds\x20MAX_PROOF_SIZE\x20('+MAX_PROOF_SIZE+'\x20bytes).','related_field':'proof'},{'code':'E_MAX_SERVER_PUBKEY_SIZE','value':0x2,'description':'server_pubkey\x20length\x20exceeds\x20MAX_SERVER_PUBKEY_SIZE\x20('+MAX_SERVER_PUBKEY_SIZE+'\x20bytes).','related_field':'server_pubkey'},{'code':'E_MAX_SERVER_SIGNATURE_SIZE','value':0x3,'description':'server_signature\x20length\x20exceeds\x20MAX_SERVER_SIGNATURE_SIZE\x20('+MAX_SERVER_SIGNATURE_SIZE+'\x20bytes).','related_field':'server_signature'}];export const PROOF_SCENES=[{'id':'proof_wts','classification':'wts','proof_type_range':''+WOWOK_WTS_PROOF_TYPE,'semantic':'Wowok\x20Will-To-Sign:\x20an\x20off-chain\x20server\x20attests\x20to\x20a\x20fact\x20and\x20signs\x20it\x20(server_pubkey\x20+\x20server_signature).','recommended':!![]},{'id':'proof_custom_reserved','classification':'custom_reserved','proof_type_range':'2-100','semantic':'Custom\x20proof\x20in\x20Wowok\x20reserved\x20range\x20—\x20NOT\x20recommended\x20(future\x20protocol\x20upgrades\x20may\x20reassign).','recommended':![]},{'id':'proof_custom_user','classification':'custom_user','proof_type_range':'>100','semantic':'User-defined\x20application-specific\x20proof\x20—\x20creator\x20documents\x20the\x20off-chain\x20verification\x20logic.','recommended':!![]}];export function getProofField(a){return PROOF_FIELDS['find'](b=>b['field']===a);}export function getProofFieldsCount(){return PROOF_FIELDS['length'];}export function getProofErrorByCode(a){return PROOF_ERROR_CODES['find'](b=>b['code']===a);}export function getProofErrorByValue(a){return PROOF_ERROR_CODES['find'](b=>b['value']===a);}export function getProofSceneByType(a){const b=typeof a==='string'?BigInt(a):BigInt(a);if(b===BigInt(WOWOK_WTS_PROOF_TYPE))return PROOF_SCENES['find'](c=>c['classification']==='wts');if(b>0x1n&&b<=0x64n)return PROOF_SCENES['find'](c=>c['classification']==='custom_reserved');if(b>0x64n)return PROOF_SCENES['find'](c=>c['classification']==='custom_user');return undefined;}export function inferProofSceneFromIntent(a){const b=a['toLowerCase']();if(/(wts|will.?to.?sign|server.?signed|attestation|merkle|kyc|timestamp)/['test'](b))return PROOF_SCENES['find'](c=>c['classification']==='wts');if(/(reserved|wowok.?defined|protocol.?reserved)/['test'](b))return PROOF_SCENES['find'](c=>c['classification']==='custom_reserved');if(/(custom|user.?defined|application.?specific)/['test'](b))return PROOF_SCENES['find'](c=>c['classification']==='custom_user');return undefined;}
@@ -0,0 +1,35 @@
1
+ import { type ProofScene } from "./proof-ledger.js";
2
+ export declare const PROOF_PUZZLE_VERSION = "1.0.0";
3
+ export type ProofPuzzleDimension = "intent" | "fields";
4
+ export interface ProofIntentPuzzle {
5
+ scene?: ProofScene;
6
+ proof_type?: number;
7
+ }
8
+ export interface ProofFieldState {
9
+ field: string;
10
+ present: boolean;
11
+ required: boolean;
12
+ }
13
+ export interface ProofPuzzle {
14
+ intent: ProofIntentPuzzle;
15
+ fields: ProofFieldState[];
16
+ }
17
+ export interface ProofPuzzleCompleteness {
18
+ complete: boolean;
19
+ missing_required: string[];
20
+ missing_optional: string[];
21
+ reason: string;
22
+ }
23
+ export interface InitProofPuzzleInput {
24
+ intent: string;
25
+ proof_type?: number;
26
+ description?: string;
27
+ proof?: string;
28
+ server_pubkey?: string;
29
+ server_signature?: string;
30
+ about_address?: string | null;
31
+ item_count?: number | bigint | string | null;
32
+ }
33
+ export declare function initProofPuzzleFromIntent(input: InitProofPuzzleInput): ProofPuzzle;
34
+ export declare function checkProofPuzzleCompleteness(puzzle: ProofPuzzle): ProofPuzzleCompleteness;
35
+ export declare function generateProofConfirmationText(puzzle: ProofPuzzle): string;
@@ -0,0 +1 @@
1
+ import{WOWOK_WTS_PROOF_TYPE}from'@wowok/wowok';import{PROOF_FIELDS,inferProofSceneFromIntent}from'./proof-ledger.js';export const PROOF_PUZZLE_VERSION='1.0.0';export function initProofPuzzleFromIntent(a){const b=inferProofSceneFromIntent(a['intent']),c=a['proof_type']??(b?.['classification']==='wts'?WOWOK_WTS_PROOF_TYPE:undefined),d={'description':!!a['description'],'proof':!!a['proof'],'server_pubkey':!!a['server_pubkey'],'server_signature':!!a['server_signature'],'proof_type':c!==undefined,'about_address':a['about_address']!=null&&a['about_address']!=='','item_count':a['item_count']!=null&&a['item_count']!==''},e=PROOF_FIELDS['filter'](g=>g['field']in d||g['field']==='signer'||g['field']==='time')['map'](g=>{if(g['field']==='signer'||g['field']==='time')return{'field':g['field'],'present':!![],'required':g['required']};return{'field':g['field'],'present':!!d[g['field']],'required':g['required']};});return{'intent':{'scene':b,'proof_type':c},'fields':e};}export function checkProofPuzzleCompleteness(a){const b=a['fields']['filter'](e=>e['required']&&!e['present'])['map'](e=>e['field']),c=a['fields']['filter'](e=>!e['required']&&!e['present'])['map'](e=>e['field']),d=b['length']===0x0;return{'complete':d,'missing_required':b,'missing_optional':c,'reason':d?'All\x20required\x20proof\x20fields\x20present.':'Missing\x20required:\x20'+b['join'](',\x20')+'.'};}export function generateProofConfirmationText(a){const b=checkProofPuzzleCompleteness(a),d=a['intent']['scene'],e=d?'Scene:\x20'+d['id']+'\x20(proof_type\x20'+d['proof_type_range']+')':'Scene:\x20not\x20classified\x20(provide\x20more\x20intent)';return[e,b['reason']]['join']('\x0a');}
@@ -1,207 +1 @@
1
- import { MAX_PROOF_SIZE, MAX_SERVER_PUBKEY_SIZE, MAX_SERVER_SIGNATURE_SIZE, WOWOK_WTS_PROOF_TYPE, } from "@wowok/wowok";
2
- const R_PR_1_01 = {
3
- rule: {
4
- id: "R-PROOF-01",
5
- level: "HIGH",
6
- category: "structural",
7
- title: `proof content exceeds MAX_PROOF_SIZE (${MAX_PROOF_SIZE} bytes)`,
8
- description: `The 'proof' string field is bounded by MAX_PROOF_SIZE=${MAX_PROOF_SIZE} bytes (Move source: proof.move:27). ` +
9
- `Exceeding this limit aborts with E_MAX_PROOF_SIZE (1). The proof content typically holds a merkle tree root ` +
10
- `or similar compact cryptographic digest — large data should be stored in a Repository and referenced by address, ` +
11
- `not inlined into the Proof object.`,
12
- affected_stakeholders: ["creator"],
13
- scenario: "Caller submits a proof string longer than 10240 bytes",
14
- mitigation: `Keep proof content compact (merkle root, hash digest). For larger payloads, store data in a Repository ` +
15
- `object and set about_address to the Repository address, or use item_count to indicate the off-chain data size.`,
16
- related_move_error: "E_MAX_PROOF_SIZE (1)",
17
- auto_fixable: false,
18
- },
19
- check: (ctx) => {
20
- if (!ctx.proof)
21
- return null;
22
- if (ctx.proof.length <= MAX_PROOF_SIZE)
23
- return null;
24
- return { ...R_PR_1_01.rule, evidence: `proof.length=${ctx.proof.length}, limit=${MAX_PROOF_SIZE}` };
25
- },
26
- };
27
- const R_PR_1_02 = {
28
- rule: {
29
- id: "R-PROOF-02",
30
- level: "MEDIUM",
31
- category: "structural",
32
- title: `server_pubkey exceeds MAX_SERVER_PUBKEY_SIZE (${MAX_SERVER_PUBKEY_SIZE} bytes)`,
33
- description: `The 'server_pubkey' field is bounded by MAX_SERVER_PUBKEY_SIZE=${MAX_SERVER_PUBKEY_SIZE} bytes (Move source: proof.move:28). ` +
34
- `Exceeding this limit aborts with E_MAX_SERVER_PUBKEY_SIZE (2). Typical public keys (Ed25519=32 bytes, RSA-2048=256 bytes, ` +
35
- `BLS12-381 G1=48 bytes, G2=96 bytes) fit comfortably within this limit.`,
36
- affected_stakeholders: ["creator"],
37
- scenario: "Caller submits an oversized server public key (e.g. certificate chain instead of raw key)",
38
- mitigation: "Submit only the raw public key bytes (hex-encoded), not a full certificate or JWK structure.",
39
- related_move_error: "E_MAX_SERVER_PUBKEY_SIZE (2)",
40
- auto_fixable: false,
41
- },
42
- check: (ctx) => {
43
- if (!ctx.server_pubkey)
44
- return null;
45
- if (ctx.server_pubkey.length <= MAX_SERVER_PUBKEY_SIZE)
46
- return null;
47
- return { ...R_PR_1_02.rule, evidence: `server_pubkey.length=${ctx.server_pubkey.length}, limit=${MAX_SERVER_PUBKEY_SIZE}` };
48
- },
49
- };
50
- const R_PR_1_03 = {
51
- rule: {
52
- id: "R-PROOF-03",
53
- level: "MEDIUM",
54
- category: "structural",
55
- title: `server_signature exceeds MAX_SERVER_SIGNATURE_SIZE (${MAX_SERVER_SIGNATURE_SIZE} bytes)`,
56
- description: `The 'server_signature' field is bounded by MAX_SERVER_SIGNATURE_SIZE=${MAX_SERVER_SIGNATURE_SIZE} bytes ` +
57
- `(Move source: proof.move:29). Exceeding this limit aborts with E_MAX_SERVER_SIGNATURE_SIZE (3). ` +
58
- `Most signature schemes produce signatures well under this limit (Ed25519=64 bytes, ECDSA=64-72 bytes, ` +
59
- `BLS12-381=96 bytes, RSA-2048=256 bytes).`,
60
- affected_stakeholders: ["creator"],
61
- scenario: "Caller submits an oversized signature (e.g. bundled with metadata)",
62
- mitigation: "Submit only the raw signature bytes (hex-encoded), not bundled metadata or certificate chains.",
63
- related_move_error: "E_MAX_SERVER_SIGNATURE_SIZE (3)",
64
- auto_fixable: false,
65
- },
66
- check: (ctx) => {
67
- if (!ctx.server_signature)
68
- return null;
69
- if (ctx.server_signature.length <= MAX_SERVER_SIGNATURE_SIZE)
70
- return null;
71
- return { ...R_PR_1_03.rule, evidence: `server_signature.length=${ctx.server_signature.length}, limit=${MAX_SERVER_SIGNATURE_SIZE}` };
72
- },
73
- };
74
- const R_PR_2_01 = {
75
- rule: {
76
- id: "R-PROOF-04",
77
- level: "MEDIUM",
78
- category: "semantic",
79
- title: `proof_type in reserved range without authority (1-100 reserved for Wowok)`,
80
- description: `proof_type=${WOWOK_WTS_PROOF_TYPE} is WOWOK_WTS_PROOF_TYPE (Will-To-Sign). Values 2-100 are reserved for ` +
81
- `future Wowok-defined proof types. User-defined proof types must use values > 100. While the Move contract ` +
82
- `does not currently enforce this range at the type level (it accepts any u64), using a reserved value without ` +
83
- `authority creates semantic confusion: consumers may misinterpret the proof's verification rules.`,
84
- affected_stakeholders: ["creator", "consumer", "verifier"],
85
- scenario: "User creates a custom proof with proof_type=5 (a reserved value)",
86
- mitigation: "Use proof_type > 100 for user-defined proof types. Use proof_type=1 only for WTS proofs signed by an " +
87
- "off-chain server (with server_pubkey + server_signature). Document the verification rule for custom types.",
88
- auto_fixable: false,
89
- },
90
- check: (ctx) => {
91
- if (ctx.proof_type === undefined || ctx.proof_type === null)
92
- return null;
93
- const n = typeof ctx.proof_type === "string" ? BigInt(ctx.proof_type) : BigInt(ctx.proof_type);
94
- if (n === BigInt(WOWOK_WTS_PROOF_TYPE) || n > 100n)
95
- return null;
96
- return { ...R_PR_2_01.rule, evidence: `proof_type=${ctx.proof_type} (reserved range 2-100)` };
97
- },
98
- };
99
- const R_PR_2_02 = {
100
- rule: {
101
- id: "R-PROOF-05",
102
- level: "LOW",
103
- category: "semantic",
104
- title: "about_address not provided — consumers cannot locate the referenced entity",
105
- description: "about_address is the on-chain address of the entity being proved (e.g. a user, an order, a Repository). " +
106
- "When null/undefined, the Proof has no on-chain binding — it is a free-standing cryptographic statement. " +
107
- "Consumers (Repository, Service, etc.) that reference this Proof cannot automatically resolve which entity " +
108
- "it applies to. This is acceptable for generic proofs but problematic for entity-bound attestations.",
109
- affected_stakeholders: ["creator", "consumer"],
110
- scenario: "Caller creates a Proof without about_address, then a Repository tries to bind it to a data entry",
111
- mitigation: "Set about_address when the Proof attests to a specific on-chain entity. Leave it null only for " +
112
- "free-standing cryptographic statements (e.g. a server's timestamp attestation).",
113
- auto_fixable: true,
114
- },
115
- check: (ctx) => {
116
- if (ctx.about_address)
117
- return null;
118
- return { ...R_PR_2_02.rule, evidence: "about_address=null/undefined" };
119
- },
120
- };
121
- const R_PR_3_01 = {
122
- rule: {
123
- id: "R-PROOF-06",
124
- level: "LOW",
125
- category: "lifecycle",
126
- title: "description missing — Proof hard to identify in queries and audit logs",
127
- description: "description is a REQUIRED field (PF-D-2=A). The Move contract stores it as a String field and SDK " +
128
- "passes it to create_wowok_proof. An empty description (\"\") is technically valid but makes the Proof " +
129
- "hard to identify in query results and audit logs. Non-empty descriptions are strongly recommended.",
130
- affected_stakeholders: ["creator", "verifier"],
131
- scenario: "Caller passes description=\"\" to save typing",
132
- mitigation: "Provide a one-line description like \"KYC attestation for user 0xabc\" or \"merkle root for batch #42\".",
133
- auto_fixable: false,
134
- },
135
- check: (ctx) => {
136
- if (ctx.description === undefined)
137
- return null;
138
- if (ctx.description.length > 0)
139
- return null;
140
- return { ...R_PR_3_01.rule, evidence: "description=\"\" (empty)" };
141
- },
142
- };
143
- const R_PR_3_02 = {
144
- rule: {
145
- id: "R-PROOF-07",
146
- level: "HIGH",
147
- category: "lifecycle",
148
- title: "Proof is immutable — cannot modify after creation (freeze_object)",
149
- description: "Proof is created via transfer::freeze_object(obj) in Move (proof.move:65). Once frozen, the object " +
150
- "cannot be modified, transferred, or deleted. All fields (proof, server_pubkey, server_signature, " +
151
- "about, proof_type, signer, time, description, item_count) are permanently fixed at the value set " +
152
- "during create_wowok_proof(). To 'update' a Proof, create a new one and update references.",
153
- affected_stakeholders: ["creator", "consumer"],
154
- scenario: "Caller wants to update server_signature after key rotation — cannot, must create new Proof",
155
- mitigation: "Verify all fields before calling create_wowok_proof. For scenarios requiring key rotation, " +
156
- "create a new Proof and update the referencing object (Repository data, Service config, etc.) to " +
157
- "point to the new Proof address.",
158
- auto_fixable: false,
159
- },
160
- check: (ctx) => null,
161
- };
162
- const R_PR_4_01 = {
163
- rule: {
164
- id: "R-PROOF-08",
165
- level: "INFO",
166
- category: "knowledge",
167
- title: "Knowledge layer & constant sync — RESOLVED",
168
- description: "All 4 Proof constants (WOWOK_WTS_PROOF_TYPE, MAX_PROOF_SIZE, MAX_SERVER_PUBKEY_SIZE, " +
169
- "MAX_SERVER_SIGNATURE_SIZE) are now synced to onchain-constants.ts (P-PROOF-P2-5). The MCP Knowledge " +
170
- "layer now includes proof-risk.ts, proof-confirm.ts, proof-translation.ts (P-PROOF-P2-6). " +
171
- "This risk rule is retained for historical audit and to detect future regressions.",
172
- affected_stakeholders: ["system"],
173
- scenario: "Future regression: someone removes a Proof constant from onchain-constants.ts",
174
- mitigation: "Run the onchain-constants sync test to detect drift.",
175
- auto_fixable: false,
176
- },
177
- check: (ctx) => {
178
- if (ctx.constants_synced)
179
- return null;
180
- return { ...R_PR_4_01.rule, evidence: "constants_synced=false" };
181
- },
182
- };
183
- export const PROOF_RISK_RULES = [
184
- R_PR_1_01,
185
- R_PR_1_02,
186
- R_PR_1_03,
187
- R_PR_2_01,
188
- R_PR_2_02,
189
- R_PR_3_01,
190
- R_PR_3_02,
191
- R_PR_4_01,
192
- ];
193
- export function checkProofRisks(ctx) {
194
- const risks = [];
195
- for (const rule of PROOF_RISK_RULES) {
196
- const r = rule.check(ctx);
197
- if (r)
198
- risks.push(r);
199
- }
200
- if (!risks.find(r => r.id === "R-PROOF-07")) {
201
- risks.push(R_PR_3_02.rule);
202
- }
203
- return risks;
204
- }
205
- export function getProofRiskById(id) {
206
- return PROOF_RISK_RULES.find(r => r.rule.id === id)?.rule;
207
- }
1
+ import{MAX_PROOF_SIZE,MAX_SERVER_PUBKEY_SIZE,MAX_SERVER_SIGNATURE_SIZE,WOWOK_WTS_PROOF_TYPE}from'@wowok/wowok';const R_PR_1_01={'rule':{'id':'R-PROOF-01','level':'HIGH','category':'structural','title':'proof\x20content\x20exceeds\x20MAX_PROOF_SIZE\x20('+MAX_PROOF_SIZE+'\x20bytes)','description':'The\x20\x27proof\x27\x20string\x20field\x20is\x20bounded\x20by\x20MAX_PROOF_SIZE='+MAX_PROOF_SIZE+'\x20bytes\x20(Move\x20source:\x20proof.move:27).\x20'+'Exceeding\x20this\x20limit\x20aborts\x20with\x20E_MAX_PROOF_SIZE\x20(1).\x20The\x20proof\x20content\x20typically\x20holds\x20a\x20merkle\x20tree\x20root\x20'+'or\x20similar\x20compact\x20cryptographic\x20digest\x20—\x20large\x20data\x20should\x20be\x20stored\x20in\x20a\x20Repository\x20and\x20referenced\x20by\x20address,\x20'+'not\x20inlined\x20into\x20the\x20Proof\x20object.','affected_stakeholders':['creator'],'scenario':'Caller\x20submits\x20a\x20proof\x20string\x20longer\x20than\x2010240\x20bytes','mitigation':'Keep\x20proof\x20content\x20compact\x20(merkle\x20root,\x20hash\x20digest).\x20For\x20larger\x20payloads,\x20store\x20data\x20in\x20a\x20Repository\x20'+'object\x20and\x20set\x20about_address\x20to\x20the\x20Repository\x20address,\x20or\x20use\x20item_count\x20to\x20indicate\x20the\x20off-chain\x20data\x20size.','related_move_error':'E_MAX_PROOF_SIZE\x20(1)','auto_fixable':![]},'check':a=>{if(!a['proof'])return null;if(a['proof']['length']<=MAX_PROOF_SIZE)return null;return{...R_PR_1_01['rule'],'evidence':'proof.length='+a['proof']['length']+',\x20limit='+MAX_PROOF_SIZE};}},R_PR_1_02={'rule':{'id':'R-PROOF-02','level':'MEDIUM','category':'structural','title':'server_pubkey\x20exceeds\x20MAX_SERVER_PUBKEY_SIZE\x20('+MAX_SERVER_PUBKEY_SIZE+'\x20bytes)','description':'The\x20\x27server_pubkey\x27\x20field\x20is\x20bounded\x20by\x20MAX_SERVER_PUBKEY_SIZE='+MAX_SERVER_PUBKEY_SIZE+'\x20bytes\x20(Move\x20source:\x20proof.move:28).\x20'+'Exceeding\x20this\x20limit\x20aborts\x20with\x20E_MAX_SERVER_PUBKEY_SIZE\x20(2).\x20Typical\x20public\x20keys\x20(Ed25519=32\x20bytes,\x20RSA-2048=256\x20bytes,\x20'+'BLS12-381\x20G1=48\x20bytes,\x20G2=96\x20bytes)\x20fit\x20comfortably\x20within\x20this\x20limit.','affected_stakeholders':['creator'],'scenario':'Caller\x20submits\x20an\x20oversized\x20server\x20public\x20key\x20(e.g.\x20certificate\x20chain\x20instead\x20of\x20raw\x20key)','mitigation':'Submit\x20only\x20the\x20raw\x20public\x20key\x20bytes\x20(hex-encoded),\x20not\x20a\x20full\x20certificate\x20or\x20JWK\x20structure.','related_move_error':'E_MAX_SERVER_PUBKEY_SIZE\x20(2)','auto_fixable':![]},'check':a=>{if(!a['server_pubkey'])return null;if(a['server_pubkey']['length']<=MAX_SERVER_PUBKEY_SIZE)return null;return{...R_PR_1_02['rule'],'evidence':'server_pubkey.length='+a['server_pubkey']['length']+',\x20limit='+MAX_SERVER_PUBKEY_SIZE};}},R_PR_1_03={'rule':{'id':'R-PROOF-03','level':'MEDIUM','category':'structural','title':'server_signature\x20exceeds\x20MAX_SERVER_SIGNATURE_SIZE\x20('+MAX_SERVER_SIGNATURE_SIZE+'\x20bytes)','description':'The\x20\x27server_signature\x27\x20field\x20is\x20bounded\x20by\x20MAX_SERVER_SIGNATURE_SIZE='+MAX_SERVER_SIGNATURE_SIZE+'\x20bytes\x20'+'(Move\x20source:\x20proof.move:29).\x20Exceeding\x20this\x20limit\x20aborts\x20with\x20E_MAX_SERVER_SIGNATURE_SIZE\x20(3).\x20'+'Most\x20signature\x20schemes\x20produce\x20signatures\x20well\x20under\x20this\x20limit\x20(Ed25519=64\x20bytes,\x20ECDSA=64-72\x20bytes,\x20'+'BLS12-381=96\x20bytes,\x20RSA-2048=256\x20bytes).','affected_stakeholders':['creator'],'scenario':'Caller\x20submits\x20an\x20oversized\x20signature\x20(e.g.\x20bundled\x20with\x20metadata)','mitigation':'Submit\x20only\x20the\x20raw\x20signature\x20bytes\x20(hex-encoded),\x20not\x20bundled\x20metadata\x20or\x20certificate\x20chains.','related_move_error':'E_MAX_SERVER_SIGNATURE_SIZE\x20(3)','auto_fixable':![]},'check':a=>{if(!a['server_signature'])return null;if(a['server_signature']['length']<=MAX_SERVER_SIGNATURE_SIZE)return null;return{...R_PR_1_03['rule'],'evidence':'server_signature.length='+a['server_signature']['length']+',\x20limit='+MAX_SERVER_SIGNATURE_SIZE};}},R_PR_2_01={'rule':{'id':'R-PROOF-04','level':'MEDIUM','category':'semantic','title':'proof_type\x20in\x20reserved\x20range\x20without\x20authority\x20(1-100\x20reserved\x20for\x20Wowok)','description':'proof_type='+WOWOK_WTS_PROOF_TYPE+'\x20is\x20WOWOK_WTS_PROOF_TYPE\x20(Will-To-Sign).\x20Values\x202-100\x20are\x20reserved\x20for\x20'+'future\x20Wowok-defined\x20proof\x20types.\x20User-defined\x20proof\x20types\x20must\x20use\x20values\x20>\x20100.\x20While\x20the\x20Move\x20contract\x20'+'does\x20not\x20currently\x20enforce\x20this\x20range\x20at\x20the\x20type\x20level\x20(it\x20accepts\x20any\x20u64),\x20using\x20a\x20reserved\x20value\x20without\x20'+'authority\x20creates\x20semantic\x20confusion:\x20consumers\x20may\x20misinterpret\x20the\x20proof\x27s\x20verification\x20rules.','affected_stakeholders':['creator','consumer','verifier'],'scenario':'User\x20creates\x20a\x20custom\x20proof\x20with\x20proof_type=5\x20(a\x20reserved\x20value)','mitigation':'Use\x20proof_type\x20>\x20100\x20for\x20user-defined\x20proof\x20types.\x20Use\x20proof_type=1\x20only\x20for\x20WTS\x20proofs\x20signed\x20by\x20an\x20'+'off-chain\x20server\x20(with\x20server_pubkey\x20+\x20server_signature).\x20Document\x20the\x20verification\x20rule\x20for\x20custom\x20types.','auto_fixable':![]},'check':a=>{if(a['proof_type']===undefined||a['proof_type']===null)return null;const b=typeof a['proof_type']==='string'?BigInt(a['proof_type']):BigInt(a['proof_type']);if(b===BigInt(WOWOK_WTS_PROOF_TYPE)||b>0x64n)return null;return{...R_PR_2_01['rule'],'evidence':'proof_type='+a['proof_type']+'\x20(reserved\x20range\x202-100)'};}},R_PR_2_02={'rule':{'id':'R-PROOF-05','level':'LOW','category':'semantic','title':'about_address\x20not\x20provided\x20—\x20consumers\x20cannot\x20locate\x20the\x20referenced\x20entity','description':'about_address\x20is\x20the\x20on-chain\x20address\x20of\x20the\x20entity\x20being\x20proved\x20(e.g.\x20a\x20user,\x20an\x20order,\x20a\x20Repository).\x20'+'When\x20null/undefined,\x20the\x20Proof\x20has\x20no\x20on-chain\x20binding\x20—\x20it\x20is\x20a\x20free-standing\x20cryptographic\x20statement.\x20'+'Consumers\x20(Repository,\x20Service,\x20etc.)\x20that\x20reference\x20this\x20Proof\x20cannot\x20automatically\x20resolve\x20which\x20entity\x20'+'it\x20applies\x20to.\x20This\x20is\x20acceptable\x20for\x20generic\x20proofs\x20but\x20problematic\x20for\x20entity-bound\x20attestations.','affected_stakeholders':['creator','consumer'],'scenario':'Caller\x20creates\x20a\x20Proof\x20without\x20about_address,\x20then\x20a\x20Repository\x20tries\x20to\x20bind\x20it\x20to\x20a\x20data\x20entry','mitigation':'Set\x20about_address\x20when\x20the\x20Proof\x20attests\x20to\x20a\x20specific\x20on-chain\x20entity.\x20Leave\x20it\x20null\x20only\x20for\x20'+'free-standing\x20cryptographic\x20statements\x20(e.g.\x20a\x20server\x27s\x20timestamp\x20attestation).','auto_fixable':!![]},'check':a=>{if(a['about_address'])return null;return{...R_PR_2_02['rule'],'evidence':'about_address=null/undefined'};}},R_PR_3_01={'rule':{'id':'R-PROOF-06','level':'LOW','category':'lifecycle','title':'description\x20missing\x20—\x20Proof\x20hard\x20to\x20identify\x20in\x20queries\x20and\x20audit\x20logs','description':'description\x20is\x20a\x20REQUIRED\x20field\x20(PF-D-2=A).\x20The\x20Move\x20contract\x20stores\x20it\x20as\x20a\x20String\x20field\x20and\x20SDK\x20'+'passes\x20it\x20to\x20create_wowok_proof.\x20An\x20empty\x20description\x20(\x22\x22)\x20is\x20technically\x20valid\x20but\x20makes\x20the\x20Proof\x20'+'hard\x20to\x20identify\x20in\x20query\x20results\x20and\x20audit\x20logs.\x20Non-empty\x20descriptions\x20are\x20strongly\x20recommended.','affected_stakeholders':['creator','verifier'],'scenario':'Caller\x20passes\x20description=\x22\x22\x20to\x20save\x20typing','mitigation':'Provide\x20a\x20one-line\x20description\x20like\x20\x22KYC\x20attestation\x20for\x20user\x200xabc\x22\x20or\x20\x22merkle\x20root\x20for\x20batch\x20#42\x22.','auto_fixable':![]},'check':a=>{if(a['description']===undefined)return null;if(a['description']['length']>0x0)return null;return{...R_PR_3_01['rule'],'evidence':'description=\x22\x22\x20(empty)'};}},R_PR_3_02={'rule':{'id':'R-PROOF-07','level':'HIGH','category':'lifecycle','title':'Proof\x20is\x20immutable\x20—\x20cannot\x20modify\x20after\x20creation\x20(freeze_object)','description':'Proof\x20is\x20created\x20via\x20transfer::freeze_object(obj)\x20in\x20Move\x20(proof.move:65).\x20Once\x20frozen,\x20the\x20object\x20'+'cannot\x20be\x20modified,\x20transferred,\x20or\x20deleted.\x20All\x20fields\x20(proof,\x20server_pubkey,\x20server_signature,\x20'+'about,\x20proof_type,\x20signer,\x20time,\x20description,\x20item_count)\x20are\x20permanently\x20fixed\x20at\x20the\x20value\x20set\x20'+'during\x20create_wowok_proof().\x20To\x20\x27update\x27\x20a\x20Proof,\x20create\x20a\x20new\x20one\x20and\x20update\x20references.','affected_stakeholders':['creator','consumer'],'scenario':'Caller\x20wants\x20to\x20update\x20server_signature\x20after\x20key\x20rotation\x20—\x20cannot,\x20must\x20create\x20new\x20Proof','mitigation':'Verify\x20all\x20fields\x20before\x20calling\x20create_wowok_proof.\x20For\x20scenarios\x20requiring\x20key\x20rotation,\x20'+'create\x20a\x20new\x20Proof\x20and\x20update\x20the\x20referencing\x20object\x20(Repository\x20data,\x20Service\x20config,\x20etc.)\x20to\x20'+'point\x20to\x20the\x20new\x20Proof\x20address.','auto_fixable':![]},'check':a=>null},R_PR_4_01={'rule':{'id':'R-PROOF-08','level':'INFO','category':'knowledge','title':'Knowledge\x20layer\x20&\x20constant\x20sync\x20—\x20RESOLVED','description':'All\x204\x20Proof\x20constants\x20(WOWOK_WTS_PROOF_TYPE,\x20MAX_PROOF_SIZE,\x20MAX_SERVER_PUBKEY_SIZE,\x20'+'MAX_SERVER_SIGNATURE_SIZE)\x20are\x20now\x20synced\x20to\x20onchain-constants.ts\x20(P-PROOF-P2-5).\x20The\x20MCP\x20Knowledge\x20'+'layer\x20now\x20includes\x20proof-risk.ts,\x20proof-confirm.ts,\x20proof-translation.ts\x20(P-PROOF-P2-6).\x20'+'This\x20risk\x20rule\x20is\x20retained\x20for\x20historical\x20audit\x20and\x20to\x20detect\x20future\x20regressions.','affected_stakeholders':['system'],'scenario':'Future\x20regression:\x20someone\x20removes\x20a\x20Proof\x20constant\x20from\x20onchain-constants.ts','mitigation':'Run\x20the\x20onchain-constants\x20sync\x20test\x20to\x20detect\x20drift.','auto_fixable':![]},'check':a=>{if(a['constants_synced'])return null;return{...R_PR_4_01['rule'],'evidence':'constants_synced=false'};}};export const PROOF_RISK_RULES=[R_PR_1_01,R_PR_1_02,R_PR_1_03,R_PR_2_01,R_PR_2_02,R_PR_3_01,R_PR_3_02,R_PR_4_01];export function checkProofRisks(a){const b=[];for(const c of PROOF_RISK_RULES){const d=c['check'](a);if(d)b['push'](d);}return!b['find'](e=>e['id']==='R-PROOF-07')&&b['push'](R_PR_3_02['rule']),b;}export function getProofRiskById(a){return PROOF_RISK_RULES['find'](b=>b['rule']['id']===a)?.['rule'];}
@@ -0,0 +1,22 @@
1
+ export declare const PROOF_TEMPLATES_VERSION = "1.0.0";
2
+ export type ProofTemplateParamType = "string" | "u64" | "address" | "number";
3
+ export interface ProofTemplateParam {
4
+ name: string;
5
+ type: ProofTemplateParamType;
6
+ required: boolean;
7
+ description: string;
8
+ }
9
+ export interface ProofTemplate {
10
+ id: string;
11
+ scene_id: string;
12
+ name: string;
13
+ description: string;
14
+ proof_type: number;
15
+ params: ProofTemplateParam[];
16
+ about_address_required: boolean;
17
+ }
18
+ export declare const PROOF_TEMPLATES: ProofTemplate[];
19
+ export declare function getProofTemplateById(id: string): ProofTemplate | undefined;
20
+ export declare function getProofTemplatesByScene(sceneId: string): ProofTemplate[];
21
+ export declare function suggestProofTemplateForScene(sceneId: string): ProofTemplate | undefined;
22
+ export declare function listProofTemplates(): ProofTemplate[];
@@ -0,0 +1 @@
1
+ import{WOWOK_WTS_PROOF_TYPE}from'@wowok/wowok';export const PROOF_TEMPLATES_VERSION='1.0.0';export const PROOF_TEMPLATES=[{'id':'proof_wts_kyc','scene_id':'proof_wts','name':'WTS\x20KYC\x20attestation','description':'An\x20off-chain\x20server\x20attests\x20to\x20a\x20user\x27s\x20identity\x20(merkle\x20root\x20of\x20N\x20leaves).','proof_type':WOWOK_WTS_PROOF_TYPE,'params':[{'name':'proof','type':'string','required':!![],'description':'Merkle\x20root\x20hex'},{'name':'server_pubkey','type':'string','required':!![],'description':'Server\x20public\x20key\x20hex'},{'name':'server_signature','type':'string','required':!![],'description':'Server\x20signature\x20hex'},{'name':'description','type':'string','required':!![],'description':'One-line\x20summary'},{'name':'item_count','type':'u64','required':![],'description':'Merkle\x20leaf\x20count'},{'name':'about_address','type':'address','required':![],'description':'Attested\x20user\x20address'}],'about_address_required':!![]},{'id':'proof_wts_timestamp','scene_id':'proof_wts','name':'WTS\x20timestamp\x20attestation','description':'A\x20free-standing\x20server\x20timestamp\x20(no\x20on-chain\x20entity\x20binding).','proof_type':WOWOK_WTS_PROOF_TYPE,'params':[{'name':'proof','type':'string','required':!![],'description':'Timestamp\x20hash\x20hex'},{'name':'server_pubkey','type':'string','required':!![],'description':'Server\x20public\x20key\x20hex'},{'name':'server_signature','type':'string','required':!![],'description':'Server\x20signature\x20hex'},{'name':'description','type':'string','required':!![],'description':'One-line\x20summary'}],'about_address_required':![]},{'id':'proof_custom_attestation','scene_id':'proof_custom_user','name':'Custom\x20attestation','description':'Application-specific\x20proof\x20with\x20creator-documented\x20verification\x20logic.','proof_type':0xc8,'params':[{'name':'proof','type':'string','required':!![],'description':'Application-specific\x20proof\x20format'},{'name':'server_pubkey','type':'string','required':!![],'description':'Signer\x20public\x20key\x20hex'},{'name':'server_signature','type':'string','required':!![],'description':'Signer\x20signature\x20hex'},{'name':'description','type':'string','required':!![],'description':'One-line\x20summary'},{'name':'proof_type','type':'number','required':!![],'description':'>100\x20user-defined'},{'name':'about_address','type':'address','required':![],'description':'Optional\x20entity\x20binding'}],'about_address_required':![]}];export function getProofTemplateById(a){return PROOF_TEMPLATES['find'](b=>b['id']===a);}export function getProofTemplatesByScene(a){return PROOF_TEMPLATES['filter'](b=>b['scene_id']===a);}export function suggestProofTemplateForScene(a){return PROOF_TEMPLATES['find'](b=>b['scene_id']===a);}export function listProofTemplates(){return PROOF_TEMPLATES;}