@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
@@ -0,0 +1,29 @@
1
+ export declare const PERSONAL_CONFIRM_VERSION = "1.0.0";
2
+ export type ConfirmSeverity = "block" | "warn" | "info";
3
+ export interface PersonalConfirmItem {
4
+ id: string;
5
+ severity: ConfirmSeverity;
6
+ title: string;
7
+ description: string;
8
+ passed: boolean;
9
+ evidence?: string;
10
+ fix_hint?: string;
11
+ }
12
+ export interface PersonalOpCheckInput {
13
+ information_entries?: Array<{
14
+ name: string;
15
+ value: unknown;
16
+ }>;
17
+ is_mark_destroy?: boolean;
18
+ is_mark_transfer?: boolean;
19
+ information_count?: number;
20
+ singleton_enforced?: boolean;
21
+ }
22
+ export declare function preCheckPersonalOp(input: PersonalOpCheckInput): PersonalConfirmItem[];
23
+ export declare function canProceedPersonalOp(input: PersonalOpCheckInput): {
24
+ canProceed: boolean;
25
+ blockers: PersonalConfirmItem[];
26
+ warnings: PersonalConfirmItem[];
27
+ info: PersonalConfirmItem[];
28
+ };
29
+ export declare function formatPersonalOpSummary(input: PersonalOpCheckInput): string;
@@ -0,0 +1 @@
1
+ import{MAX_RECORD_COUNT_REGISTRAR}from'@wowok/wowok';export const PERSONAL_CONFIRM_VERSION='1.0.0';function detectSensitive(a){const b=[];for(const c of a){const d=typeof c['value']==='string'?c['value']:String(c['value']??'');if(/^\+?\d{10,15}$/['test'](d))b['push'](c['name']+'=phone-like');if(/[^\s@]+@[^\s@]+\.[^\s@]+/['test'](d))b['push'](c['name']+'=email-like');if(/^(0x)?[0-9a-fA-F]{64}$/['test'](d))b['push'](c['name']+'=private-key-like');if(/^([a-z]{3,8}\s){11,23}[a-z]{3,8}$/['test'](d['trim']()))b['push'](c['name']+'=mnemonic-like');if(/private[_-]?key|secret|mnemonic|seed/i['test'](c['name']))b['push'](c['name']+'=secret-named');}return b;}function checkSensitive(a){if(!a['information_entries']||a['information_entries']['length']===0x0)return{'id':'C-PERSONAL-01','severity':'info','title':'No\x20sensitive\x20information\x20written\x20on-chain','description':'On-chain\x20records\x20are\x20permanent\x20and\x20public.\x20Phone/email/private-key/mnemonic\x20must\x20never\x20be\x20stored.','passed':!![],'evidence':'no\x20information\x20entries'};const b=detectSensitive(a['information_entries']),c=b['length']===0x0;return{'id':'C-PERSONAL-01','severity':c?'info':'block','title':'Sensitive\x20information\x20detected\x20—\x20on-chain\x20data\x20is\x20permanent','description':'information\x20is\x20stored\x20as\x20on-chain\x20Records\x20with\x20no\x20delete.\x20Once\x20written,\x20phone/email/private-key/mnemonic\x20is\x20public\x20forever.','passed':c,'evidence':c?'no\x20sensitive\x20patterns':'sensitive\x20patterns:\x20'+b['join'](';\x20'),'fix_hint':'Use\x20the\x20\x27local\x27\x20tool\x20for\x20private\x20data;\x20re-confirm\x20before\x20writing\x20on-chain.'};}function checkSingleton(a){if(a['singleton_enforced']!==![])return{'id':'C-PERSONAL-02','severity':'info','title':'Singleton\x20invariant\x20enforced','description':'Each\x20user\x20has\x20exactly\x20one\x20Entity\x20record\x20+\x20one\x20Resource\x20mark\x20via\x20entity_register\x20idempotency.','passed':!![],'evidence':'singleton\x20enforced'};return{'id':'C-PERSONAL-02','severity':'warn','title':'Singleton\x20invariant\x20not\x20enforced\x20—\x20duplicate\x20identity\x20risk','description':'entity_register_with_resource_forced\x20can\x20create\x20a\x20second\x20Resource\x20mark,\x20invalidating\x20the\x20old\x20address.','passed':![],'evidence':'singleton_enforced=false','fix_hint':'Refuse\x20entity_register_with_resource_forced\x20unless\x20the\x20user\x20explicitly\x20opts\x20in.'};}function checkDestroy(a){if(!a['is_mark_destroy'])return{'id':'C-PERSONAL-03','severity':'info','title':'mark\x20destroy\x20is\x20irreversible','description':'Destroying\x20the\x20mark\x20Resource\x20permanently\x20removes\x20the\x20user\x27s\x20on-chain\x20identity\x20mark.','passed':!![],'evidence':'not\x20destroying'};return{'id':'C-PERSONAL-03','severity':'warn','title':'mark\x20destroy\x20is\x20irreversible\x20—\x20identity\x20mark\x20permanently\x20lost','description':'After\x20destroy,\x20the\x20user\x20has\x20no\x20on-chain\x20identity\x20mark\x20until\x20re-created,\x20breaking\x20downstream\x20services\x20keyed\x20on\x20the\x20old\x20Resource.','passed':![],'evidence':'is_mark_destroy=true','fix_hint':'Prefer\x20a\x20\x27replace\x27\x20alternative\x20that\x20swaps\x20the\x20Resource\x20without\x20losing\x20continuity.'};}function checkTransfer(a){if(!a['is_mark_transfer'])return{'id':'C-PERSONAL-04','severity':'info','title':'mark\x20transfer\x20detaches\x20source\x20address','description':'Transferring\x20the\x20mark\x20moves\x20the\x20Resource\x20to\x20a\x20new\x20address;\x20the\x20source\x20loses\x20the\x20binding.','passed':!![],'evidence':'not\x20transferring'};return{'id':'C-PERSONAL-04','severity':'warn','title':'mark\x20transfer\x20will\x20detach\x20the\x20mark\x20from\x20this\x20address','description':'Services\x20keyed\x20on\x20the\x20source\x20address\x20lose\x20the\x20binding;\x20no\x20forwarding\x20stub\x20is\x20left\x20behind.','passed':![],'evidence':'is_mark_transfer=true','fix_hint':'Warn\x20the\x20user\x20that\x20old-address\x20logins\x20will\x20break;\x20track\x20marks\x20by\x20Resource\x20address.'};}function checkRecordCount(a){if(a['information_count']===undefined)return{'id':'C-PERSONAL-05','severity':'info','title':'information_count\x20below\x20MAX_RECORD_COUNT_REGISTRAR\x20('+MAX_RECORD_COUNT_REGISTRAR+')','description':'Personal\x20inherits\x20Entity\x27s\x20record\x20cap.','passed':!![],'evidence':'not\x20provided'};const b=a['information_count']<MAX_RECORD_COUNT_REGISTRAR;return{'id':'C-PERSONAL-05','severity':b?'info':'warn','title':'information_count\x20below\x20MAX_RECORD_COUNT_REGISTRAR\x20('+MAX_RECORD_COUNT_REGISTRAR+')','description':'Entity\x27s\x20record\x20cap\x20is\x20MAX_RECORD_COUNT_REGISTRAR='+MAX_RECORD_COUNT_REGISTRAR+'.','passed':b,'evidence':'information_count='+a['information_count']+',\x20limit='+MAX_RECORD_COUNT_REGISTRAR,'fix_hint':'Self-limit\x20profile\x20data;\x20store\x20bulk\x20data\x20off-chain\x20via\x20Repository/Proof.'};}export function preCheckPersonalOp(a){return[checkSensitive(a),checkSingleton(a),checkDestroy(a),checkTransfer(a),checkRecordCount(a)];}export function canProceedPersonalOp(a){const b=preCheckPersonalOp(a);return{'canProceed':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 formatPersonalOpSummary(a){const {canProceed:b,blockers:c,warnings:d}=canProceedPersonalOp(a),e=[b?'✓\x20Personal\x20operation\x20pre-check\x20PASSED':'✗\x20Personal\x20operation\x20pre-check\x20FAILED',''];return c['length']>0x0&&(e['push']('BLOCKERS:'),c['forEach'](f=>e['push']('\x20\x20['+f['id']+']\x20'+f['title']+'\x20—\x20'+(f['evidence']??''))),e['push']('')),d['length']>0x0&&(e['push']('WARNINGS:'),d['forEach'](f=>e['push']('\x20\x20['+f['id']+']\x20'+f['title']+'\x20—\x20'+(f['evidence']??'')))),e['join']('\x0a');}
@@ -1,212 +1 @@
1
- import { MAX_ADDRESS_COUNT, MAX_RECORD_COUNT_REGISTRAR, MAX_RECORD_LENGTH, MAX_TAGS_COUNT, } from "@wowok/wowok";
2
- function detectSensitiveInformation(entries) {
3
- const hits = [];
4
- for (const e of entries) {
5
- const v = typeof e.value === "string" ? e.value : String(e.value ?? "");
6
- const lower = v.toLowerCase();
7
- if (/^\+?\d{10,15}$/.test(v))
8
- hits.push(`${e.name}=phone-like`);
9
- if (/[^\s@]+@[^\s@]+\.[^\s@]+/.test(v))
10
- hits.push(`${e.name}=email-like`);
11
- if (/^(0x)?[0-9a-fA-F]{64}$/.test(v))
12
- hits.push(`${e.name}=private-key-like`);
13
- if (/^([a-z]{3,8}\s){11,23}[a-z]{3,8}$/.test(v.trim()))
14
- hits.push(`${e.name}=mnemonic-like`);
15
- if (/private[_-]?key|secret|mnemonic|seed/i.test(e.name))
16
- hits.push(`${e.name}=secret-named`);
17
- void lower;
18
- }
19
- return hits;
20
- }
21
- const R_PE_01 = {
22
- rule: {
23
- id: "R-PERSONAL-01",
24
- level: "HIGH",
25
- category: "semantic",
26
- title: "Sensitive information leakage — on-chain data is permanent",
27
- description: "information is stored via Entity.info_add as on-chain Records. The schema description " +
28
- "warns 'NEVER: phone, address, private keys' but the Move layer does not validate " +
29
- "content. Once a phone number, physical address, email, or private key is written " +
30
- "on-chain, it is permanent and publicly readable — there is no delete (info_remove " +
31
- "only removes the named entry from the user's record; the data remains in the " +
32
- "transaction history).",
33
- affected_stakeholders: ["user"],
34
- scenario: "User adds information {name: 'phone', value: '+8613800000000'}; number is public forever",
35
- mitigation: "MCP schema description MUST warn. AI agents MUST re-confirm before adding any " +
36
- "information entry. Business layer should run a sensitive-data regex (phone/email/" +
37
- "private-key/mnemonic) and reject matches. Use the 'local' tool for private data.",
38
- auto_fixable: false,
39
- },
40
- check: (ctx) => {
41
- if (!ctx.information_entries || ctx.information_entries.length === 0)
42
- return null;
43
- const hits = detectSensitiveInformation(ctx.information_entries);
44
- if (hits.length === 0)
45
- return null;
46
- return { ...R_PE_01.rule, evidence: `sensitive patterns: ${hits.join("; ")}` };
47
- },
48
- };
49
- const R_PE_02 = {
50
- rule: {
51
- id: "R-PERSONAL-02",
52
- level: "MEDIUM",
53
- category: "lifecycle",
54
- title: "mark destroy is irreversible — identity mark permanently lost",
55
- description: "The 'destroy' mark op permanently deletes the Resource object backing the user's " +
56
- "identity mark. There is no archive, no event, and no rollback. After destroy, the " +
57
- "user has no on-chain identity mark until they create a new one, and any external " +
58
- "system keyed on the old Resource address breaks.",
59
- affected_stakeholders: ["user", "consumer"],
60
- scenario: "User destroys their mark; downstream services keyed on the old Resource address fail",
61
- mitigation: "Require explicit confirmation before destroy. SDK should refuse destroy if any " +
62
- "live consumer still references the mark. Provide a 'replace' alternative that " +
63
- "swaps the underlying Resource without losing continuity.",
64
- auto_fixable: false,
65
- },
66
- check: (ctx) => {
67
- if (!ctx.is_mark_destroy)
68
- return null;
69
- return { ...R_PE_02.rule, evidence: "is_mark_destroy=true (irreversible)" };
70
- },
71
- };
72
- const R_PE_03 = {
73
- rule: {
74
- id: "R-PERSONAL-03",
75
- level: "MEDIUM",
76
- category: "semantic",
77
- title: "referrer chain can be abused to fabricate trust signals",
78
- description: "When registering, a user may specify any referrer address. There is no on-chain " +
79
- "verification that the referrer actually invited the user. A sybil attacker can " +
80
- "register many accounts chained to a reputable address, fabricating an affiliation " +
81
- "to borrow trust. The Registrar records referrer but does not validate consent.",
82
- affected_stakeholders: ["user", "consumer"],
83
- scenario: "Attacker registers 100 accounts all citing a reputable merchant as referrer",
84
- mitigation: "Business layer should treat referrer as a self-attested hint, not a verified trust " +
85
- "signal. Audit referrer chains off-chain; require the referrer to co-sign if used for " +
86
- "trust scoring.",
87
- auto_fixable: false,
88
- },
89
- check: (ctx) => {
90
- if (!ctx.has_referrer)
91
- return null;
92
- return { ...R_PE_03.rule, evidence: "has_referrer=true (self-attested, unverified)" };
93
- },
94
- };
95
- const R_PE_04 = {
96
- rule: {
97
- id: "R-PERSONAL-04",
98
- level: "LOW",
99
- category: "structural",
100
- title: `information inherits MAX_RECORD_COUNT_REGISTRAR=${MAX_RECORD_COUNT_REGISTRAR} — permissive`,
101
- description: `Personal does not define its own record cap; it inherits Entity's ` +
102
- `MAX_RECORD_COUNT_REGISTRAR=${MAX_RECORD_COUNT_REGISTRAR} (registrar.move) and ` +
103
- `MAX_RECORD_LENGTH=${MAX_RECORD_LENGTH} per record. ${MAX_RECORD_COUNT_REGISTRAR} records ` +
104
- `per user is generous and can bloat on-chain storage if users add many entries. ` +
105
- `MAX_ADDRESS_COUNT=${MAX_ADDRESS_COUNT} and MAX_TAGS_COUNT=${MAX_TAGS_COUNT} also apply via Entity/Resource.`,
106
- affected_stakeholders: ["user", "system"],
107
- scenario: "User adds 1000 information entries; Entity record storage is heavy and slow to read",
108
- mitigation: "Business layer should self-limit information count (e.g. ≤50). For bulk profile data, " +
109
- "store off-chain and reference via a Repository or Proof.",
110
- auto_fixable: false,
111
- },
112
- check: (ctx) => {
113
- if (ctx.information_count === undefined)
114
- return null;
115
- if (ctx.information_count < MAX_RECORD_COUNT_REGISTRAR)
116
- return null;
117
- return {
118
- ...R_PE_04.rule,
119
- evidence: `information_count=${ctx.information_count}, limit=${MAX_RECORD_COUNT_REGISTRAR}`,
120
- };
121
- },
122
- };
123
- const R_PE_05 = {
124
- rule: {
125
- id: "R-PERSONAL-05",
126
- level: "MEDIUM",
127
- category: "lifecycle",
128
- title: "mark transfer loses identity mark at the source address",
129
- description: "The 'transfer' mark op moves the Resource backing the identity mark to a new address. " +
130
- "After transfer, the source address has no mark — any service that keyed identity on " +
131
- "the source address loses the binding. There is no automatic forwarding stub left behind.",
132
- affected_stakeholders: ["user", "consumer"],
133
- scenario: "User transfers mark to a new wallet; old-wallet-based logins all break",
134
- mitigation: "Surface a 'transfer will detach the mark from this address' warning. Consumers should " +
135
- "track marks by Resource address, not by user address. Provide a migration window " +
136
- "where both addresses are valid.",
137
- auto_fixable: false,
138
- },
139
- check: (ctx) => {
140
- if (!ctx.is_mark_transfer)
141
- return null;
142
- return { ...R_PE_05.rule, evidence: "is_mark_transfer=true (source loses mark)" };
143
- },
144
- };
145
- const R_PE_06 = {
146
- rule: {
147
- id: "R-PERSONAL-06",
148
- level: "LOW",
149
- category: "cross_object",
150
- title: "Personal has no dedicated Move struct — depends entirely on Entity + Resource",
151
- description: "Personal is an SDK-layer construct: there is no personal.move. The SDK composes " +
152
- "Entity (information/description) and Resource (mark) on behalf of the user. Any " +
153
- "breaking change in Entity or Resource directly affects Personal. The MCP layer " +
154
- "cannot fix Personal bugs without touching Entity/Resource.",
155
- affected_stakeholders: ["system"],
156
- scenario: "Entity schema changes; Personal.information silently breaks",
157
- mitigation: "Track Entity and Resource changelogs as first-order dependencies of Personal. Add " +
158
- "integration tests that exercise Personal flows whenever Entity/Resource change.",
159
- auto_fixable: false,
160
- },
161
- check: (ctx) => {
162
- if (!ctx.expects_dedicated_move_struct)
163
- return null;
164
- return { ...R_PE_06.rule, evidence: "expects_dedicated_move_struct=true (none exists)" };
165
- },
166
- };
167
- const R_PE_07 = {
168
- rule: {
169
- id: "R-PERSONAL-07",
170
- level: "MEDIUM",
171
- category: "lifecycle",
172
- title: "Singleton assumption — if violated, multiple Personal instances conflict",
173
- description: "Personal assumes each account has exactly one Entity record (and one Resource mark). " +
174
- "The Move layer enforces this via entity_register's idempotency (returns the existing " +
175
- "Resource for already-registered users). But if the SDK ever bypasses entity_register " +
176
- "and creates duplicates (e.g. via entity_register_with_resource_forced), downstream " +
177
- "code that assumes a singleton would see inconsistent state.",
178
- affected_stakeholders: ["user", "consumer"],
179
- scenario: "SDK calls entity_register_with_resource_forced; user now has two Resource marks",
180
- mitigation: "SDK MUST enforce the singleton invariant: refuse to call entity_register_with_resource_forced " +
181
- "unless the user explicitly opts in. Document that forced re-registration invalidates " +
182
- "the old Resource address.",
183
- auto_fixable: false,
184
- },
185
- check: (ctx) => {
186
- if (ctx.singleton_enforced)
187
- return null;
188
- return { ...R_PE_07.rule, evidence: "singleton_enforced=false (needs SDK guard)" };
189
- },
190
- };
191
- export const PERSONAL_RISK_RULES = [
192
- R_PE_01,
193
- R_PE_02,
194
- R_PE_03,
195
- R_PE_04,
196
- R_PE_05,
197
- R_PE_06,
198
- R_PE_07,
199
- ];
200
- export const PERSONAL_RISK_VERSION = "1.0.0";
201
- export function checkPersonalRisks(ctx) {
202
- const risks = [];
203
- for (const rule of PERSONAL_RISK_RULES) {
204
- const r = rule.check(ctx);
205
- if (r)
206
- risks.push(r);
207
- }
208
- return risks;
209
- }
210
- export function getPersonalRiskById(id) {
211
- return PERSONAL_RISK_RULES.find(r => r.rule.id === id)?.rule;
212
- }
1
+ import{MAX_ADDRESS_COUNT,MAX_RECORD_COUNT_REGISTRAR,MAX_RECORD_LENGTH,MAX_TAGS_COUNT}from'@wowok/wowok';function detectSensitiveInformation(a){const b=[];for(const c of a){const d=typeof c['value']==='string'?c['value']:String(c['value']??''),f=d['toLowerCase']();if(/^\+?\d{10,15}$/['test'](d))b['push'](c['name']+'=phone-like');if(/[^\s@]+@[^\s@]+\.[^\s@]+/['test'](d))b['push'](c['name']+'=email-like');if(/^(0x)?[0-9a-fA-F]{64}$/['test'](d))b['push'](c['name']+'=private-key-like');if(/^([a-z]{3,8}\s){11,23}[a-z]{3,8}$/['test'](d['trim']()))b['push'](c['name']+'=mnemonic-like');if(/private[_-]?key|secret|mnemonic|seed/i['test'](c['name']))b['push'](c['name']+'=secret-named');void f;}return b;}const R_PE_01={'rule':{'id':'R-PERSONAL-01','level':'HIGH','category':'semantic','title':'Sensitive\x20information\x20leakage\x20—\x20on-chain\x20data\x20is\x20permanent','description':'information\x20is\x20stored\x20via\x20Entity.info_add\x20as\x20on-chain\x20Records.\x20The\x20schema\x20description\x20'+'warns\x20\x27NEVER:\x20phone,\x20address,\x20private\x20keys\x27\x20but\x20the\x20Move\x20layer\x20does\x20not\x20validate\x20'+'content.\x20Once\x20a\x20phone\x20number,\x20physical\x20address,\x20email,\x20or\x20private\x20key\x20is\x20written\x20'+'on-chain,\x20it\x20is\x20permanent\x20and\x20publicly\x20readable\x20—\x20there\x20is\x20no\x20delete\x20(info_remove\x20'+'only\x20removes\x20the\x20named\x20entry\x20from\x20the\x20user\x27s\x20record;\x20the\x20data\x20remains\x20in\x20the\x20'+'transaction\x20history).','affected_stakeholders':['user'],'scenario':'User\x20adds\x20information\x20{name:\x20\x27phone\x27,\x20value:\x20\x27+8613800000000\x27};\x20number\x20is\x20public\x20forever','mitigation':'MCP\x20schema\x20description\x20MUST\x20warn.\x20AI\x20agents\x20MUST\x20re-confirm\x20before\x20adding\x20any\x20'+'information\x20entry.\x20Business\x20layer\x20should\x20run\x20a\x20sensitive-data\x20regex\x20(phone/email/'+'private-key/mnemonic)\x20and\x20reject\x20matches.\x20Use\x20the\x20\x27local\x27\x20tool\x20for\x20private\x20data.','auto_fixable':![]},'check':a=>{if(!a['information_entries']||a['information_entries']['length']===0x0)return null;const b=detectSensitiveInformation(a['information_entries']);if(b['length']===0x0)return null;return{...R_PE_01['rule'],'evidence':'sensitive\x20patterns:\x20'+b['join'](';\x20')};}},R_PE_02={'rule':{'id':'R-PERSONAL-02','level':'MEDIUM','category':'lifecycle','title':'mark\x20destroy\x20is\x20irreversible\x20—\x20identity\x20mark\x20permanently\x20lost','description':'The\x20\x27destroy\x27\x20mark\x20op\x20permanently\x20deletes\x20the\x20Resource\x20object\x20backing\x20the\x20user\x27s\x20'+'identity\x20mark.\x20There\x20is\x20no\x20archive,\x20no\x20event,\x20and\x20no\x20rollback.\x20After\x20destroy,\x20the\x20'+'user\x20has\x20no\x20on-chain\x20identity\x20mark\x20until\x20they\x20create\x20a\x20new\x20one,\x20and\x20any\x20external\x20'+'system\x20keyed\x20on\x20the\x20old\x20Resource\x20address\x20breaks.','affected_stakeholders':['user','consumer'],'scenario':'User\x20destroys\x20their\x20mark;\x20downstream\x20services\x20keyed\x20on\x20the\x20old\x20Resource\x20address\x20fail','mitigation':'Require\x20explicit\x20confirmation\x20before\x20destroy.\x20SDK\x20should\x20refuse\x20destroy\x20if\x20any\x20'+'live\x20consumer\x20still\x20references\x20the\x20mark.\x20Provide\x20a\x20\x27replace\x27\x20alternative\x20that\x20'+'swaps\x20the\x20underlying\x20Resource\x20without\x20losing\x20continuity.','auto_fixable':![]},'check':a=>{if(!a['is_mark_destroy'])return null;return{...R_PE_02['rule'],'evidence':'is_mark_destroy=true\x20(irreversible)'};}},R_PE_03={'rule':{'id':'R-PERSONAL-03','level':'MEDIUM','category':'semantic','title':'referrer\x20chain\x20can\x20be\x20abused\x20to\x20fabricate\x20trust\x20signals','description':'When\x20registering,\x20a\x20user\x20may\x20specify\x20any\x20referrer\x20address.\x20There\x20is\x20no\x20on-chain\x20'+'verification\x20that\x20the\x20referrer\x20actually\x20invited\x20the\x20user.\x20A\x20sybil\x20attacker\x20can\x20'+'register\x20many\x20accounts\x20chained\x20to\x20a\x20reputable\x20address,\x20fabricating\x20an\x20affiliation\x20'+'to\x20borrow\x20trust.\x20The\x20Registrar\x20records\x20referrer\x20but\x20does\x20not\x20validate\x20consent.','affected_stakeholders':['user','consumer'],'scenario':'Attacker\x20registers\x20100\x20accounts\x20all\x20citing\x20a\x20reputable\x20merchant\x20as\x20referrer','mitigation':'Business\x20layer\x20should\x20treat\x20referrer\x20as\x20a\x20self-attested\x20hint,\x20not\x20a\x20verified\x20trust\x20'+'signal.\x20Audit\x20referrer\x20chains\x20off-chain;\x20require\x20the\x20referrer\x20to\x20co-sign\x20if\x20used\x20for\x20'+'trust\x20scoring.','auto_fixable':![]},'check':a=>{if(!a['has_referrer'])return null;return{...R_PE_03['rule'],'evidence':'has_referrer=true\x20(self-attested,\x20unverified)'};}},R_PE_04={'rule':{'id':'R-PERSONAL-04','level':'LOW','category':'structural','title':'information\x20inherits\x20MAX_RECORD_COUNT_REGISTRAR='+MAX_RECORD_COUNT_REGISTRAR+'\x20—\x20permissive','description':'Personal\x20does\x20not\x20define\x20its\x20own\x20record\x20cap;\x20it\x20inherits\x20Entity\x27s\x20'+('MAX_RECORD_COUNT_REGISTRAR='+MAX_RECORD_COUNT_REGISTRAR+'\x20(registrar.move)\x20and\x20')+('MAX_RECORD_LENGTH='+MAX_RECORD_LENGTH+'\x20per\x20record.\x20'+MAX_RECORD_COUNT_REGISTRAR+'\x20records\x20')+'per\x20user\x20is\x20generous\x20and\x20can\x20bloat\x20on-chain\x20storage\x20if\x20users\x20add\x20many\x20entries.\x20'+('MAX_ADDRESS_COUNT='+MAX_ADDRESS_COUNT+'\x20and\x20MAX_TAGS_COUNT='+MAX_TAGS_COUNT+'\x20also\x20apply\x20via\x20Entity/Resource.'),'affected_stakeholders':['user','system'],'scenario':'User\x20adds\x201000\x20information\x20entries;\x20Entity\x20record\x20storage\x20is\x20heavy\x20and\x20slow\x20to\x20read','mitigation':'Business\x20layer\x20should\x20self-limit\x20information\x20count\x20(e.g.\x20≤50).\x20For\x20bulk\x20profile\x20data,\x20'+'store\x20off-chain\x20and\x20reference\x20via\x20a\x20Repository\x20or\x20Proof.','auto_fixable':![]},'check':a=>{if(a['information_count']===undefined)return null;if(a['information_count']<MAX_RECORD_COUNT_REGISTRAR)return null;return{...R_PE_04['rule'],'evidence':'information_count='+a['information_count']+',\x20limit='+MAX_RECORD_COUNT_REGISTRAR};}},R_PE_05={'rule':{'id':'R-PERSONAL-05','level':'MEDIUM','category':'lifecycle','title':'mark\x20transfer\x20loses\x20identity\x20mark\x20at\x20the\x20source\x20address','description':'The\x20\x27transfer\x27\x20mark\x20op\x20moves\x20the\x20Resource\x20backing\x20the\x20identity\x20mark\x20to\x20a\x20new\x20address.\x20'+'After\x20transfer,\x20the\x20source\x20address\x20has\x20no\x20mark\x20—\x20any\x20service\x20that\x20keyed\x20identity\x20on\x20'+'the\x20source\x20address\x20loses\x20the\x20binding.\x20There\x20is\x20no\x20automatic\x20forwarding\x20stub\x20left\x20behind.','affected_stakeholders':['user','consumer'],'scenario':'User\x20transfers\x20mark\x20to\x20a\x20new\x20wallet;\x20old-wallet-based\x20logins\x20all\x20break','mitigation':'Surface\x20a\x20\x27transfer\x20will\x20detach\x20the\x20mark\x20from\x20this\x20address\x27\x20warning.\x20Consumers\x20should\x20'+'track\x20marks\x20by\x20Resource\x20address,\x20not\x20by\x20user\x20address.\x20Provide\x20a\x20migration\x20window\x20'+'where\x20both\x20addresses\x20are\x20valid.','auto_fixable':![]},'check':a=>{if(!a['is_mark_transfer'])return null;return{...R_PE_05['rule'],'evidence':'is_mark_transfer=true\x20(source\x20loses\x20mark)'};}},R_PE_06={'rule':{'id':'R-PERSONAL-06','level':'LOW','category':'cross_object','title':'Personal\x20has\x20no\x20dedicated\x20Move\x20struct\x20—\x20depends\x20entirely\x20on\x20Entity\x20+\x20Resource','description':'Personal\x20is\x20an\x20SDK-layer\x20construct:\x20there\x20is\x20no\x20personal.move.\x20The\x20SDK\x20composes\x20'+'Entity\x20(information/description)\x20and\x20Resource\x20(mark)\x20on\x20behalf\x20of\x20the\x20user.\x20Any\x20'+'breaking\x20change\x20in\x20Entity\x20or\x20Resource\x20directly\x20affects\x20Personal.\x20The\x20MCP\x20layer\x20'+'cannot\x20fix\x20Personal\x20bugs\x20without\x20touching\x20Entity/Resource.','affected_stakeholders':['system'],'scenario':'Entity\x20schema\x20changes;\x20Personal.information\x20silently\x20breaks','mitigation':'Track\x20Entity\x20and\x20Resource\x20changelogs\x20as\x20first-order\x20dependencies\x20of\x20Personal.\x20Add\x20'+'integration\x20tests\x20that\x20exercise\x20Personal\x20flows\x20whenever\x20Entity/Resource\x20change.','auto_fixable':![]},'check':a=>{if(!a['expects_dedicated_move_struct'])return null;return{...R_PE_06['rule'],'evidence':'expects_dedicated_move_struct=true\x20(none\x20exists)'};}},R_PE_07={'rule':{'id':'R-PERSONAL-07','level':'MEDIUM','category':'lifecycle','title':'Singleton\x20assumption\x20—\x20if\x20violated,\x20multiple\x20Personal\x20instances\x20conflict','description':'Personal\x20assumes\x20each\x20account\x20has\x20exactly\x20one\x20Entity\x20record\x20(and\x20one\x20Resource\x20mark).\x20'+'The\x20Move\x20layer\x20enforces\x20this\x20via\x20entity_register\x27s\x20idempotency\x20(returns\x20the\x20existing\x20'+'Resource\x20for\x20already-registered\x20users).\x20But\x20if\x20the\x20SDK\x20ever\x20bypasses\x20entity_register\x20'+'and\x20creates\x20duplicates\x20(e.g.\x20via\x20entity_register_with_resource_forced),\x20downstream\x20'+'code\x20that\x20assumes\x20a\x20singleton\x20would\x20see\x20inconsistent\x20state.','affected_stakeholders':['user','consumer'],'scenario':'SDK\x20calls\x20entity_register_with_resource_forced;\x20user\x20now\x20has\x20two\x20Resource\x20marks','mitigation':'SDK\x20MUST\x20enforce\x20the\x20singleton\x20invariant:\x20refuse\x20to\x20call\x20entity_register_with_resource_forced\x20'+'unless\x20the\x20user\x20explicitly\x20opts\x20in.\x20Document\x20that\x20forced\x20re-registration\x20invalidates\x20'+'the\x20old\x20Resource\x20address.','auto_fixable':![]},'check':a=>{if(a['singleton_enforced'])return null;return{...R_PE_07['rule'],'evidence':'singleton_enforced=false\x20(needs\x20SDK\x20guard)'};}};export const PERSONAL_RISK_RULES=[R_PE_01,R_PE_02,R_PE_03,R_PE_04,R_PE_05,R_PE_06,R_PE_07];export const PERSONAL_RISK_VERSION='1.0.0';export function checkPersonalRisks(a){const b=[];for(const c of PERSONAL_RISK_RULES){const d=c['check'](a);if(d)b['push'](d);}return b;}export function getPersonalRiskById(a){return PERSONAL_RISK_RULES['find'](b=>b['rule']['id']===a)?.['rule'];}
@@ -0,0 +1,37 @@
1
+ export declare const PERSONAL_TRANSLATION_VERSION = "1.0.0";
2
+ export interface SemanticToPersonalSchemaRule {
3
+ id: string;
4
+ pattern_name: string;
5
+ semantic_intent: string;
6
+ match_keywords: string[];
7
+ required_fields: string[];
8
+ optional_fields: string[];
9
+ example: Record<string, unknown>;
10
+ }
11
+ export declare const SEMANTIC_TO_PERSONAL_SCHEMA_RULES: SemanticToPersonalSchemaRule[];
12
+ export interface PersonalFieldTranslation {
13
+ field_name: string;
14
+ value_type: string;
15
+ semantic: string;
16
+ format_example: string;
17
+ validation_rules: string[];
18
+ }
19
+ export declare const PERSONAL_FIELD_TRANSLATIONS: PersonalFieldTranslation[];
20
+ export interface PersonalConstraintRule {
21
+ id: string;
22
+ name: string;
23
+ description: string;
24
+ related_field: string;
25
+ }
26
+ export declare const PERSONAL_CONSTRAINT_RULES: PersonalConstraintRule[];
27
+ export interface PersonalExplainInput {
28
+ description?: string;
29
+ information_count?: number;
30
+ has_mark?: boolean;
31
+ }
32
+ export interface PersonalExplanation {
33
+ summary: string;
34
+ mark_status: string;
35
+ warnings: string[];
36
+ }
37
+ export declare function explainPersonal(input: PersonalExplainInput): PersonalExplanation;
@@ -0,0 +1 @@
1
+ export const PERSONAL_TRANSLATION_VERSION='1.0.0';export const SEMANTIC_TO_PERSONAL_SCHEMA_RULES=[{'id':'P-PERSONAL-01','pattern_name':'Register\x20identity','semantic_intent':'Create\x20a\x20user\x20identity\x20(Entity\x20record\x20+\x20Resource\x20mark)\x20via\x20entity_register.','match_keywords':['register','create\x20identity','open\x20account'],'required_fields':[],'optional_fields':['referrer'],'example':{'referrer':'0x...'}},{'id':'P-PERSONAL-02','pattern_name':'Add\x20information','semantic_intent':'Add\x20a\x20named\x20record\x20to\x20the\x20user\x27s\x20Entity\x20(never\x20store\x20sensitive\x20data).','match_keywords':['add\x20info','set\x20profile','add\x20record'],'required_fields':['name','typed_value'],'optional_fields':[],'example':{'name':'preferences','typed_value':'0x...'}}];export const PERSONAL_FIELD_TRANSLATIONS=[{'field_name':'information','value_type':'vector<Record>\x20(via\x20Entity)','semantic':'User\x20profile\x20records;\x20Record{name,\x20typed_value}.','format_example':'[{name,\x20typed_value}]','validation_rules':['never\x20store\x20phone/email/private-key','record\x20cap\x20via\x20Entity']},{'field_name':'mark','value_type':'address\x20(Resource)','semantic':'Identity\x20mark\x20—\x20a\x20Resource\x20holding\x20tags.','format_example':'0x...resource...','validation_rules':['singleton\x20per\x20user','transfer\x20detaches\x20source']},{'field_name':'referrer','value_type':'Option<address>','semantic':'Self-attested\x20referrer\x20(not\x20a\x20verified\x20trust\x20signal).','format_example':'0x...referrer...','validation_rules':['unverified\x20—\x20treat\x20as\x20hint']},{'field_name':'description','value_type':'string','semantic':'User\x20description\x20(Entity).','format_example':'merchant\x20in\x20Shenzhen','validation_rules':['common::DESCRIPTION']}];export const PERSONAL_CONSTRAINT_RULES=[{'id':'PERSONAL_C_01','name':'sensitive\x20data','description':'no\x20phone/email/private-key/mnemonic\x20on-chain.','related_field':'information'},{'id':'PERSONAL_C_02','name':'singleton','description':'one\x20Entity\x20record\x20+\x20one\x20Resource\x20mark\x20per\x20user.','related_field':'mark'},{'id':'PERSONAL_C_03','name':'referrer\x20unverified','description':'referrer\x20is\x20self-attested,\x20not\x20consent-verified.','related_field':'referrer'}];export function explainPersonal(a){const b=[],c=a['has_mark']?'has\x20identity\x20mark':'no\x20identity\x20mark';if(!a['has_mark'])b['push']('user\x20has\x20no\x20Resource\x20mark;\x20register\x20before\x20on-chain\x20identity\x20ops');return{'summary':'Personal\x20('+(a['description']??'no\x20description')+').\x20'+c+'.\x20'+(a['information_count']??'?')+'\x20information\x20records.','mark_status':c,'warnings':b};}
@@ -1,13 +1,4 @@
1
- export type PermissionScope = "organization" | "order" | "order_holder";
2
- export interface PermissionTypeDef {
3
- name: "Permission" | "NamedOperator" | "OrderHolder";
4
- scope: PermissionScope;
5
- definedOn: string;
6
- controls: string;
7
- grantedBy: string;
8
- example: string;
9
- }
10
- export declare const PERMISSION_TYPES: PermissionTypeDef[];
1
+ export { PERMISSION_TYPES, getPermissionType, type PermissionScope, type PermissionTypeDef, } from "./permission-ledger.js";
11
2
  export type GameElementType = "player" | "strategy" | "payoff" | "utility" | "equilibrium" | "information" | "sequence" | "repetition" | "commitment" | "punishment" | "reward" | "reputation" | "signaling" | "screening" | "bargaining" | "auction" | "mechanism" | "constraint" | "uncertainty" | "cooperation";
12
3
  export interface GameElementDef {
13
4
  id: number;
@@ -18,7 +9,6 @@ export interface GameElementDef {
18
9
  onChainMechanism: string;
19
10
  }
20
11
  export declare const GAME_ELEMENTS: GameElementDef[];
21
- export declare function getPermissionType(name: string): PermissionTypeDef | undefined;
22
12
  export declare function getGameElement(id: number): GameElementDef | undefined;
23
13
  export declare function getGameElementsByType(type: GameElementType): GameElementDef[];
24
14
  export declare const PROCESS_MODEL_VERSION = 1;
@@ -1,160 +1 @@
1
- export const PERMISSION_TYPES = [
2
- {
3
- name: "Permission",
4
- scope: "organization",
5
- definedOn: "Permission Object (standalone on-chain object, referenced by service/machine/etc.)",
6
- controls: "Who can modify the bound object's settings, publish it, manage its funds, etc.",
7
- grantedBy: "The object's creator (owner) or anyone the creator delegates to",
8
- example: "A shop owner creates a Permission allowing only their staff to modify the Service's price.",
9
- },
10
- {
11
- name: "NamedOperator",
12
- scope: "order",
13
- definedOn: "Per-order (specified in the order creation/modification by the service)",
14
- controls: "Who can operate on a specific order: advance progress, settle, refund, etc.",
15
- grantedBy: "The service (via its order_allocators or explicit named operators)",
16
- example: "A delivery service assigns Alice as the NamedOperator for order #123 — only Alice can mark it delivered.",
17
- },
18
- {
19
- name: "OrderHolder",
20
- scope: "order_holder",
21
- definedOn: "Per-order (the '' empty string address = the order's current holder)",
22
- controls: "Who currently holds the order and can perform holder-specific actions (accept, reject, pay)",
23
- grantedBy: "Implicitly assigned when an order is created or transferred",
24
- example: "Bob places an order — he becomes the OrderHolder. He can accept delivery or request arbitration.",
25
- },
26
- ];
27
- export const GAME_ELEMENTS = [
28
- {
29
- id: 1, type: "player", name: "Merchant vs Customer",
30
- description: "The basic participants of the game: the merchant providing the service and the customer purchasing the service.",
31
- wowokApplication: "Service creator (merchant) and Order creator (customer).",
32
- onChainMechanism: "Service + Order objects, each with an independent on-chain address.",
33
- },
34
- {
35
- id: 2, type: "player", name: "Arbitrator",
36
- description: "Third-party arbitrators participate in the dispute resolution game.",
37
- wowokApplication: "NamedOperator of the Arb object, designated by the Service.",
38
- onChainMechanism: "Arbitration object + NamedOperator permission.",
39
- },
40
- {
41
- id: 3, type: "strategy", name: "Cooperation vs Deception",
42
- description: "The merchant can choose honest fulfillment (cooperation) or fraud (deception). The customer can choose to trust or refuse.",
43
- wowokApplication: "Merchant ships vs doesn't ship; customer pays vs refuses to pay.",
44
- onChainMechanism: "Progress node advancement + immutable on-chain state.",
45
- },
46
- {
47
- id: 4, type: "payoff", name: "Fulfillment payoff vs Fraud payoff",
48
- description: "Honest fulfillment yields sustained income + reputation; fraud yields one-time income but loses reputation and compensation fund.",
49
- wowokApplication: "compensation_fund as economic penalty for fraud; repeat business as long-term payoff for cooperation.",
50
- onChainMechanism: "Service.compensation_fund + Treasury locked funds.",
51
- },
52
- {
53
- id: 5, type: "utility", name: "Reputation utility",
54
- description: "Merchant's total utility = immediate income + reputation-discounted future income - expected penalty.",
55
- wowokApplication: "Merchants with high reputation scores get more orders (Demand matching priority).",
56
- onChainMechanism: "ReviewRepository (on-chain public reviews) + Demand matching engine.",
57
- },
58
- {
59
- id: 6, type: "equilibrium", name: "Nash equilibrium: mutual cooperation",
60
- description: "When penalties are large enough and reputation is important enough, the strategy profile of mutual cooperation becomes a Nash equilibrium.",
61
- wowokApplication: "compensation_fund large enough + immutable on-chain reputation -> cooperation becomes the optimal strategy.",
62
- onChainMechanism: "Guard verifies compensation_fund amount + ReviewRepository public.",
63
- },
64
- {
65
- id: 7, type: "information", name: "Incomplete information",
66
- description: "Customers don't fully understand the merchant's service quality; merchants don't fully understand the customer's payment capacity.",
67
- wowokApplication: "Service.description + Guard verification as signals; customer wallet balance is queryable on-chain.",
68
- onChainMechanism: "Guard + Personal object + on-chain transaction history.",
69
- },
70
- {
71
- id: 8, type: "sequence", name: "Sequential game",
72
- description: "Customer places order and pays first, merchant fulfills later — this is a typical sequential game.",
73
- wowokApplication: "Order creation -> Progress advancement -> Acceptance/Arbitration.",
74
- onChainMechanism: "Machine node sequence + Progress state machine.",
75
- },
76
- {
77
- id: 9, type: "repetition", name: "Repeated game",
78
- description: "Merchants and customers may transact multiple times; repeated games make cooperation strategies superior.",
79
- wowokApplication: "Customer repeat purchases + Demand matching prioritizes high-reputation merchants.",
80
- onChainMechanism: "ReviewRepository accumulates reviews + Demand matching engine.",
81
- },
82
- {
83
- id: 10, type: "commitment", name: "Compensation fund commitment",
84
- description: "Merchants make a credible commitment by locking compensation_fund, reducing customers' risk perception.",
85
- wowokApplication: "Service.compensation_fund locks funds; customers can claim compensation in case of fraud.",
86
- onChainMechanism: "Treasury object + Guard verifies amount + withdrawal rules.",
87
- },
88
- {
89
- id: 11, type: "punishment", name: "Compensation fund penalty",
90
- description: "When a merchant commits fraud, the compensation fund is transferred to the customer, constituting economic punishment.",
91
- wowokApplication: "Arbitration verdict -> compensation_fund withdrawal -> customer receives compensation.",
92
- onChainMechanism: "Arbitration verdict + Treasury withdrawal rules.",
93
- },
94
- {
95
- id: 12, type: "reward", name: "Reward marketing incentive",
96
- description: "Merchants issue rewards via Reward objects, incentivizing customer behavior (first order, referral, loyalty).",
97
- wowokApplication: "Reward object + Guard verifies claim conditions (e.g., completed first order).",
98
- onChainMechanism: "Reward object + Guard claim conditions + Allocation distribution.",
99
- },
100
- {
101
- id: 13, type: "reputation", name: "On-chain public reputation",
102
- description: "All transactions and reviews are recorded on-chain, forming an immutable reputation system.",
103
- wowokApplication: "ReviewRepository stores like/dislike/review tags, queryable on-chain.",
104
- onChainMechanism: "Repository object + Guard anti-spam + address-keyed review records.",
105
- },
106
- {
107
- id: 14, type: "signaling", name: "Quality signal",
108
- description: "Merchants send quality signals via Guard verification, compensation_fund amount, and Machine transparency.",
109
- wowokApplication: "buy_guard verification -> signal; compensation_fund amount -> signal; Machine public -> signal.",
110
- onChainMechanism: "Guard + Treasury + Machine object's on-chain public data.",
111
- },
112
- {
113
- id: 15, type: "screening", name: "Customer screening",
114
- description: "Merchants screen customers via Guard (e.g., verify identity, credit score, wallet balance).",
115
- wowokApplication: "Service.buy_guard verifies customer eligibility.",
116
- onChainMechanism: "Guard object + gen_passport verifies credentials.",
117
- },
118
- {
119
- id: 16, type: "bargaining", name: "Price bargaining",
120
- description: "Customers and merchants can bargain via Messenger; the final price is submitted via Demand.",
121
- wowokApplication: "Messenger encrypted communication -> Demand submits demand with reward.",
122
- onChainMechanism: "Contact + Messenger + Demand objects.",
123
- },
124
- {
125
- id: 17, type: "auction", name: "Demand bidding",
126
- description: "Multiple service providers can compete for the same Demand, forming a bidding mechanism.",
127
- wowokApplication: "Demand publishes demand -> multiple Services submit proposals -> customer chooses.",
128
- onChainMechanism: "Demand object + order creation + Progress advancement.",
129
- },
130
- {
131
- id: 18, type: "mechanism", name: "Mechanism design",
132
- description: "WoWok's overall architecture is mechanism design: incentivizing cooperation and punishing fraud via on-chain rules.",
133
- wowokApplication: "compensation_fund + Arbitration + ReviewRepository combine to form a trust mechanism.",
134
- onChainMechanism: "Move contract-level object composition + Guard verification + immutability.",
135
- },
136
- {
137
- id: 19, type: "constraint", name: "Fund constraint",
138
- description: "compensation_fund and Reward fund locks constitute economic constraints, limiting the merchant's incentive to commit fraud.",
139
- wowokApplication: "Fund lock > fraud payoff -> cooperation is the rational choice.",
140
- onChainMechanism: "Treasury + Allocation fund lock.",
141
- },
142
- {
143
- id: 20, type: "cooperation", name: "Supply chain collaboration",
144
- description: "Multiple merchants combine via Machine to form a supply chain, cooperating to fulfill complex orders (sub-orders).",
145
- wowokApplication: "Service's order_allocators supports multi-supplier allocation; Machine node forwards combine.",
146
- onChainMechanism: "Allocation + Machine Forward + Progress cross-object composition.",
147
- },
148
- ];
149
- const PERMISSION_INDEX = new Map(PERMISSION_TYPES.map((p) => [p.name, p]));
150
- const GAME_ELEMENT_INDEX = new Map(GAME_ELEMENTS.map((g) => [g.id, g]));
151
- export function getPermissionType(name) {
152
- return PERMISSION_INDEX.get(name);
153
- }
154
- export function getGameElement(id) {
155
- return GAME_ELEMENT_INDEX.get(id);
156
- }
157
- export function getGameElementsByType(type) {
158
- return GAME_ELEMENTS.filter((g) => g.type === type);
159
- }
160
- export const PROCESS_MODEL_VERSION = 1;
1
+ export{PERMISSION_TYPES,getPermissionType}from'./permission-ledger.js';export const GAME_ELEMENTS=[{'id':0x1,'type':'player','name':'Merchant\x20vs\x20Customer','description':'The\x20basic\x20participants\x20of\x20the\x20game:\x20the\x20merchant\x20providing\x20the\x20service\x20and\x20the\x20customer\x20purchasing\x20the\x20service.','wowokApplication':'Service\x20creator\x20(merchant)\x20and\x20Order\x20creator\x20(customer).','onChainMechanism':'Service\x20+\x20Order\x20objects,\x20each\x20with\x20an\x20independent\x20on-chain\x20address.'},{'id':0x2,'type':'player','name':'Arbitrator','description':'Third-party\x20arbitrators\x20participate\x20in\x20the\x20dispute\x20resolution\x20game.','wowokApplication':'NamedOperator\x20of\x20the\x20Arb\x20object,\x20designated\x20by\x20the\x20Service.','onChainMechanism':'Arbitration\x20object\x20+\x20NamedOperator\x20permission.'},{'id':0x3,'type':'strategy','name':'Cooperation\x20vs\x20Deception','description':'The\x20merchant\x20can\x20choose\x20honest\x20fulfillment\x20(cooperation)\x20or\x20fraud\x20(deception).\x20The\x20customer\x20can\x20choose\x20to\x20trust\x20or\x20refuse.','wowokApplication':'Merchant\x20ships\x20vs\x20doesn\x27t\x20ship;\x20customer\x20pays\x20vs\x20refuses\x20to\x20pay.','onChainMechanism':'Progress\x20node\x20advancement\x20+\x20immutable\x20on-chain\x20state.'},{'id':0x4,'type':'payoff','name':'Fulfillment\x20payoff\x20vs\x20Fraud\x20payoff','description':'Honest\x20fulfillment\x20yields\x20sustained\x20income\x20+\x20reputation;\x20fraud\x20yields\x20one-time\x20income\x20but\x20loses\x20reputation\x20and\x20compensation\x20fund.','wowokApplication':'compensation_fund\x20as\x20economic\x20penalty\x20for\x20fraud;\x20repeat\x20business\x20as\x20long-term\x20payoff\x20for\x20cooperation.','onChainMechanism':'Service.compensation_fund\x20+\x20Treasury\x20locked\x20funds.'},{'id':0x5,'type':'utility','name':'Reputation\x20utility','description':'Merchant\x27s\x20total\x20utility\x20=\x20immediate\x20income\x20+\x20reputation-discounted\x20future\x20income\x20-\x20expected\x20penalty.','wowokApplication':'Merchants\x20with\x20high\x20reputation\x20scores\x20get\x20more\x20orders\x20(Demand\x20matching\x20priority).','onChainMechanism':'ReviewRepository\x20(on-chain\x20public\x20reviews)\x20+\x20Demand\x20matching\x20engine.'},{'id':0x6,'type':'equilibrium','name':'Nash\x20equilibrium:\x20mutual\x20cooperation','description':'When\x20penalties\x20are\x20large\x20enough\x20and\x20reputation\x20is\x20important\x20enough,\x20the\x20strategy\x20profile\x20of\x20mutual\x20cooperation\x20becomes\x20a\x20Nash\x20equilibrium.','wowokApplication':'compensation_fund\x20large\x20enough\x20+\x20immutable\x20on-chain\x20reputation\x20->\x20cooperation\x20becomes\x20the\x20optimal\x20strategy.','onChainMechanism':'Guard\x20verifies\x20compensation_fund\x20amount\x20+\x20ReviewRepository\x20public.'},{'id':0x7,'type':'information','name':'Incomplete\x20information','description':'Customers\x20don\x27t\x20fully\x20understand\x20the\x20merchant\x27s\x20service\x20quality;\x20merchants\x20don\x27t\x20fully\x20understand\x20the\x20customer\x27s\x20payment\x20capacity.','wowokApplication':'Service.description\x20+\x20Guard\x20verification\x20as\x20signals;\x20customer\x20wallet\x20balance\x20is\x20queryable\x20on-chain.','onChainMechanism':'Guard\x20+\x20Personal\x20object\x20+\x20on-chain\x20transaction\x20history.'},{'id':0x8,'type':'sequence','name':'Sequential\x20game','description':'Customer\x20places\x20order\x20and\x20pays\x20first,\x20merchant\x20fulfills\x20later\x20—\x20this\x20is\x20a\x20typical\x20sequential\x20game.','wowokApplication':'Order\x20creation\x20->\x20Progress\x20advancement\x20->\x20Acceptance/Arbitration.','onChainMechanism':'Machine\x20node\x20sequence\x20+\x20Progress\x20state\x20machine.'},{'id':0x9,'type':'repetition','name':'Repeated\x20game','description':'Merchants\x20and\x20customers\x20may\x20transact\x20multiple\x20times;\x20repeated\x20games\x20make\x20cooperation\x20strategies\x20superior.','wowokApplication':'Customer\x20repeat\x20purchases\x20+\x20Demand\x20matching\x20prioritizes\x20high-reputation\x20merchants.','onChainMechanism':'ReviewRepository\x20accumulates\x20reviews\x20+\x20Demand\x20matching\x20engine.'},{'id':0xa,'type':'commitment','name':'Compensation\x20fund\x20commitment','description':'Merchants\x20make\x20a\x20credible\x20commitment\x20by\x20locking\x20compensation_fund,\x20reducing\x20customers\x27\x20risk\x20perception.','wowokApplication':'Service.compensation_fund\x20locks\x20funds;\x20customers\x20can\x20claim\x20compensation\x20in\x20case\x20of\x20fraud.','onChainMechanism':'Treasury\x20object\x20+\x20Guard\x20verifies\x20amount\x20+\x20withdrawal\x20rules.'},{'id':0xb,'type':'punishment','name':'Compensation\x20fund\x20penalty','description':'When\x20a\x20merchant\x20commits\x20fraud,\x20the\x20compensation\x20fund\x20is\x20transferred\x20to\x20the\x20customer,\x20constituting\x20economic\x20punishment.','wowokApplication':'Arbitration\x20verdict\x20->\x20compensation_fund\x20withdrawal\x20->\x20customer\x20receives\x20compensation.','onChainMechanism':'Arbitration\x20verdict\x20+\x20Treasury\x20withdrawal\x20rules.'},{'id':0xc,'type':'reward','name':'Reward\x20marketing\x20incentive','description':'Merchants\x20issue\x20rewards\x20via\x20Reward\x20objects,\x20incentivizing\x20customer\x20behavior\x20(first\x20order,\x20referral,\x20loyalty).','wowokApplication':'Reward\x20object\x20+\x20Guard\x20verifies\x20claim\x20conditions\x20(e.g.,\x20completed\x20first\x20order).','onChainMechanism':'Reward\x20object\x20+\x20Guard\x20claim\x20conditions\x20+\x20Allocation\x20distribution.'},{'id':0xd,'type':'reputation','name':'On-chain\x20public\x20reputation','description':'All\x20transactions\x20and\x20reviews\x20are\x20recorded\x20on-chain,\x20forming\x20an\x20immutable\x20reputation\x20system.','wowokApplication':'ReviewRepository\x20stores\x20like/dislike/review\x20tags,\x20queryable\x20on-chain.','onChainMechanism':'Repository\x20object\x20+\x20Guard\x20anti-spam\x20+\x20address-keyed\x20review\x20records.'},{'id':0xe,'type':'signaling','name':'Quality\x20signal','description':'Merchants\x20send\x20quality\x20signals\x20via\x20Guard\x20verification,\x20compensation_fund\x20amount,\x20and\x20Machine\x20transparency.','wowokApplication':'buy_guard\x20verification\x20->\x20signal;\x20compensation_fund\x20amount\x20->\x20signal;\x20Machine\x20public\x20->\x20signal.','onChainMechanism':'Guard\x20+\x20Treasury\x20+\x20Machine\x20object\x27s\x20on-chain\x20public\x20data.'},{'id':0xf,'type':'screening','name':'Customer\x20screening','description':'Merchants\x20screen\x20customers\x20via\x20Guard\x20(e.g.,\x20verify\x20identity,\x20credit\x20score,\x20wallet\x20balance).','wowokApplication':'Service.buy_guard\x20verifies\x20customer\x20eligibility.','onChainMechanism':'Guard\x20object\x20+\x20gen_passport\x20verifies\x20credentials.'},{'id':0x10,'type':'bargaining','name':'Price\x20bargaining','description':'Customers\x20and\x20merchants\x20can\x20bargain\x20via\x20Messenger;\x20the\x20final\x20price\x20is\x20submitted\x20via\x20Demand.','wowokApplication':'Messenger\x20encrypted\x20communication\x20->\x20Demand\x20submits\x20demand\x20with\x20reward.','onChainMechanism':'Contact\x20+\x20Messenger\x20+\x20Demand\x20objects.'},{'id':0x11,'type':'auction','name':'Demand\x20bidding','description':'Multiple\x20service\x20providers\x20can\x20compete\x20for\x20the\x20same\x20Demand,\x20forming\x20a\x20bidding\x20mechanism.','wowokApplication':'Demand\x20publishes\x20demand\x20->\x20multiple\x20Services\x20submit\x20proposals\x20->\x20customer\x20chooses.','onChainMechanism':'Demand\x20object\x20+\x20order\x20creation\x20+\x20Progress\x20advancement.'},{'id':0x12,'type':'mechanism','name':'Mechanism\x20design','description':'WoWok\x27s\x20overall\x20architecture\x20is\x20mechanism\x20design:\x20incentivizing\x20cooperation\x20and\x20punishing\x20fraud\x20via\x20on-chain\x20rules.','wowokApplication':'compensation_fund\x20+\x20Arbitration\x20+\x20ReviewRepository\x20combine\x20to\x20form\x20a\x20trust\x20mechanism.','onChainMechanism':'Move\x20contract-level\x20object\x20composition\x20+\x20Guard\x20verification\x20+\x20immutability.'},{'id':0x13,'type':'constraint','name':'Fund\x20constraint','description':'compensation_fund\x20and\x20Reward\x20fund\x20locks\x20constitute\x20economic\x20constraints,\x20limiting\x20the\x20merchant\x27s\x20incentive\x20to\x20commit\x20fraud.','wowokApplication':'Fund\x20lock\x20>\x20fraud\x20payoff\x20->\x20cooperation\x20is\x20the\x20rational\x20choice.','onChainMechanism':'Treasury\x20+\x20Allocation\x20fund\x20lock.'},{'id':0x14,'type':'cooperation','name':'Supply\x20chain\x20collaboration','description':'Multiple\x20merchants\x20combine\x20via\x20Machine\x20to\x20form\x20a\x20supply\x20chain,\x20cooperating\x20to\x20fulfill\x20complex\x20orders\x20(sub-orders).','wowokApplication':'Service\x27s\x20order_allocators\x20supports\x20multi-supplier\x20allocation;\x20Machine\x20node\x20forwards\x20combine.','onChainMechanism':'Allocation\x20+\x20Machine\x20Forward\x20+\x20Progress\x20cross-object\x20composition.'}];const GAME_ELEMENT_INDEX=new Map(GAME_ELEMENTS['map'](a=>[a['id'],a]));export function getGameElement(a){return GAME_ELEMENT_INDEX['get'](a);}export function getGameElementsByType(a){return GAME_ELEMENTS['filter'](b=>b['type']===a);}export const PROCESS_MODEL_VERSION=0x1;