@wowok/agent-mcp 3.0.2 → 3.0.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 (260) hide show
  1. package/LICENSE +0 -3
  2. package/dist/harness/recover.js +1 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +1 -1
  5. package/dist/knowledge/account-marks.js +1 -1
  6. package/dist/knowledge/arbitration-risk.js +1 -1
  7. package/dist/knowledge/flywheel-loop.d.ts +4 -52
  8. package/dist/knowledge/flywheel-loop.js +1 -1
  9. package/dist/knowledge/guard-lint.js +1 -1
  10. package/dist/knowledge/index.d.ts +2 -225
  11. package/dist/knowledge/index.js +1 -1
  12. package/dist/knowledge/industry-registry.js +1 -1
  13. package/dist/knowledge/machine-risk.js +1 -1
  14. package/dist/knowledge/machine-translation.js +1 -1
  15. package/dist/knowledge/onchain-constants.js +1 -1
  16. package/dist/knowledge/order-ledger.d.ts +2 -2
  17. package/dist/knowledge/order-ledger.js +1 -1
  18. package/dist/knowledge/order-puzzle.d.ts +4 -4
  19. package/dist/knowledge/order-puzzle.js +1 -1
  20. package/dist/knowledge/order-risk.d.ts +1 -0
  21. package/dist/knowledge/order-risk.js +1 -1
  22. package/dist/knowledge/order-templates.d.ts +1 -1
  23. package/dist/knowledge/order-templates.js +1 -1
  24. package/dist/knowledge/safety-rules.js +1 -1
  25. package/dist/knowledge/service-ledger.js +1 -1
  26. package/dist/knowledge/service-risk.js +1 -1
  27. package/dist/knowledge/template-registry.js +1 -1
  28. package/dist/knowledge/tools-reference.js +1 -1
  29. package/dist/knowledge/workspace-lists.js +1 -1
  30. package/dist/monitor/MonitorLoop.js +1 -1
  31. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  32. package/dist/playbooks/service-build/context-assembly.d.ts +3 -1
  33. package/dist/playbooks/service-build/context-assembly.js +1 -1
  34. package/dist/playbooks/service-build/machine-nodes.d.ts +2 -0
  35. package/dist/playbooks/service-build/machine-nodes.js +1 -1
  36. package/dist/playbooks/service-build/machine-panorama.d.ts +7 -0
  37. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  38. package/dist/review/machine.js +1 -1
  39. package/dist/safety/confirm-gate.js +1 -1
  40. package/dist/schema/call/base.d.ts +12 -3
  41. package/dist/schema/call/base.js +1 -1
  42. package/dist/schema/call/bridge.d.ts +4 -0
  43. package/dist/schema/call/bridge.js +1 -1
  44. package/dist/schema/call/error-codes.d.ts +2 -0
  45. package/dist/schema/call/error-codes.js +1 -0
  46. package/dist/schema/call/guard.d.ts +4 -4
  47. package/dist/schema/call/semantic.d.ts +9 -1
  48. package/dist/schema/call/semantic.js +1 -1
  49. package/dist/schema/common/index.js +1 -1
  50. package/dist/schema/goal/index.d.ts +3 -3
  51. package/dist/schema/goal/planning.d.ts +2 -2
  52. package/dist/schema/industry-pack/index.d.ts +4 -4
  53. package/dist/schema/industry-pack/modes.d.ts +4 -4
  54. package/dist/schema/local/index.d.ts +558 -0
  55. package/dist/schema/local/index.js +1 -1
  56. package/dist/schema/messenger/index.d.ts +25 -25
  57. package/dist/schema/operations.d.ts +1 -1
  58. package/dist/schema/persona/index.d.ts +2 -2
  59. package/dist/schema/query/bi.d.ts +0 -4
  60. package/dist/schema/query/bi.js +1 -1
  61. package/dist/schema/query/index.js +1 -1
  62. package/dist/schema/schema-query/index.d.ts +1 -1
  63. package/dist/schema/schema-version.js +1 -1
  64. package/dist/schema/trust/index.d.ts +3 -3
  65. package/dist/schema/workspace/index.d.ts +1 -1
  66. package/dist/schema-query-impl/index.js +1 -1
  67. package/dist/schemas/account_operation.output.json +4 -0
  68. package/dist/schemas/bridge_operation.output.json +4 -0
  69. package/dist/schemas/index.json +7 -1
  70. package/dist/schemas/local_history_operation.output.json +1458 -0
  71. package/dist/schemas/local_history_operation.schema.json +105 -0
  72. package/dist/schemas/local_info_operation.output.json +4 -0
  73. package/dist/schemas/local_mark_operation.output.json +4 -0
  74. package/dist/schemas/onchain_operations.output.json +4 -1
  75. package/dist/schemas/onchain_operations.schema.json +30 -10
  76. package/dist/schemas/onchain_operations_guard.schema.json +30 -10
  77. package/dist/schemas/query_toolkit.output.json +17 -16
  78. package/dist/tools/handlers/config.js +1 -1
  79. package/dist/tools/handlers/local.d.ts +1 -0
  80. package/dist/tools/handlers/local.js +1 -1
  81. package/dist/tools/handlers/onchain.js +1 -1
  82. package/dist/tools/index.js +1 -1
  83. package/dist/tools/registry/local.js +1 -1
  84. package/dist/tools/shared.js +1 -1
  85. package/dist/tools/wrap.js +1 -1
  86. package/package.json +2 -2
  87. package/dist/knowledge/allocation-confirm.d.ts +0 -115
  88. package/dist/knowledge/allocation-confirm.js +0 -1
  89. package/dist/knowledge/allocation-context.d.ts +0 -58
  90. package/dist/knowledge/allocation-context.js +0 -1
  91. package/dist/knowledge/allocation-translation.d.ts +0 -72
  92. package/dist/knowledge/allocation-translation.js +0 -1
  93. package/dist/knowledge/arb-confirm.d.ts +0 -28
  94. package/dist/knowledge/arb-confirm.js +0 -1
  95. package/dist/knowledge/arb-translation.d.ts +0 -48
  96. package/dist/knowledge/arb-translation.js +0 -1
  97. package/dist/knowledge/arbitration-confirm.d.ts +0 -135
  98. package/dist/knowledge/arbitration-confirm.js +0 -1
  99. package/dist/knowledge/arbitration-context.d.ts +0 -81
  100. package/dist/knowledge/arbitration-context.js +0 -1
  101. package/dist/knowledge/arbitration-translation.d.ts +0 -91
  102. package/dist/knowledge/arbitration-translation.js +0 -1
  103. package/dist/knowledge/bridge-confirm.d.ts +0 -26
  104. package/dist/knowledge/bridge-confirm.js +0 -1
  105. package/dist/knowledge/bridge-translation.d.ts +0 -37
  106. package/dist/knowledge/bridge-translation.js +0 -1
  107. package/dist/knowledge/contact-confirm.d.ts +0 -27
  108. package/dist/knowledge/contact-confirm.js +0 -1
  109. package/dist/knowledge/contact-translation.d.ts +0 -39
  110. package/dist/knowledge/contact-translation.js +0 -1
  111. package/dist/knowledge/demand-confirm.d.ts +0 -32
  112. package/dist/knowledge/demand-confirm.js +0 -1
  113. package/dist/knowledge/demand-context.d.ts +0 -17
  114. package/dist/knowledge/demand-context.js +0 -1
  115. package/dist/knowledge/demand-ledger.d.ts +0 -26
  116. package/dist/knowledge/demand-ledger.js +0 -1
  117. package/dist/knowledge/demand-puzzle.d.ts +0 -29
  118. package/dist/knowledge/demand-puzzle.js +0 -1
  119. package/dist/knowledge/demand-templates.d.ts +0 -12
  120. package/dist/knowledge/demand-templates.js +0 -1
  121. package/dist/knowledge/demand-translation.d.ts +0 -55
  122. package/dist/knowledge/demand-translation.js +0 -1
  123. package/dist/knowledge/examples-scanner-cli.d.ts +0 -1
  124. package/dist/knowledge/examples-scanner-cli.js +0 -1
  125. package/dist/knowledge/examples-scanner.d.ts +0 -121
  126. package/dist/knowledge/examples-scanner.js +0 -1
  127. package/dist/knowledge/glossary.d.ts +0 -18
  128. package/dist/knowledge/glossary.js +0 -1
  129. package/dist/knowledge/guard-bytecode-spec.d.ts +0 -82
  130. package/dist/knowledge/guard-bytecode-spec.js +0 -1
  131. package/dist/knowledge/guard-confirm.d.ts +0 -86
  132. package/dist/knowledge/guard-confirm.js +0 -1
  133. package/dist/knowledge/immutability.d.ts +0 -11
  134. package/dist/knowledge/immutability.js +0 -1
  135. package/dist/knowledge/machine-confirm.d.ts +0 -102
  136. package/dist/knowledge/machine-confirm.js +0 -1
  137. package/dist/knowledge/machine-context.d.ts +0 -160
  138. package/dist/knowledge/machine-context.js +0 -1
  139. package/dist/knowledge/machine-render.d.ts +0 -41
  140. package/dist/knowledge/machine-render.js +0 -1
  141. package/dist/knowledge/mcp-schema-audit-cli.d.ts +0 -1
  142. package/dist/knowledge/mcp-schema-audit-cli.js +0 -1
  143. package/dist/knowledge/mcp-schema-audit.d.ts +0 -91
  144. package/dist/knowledge/mcp-schema-audit.js +0 -1
  145. package/dist/knowledge/messenger-guard-guidance.d.ts +0 -17
  146. package/dist/knowledge/messenger-guard-guidance.js +0 -1
  147. package/dist/knowledge/order-confirm.d.ts +0 -115
  148. package/dist/knowledge/order-confirm.js +0 -1
  149. package/dist/knowledge/order-context.d.ts +0 -66
  150. package/dist/knowledge/order-context.js +0 -1
  151. package/dist/knowledge/order-translation.d.ts +0 -78
  152. package/dist/knowledge/order-translation.js +0 -1
  153. package/dist/knowledge/overrides-loader.d.ts +0 -13
  154. package/dist/knowledge/overrides-loader.js +0 -1
  155. package/dist/knowledge/passport-confirm.d.ts +0 -130
  156. package/dist/knowledge/passport-confirm.js +0 -1
  157. package/dist/knowledge/passport-context.d.ts +0 -59
  158. package/dist/knowledge/passport-context.js +0 -1
  159. package/dist/knowledge/passport-puzzle.d.ts +0 -108
  160. package/dist/knowledge/passport-puzzle.js +0 -1
  161. package/dist/knowledge/passport-risk.d.ts +0 -70
  162. package/dist/knowledge/passport-risk.js +0 -1
  163. package/dist/knowledge/passport-translation.d.ts +0 -68
  164. package/dist/knowledge/passport-translation.js +0 -1
  165. package/dist/knowledge/payment-confirm.d.ts +0 -26
  166. package/dist/knowledge/payment-confirm.js +0 -1
  167. package/dist/knowledge/payment-translation.d.ts +0 -37
  168. package/dist/knowledge/payment-translation.js +0 -1
  169. package/dist/knowledge/permission-confirm.d.ts +0 -110
  170. package/dist/knowledge/permission-confirm.js +0 -1
  171. package/dist/knowledge/permission-context.d.ts +0 -69
  172. package/dist/knowledge/permission-context.js +0 -1
  173. package/dist/knowledge/permission-translation.d.ts +0 -57
  174. package/dist/knowledge/permission-translation.js +0 -1
  175. package/dist/knowledge/personal-confirm.d.ts +0 -29
  176. package/dist/knowledge/personal-confirm.js +0 -1
  177. package/dist/knowledge/personal-translation.d.ts +0 -37
  178. package/dist/knowledge/personal-translation.js +0 -1
  179. package/dist/knowledge/process-model.d.ts +0 -14
  180. package/dist/knowledge/process-model.js +0 -1
  181. package/dist/knowledge/progress-confirm.d.ts +0 -108
  182. package/dist/knowledge/progress-confirm.js +0 -1
  183. package/dist/knowledge/progress-context.d.ts +0 -123
  184. package/dist/knowledge/progress-context.js +0 -1
  185. package/dist/knowledge/progress-translation.d.ts +0 -52
  186. package/dist/knowledge/progress-translation.js +0 -1
  187. package/dist/knowledge/proof-confirm.d.ts +0 -31
  188. package/dist/knowledge/proof-confirm.js +0 -1
  189. package/dist/knowledge/proof-context.d.ts +0 -17
  190. package/dist/knowledge/proof-context.js +0 -1
  191. package/dist/knowledge/proof-ledger.d.ts +0 -34
  192. package/dist/knowledge/proof-ledger.js +0 -1
  193. package/dist/knowledge/proof-puzzle.d.ts +0 -35
  194. package/dist/knowledge/proof-puzzle.js +0 -1
  195. package/dist/knowledge/proof-templates.d.ts +0 -22
  196. package/dist/knowledge/proof-templates.js +0 -1
  197. package/dist/knowledge/proof-translation.d.ts +0 -52
  198. package/dist/knowledge/proof-translation.js +0 -1
  199. package/dist/knowledge/registrar-confirm.d.ts +0 -26
  200. package/dist/knowledge/registrar-confirm.js +0 -1
  201. package/dist/knowledge/registrar-translation.d.ts +0 -37
  202. package/dist/knowledge/registrar-translation.js +0 -1
  203. package/dist/knowledge/repository-confirm.d.ts +0 -40
  204. package/dist/knowledge/repository-confirm.js +0 -1
  205. package/dist/knowledge/repository-context.d.ts +0 -12
  206. package/dist/knowledge/repository-context.js +0 -1
  207. package/dist/knowledge/repository-ledger.d.ts +0 -25
  208. package/dist/knowledge/repository-ledger.js +0 -1
  209. package/dist/knowledge/repository-puzzle.d.ts +0 -30
  210. package/dist/knowledge/repository-puzzle.js +0 -1
  211. package/dist/knowledge/repository-templates.d.ts +0 -14
  212. package/dist/knowledge/repository-templates.js +0 -1
  213. package/dist/knowledge/repository-translation.d.ts +0 -58
  214. package/dist/knowledge/repository-translation.js +0 -1
  215. package/dist/knowledge/resource-confirm.d.ts +0 -25
  216. package/dist/knowledge/resource-confirm.js +0 -1
  217. package/dist/knowledge/resource-translation.d.ts +0 -37
  218. package/dist/knowledge/resource-translation.js +0 -1
  219. package/dist/knowledge/reward-confirm.d.ts +0 -116
  220. package/dist/knowledge/reward-confirm.js +0 -1
  221. package/dist/knowledge/reward-context.d.ts +0 -127
  222. package/dist/knowledge/reward-context.js +0 -1
  223. package/dist/knowledge/reward-translation.d.ts +0 -58
  224. package/dist/knowledge/reward-translation.js +0 -1
  225. package/dist/knowledge/service-confirm.d.ts +0 -161
  226. package/dist/knowledge/service-confirm.js +0 -1
  227. package/dist/knowledge/service-context.d.ts +0 -66
  228. package/dist/knowledge/service-context.js +0 -1
  229. package/dist/knowledge/service-translation.d.ts +0 -103
  230. package/dist/knowledge/service-translation.js +0 -1
  231. package/dist/knowledge/treasury-confirm.d.ts +0 -133
  232. package/dist/knowledge/treasury-confirm.js +0 -1
  233. package/dist/knowledge/treasury-context.d.ts +0 -64
  234. package/dist/knowledge/treasury-context.js +0 -1
  235. package/dist/knowledge/treasury-translation.d.ts +0 -78
  236. package/dist/knowledge/treasury-translation.js +0 -1
  237. package/dist/knowledge/util-confirm.d.ts +0 -24
  238. package/dist/knowledge/util-confirm.js +0 -1
  239. package/dist/knowledge/util-translation.d.ts +0 -39
  240. package/dist/knowledge/util-translation.js +0 -1
  241. package/dist/loop-engineering/aggregate.d.ts +0 -50
  242. package/dist/loop-engineering/aggregate.js +0 -1
  243. package/dist/loop-engineering/context-collect.d.ts +0 -7
  244. package/dist/loop-engineering/context-collect.js +0 -1
  245. package/dist/loop-engineering/diagnose.d.ts +0 -22
  246. package/dist/loop-engineering/diagnose.js +0 -1
  247. package/dist/loop-engineering/improve.d.ts +0 -55
  248. package/dist/loop-engineering/improve.js +0 -1
  249. package/dist/loop-engineering/index.d.ts +0 -4
  250. package/dist/loop-engineering/index.js +0 -1
  251. package/dist/loop-engineering/pipeline.d.ts +0 -17
  252. package/dist/loop-engineering/pipeline.js +0 -1
  253. package/dist/schema/utils/object-type-utils.d.ts +0 -12
  254. package/dist/schema/utils/object-type-utils.js +0 -1
  255. package/dist/telemetry/index.d.ts +0 -19
  256. package/dist/telemetry/index.js +0 -1
  257. package/dist/telemetry/redact.d.ts +0 -2
  258. package/dist/telemetry/redact.js +0 -1
  259. package/dist/telemetry/storage.d.ts +0 -8
  260. package/dist/telemetry/storage.js +0 -1
@@ -1,22 +0,0 @@
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[];
@@ -1 +0,0 @@
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;}
@@ -1,52 +0,0 @@
1
- export interface SemanticToProofSchemaRule {
2
- id: string;
3
- pattern_name: string;
4
- proof_type_classification: "wts" | "custom_reserved" | "custom_user";
5
- semantic_intent: string;
6
- match_keywords: string[];
7
- schema_elements: {
8
- proof_type_value: number | string;
9
- required_fields: string[];
10
- optional_fields: string[];
11
- about_address_recommendation: string;
12
- };
13
- constraints: string[];
14
- example: Record<string, unknown>;
15
- }
16
- export declare const SEMANTIC_TO_PROOF_SCHEMA_RULES: SemanticToProofSchemaRule[];
17
- export interface ProofFieldTranslation {
18
- field_name: string;
19
- move_field?: string;
20
- value_type: string;
21
- semantic: string;
22
- format_example: string;
23
- validation_rules: string[];
24
- }
25
- export declare const PROOF_FIELD_TRANSLATIONS: ProofFieldTranslation[];
26
- export interface ProofConstraintRule {
27
- id: string;
28
- name: string;
29
- description: string;
30
- validation_logic: string;
31
- failure_message: string;
32
- related_field: string;
33
- }
34
- export declare const PROOF_CONSTRAINT_RULES: ProofConstraintRule[];
35
- export interface ProofExplainInput {
36
- proof_type?: number | bigint | string;
37
- proof?: string;
38
- server_pubkey?: string;
39
- server_signature?: string;
40
- about_address?: string | null;
41
- description?: string;
42
- item_count?: number | bigint | string | null;
43
- }
44
- export interface ProofExplanation {
45
- summary: string;
46
- proof_type_classification: string;
47
- binding: string;
48
- size_status: string;
49
- warnings: string[];
50
- recommendations: string[];
51
- }
52
- export declare function explainProof(input: ProofExplainInput): ProofExplanation;
@@ -1 +0,0 @@
1
- import{WOWOK_WTS_PROOF_TYPE}from'@wowok/wowok';export const SEMANTIC_TO_PROOF_SCHEMA_RULES=[{'id':'P-PROOF-01','pattern_name':'Wowok\x20WTS\x20(Will-To-Sign)\x20proof','proof_type_classification':'wts','semantic_intent':'An\x20off-chain\x20server\x20attests\x20to\x20a\x20fact\x20(identity,\x20timestamp,\x20merkle\x20root)\x20and\x20signs\x20it\x20with\x20server_pubkey.\x20'+'On-chain\x20consumers\x20verify\x20the\x20signature\x20off-chain\x20and\x20trust\x20the\x20Proof\x20record\x20as\x20evidence.','match_keywords':['wts','server-signed','attestation','kyc','merkle\x20root','timestamp'],'schema_elements':{'proof_type_value':WOWOK_WTS_PROOF_TYPE,'required_fields':['proof','server_pubkey','server_signature','description'],'optional_fields':['item_count','about_address','namedNew'],'about_address_recommendation':'Set\x20about_address\x20when\x20the\x20WTS\x20proof\x20attests\x20to\x20a\x20specific\x20on-chain\x20entity\x20(user\x20address,\x20Repository,\x20etc.).\x20'+'Leave\x20null\x20for\x20free-standing\x20attestations\x20(e.g.\x20server\x20timestamp).'},'constraints':['proof_type\x20must\x20equal\x20'+WOWOK_WTS_PROOF_TYPE+'\x20(WOWOK_WTS_PROOF_TYPE)','server_pubkey\x20must\x20be\x20the\x20raw\x20public\x20key\x20(hex-encoded),\x20not\x20a\x20certificate','server_signature\x20must\x20sign\x20the\x20exact\x20bytes\x20of\x20the\x20\x27proof\x27\x20field\x20(or\x20a\x20documented\x20pre-image)','Off-chain\x20verification\x20logic\x20must\x20be\x20documented\x20for\x20consumers'],'example':{'proof_type':WOWOK_WTS_PROOF_TYPE,'proof':'0xabc123...merkle_root_hex...','server_pubkey':'0x04a1b2c3...ed25519_or_ecdsa_pubkey_hex...','server_signature':'0x9d8e7f6...signature_hex...','description':'KYC\x20attestation\x20for\x20user\x200xabc\x20(merkle\x20root\x20of\x201024\x20leaves)','item_count':0x400,'about_address':'0xabc...user_address...','namedNew':{'name':'kyc_user_abc'}}},{'id':'P-PROOF-02','pattern_name':'Custom\x20proof\x20in\x20Wowok\x20reserved\x20range\x20(NOT\x20recommended)','proof_type_classification':'custom_reserved','semantic_intent':'A\x20custom\x20proof\x20type\x20using\x20a\x20value\x20in\x20the\x20reserved\x20range\x202-100.\x20This\x20is\x20NOT\x20recommended\x20because\x20future\x20'+'Wowok\x20protocol\x20upgrades\x20may\x20claim\x20these\x20values,\x20breaking\x20semantic\x20compatibility.\x20Use\x20only\x20if\x20you\x20have\x20'+'explicit\x20Wowok\x20authority\x20to\x20claim\x20a\x20reserved\x20value.','match_keywords':['reserved','custom\x20reserved','wowok-defined'],'schema_elements':{'proof_type_value':'2-100\x20(specific\x20value\x20documented\x20by\x20creator)','required_fields':['proof','server_pubkey','server_signature','description','proof_type'],'optional_fields':['item_count','about_address','namedNew'],'about_address_recommendation':'Same\x20as\x20P-PROOF-01:\x20set\x20about_address\x20for\x20entity-bound\x20attestations.'},'constraints':['Caller\x20must\x20have\x20explicit\x20Wowok\x20authority\x20to\x20claim\x20a\x20reserved\x20proof_type\x20value','Verification\x20logic\x20must\x20be\x20documented\x20and\x20stable\x20across\x20protocol\x20upgrades','Future\x20Wowok\x20upgrades\x20may\x20reassign\x20this\x20value\x20—\x20callers\x20must\x20handle\x20migration'],'example':{'proof_type':0x5,'proof':'0x...custom_proof_format...','server_pubkey':'0x...pubkey...','server_signature':'0x...sig...','description':'Custom\x20reserved\x20proof\x20type\x20(documented\x20by\x20authority\x20X)'}},{'id':'P-PROOF-03','pattern_name':'User-defined\x20proof\x20type\x20(>100)','proof_type_classification':'custom_user','semantic_intent':'A\x20fully\x20custom\x20proof\x20type\x20using\x20a\x20value\x20>\x20100.\x20The\x20creator\x20defines\x20the\x20verification\x20logic\x20(off-chain).\x20'+'This\x20is\x20the\x20recommended\x20range\x20for\x20application-specific\x20proof\x20semantics\x20that\x20Wowok\x20protocol\x20does\x20not\x20cover.','match_keywords':['custom','user-defined','application-specific','custom\x20proof\x20type'],'schema_elements':{'proof_type_value':'>100\x20(user-chosen,\x20must\x20be\x20unique\x20within\x20application\x20scope)','required_fields':['proof','server_pubkey','server_signature','description','proof_type'],'optional_fields':['item_count','about_address','namedNew'],'about_address_recommendation':'Set\x20about_address\x20when\x20the\x20proof\x20is\x20bound\x20to\x20a\x20specific\x20on-chain\x20entity.\x20Leave\x20null\x20for\x20off-chain-only\x20proofs.'},'constraints':['proof_type\x20must\x20be\x20>\x20100\x20(user-defined\x20range)','Application\x20must\x20document\x20the\x20verification\x20logic\x20and\x20proof\x20format','Ensure\x20proof_type\x20does\x20not\x20collide\x20with\x20other\x20user-defined\x20types\x20in\x20the\x20same\x20consumer\x20scope'],'example':{'proof_type':0xc8,'proof':'0x...application_specific_proof_format...','server_pubkey':'0x...pubkey...','server_signature':'0x...sig...','description':'Application-specific\x20attestation\x20(format\x20documented\x20at\x20https://...)','about_address':null,'namedNew':{'name':'custom_attestation_001'}}}];export const PROOF_FIELD_TRANSLATIONS=[{'field_name':'proof','value_type':'string\x20(hex-encoded)','semantic':'The\x20cryptographic\x20proof\x20content.\x20Typically\x20a\x20merkle\x20tree\x20root,\x20a\x20hash\x20digest,\x20or\x20a\x20compact\x20serialized\x20attestation.\x20'+'Off-chain\x20verifiers\x20use\x20this\x20together\x20with\x20server_pubkey\x20and\x20server_signature\x20to\x20verify\x20the\x20proof\x27s\x20authenticity.','format_example':'0xabc123...merkle_root_64hex...','validation_rules':['Non-empty\x20string','Length\x20≤\x20MAX_PROOF_SIZE\x20(10240\x20bytes)','Move\x20aborts\x20with\x20E_MAX_PROOF_SIZE\x20(1)\x20on\x20overflow']},{'field_name':'server_pubkey','value_type':'string\x20(hex-encoded)','semantic':'The\x20public\x20key\x20of\x20the\x20off-chain\x20server\x20that\x20signed\x20this\x20proof.\x20Consumers\x20use\x20this\x20to\x20verify\x20server_signature\x20'+'off-chain.\x20Submit\x20the\x20raw\x20public\x20key\x20bytes,\x20not\x20a\x20certificate\x20chain\x20or\x20JWK\x20structure.','format_example':'0x04a1b2c3...ed25519_pubkey_64hex...','validation_rules':['Non-empty\x20string','Length\x20≤\x20MAX_SERVER_PUBKEY_SIZE\x20(2048\x20bytes)','Move\x20aborts\x20with\x20E_MAX_SERVER_PUBKEY_SIZE\x20(2)\x20on\x20overflow','Must\x20be\x20a\x20valid\x20public\x20key\x20for\x20the\x20signature\x20scheme\x20used']},{'field_name':'server_signature','value_type':'string\x20(hex-encoded)','semantic':'The\x20signature\x20produced\x20by\x20the\x20off-chain\x20server\x20using\x20its\x20private\x20key.\x20Verifiers\x20check\x20this\x20against\x20'+'server_pubkey\x20and\x20the\x20proof\x20content\x20(or\x20a\x20documented\x20pre-image).','format_example':'0x9d8e7f6...signature_hex...','validation_rules':['Non-empty\x20string','Length\x20≤\x20MAX_SERVER_SIGNATURE_SIZE\x20(40480\x20bytes)','Move\x20aborts\x20with\x20E_MAX_SERVER_SIGNATURE_SIZE\x20(3)\x20on\x20overflow']},{'field_name':'proof_type','value_type':'u64\x20(number\x20|\x20bigint\x20|\x20numeric\x20string)','semantic':'Classifies\x20the\x20proof\x27s\x20verification\x20logic.\x20'+WOWOK_WTS_PROOF_TYPE+'=WOWOK_WTS_PROOF_TYPE\x20(Wowok\x20Will-To-Sign,\x20'+'signed\x20by\x20off-chain\x20server).\x20Values\x202-100\x20are\x20reserved\x20for\x20future\x20Wowok-defined\x20types.\x20Values\x20>100\x20are\x20user-defined.','format_example':'1\x20(WTS),\x20200\x20(custom)','validation_rules':['Required\x20field','Must\x20be\x20≥\x201\x20(P-PROOF-P2-2:\x20schema\x20rejects\x200\x20and\x20non-numeric\x20strings)','Value\x201\x20=\x20WOWOK_WTS_PROOF_TYPE','Values\x202-100\x20require\x20explicit\x20Wowok\x20authority','Values\x20>100\x20are\x20user-defined']},{'field_name':'about_address','move_field':'about','value_type':'Option<address>\x20(string\x20|\x20null)','semantic':'The\x20on-chain\x20address\x20of\x20the\x20entity\x20being\x20proved\x20(e.g.\x20a\x20user,\x20order,\x20Repository).\x20When\x20null,\x20the\x20Proof\x20is\x20a\x20'+'free-standing\x20cryptographic\x20statement\x20with\x20no\x20on-chain\x20binding.\x20SDK\x20sends\x20Option::none\x20to\x20Move\x20when\x20null/undefined.','format_example':'0xabc...64hex_address...\x20or\x20null','validation_rules':['Optional\x20(null/undefined\x20→\x20Option::none)\x20[PF-D-1=A]','When\x20provided,\x20must\x20be\x20a\x20raw\x200x-prefixed\x2064-hex\x20address\x20(NOT\x20a\x20name)','SDK\x20isValidAddress\x20check\x20enforces\x20format']},{'field_name':'description','value_type':'string','semantic':'Human-readable\x20description\x20of\x20this\x20Proof.\x20Required\x20field\x20(PF-D-2=A).\x20Helps\x20identify\x20the\x20Proof\x20in\x20query\x20results\x20'+'and\x20audit\x20logs.\x20Should\x20be\x20a\x20one-line\x20summary\x20(e.g.\x20\x22KYC\x20attestation\x20for\x20user\x200xabc\x22).','format_example':'KYC\x20attestation\x20for\x20user\x200xabc\x20(merkle\x20root\x20of\x201024\x20leaves)','validation_rules':['Required\x20field\x20[PF-D-2=A]','Length\x20≤\x20MAX_DESCRIPTION_LENGTH\x20(defined\x20in\x20common.ts)','SDK\x20isValidDescription\x20check\x20enforces\x20max\x20length']},{'field_name':'item_count','move_field':'item_count','value_type':'Option<u64>\x20(number\x20|\x20bigint\x20|\x20numeric\x20string\x20|\x20null)','semantic':'Optional\x20count\x20of\x20items\x20in\x20the\x20off-chain\x20data\x20structure\x20(e.g.\x20number\x20of\x20leaves\x20in\x20a\x20merkle\x20tree).\x20'+'Used\x20by\x20consumers\x20to\x20interpret\x20the\x20proof\x20content.\x20When\x20null,\x20SDK\x20sends\x20Option::none\x20to\x20Move.','format_example':'1024\x20or\x20null','validation_rules':['Optional\x20(null/undefined\x20→\x20Option::none)','When\x20provided,\x20must\x20be\x20≥\x200']}];export const PROOF_CONSTRAINT_RULES=[{'id':'PROOF_C_01','name':'proof\x20content\x20non-empty','description':'The\x20\x27proof\x27\x20field\x20must\x20be\x20a\x20non-empty\x20string.','validation_logic':'proof.length\x20>\x200','failure_message':'proof\x20field\x20is\x20empty','related_field':'proof'},{'id':'PROOF_C_02','name':'proof\x20content\x20within\x20size\x20limit','description':'The\x20\x27proof\x27\x20field\x20must\x20be\x20≤\x20MAX_PROOF_SIZE\x20(10240\x20bytes).','validation_logic':'proof.length\x20<=\x20MAX_PROOF_SIZE','failure_message':'proof\x20exceeds\x20MAX_PROOF_SIZE\x20(10240\x20bytes)\x20—\x20E_MAX_PROOF_SIZE\x20(1)','related_field':'proof'},{'id':'PROOF_C_03','name':'server_pubkey\x20within\x20size\x20limit','description':'The\x20\x27server_pubkey\x27\x20field\x20must\x20be\x20≤\x20MAX_SERVER_PUBKEY_SIZE\x20(2048\x20bytes).','validation_logic':'server_pubkey.length\x20<=\x20MAX_SERVER_PUBKEY_SIZE','failure_message':'server_pubkey\x20exceeds\x20MAX_SERVER_PUBKEY_SIZE\x20(2048\x20bytes)\x20—\x20E_MAX_SERVER_PUBKEY_SIZE\x20(2)','related_field':'server_pubkey'},{'id':'PROOF_C_04','name':'server_signature\x20within\x20size\x20limit','description':'The\x20\x27server_signature\x27\x20field\x20must\x20be\x20≤\x20MAX_SERVER_SIGNATURE_SIZE\x20(40480\x20bytes).','validation_logic':'server_signature.length\x20<=\x20MAX_SERVER_SIGNATURE_SIZE','failure_message':'server_signature\x20exceeds\x20MAX_SERVER_SIGNATURE_SIZE\x20(40480\x20bytes)\x20—\x20E_MAX_SERVER_SIGNATURE_SIZE\x20(3)','related_field':'server_signature'},{'id':'PROOF_C_05','name':'proof_type\x20valid\x20range','description':'proof_type\x20must\x20be\x20≥\x201\x20(WOWOK_WTS_PROOF_TYPE='+WOWOK_WTS_PROOF_TYPE+'\x20is\x20the\x20minimum).','validation_logic':'proof_type\x20>=\x201','failure_message':'proof_type\x20must\x20be\x20≥\x201\x20—\x20schema\x20rejects\x200\x20and\x20non-numeric\x20strings','related_field':'proof_type'},{'id':'PROOF_C_06','name':'about_address\x20format\x20(when\x20provided)','description':'When\x20about_address\x20is\x20non-null,\x20it\x20must\x20be\x20a\x20valid\x200x-prefixed\x2064-hex\x20address.','validation_logic':'about_address\x20==\x20null\x20||\x20/^0x[0-9a-fA-F]{64}$/.test(about_address)','failure_message':'about_address\x20is\x20not\x20a\x20valid\x200x-prefixed\x2064-hex\x20address','related_field':'about_address'}];export function explainProof(a){const b=[],c=[];let d='unknown';if(a['proof_type']!==undefined&&a['proof_type']!==null){const h=typeof a['proof_type']==='string'?BigInt(a['proof_type']):BigInt(a['proof_type']);if(h===BigInt(WOWOK_WTS_PROOF_TYPE))d='WTS\x20proof\x20(proof_type='+WOWOK_WTS_PROOF_TYPE+')\x20—\x20signed\x20by\x20off-chain\x20server';else{if(h>0x1n&&h<=0x64n)d='Custom\x20proof\x20in\x20reserved\x20range\x20(proof_type='+a['proof_type']+')\x20—\x20NOT\x20recommended\x20without\x20Wowok\x20authority',b['push']('proof_type='+a['proof_type']+'\x20is\x20in\x20reserved\x20range\x202-100\x20—\x20future\x20Wowok\x20upgrades\x20may\x20reassign\x20this\x20value');else h>0x64n?d='User-defined\x20proof\x20(proof_type='+a['proof_type']+')\x20—\x20application-specific\x20verification\x20logic':(d='INVALID\x20proof_type='+a['proof_type']+'\x20(must\x20be\x20≥\x201)',b['push']('proof_type\x20is\x20<\x201\x20—\x20schema\x20validation\x20will\x20reject'));}}const e=a['about_address']?'Entity-bound:\x20about_address='+a['about_address']['substring'](0x0,0xa)+'...\x20(proof\x20attests\x20to\x20this\x20on-chain\x20entity)':'Free-standing:\x20no\x20on-chain\x20entity\x20binding\x20(about_address=null)',f=[];a['proof']&&f['push']('proof='+a['proof']['length']+'\x20bytes\x20(limit\x2010240)');a['server_pubkey']&&f['push']('server_pubkey='+a['server_pubkey']['length']+'\x20bytes\x20(limit\x202048)');a['server_signature']&&f['push']('server_signature='+a['server_signature']['length']+'\x20bytes\x20(limit\x2040480)');(!a['description']||a['description']['length']===0x0)&&c['push']('Provide\x20a\x20non-empty\x20description\x20for\x20audit\x20log\x20discoverability');!a['about_address']&&c['push']('Consider\x20setting\x20about_address\x20if\x20this\x20Proof\x20attests\x20to\x20a\x20specific\x20on-chain\x20entity');(a['item_count']===undefined||a['item_count']===null)&&c['push']('Consider\x20setting\x20item_count\x20if\x20the\x20proof\x20references\x20a\x20multi-item\x20data\x20structure');const g='Proof\x20is\x20a\x20'+d+'.\x20'+e+'.\x20'+(f['length']>0x0?'Sizes:\x20'+f['join'](',\x20')+'.':'');return{'summary':g,'proof_type_classification':d,'binding':e,'size_status':f['join'](',\x20'),'warnings':b,'recommendations':c};}
@@ -1,26 +0,0 @@
1
- export declare const REGISTRAR_CONFIRM_VERSION = "1.0.0";
2
- export type ConfirmSeverity = "block" | "warn" | "info";
3
- export interface RegistrarConfirmItem {
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 RegistrarOpCheckInput {
13
- typed_value_first_byte?: number;
14
- typed_value_length?: number;
15
- address_count?: number;
16
- expects_fresh_resource_on_register?: boolean;
17
- is_resource_transfer?: boolean;
18
- }
19
- export declare function preCheckRegistrarOp(input: RegistrarOpCheckInput): RegistrarConfirmItem[];
20
- export declare function canProceedRegistrarOp(input: RegistrarOpCheckInput): {
21
- canProceed: boolean;
22
- blockers: RegistrarConfirmItem[];
23
- warnings: RegistrarConfirmItem[];
24
- info: RegistrarConfirmItem[];
25
- };
26
- export declare function formatRegistrarOpSummary(input: RegistrarOpCheckInput): string;
@@ -1 +0,0 @@
1
- import{MAX_ADDRESS_COUNT,MAX_RECORD_LENGTH}from'@wowok/wowok';export const REGISTRAR_CONFIRM_VERSION='1.0.0';function checkTypedValue(a){if(a['typed_value_first_byte']===undefined)return{'id':'C-REGISTRAR-01','severity':'info','title':'Record.typed_value\x20first\x20byte\x20is\x20a\x20known\x20ValueType','description':'The\x20first\x20byte\x20encodes\x20ValueType;\x20the\x20Move\x20layer\x20only\x20checks\x20non-empty,\x20not\x20validity.','passed':!![],'evidence':'not\x20provided'};const b=a['typed_value_first_byte']!==0x0&&a['typed_value_first_byte']!==0xff;return{'id':'C-REGISTRAR-01','severity':b?'info':'warn','title':'Record.typed_value\x20first\x20byte\x20is\x20a\x20known\x20ValueType','description':'Move\x20validates\x20only\x20that\x20typed_value\x20is\x20non-empty;\x20a\x20misencoded\x20first\x20byte\x20deserializes\x20to\x20garbage\x20without\x20an\x20abort.','passed':b,'evidence':'first_byte=0x'+a['typed_value_first_byte']['toString'](0x10),'fix_hint':'Validate\x20the\x20first\x20byte\x20against\x20the\x20ValueType\x20enum\x20before\x20submitting.'};}function checkRecordLength(a){if(a['typed_value_length']===undefined)return{'id':'C-REGISTRAR-02','severity':'info','title':'typed_value\x20length\x20≤\x20MAX_RECORD_LENGTH\x20('+MAX_RECORD_LENGTH+')','description':'record()\x20aborts\x20with\x20ERecordLengthExceeded\x20(2)\x20above\x20the\x20cap.','passed':!![],'evidence':'not\x20provided'};const b=a['typed_value_length']>0x0&&a['typed_value_length']<=MAX_RECORD_LENGTH;return{'id':'C-REGISTRAR-02','severity':b?'info':'block','title':'typed_value\x20length\x20in\x20(0,\x20MAX_RECORD_LENGTH]\x20('+MAX_RECORD_LENGTH+')','description':'record()\x20requires\x20a\x20non-empty\x20typed_value\x20≤\x20MAX_RECORD_LENGTH='+MAX_RECORD_LENGTH+';\x20empty\x20aborts\x20with\x20ERecordTypeEmpty\x20(3).','passed':b,'evidence':'typed_value_length='+a['typed_value_length']+',\x20limit='+MAX_RECORD_LENGTH,'fix_hint':'Trim\x20the\x20record\x20payload\x20or\x20store\x20bulk\x20data\x20off-chain.'};}function checkAddressCount(a){if(a['address_count']===undefined)return{'id':'C-REGISTRAR-03','severity':'info','title':'address_count\x20below\x20MAX_ADDRESS_COUNT\x20('+MAX_ADDRESS_COUNT+')','description':'Entity/Registrar\x20ParentTables\x20are\x20bounded\x20by\x20MAX_ADDRESS_COUNT.','passed':!![],'evidence':'not\x20provided'};const b=a['address_count']<MAX_ADDRESS_COUNT;return{'id':'C-REGISTRAR-03','severity':b?'info':'warn','title':'address_count\x20below\x20MAX_ADDRESS_COUNT\x20('+MAX_ADDRESS_COUNT+')','description':'Registration\x20aborts\x20when\x20the\x20address\x20cap\x20MAX_ADDRESS_COUNT='+MAX_ADDRESS_COUNT+'\x20is\x20reached;\x20raising\x20it\x20needs\x20a\x20package\x20upgrade.','passed':b,'evidence':'address_count='+a['address_count']+',\x20limit='+MAX_ADDRESS_COUNT,'fix_hint':'Monitor\x20address_count\x20and\x20plan\x20a\x20package\x20upgrade\x20before\x20hitting\x20the\x20cap.'};}function checkIdempotency(a){if(!a['expects_fresh_resource_on_register'])return{'id':'C-REGISTRAR-04','severity':'info','title':'entity_register\x20is\x20idempotent','description':'entity_register\x20returns\x20the\x20existing\x20Resource\x20for\x20an\x20already-registered\x20user.','passed':!![],'evidence':'idempotency\x20understood'};return{'id':'C-REGISTRAR-04','severity':'warn','title':'entity_register\x20returns\x20the\x20existing\x20Resource\x20(not\x20a\x20fresh\x20one)','description':'After\x20a\x20forced\x20destroy,\x20use\x20entity_register_with_resource_forced\x20to\x20re-allocate;\x20entity_register\x20would\x20return\x20the\x20old\x20(now-invalid)\x20address.','passed':![],'evidence':'expects_fresh_resource_on_register=true','fix_hint':'Use\x20entity_register_with_resource_forced\x20only\x20when\x20the\x20old\x20Resource\x20is\x20truly\x20gone.'};}function checkTransfer(a){if(!a['is_resource_transfer'])return{'id':'C-REGISTRAR-05','severity':'info','title':'entity_resource_transfer\x20detaches\x20source\x20address','description':'Transferring\x20the\x20Resource\x20moves\x20it\x20to\x20a\x20new\x20address;\x20the\x20source\x20loses\x20the\x20binding.','passed':!![],'evidence':'not\x20transferring'};return{'id':'C-REGISTRAR-05','severity':'warn','title':'entity_resource_transfer\x20will\x20detach\x20Resource\x20from\x20source\x20address','description':'Downstream\x20services\x20keyed\x20on\x20the\x20source\x20address\x20lose\x20the\x20binding;\x20no\x20forwarding\x20stub\x20is\x20left\x20behind.','passed':![],'evidence':'is_resource_transfer=true','fix_hint':'Warn\x20that\x20old-address\x20bindings\x20break;\x20track\x20users\x20by\x20Resource\x20address.'};}export function preCheckRegistrarOp(a){return[checkTypedValue(a),checkRecordLength(a),checkAddressCount(a),checkIdempotency(a),checkTransfer(a)];}export function canProceedRegistrarOp(a){const b=preCheckRegistrarOp(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 formatRegistrarOpSummary(a){const {canProceed:b,blockers:c,warnings:d}=canProceedRegistrarOp(a),e=[b?'✓\x20Registrar\x20operation\x20pre-check\x20PASSED':'✗\x20Registrar\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,37 +0,0 @@
1
- export declare const REGISTRAR_TRANSLATION_VERSION = "1.0.0";
2
- export interface SemanticToRegistrarSchemaRule {
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_REGISTRAR_SCHEMA_RULES: SemanticToRegistrarSchemaRule[];
12
- export interface RegistrarFieldTranslation {
13
- field_name: string;
14
- value_type: string;
15
- semantic: string;
16
- format_example: string;
17
- validation_rules: string[];
18
- }
19
- export declare const REGISTRAR_FIELD_TRANSLATIONS: RegistrarFieldTranslation[];
20
- export interface RegistrarConstraintRule {
21
- id: string;
22
- name: string;
23
- description: string;
24
- related_field: string;
25
- }
26
- export declare const REGISTRAR_CONSTRAINT_RULES: RegistrarConstraintRule[];
27
- export interface RegistrarExplainInput {
28
- typed_value_first_byte?: number;
29
- record_length?: number;
30
- info?: number;
31
- }
32
- export interface RegistrarExplanation {
33
- summary: string;
34
- vote_flags: string;
35
- warnings: string[];
36
- }
37
- export declare function explainRegistrar(input: RegistrarExplainInput): RegistrarExplanation;
@@ -1 +0,0 @@
1
- import{MAX_ADDRESS_COUNT,MAX_RECORD_LENGTH}from'@wowok/wowok';export const REGISTRAR_TRANSLATION_VERSION='1.0.0';export const SEMANTIC_TO_REGISTRAR_SCHEMA_RULES=[{'id':'P-REGISTRAR-01','pattern_name':'Register\x20entity','semantic_intent':'Register\x20a\x20user\x20Entity\x20record\x20+\x20Resource\x20mark\x20(idempotent).','match_keywords':['register\x20entity','register\x20user','affiliate'],'required_fields':[],'optional_fields':['referrer'],'example':{'referrer':'0x...'}},{'id':'P-REGISTRAR-02','pattern_name':'Vote\x20(like/dislike/favor)','semantic_intent':'Cast\x20a\x20like/dislike/favor\x20vote\x20via\x20the\x20Vote.info\x20bitmask.','match_keywords':['like','dislike','favor','vote'],'required_fields':['who'],'optional_fields':['info'],'example':{'who':'0x...','info':0x2}}];export const REGISTRAR_FIELD_TRANSLATIONS=[{'field_name':'table','value_type':'ParentTable<address,\x20Votes\x20|\x20AddressInfo>','semantic':'Registrar:\x20who\x20→\x20Votes;\x20Entity:\x20who\x20→\x20AddressInfo.','format_example':'{0x...:\x20Votes}','validation_rules':['bounded\x20by\x20MAX_ADDRESS_COUNT\x20('+MAX_ADDRESS_COUNT+')']},{'field_name':'typed_value','value_type':'vector<u8>','semantic':'Record\x20value;\x20first\x20byte\x20encodes\x20ValueType.','format_example':'0x01...','validation_rules':['ERecordTypeEmpty\x20(3)\x20when\x20empty','≤\x20MAX_RECORD_LENGTH\x20('+MAX_RECORD_LENGTH+')']},{'field_name':'info','value_type':'u8','semantic':'Vote\x20bitmask:\x20LIKE=0x02,\x20DISLIKE=0x04,\x20FAVOR=0x08;\x20bits\x204-7\x20reserved.','format_example':'0x02\x20(like)','validation_rules':['mask\x20to\x20bits\x200-3\x20today']},{'field_name':'referrer','value_type':'Option<address>','semantic':'Self-attested\x20referrer\x20(unverified).','format_example':'0x...referrer...','validation_rules':['treat\x20as\x20hint,\x20not\x20trust\x20signal']}];export const REGISTRAR_CONSTRAINT_RULES=[{'id':'REGISTRAR_C_01','name':'record\x20type','description':'typed_value\x20non-empty;\x20first\x20byte\x20is\x20ValueType.','related_field':'typed_value'},{'id':'REGISTRAR_C_02','name':'record\x20length','description':'typed_value\x20≤\x20MAX_RECORD_LENGTH\x20('+MAX_RECORD_LENGTH+').','related_field':'typed_value'},{'id':'REGISTRAR_C_03','name':'address\x20cap','description':'Entity/Registrar\x20tables\x20bounded\x20by\x20MAX_ADDRESS_COUNT\x20('+MAX_ADDRESS_COUNT+').','related_field':'table'},{'id':'REGISTRAR_C_04','name':'vote\x20bitmask','description':'bits\x204-7\x20reserved;\x20mask\x20to\x200-3.','related_field':'info'}];export function explainRegistrar(a){const b=[],c=[];if(a['info']!==undefined){if((a['info']&0x2)===0x2)c['push']('like');if((a['info']&0x4)===0x4)c['push']('dislike');if((a['info']&0x8)===0x8)c['push']('favor');if((a['info']&0xf0)!==0x0)b['push']('reserved\x20bits\x204-7\x20set\x20(forward-incompatible)');}return a['record_length']!==undefined&&a['record_length']>MAX_RECORD_LENGTH&&b['push']('record\x20length\x20'+a['record_length']+'\x20>\x20'+MAX_RECORD_LENGTH),{'summary':'Registrar\x20record.\x20Vote\x20flags:\x20'+(c['join'](',')||'none')+'.','vote_flags':c['join'](',')||'none','warnings':b};}
@@ -1,40 +0,0 @@
1
- export type ConfirmSeverity = "block" | "warn" | "info";
2
- export interface RepositoryConfirmItem {
3
- id: string;
4
- severity: ConfirmSeverity;
5
- title: string;
6
- description: string;
7
- passed: boolean;
8
- evidence?: string;
9
- fix_hint?: string;
10
- }
11
- export interface RepositoryPolicyInput {
12
- name: string;
13
- description?: string;
14
- id_from: number | string;
15
- write_guard_count: number;
16
- has_id_from_submission: boolean;
17
- has_data_from_submission: boolean;
18
- }
19
- export interface RepositoryOpCheckInput {
20
- op: "create" | "policy_add" | "policy_set" | "data_add" | "data_remove" | "rewards";
21
- policies?: RepositoryPolicyInput[];
22
- existing_policy_count?: number;
23
- data_size?: number;
24
- id_count_once?: number;
25
- reward_count?: number;
26
- is_data_remove_with_passport?: boolean;
27
- description?: string;
28
- has_quote_guard?: boolean;
29
- quote_guard_is_depended?: boolean;
30
- quote_guard_verifies_payment?: boolean;
31
- has_owner_receive?: boolean;
32
- }
33
- export declare function preCheckRepositoryOp(input: RepositoryOpCheckInput): RepositoryConfirmItem[];
34
- export declare function canProceedRepositoryOp(input: RepositoryOpCheckInput): {
35
- canProceed: boolean;
36
- blockers: RepositoryConfirmItem[];
37
- warnings: RepositoryConfirmItem[];
38
- info: RepositoryConfirmItem[];
39
- };
40
- export declare function formatRepositoryOpSummary(input: RepositoryOpCheckInput): string;
@@ -1 +0,0 @@
1
- import{MAX_POLICY_COUNT,MAX_POLICY_DESCRIPTION_LEN,MAX_POLICY_GUARD_COUNT,MAX_DATA_SIZE,MAX_ID_COUNT_ONCE,MAX_REWARD_COUNT}from'@wowok/wowok';function normalizeIdFrom(a){if(typeof a==='number')return a;const b=String(a)['toLowerCase']();if(b==='none')return 0x0;if(b==='clock')return 0x1;if(b==='signer')return 0x2;const c=Number(a);return Number['isNaN'](c)?-0x1:c;}function checkPolicyCount(a){if(!a['policies']||a['existing_policy_count']===undefined)return{'id':'C-REP-01','severity':'info','title':'Policy\x20count\x20within\x20MAX_POLICY_COUNT\x20('+MAX_POLICY_COUNT+')','description':'Skipped:\x20no\x20policy\x20count\x20provided.','passed':!![]};const b=a['existing_policy_count']+a['policies']['length'],c=b<=MAX_POLICY_COUNT;return{'id':'C-REP-01','severity':c?'info':'block','title':'Policy\x20count\x20within\x20MAX_POLICY_COUNT\x20('+MAX_POLICY_COUNT+')','description':'A\x20single\x20Repository\x20may\x20hold\x20up\x20to\x20MAX_POLICY_COUNT\x20policies.\x20Exceeding\x20aborts\x20with\x20E_POLICY_COUNT_EXCEEDED\x20(3).\x20'+'Each\x20policy\x20is\x20a\x20named\x20data\x20slot\x20with\x20its\x20own\x20write_guard\x20and\x20id_from\x20routing.','passed':c,'evidence':'existing='+a['existing_policy_count']+',\x20adding='+a['policies']['length']+',\x20total='+b,'fix_hint':'Consolidate\x20or\x20split\x20across\x20multiple\x20Repository\x20objects.\x20Limit='+MAX_POLICY_COUNT+'.'};}function checkWriteGuardRequiredWhenIdFromNone(a){if(!a['policies'])return{'id':'C-REP-02','severity':'info','title':'write_guard/id_from\x20consistency\x20(R-D-1)','description':'Skipped:\x20no\x20policies.','passed':!![]};const b=a['policies']['filter'](d=>normalizeIdFrom(d['id_from'])===0x0&&d['write_guard_count']===0x0),c=b['length']===0x0;return{'id':'C-REP-02','severity':c?'info':'block','title':'write_guard\x20non-empty\x20when\x20id_from=None\x20(R-D-1\x20Move\x20assert)','description':'When\x20id_from\x20is\x20None,\x20the\x20data\x20ID\x20comes\x20from\x20the\x20caller\x20—\x20without\x20write_guard,\x20ANY\x20address\x20can\x20write\x20'+'data\x20with\x20any\x20ID.\x20Move\x20aborts\x20with\x20E_POLICY_WRITE_GUARD_REQUIRED\x20(22)\x20in\x20policy_add_imp()\x20[R-D-1=A].','passed':c,'evidence':c?'all\x20policies\x20with\x20id_from=None\x20have\x20write_guard':'offenders:\x20'+b['map'](d=>d['name'])['join'](',\x20'),'fix_hint':'Add\x20at\x20least\x20one\x20PolicyGuard\x20to\x20write_guard,\x20OR\x20switch\x20id_from\x20to\x20Clock/Signer.'};}function checkWriteGuardForbiddenWhenIdFromClockSigner(a){if(!a['policies'])return{'id':'C-REP-03','severity':'info','title':'id_from_submission\x20null\x20when\x20id_from=Clock/Signer\x20(R-D-1)','description':'Skipped:\x20no\x20policies.','passed':!![]};const b=a['policies']['filter'](d=>{const e=normalizeIdFrom(d['id_from']);return(e===0x1||e===0x2)&&d['has_id_from_submission'];}),c=b['length']===0x0;return{'id':'C-REP-03','severity':c?'info':'block','title':'id_from_submission\x20null\x20when\x20id_from=Clock/Signer\x20(R-D-1\x20Move\x20assert)','description':'When\x20id_from\x20is\x20Clock/Signer,\x20the\x20ID\x20is\x20auto-generated\x20—\x20id_from_submission\x20would\x20conflict.\x20'+'data_from_submission\x20is\x20still\x20allowed\x20(used\x20by\x20data_when_id_from_set_with_passport).\x20'+'Move\x20aborts\x20with\x20E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN\x20(23)\x20in\x20policy_add_imp()\x20[R-D-1=A,\x20refined].','passed':c,'evidence':c?'all\x20policies\x20with\x20id_from=Clock/Signer\x20have\x20id_from_submission=null':'offenders:\x20'+b['map'](d=>d['name']+'(id_from='+d['id_from']+')')['join'](',\x20'),'fix_hint':'Set\x20id_from_submission=null\x20on\x20all\x20write_guard\x20entries,\x20OR\x20switch\x20id_from\x20to\x20None.'};}function checkPolicyGuardCount(a){if(!a['policies'])return{'id':'C-REP-04','severity':'info','title':'write_guard\x20count\x20≤\x20'+MAX_POLICY_GUARD_COUNT,'description':'Skipped:\x20no\x20policies.','passed':!![]};const b=a['policies']['filter'](d=>d['write_guard_count']>MAX_POLICY_GUARD_COUNT),c=b['length']===0x0;return{'id':'C-REP-04','severity':c?'info':'block','title':'Each\x20policy\x20write_guard\x20count\x20≤\x20MAX_POLICY_GUARD_COUNT\x20('+MAX_POLICY_GUARD_COUNT+')','description':'Each\x20policy\x20may\x20define\x20up\x20to\x20MAX_POLICY_GUARD_COUNT\x20guard\x20entries.\x20Move\x20aborts\x20with\x20E_POLICY_GUARD_COUNT_EXCEEDED\x20(2).','passed':c,'evidence':c?'all\x20policies\x20within\x20limit':'offenders:\x20'+b['map'](d=>d['name']+'('+d['write_guard_count']+')')['join'](',\x20'),'fix_hint':'Reduce\x20write_guard\x20entries\x20to\x20≤\x20'+MAX_POLICY_GUARD_COUNT+'\x20per\x20policy.'};}function checkPolicyDescription(a){if(!a['policies'])return{'id':'C-REP-05','severity':'info','title':'Policy\x20description\x20≤\x20'+MAX_POLICY_DESCRIPTION_LEN,'description':'Skipped:\x20no\x20policies.','passed':!![]};const b=a['policies']['filter'](d=>d['description']!==undefined&&d['description']['length']>MAX_POLICY_DESCRIPTION_LEN),c=b['length']===0x0;return{'id':'C-REP-05','severity':c?'info':'block','title':'Each\x20policy\x20description\x20≤\x20MAX_POLICY_DESCRIPTION_LEN\x20('+MAX_POLICY_DESCRIPTION_LEN+')','description':'Policy\x20description\x20is\x20bounded\x20by\x20MAX_POLICY_DESCRIPTION_LEN.\x20Move\x20aborts\x20with\x20E_POLICY_DESCRIPTION_EXCEEDED\x20(1).','passed':c,'evidence':c?'all\x20descriptions\x20within\x20limit':'offenders:\x20'+b['map'](d=>d['name']+'(len='+d['description']['length']+')')['join'](',\x20'),'fix_hint':'Shorten\x20policy\x20descriptions\x20to\x20≤\x20'+MAX_POLICY_DESCRIPTION_LEN+'\x20chars.'};}function checkDataSize(a){if(a['data_size']===undefined)return{'id':'C-REP-06','severity':'info','title':'Data\x20value\x20≤\x20MAX_DATA_SIZE\x20('+MAX_DATA_SIZE+')','description':'Skipped:\x20no\x20data_size.','passed':!![]};const b=a['data_size']<=MAX_DATA_SIZE;return{'id':'C-REP-06','severity':b?'info':'block','title':'Data\x20value\x20≤\x20MAX_DATA_SIZE\x20('+MAX_DATA_SIZE+'\x20bytes)','description':'Each\x20data\x20value\x20must\x20be\x20≤\x20MAX_DATA_SIZE\x20bytes\x20(BCS-serialized,\x20type-tag\x20prefixed).\x20Move\x20aborts\x20with\x20E_DATA_EXCEEDED\x20(4).\x20'+'Store\x20large\x20payloads\x20off-chain\x20and\x20reference\x20by\x20hash.','passed':b,'evidence':'data_size='+a['data_size']+',\x20limit='+MAX_DATA_SIZE,'fix_hint':'Store\x20large\x20data\x20off-chain;\x20write\x20only\x20the\x20content\x20hash.\x20Limit='+MAX_DATA_SIZE+'\x20bytes.'};}function checkIdCountOnce(a){if(a['id_count_once']===undefined)return{'id':'C-REP-07','severity':'info','title':'ID\x20count\x20≤\x20MAX_ID_COUNT_ONCE\x20('+MAX_ID_COUNT_ONCE+')','description':'Skipped:\x20no\x20id_count.','passed':!![]};const b=a['id_count_once']<=MAX_ID_COUNT_ONCE;return{'id':'C-REP-07','severity':b?'info':'block','title':'ID\x20count\x20per\x20op\x20≤\x20MAX_ID_COUNT_ONCE\x20('+MAX_ID_COUNT_ONCE+')','description':'A\x20single\x20Repository\x20call\x20may\x20operate\x20on\x20at\x20most\x20MAX_ID_COUNT_ONCE\x20IDs.\x20Move\x20aborts\x20with\x20E_ID_COUNT_EXCEEDED\x20(5).\x20'+'Batch\x20large\x20operations\x20across\x20multiple\x20transactions.','passed':b,'evidence':'id_count='+a['id_count_once']+',\x20limit='+MAX_ID_COUNT_ONCE,'fix_hint':'Split\x20into\x20batches\x20of\x20≤\x20'+MAX_ID_COUNT_ONCE+'\x20IDs\x20per\x20transaction.'};}function checkRewardCount(a){if(a['reward_count']===undefined)return{'id':'C-REP-08','severity':'info','title':'Reward\x20count\x20≤\x20MAX_REWARD_COUNT\x20('+MAX_REWARD_COUNT+')','description':'Skipped:\x20no\x20reward_count.','passed':!![]};const b=a['reward_count']<=MAX_REWARD_COUNT;return{'id':'C-REP-08','severity':b?'info':'block','title':'Reward\x20count\x20≤\x20MAX_REWARD_COUNT\x20('+MAX_REWARD_COUNT+')','description':'A\x20Repository\x20may\x20reference\x20up\x20to\x20MAX_REWARD_COUNT\x20Reward\x20objects.\x20Move\x20aborts\x20with\x20E_MAX_REWARD_COUNT_EXCEEDED\x20(19).','passed':b,'evidence':'reward_count='+a['reward_count']+',\x20limit='+MAX_REWARD_COUNT,'fix_hint':'Consolidate\x20rewards\x20or\x20use\x20a\x20separate\x20Repository.\x20Limit='+MAX_REWARD_COUNT+'.'};}function checkDataRemoveWithPassportSubmission(a){if(!a['is_data_remove_with_passport']||!a['policies'])return{'id':'C-REP-09','severity':'info','title':'id_data_remove_with_passport\x20submission\x20check\x20(R-D-2)','description':'Skipped:\x20not\x20applicable.','passed':!![]};const b=a['policies']['filter'](d=>d['has_data_from_submission']),c=b['length']===0x0;return{'id':'C-REP-09','severity':c?'info':'block','title':'id_data_remove_with_passport:\x20no\x20data_from_submission\x20(R-D-2\x20Move\x20assert)','description':'id_data_remove_with_passport\x20only\x20removes\x20data\x20by\x20caller-provided\x20id;\x20it\x20cannot\x20consume\x20Passport\x20'+'submissions.\x20Move\x20now\x20checks\x20BOTH\x20id_from_submission\x20AND\x20data_from_submission\x20are\x20None\x20[R-D-2=A],\x20'+'aborting\x20with\x20E_GUARD_SPECIFIED_ID_FROM_SUBMISSION\x20(11).','passed':c,'evidence':c?'no\x20policies\x20with\x20data_from_submission':'offenders:\x20'+b['map'](d=>d['name'])['join'](',\x20'),'fix_hint':'Use\x20id_data_mixed_remove_with_passport\x20for\x20submission-based\x20removal,\x20or\x20unset\x20data_from_submission.'};}function checkIdFromString(a){if(!a['policies'])return{'id':'C-REP-10','severity':'info','title':'id_from\x20string\x20form\x20valid\x20(P1-2\x20parseIdFrom)','description':'Skipped:\x20no\x20policies.','passed':!![]};const b=a['policies']['filter'](d=>{const e=normalizeIdFrom(d['id_from']);return e<0x0||e>0x2;}),c=b['length']===0x0;return{'id':'C-REP-10','severity':c?'info':'warn','title':'id_from\x20string\x20form\x20is\x20recognized\x20(P1-2\x20parseIdFrom)','description':'SDK\x20parseIdFrom\x20normalizes\x20string\x20id_from\x20(e.g.\x20\x22none\x22/\x22clock\x22/\x22signer\x22)\x20to\x20numeric\x20enum\x20before\x20'+'comparison\x20[P1-2\x20fix].\x20Unrecognized\x20values\x20fall\x20through\x20to\x20Move\x20which\x20aborts\x20with\x20E_INVALID_ID_FROM\x20(18).','passed':c,'evidence':c?'all\x20id_from\x20values\x20recognized':'offenders:\x20'+b['map'](d=>d['name']+'(id_from='+d['id_from']+')')['join'](',\x20'),'fix_hint':'Use\x200/1/2,\x20or\x20\x27None\x27/\x27Clock\x27/\x27Signer\x27\x20(case-insensitive).'};}function checkQuoteGuardIsDepended(a){if(!a['has_quote_guard'])return{'id':'C-REP-11','severity':'info','title':'quote_guard\x20is_depended\x20check','description':'Skipped:\x20no\x20quote_guard\x20set.','passed':!![]};const b=a['quote_guard_is_depended']===!![];return{'id':'C-REP-11','severity':b?'info':'block','title':'quote_guard\x20satisfies\x20is_depended\x20(immutable\x20+\x20rep=true\x20+\x20no\x20relies)','description':'When\x20quote_guard\x20is\x20set,\x20it\x20MUST\x20satisfy\x20guard::is_depended\x20(guard.move#L133-135):\x20'+'immutable=true,\x20relies\x20empty,\x20rep=true.\x20Move\x20aborts\x20with\x20E_NEED_DEPENDENT_GUARD\x20(repository.move#L422).\x20'+'VERIFIED:\x20passport.rs#L545-612\x20—\x20check_repository_quote_guard\x20enforces\x20this\x20at\x20query\x20time.\x20'+'quote_guard\x20is\x20a\x20RIGID\x20verification\x20requirement:\x20any\x20guard\x20querying\x20this\x20Repository\x27s\x20data\x20must\x20satisfy\x20it.','passed':b,'evidence':b?'quote_guard\x20is\x20is_depended':'quote_guard\x20NOT\x20is_depended\x20(will\x20abort)','fix_hint':'Ensure\x20the\x20quote_guard\x20Guard\x20object\x20has:\x20immutable=true,\x20relies=empty,\x20rep=true.'};}function checkQuoteGuardSubscriptionDesign(a){if(!a['has_quote_guard'])return{'id':'C-REP-12','severity':'info','title':'quote_guard\x20subscription\x20design\x20check','description':'Skipped:\x20no\x20quote_guard\x20set.','passed':!![]};const b=[];if(!a['quote_guard_verifies_payment'])b['push']('quote_guard\x20does\x20not\x20verify\x20Payment\x20for\x20subscription');if(!a['has_owner_receive'])b['push']('Repository\x20missing\x20owner_receive\x20for\x20Payment\x20revenue');const c=b['length']===0x0;return{'id':'C-REP-12','severity':c?'info':'warn','title':'quote_guard\x20data\x20subscription\x20design\x20—\x20Payment\x20verification\x20+\x20owner_receive\x20revenue','description':'For\x20data\x20subscription\x20pattern\x20(Repository+quote_guard+Payment):\x20'+'(1)\x20quote_guard\x20should\x20verify\x20Payment\x20(for_object\x20matches\x20Repository,\x20amount\x20meets\x20subscription\x20price);\x20'+'(2)\x20Repository\x20should\x20have\x20owner_receive<T>\x20configured\x20to\x20accept\x20Payment\x20as\x20subscription\x20revenue\x20'+'(repository.move#L714-717).\x20VERIFIED:\x20passport.rs#L545-612.\x20'+'DESIGN:\x20user\x20submits\x20Payment\x20via\x20Passport\x20→\x20quote_guard\x20verifies\x20→\x20repository\x20data\x20query\x20passes.','passed':c,'evidence':c?'quote_guard\x20subscription\x20design\x20complete':b['join'](';\x20'),'fix_hint':'Use\x20tpl_repository_quote_guard_subscription\x20(guard-templates.ts)\x20as\x20the\x20design\x20template.'};}export function preCheckRepositoryOp(a){return[checkPolicyCount(a),checkWriteGuardRequiredWhenIdFromNone(a),checkWriteGuardForbiddenWhenIdFromClockSigner(a),checkPolicyGuardCount(a),checkPolicyDescription(a),checkDataSize(a),checkIdCountOnce(a),checkRewardCount(a),checkDataRemoveWithPassportSubmission(a),checkIdFromString(a),checkQuoteGuardIsDepended(a),checkQuoteGuardSubscriptionDesign(a)];}export function canProceedRepositoryOp(a){const b=preCheckRepositoryOp(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 formatRepositoryOpSummary(a){const {canProceed:b,blockers:c,warnings:d,info:e}=canProceedRepositoryOp(a),f=[];return f['push'](b?'✓\x20Repository\x20'+a['op']+'\x20pre-check\x20PASSED':'✗\x20Repository\x20'+a['op']+'\x20pre-check\x20FAILED'),f['push'](''),c['length']>0x0&&(f['push']('BLOCKERS\x20(must\x20fix\x20before\x20operation):'),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');}
@@ -1,12 +0,0 @@
1
- import { type RepositoryIdFromMode } from "./repository-ledger.js";
2
- export declare const REPOSITORY_CONTEXT_VERSION = "1.0.0";
3
- export interface RepositoryContextBundle {
4
- idFromMode?: RepositoryIdFromMode;
5
- summary: string;
6
- }
7
- export interface BuildRepositoryContextInput {
8
- id_from?: number;
9
- name?: string;
10
- }
11
- export declare function buildRepositoryContext(input: BuildRepositoryContextInput): RepositoryContextBundle;
12
- export declare function getRepositoryContextSummary(ctx: RepositoryContextBundle): string;
@@ -1 +0,0 @@
1
- import{getRepositoryIdFrom}from'./repository-ledger.js';export const REPOSITORY_CONTEXT_VERSION='1.0.0';export function buildRepositoryContext(a){const b=a['id_from']!==undefined?getRepositoryIdFrom(a['id_from']):undefined,c=[];return a['name']&&c['push']('policy\x20\x22'+a['name']+'\x22'),b?c['push']('id_from='+b['mode']+'\x20('+b['semantic']+')'):c['push']('id_from\x20not\x20classified'),{'idFromMode':b?.['mode'],'summary':c['join']('\x20·\x20')};}export function getRepositoryContextSummary(a){return a['summary'];}
@@ -1,25 +0,0 @@
1
- export declare const REPOSITORY_LEDGER_VERSION = "1.0.0";
2
- export type RepositoryIdFromMode = "none" | "clock" | "signer";
3
- export interface RepositoryIdFromEntry {
4
- value: number;
5
- mode: RepositoryIdFromMode;
6
- semantic: string;
7
- }
8
- export declare const REPOSITORY_ID_FROM: RepositoryIdFromEntry[];
9
- export interface RepositoryFieldEntry {
10
- field: string;
11
- value_type: string;
12
- semantic: string;
13
- required: boolean;
14
- }
15
- export declare const REPOSITORY_POLICY_FIELDS: RepositoryFieldEntry[];
16
- export interface RepositoryErrorEntry {
17
- code: string;
18
- value: number;
19
- description: string;
20
- }
21
- export declare const REPOSITORY_ERROR_CODES: RepositoryErrorEntry[];
22
- export declare function getRepositoryIdFrom(value: number): RepositoryIdFromEntry | undefined;
23
- export declare function getRepositoryErrorByCode(code: string): RepositoryErrorEntry | undefined;
24
- export declare function getRepositoryErrorByValue(value: number): RepositoryErrorEntry | undefined;
25
- export declare function getRepositoryErrorsCount(): number;
@@ -1 +0,0 @@
1
- export const REPOSITORY_LEDGER_VERSION='1.0.0';export const REPOSITORY_ID_FROM=[{'value':0x0,'mode':'none','semantic':'No\x20auto-id\x20—\x20caller\x20supplies\x20the\x20id\x20(write_guard\x20required,\x20E_POLICY_WRITE_GUARD_REQUIRED).'},{'value':0x1,'mode':'clock','semantic':'Id\x20is\x20auto-generated\x20from\x20clock\x20(timestamp-derived).'},{'value':0x2,'mode':'signer','semantic':'Id\x20is\x20auto-generated\x20from\x20the\x20tx\x20signer\x20address.'}];export const REPOSITORY_POLICY_FIELDS=[{'field':'name','value_type':'string','semantic':'Policy\x20name\x20(unique\x20key\x20within\x20the\x20repository).','required':!![]},{'field':'description','value_type':'string','semantic':'Policy\x20description\x20(≤\x20MAX_POLICY_DESCRIPTION_LEN\x20500\x20bytes).','required':!![]},{'field':'write_guard','value_type':'vector<PolicyGuard>','semantic':'Guards\x20that\x20must\x20pass\x20to\x20write\x20a\x20record\x20(≤\x20MAX_POLICY_GUARD_COUNT\x2010).','required':![]},{'field':'quote_guard','value_type':'Option<address>','semantic':'Guard\x20that\x20must\x20pass\x20to\x20read/quote\x20a\x20record.','required':![]},{'field':'id_from','value_type':'u8','semantic':'Id\x20derivation\x20mode\x20(0=none,\x201=clock,\x202=signer).','required':!![]},{'field':'value_type','value_type':'u8','semantic':'Data\x20value\x20type\x20(VALUE_TYPE).','required':!![]}];export const REPOSITORY_ERROR_CODES=[{'code':'E_POLICY_DESCRIPTION_EXCEEDED','value':0x1,'description':'Policy\x20description\x20>\x20MAX_POLICY_DESCRIPTION_LEN\x20(500).'},{'code':'E_POLICY_GUARD_COUNT_EXCEEDED','value':0x2,'description':'write_guard\x20count\x20>\x20MAX_POLICY_GUARD_COUNT\x20(10).'},{'code':'E_POLICY_COUNT_EXCEEDED','value':0x3,'description':'policy\x20count\x20>\x20MAX_POLICY_COUNT\x20(50).'},{'code':'E_DATA_EXCEEDED','value':0x4,'description':'data\x20size\x20>\x20MAX_DATA_SIZE\x20(40960\x20bytes).'},{'code':'E_ID_COUNT_EXCEEDED','value':0x5,'description':'id\x20count\x20>\x20MAX_ID_COUNT_ONCE\x20(100).'},{'code':'E_QUANTITIES_NOT_EQUAL','value':0x6,'description':'ids\x20and\x20data\x20vector\x20lengths\x20mismatch.'},{'code':'E_POLICY_NOT_FOUND','value':0x7,'description':'Referenced\x20policy\x20name\x20not\x20found.'},{'code':'E_POLICY_ID_FROM_NONE','value':0x8,'description':'Policy\x20id_from\x20is\x20None\x20but\x20caller\x20supplied\x20an\x20id.'},{'code':'E_NEED_PASSPORT','value':0x9,'description':'Operation\x20requires\x20a\x20passport\x20(usage\x20guard).'},{'code':'E_DATA_TYPE_NOT_MATCH','value':0xa,'description':'Data\x20value\x20type\x20does\x20not\x20match\x20policy\x20value_type.'},{'code':'E_GUARD_SPECIFIED_ID_FROM_SUBMISSION','value':0xb,'description':'Guard-specified\x20id_from_submission\x20conflict.'},{'code':'E_NOT_IMPACT_GUARD_IN_PASSPORT','value':0xc,'description':'Guard\x20not\x20marked\x20impactful\x20in\x20passport.'},{'code':'E_GUARD_SPECIFIED_NOT_IN_POLICY','value':0xd,'description':'Guard\x20not\x20in\x20policy\x20write_guard.'},{'code':'E_ID_VECTOR_NOT_ENOUGH','value':0xe,'description':'Not\x20enough\x20ids\x20supplied.'},{'code':'E_DATA_VECTOR_NOT_ENOUGH','value':0xf,'description':'Not\x20enough\x20data\x20supplied.'},{'code':'E_INVALID_ID_IN_GUARD_TABLE','value':0x10,'description':'Invalid\x20id\x20identifier\x20in\x20guard\x20table.'},{'code':'E_INVALID_DATA_IN_GUARD_TABLE','value':0x11,'description':'Invalid\x20data\x20identifier\x20in\x20guard\x20table.'},{'code':'E_INVALID_ID_FROM','value':0x12,'description':'id_from\x20is\x20not\x200/1/2.'},{'code':'E_MAX_REWARD_COUNT_EXCEEDED','value':0x13,'description':'reward\x20count\x20>\x20MAX_REWARD_COUNT\x20(20).'},{'code':'E_GUARD_NOT_SPECIFIED_ID_FROM_SUBMISSION','value':0x14,'description':'Guard\x20id_from_submission\x20missing\x20when\x20required.'},{'code':'E_NEED_DEPENDENT_GUARD','value':0x15,'description':'Dependent\x20guard\x20not\x20satisfied.'},{'code':'E_POLICY_WRITE_GUARD_REQUIRED','value':0x16,'description':'write_guard\x20empty\x20when\x20id_from\x20is\x20None.'},{'code':'E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN','value':0x17,'description':'id_from_submission\x20forbidden\x20when\x20id_from\x20is\x20Clock/Signer.'}];export function getRepositoryIdFrom(a){return REPOSITORY_ID_FROM['find'](b=>b['value']===a);}export function getRepositoryErrorByCode(a){return REPOSITORY_ERROR_CODES['find'](b=>b['code']===a);}export function getRepositoryErrorByValue(a){return REPOSITORY_ERROR_CODES['find'](b=>b['value']===a);}export function getRepositoryErrorsCount(){return REPOSITORY_ERROR_CODES['length'];}
@@ -1,30 +0,0 @@
1
- import { type RepositoryIdFromMode } from "./repository-ledger.js";
2
- export declare const REPOSITORY_PUZZLE_VERSION = "1.0.0";
3
- export interface RepositoryIntentPuzzle {
4
- idFromMode?: RepositoryIdFromMode;
5
- }
6
- export interface RepositoryFieldState {
7
- field: string;
8
- present: boolean;
9
- required: boolean;
10
- }
11
- export interface RepositoryPuzzle {
12
- intent: RepositoryIntentPuzzle;
13
- fields: RepositoryFieldState[];
14
- }
15
- export interface RepositoryPuzzleCompleteness {
16
- complete: boolean;
17
- missing_required: string[];
18
- reason: string;
19
- }
20
- export interface InitRepositoryPuzzleInput {
21
- intent: string;
22
- id_from?: number;
23
- name?: string;
24
- description?: string;
25
- value_type?: number;
26
- write_guard_count?: number;
27
- quote_guard?: string | null;
28
- }
29
- export declare function initRepositoryPuzzleFromIntent(input: InitRepositoryPuzzleInput): RepositoryPuzzle;
30
- export declare function checkRepositoryPuzzleCompleteness(puzzle: RepositoryPuzzle): RepositoryPuzzleCompleteness;
@@ -1 +0,0 @@
1
- import{REPOSITORY_ID_FROM,REPOSITORY_POLICY_FIELDS}from'./repository-ledger.js';export const REPOSITORY_PUZZLE_VERSION='1.0.0';export function initRepositoryPuzzleFromIntent(a){const b=a['id_from']!==undefined?REPOSITORY_ID_FROM['find'](e=>e['value']===a['id_from']):undefined,c={'name':!!a['name'],'description':!!a['description'],'id_from':a['id_from']!==undefined,'value_type':a['value_type']!==undefined,'write_guard':(a['write_guard_count']??0x0)>0x0,'quote_guard':a['quote_guard']!=null&&a['quote_guard']!==''},d=REPOSITORY_POLICY_FIELDS['map'](e=>({'field':e['field'],'present':!!c[e['field']],'required':e['required']}));return{'intent':{'idFromMode':b?.['mode']},'fields':d};}export function checkRepositoryPuzzleCompleteness(a){const b=a['fields']['filter'](d=>d['required']&&!d['present'])['map'](d=>d['field']),c=b['length']===0x0;return{'complete':c,'missing_required':b,'reason':c?'All\x20required\x20policy\x20fields\x20present.':'Missing\x20required:\x20'+b['join'](',\x20')+'.'};}
@@ -1,14 +0,0 @@
1
- export declare const REPOSITORY_TEMPLATES_VERSION = "1.0.0";
2
- export interface RepositoryTemplate {
3
- id: string;
4
- name: string;
5
- description: string;
6
- id_from: number;
7
- value_type: number;
8
- write_guard_required: boolean;
9
- quote_guard_required: boolean;
10
- }
11
- export declare const REPOSITORY_TEMPLATES: RepositoryTemplate[];
12
- export declare function getRepositoryTemplateById(id: string): RepositoryTemplate | undefined;
13
- export declare function listRepositoryTemplates(): RepositoryTemplate[];
14
- export declare function suggestRepositoryTemplateForMode(mode: string): RepositoryTemplate | undefined;
@@ -1 +0,0 @@
1
- import{REPOSITORY_ID_FROM}from'./repository-ledger.js';export const REPOSITORY_TEMPLATES_VERSION='1.0.0';export const REPOSITORY_TEMPLATES=[{'id':'repo_timestamp_log','name':'Append-only\x20timestamp\x20log','description':'Id\x20auto-derived\x20from\x20clock;\x20write\x20protected\x20by\x20a\x20signer\x20guard.','id_from':0x1,'value_type':0x0,'write_guard_required':!![],'quote_guard_required':![]},{'id':'repo_signer_owned','name':'Signer-owned\x20record','description':'Id\x20auto-derived\x20from\x20signer\x20address;\x20write\x20protected\x20by\x20ownership.','id_from':0x2,'value_type':0x0,'write_guard_required':!![],'quote_guard_required':![]},{'id':'repo_caller_supplied','name':'Caller-supplied\x20id','description':'Caller\x20supplies\x20the\x20id;\x20write_guard\x20is\x20mandatory\x20(id_from=None).','id_from':0x0,'value_type':0x0,'write_guard_required':!![],'quote_guard_required':![]}];export function getRepositoryTemplateById(a){return REPOSITORY_TEMPLATES['find'](b=>b['id']===a);}export function listRepositoryTemplates(){return REPOSITORY_TEMPLATES;}export function suggestRepositoryTemplateForMode(a){const b=REPOSITORY_ID_FROM['find'](c=>c['mode']===a);return b?REPOSITORY_TEMPLATES['find'](c=>c['id_from']===b['value']):undefined;}
@@ -1,58 +0,0 @@
1
- export interface SemanticToRepositorySchemaRule {
2
- id: string;
3
- pattern_name: string;
4
- routing_mode: "clock" | "signer" | "guard_caller" | "guard_submission";
5
- semantic_intent: string;
6
- match_keywords: string[];
7
- schema_elements: {
8
- id_from_value: number | string;
9
- required_policy_fields: string[];
10
- write_guard_requirement: "empty" | "non_empty" | "either";
11
- move_entry_point: string;
12
- caller_input_shape: string;
13
- };
14
- constraints: string[];
15
- example: Record<string, unknown>;
16
- }
17
- export declare const SEMANTIC_TO_REPOSITORY_SCHEMA_RULES: SemanticToRepositorySchemaRule[];
18
- export interface RepositoryFieldTranslation {
19
- field_name: string;
20
- move_field?: string;
21
- value_type: string;
22
- semantic: string;
23
- format_example: string;
24
- validation_rules: string[];
25
- }
26
- export declare const REPOSITORY_FIELD_TRANSLATIONS: RepositoryFieldTranslation[];
27
- export interface RepositoryConstraintRule {
28
- id: string;
29
- name: string;
30
- description: string;
31
- validation_logic: string;
32
- failure_message: string;
33
- related_field: string;
34
- }
35
- export declare const REPOSITORY_CONSTRAINT_RULES: RepositoryConstraintRule[];
36
- export interface RepositoryExplainInput {
37
- policies?: RepositoryPolicyInput[];
38
- op?: string;
39
- is_data_remove_with_passport?: boolean;
40
- }
41
- export interface RepositoryPolicyInput {
42
- name: string;
43
- id_from: number | string;
44
- write_guard_count: number;
45
- has_id_from_submission: boolean;
46
- has_data_from_submission: boolean;
47
- }
48
- export interface RepositoryExplanation {
49
- summary: string;
50
- routing_modes: string[];
51
- r_d_1_status: string;
52
- r_d_2_status: string;
53
- p1_1_status: string;
54
- p1_2_status: string;
55
- warnings: string[];
56
- recommendations: string[];
57
- }
58
- export declare function explainRepository(input: RepositoryExplainInput): RepositoryExplanation;
@@ -1 +0,0 @@
1
- import{MAX_POLICY_COUNT,MAX_POLICY_DESCRIPTION_LEN,MAX_POLICY_GUARD_COUNT,MAX_DATA_SIZE,MAX_ID_COUNT_ONCE,MAX_REWARD_COUNT}from'@wowok/wowok';export const SEMANTIC_TO_REPOSITORY_SCHEMA_RULES=[{'id':'P-REP-01','pattern_name':'Clock-routed\x20data\x20(id=timestamp)','routing_mode':'clock','semantic_intent':'Data\x20is\x20keyed\x20by\x20current\x20timestamp\x20(id_from=Clock).\x20Each\x20write\x20produces\x20a\x20unique\x20timestamp-keyed\x20entry.\x20'+'Suitable\x20for\x20append-only\x20logs,\x20time-series\x20records,\x20and\x20audit\x20trails.\x20write_guard\x20may\x20be\x20empty\x20(id\x20is\x20'+'auto-generated\x20and\x20predictable)\x20or\x20non-empty\x20with\x20data_from_submission\x20set\x20(guard\x20supplies\x20the\x20data\x20'+'payload\x20while\x20id\x20comes\x20from\x20the\x20clock\x20—\x20e.g.\x20oracle-fed\x20time-series).','match_keywords':['timestamp','log','audit\x20trail','time-series','append-only','clock'],'schema_elements':{'id_from_value':0x1,'required_policy_fields':['name','description','id_from','value_type','write_guard'],'write_guard_requirement':'either','move_entry_point':'data_when_id_from_set','caller_input_shape':'{\x20name,\x20data\x20}\x20—\x20no\x20id,\x20no\x20write_guard,\x20no\x20Passport'},'constraints':['id_from\x20MUST\x20be\x20Clock\x20(1)','write_guard\x20MAY\x20be\x20empty\x20OR\x20non-empty\x20(R-D-1\x20refined)','If\x20write_guard\x20is\x20non-empty,\x20every\x20PolicyGuard.id_from_submission\x20MUST\x20be\x20None\x20(E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN=23)','data_from_submission\x20MAY\x20be\x20set\x20(used\x20by\x20data_when_id_from_set_with_passport)','Caller\x20uses\x20data_when_id_from_set\x20(no\x20guard)\x20or\x20data_when_id_from_set_with_passport\x20(with\x20guard)','ID\x20is\x20auto-generated\x20from\x20clock::timestamp_ms'],'example':{'name':'audit_log','description':'Append-only\x20audit\x20log\x20keyed\x20by\x20timestamp','id_from':'Clock','value_type':0x0,'write_guard':[]}},{'id':'P-REP-02','pattern_name':'Signer-routed\x20data\x20(id=signer\x20address)','routing_mode':'signer','semantic_intent':'Data\x20is\x20keyed\x20by\x20signer\x20address\x20(id_from=Signer).\x20Each\x20user\x20has\x20at\x20most\x20one\x20data\x20entry\x20per\x20policy.\x20'+'Suitable\x20for\x20user\x20profiles,\x20KYC\x20attestations,\x20per-user\x20settings.\x20write_guard\x20may\x20be\x20empty\x20(signer\x20'+'writes\x20their\x20own\x20data)\x20or\x20non-empty\x20with\x20data_from_submission\x20set\x20(guard\x20supplies\x20the\x20data\x20payload\x20'+'while\x20id\x20comes\x20from\x20the\x20signer\x20—\x20e.g.\x20verified\x20credential\x20insertion).','match_keywords':['profile','user\x20data','kyc','per-user','signer','identity'],'schema_elements':{'id_from_value':0x2,'required_policy_fields':['name','description','id_from','value_type','write_guard'],'write_guard_requirement':'either','move_entry_point':'data_when_id_from_set','caller_input_shape':'{\x20name,\x20data\x20}\x20—\x20no\x20id,\x20no\x20write_guard,\x20no\x20Passport'},'constraints':['id_from\x20MUST\x20be\x20Signer\x20(2)','write_guard\x20MAY\x20be\x20empty\x20OR\x20non-empty\x20(R-D-1\x20refined)','If\x20write_guard\x20is\x20non-empty,\x20every\x20PolicyGuard.id_from_submission\x20MUST\x20be\x20None\x20(E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN=23)','data_from_submission\x20MAY\x20be\x20set\x20(used\x20by\x20data_when_id_from_set_with_passport)','Caller\x20uses\x20data_when_id_from_set\x20(no\x20guard)\x20or\x20data_when_id_from_set_with_passport\x20(with\x20guard)','ID\x20is\x20auto-generated\x20from\x20ctx.sender()'],'example':{'name':'user_profile','description':'Per-user\x20profile\x20data\x20keyed\x20by\x20signer\x20address','id_from':'Signer','value_type':0x0,'write_guard':[]}},{'id':'P-REP-03','pattern_name':'Guard-protected\x20with\x20caller-provided\x20id\x20(Mode\x204)','routing_mode':'guard_caller','semantic_intent':'Data\x20is\x20keyed\x20by\x20caller-provided\x20id\x20(id_from=None).\x20Write\x20authorization\x20requires\x20a\x20Passport\x20submission\x20'+'verifying\x20the\x20guard.\x20Suitable\x20for\x20application-specific\x20keys\x20(order\x20IDs,\x20content\x20hashes,\x20custom\x20identifiers).\x20'+'The\x20guard\x20enforces\x20WHO\x20can\x20write;\x20the\x20caller\x20decides\x20WHAT\x20id\x20to\x20use.','match_keywords':['custom\x20id','order\x20id','content\x20hash','application\x20key','guard\x20protected','passport'],'schema_elements':{'id_from_value':0x0,'required_policy_fields':['name','description','id_from','value_type','write_guard'],'write_guard_requirement':'non_empty','move_entry_point':'id_data_with_passport','caller_input_shape':'{\x20name,\x20items:\x20[{\x20id,\x20data,\x20write_guard\x20}]\x20}\x20—\x20id\x20and\x20data\x20provided\x20by\x20caller,\x20Passport\x20verifies\x20guard'},'constraints':['id_from\x20MUST\x20be\x20None\x20(0)','write_guard\x20MUST\x20be\x20non-empty\x20(R-D-1:\x20E_POLICY_WRITE_GUARD_REQUIRED=22)','Each\x20PolicyGuard\x20MUST\x20have\x20id_from_submission=None\x20AND\x20data_from_submission=None','Caller\x20uses\x20id_data_with_passport\x20entry\x20point','Passport\x20must\x20verify\x20one\x20of\x20the\x20policy\x27s\x20write_guards'],'example':{'name':'order_metadata','description':'Order-specific\x20metadata\x20keyed\x20by\x20order\x20id,\x20guard-protected','id_from':'None','value_type':0x0,'write_guard':[{'guard':'0xguard_addr...','id_from_submission':null,'data_from_submission':null}]}},{'id':'P-REP-04','pattern_name':'Guard-protected\x20with\x20submission-derived\x20id/data\x20(Mode\x205)','routing_mode':'guard_submission','semantic_intent':'Data\x20id\x20and/or\x20data\x20payload\x20are\x20derived\x20from\x20Guard\x20submission\x20values\x20in\x20the\x20Passport.\x20This\x20is\x20the\x20most\x20'+'flexible\x20mode:\x20the\x20guard\x20can\x20compute\x20both\x20the\x20key\x20and\x20the\x20value\x20from\x20its\x20internal\x20table.\x20Suitable\x20for\x20'+'bridges\x20(where\x20the\x20guard\x20verifies\x20an\x20external\x20event\x20and\x20outputs\x20the\x20bridged\x20amount),\x20oracle-fed\x20data,\x20'+'and\x20complex\x20authorization\x20patterns.','match_keywords':['oracle','bridge','submission','guard\x20derived','computed\x20id','computed\x20data'],'schema_elements':{'id_from_value':0x0,'required_policy_fields':['name','description','id_from','value_type','write_guard'],'write_guard_requirement':'non_empty','move_entry_point':'id_data_mixed_with_passport','caller_input_shape':'{\x20name,\x20items:\x20[{\x20write_guard,\x20id?,\x20data?\x20}]\x20}\x20—\x20id/data\x20omitted\x20where\x20submission\x20provides\x20them'},'constraints':['id_from\x20MUST\x20be\x20None\x20(0)','write_guard\x20MUST\x20be\x20non-empty\x20(R-D-1:\x20E_POLICY_WRITE_GUARD_REQUIRED=22)','Each\x20PolicyGuard\x20may\x20have\x20id_from_submission\x20and/or\x20data_from_submission\x20set','Caller\x20uses\x20id_data_mixed_with_passport\x20entry\x20point','SDK\x20hasSubmissionSettings\x20must\x20check\x20BOTH\x20id_from_submission\x20AND\x20data_from_submission\x20(P1-1\x20fix)','Passport\x20must\x20verify\x20the\x20specified\x20write_guards'],'example':{'name':'oracle_price','description':'Oracle-fed\x20price\x20data,\x20id\x20and\x20data\x20both\x20from\x20guard\x20submission','id_from':'None','value_type':0x0,'write_guard':[{'guard':'0xoracle_guard_addr...','id_from_submission':0x0,'data_from_submission':0x1}]}}];export const REPOSITORY_FIELD_TRANSLATIONS=[{'field_name':'policies','value_type':'PolicyRule[]','semantic':'List\x20of\x20policy\x20rules\x20defining\x20data\x20write\x20permissions\x20and\x20routing.\x20Each\x20policy\x20is\x20a\x20named\x20data\x20slot\x20'+'with\x20its\x20own\x20write_guard\x20list\x20and\x20id_from\x20routing\x20mode.\x20Operations\x20(data_add/data_remove)\x20reference\x20'+'policies\x20by\x20name.','format_example':'[{\x20name:\x20\x27audit_log\x27,\x20id_from:\x20\x27Clock\x27,\x20...\x20}]','validation_rules':['Array\x20length\x20≤\x20MAX_POLICY_COUNT\x20('+MAX_POLICY_COUNT+')','Each\x20policy\x20name\x20must\x20be\x20unique\x20within\x20the\x20Repository','Move\x20aborts\x20with\x20E_POLICY_COUNT_EXCEEDED\x20(3)\x20on\x20overflow','Move\x20aborts\x20with\x20E_POLICY_NOT_FOUND\x20(7)\x20when\x20name\x20not\x20found']},{'field_name':'policies[].name','move_field':'PolicyRule.name','value_type':'string','semantic':'Policy\x20name.\x20Acts\x20as\x20the\x20key\x20for\x20data_add/data_remove\x20operations.\x20Must\x20be\x20unique\x20within\x20the\x20Repository.\x20'+'Cannot\x20be\x20empty\x20if\x20NAME_ALLOW_EMPTY\x20is\x20not\x20set.','format_example':'audit_log','validation_rules':['Non-empty\x20string\x20(unless\x20NAME_ALLOW_EMPTY)','Must\x20match\x20an\x20existing\x20policy\x20name\x20in\x20data_add/data_remove\x20operations']},{'field_name':'policies[].description','move_field':'PolicyRule.description','value_type':'string','semantic':'Human-readable\x20description\x20of\x20what\x20the\x20policy\x20is\x20for.\x20Helps\x20with\x20auditing\x20and\x20tooling.','format_example':'Append-only\x20audit\x20log\x20keyed\x20by\x20timestamp','validation_rules':['Length\x20≤\x20MAX_POLICY_DESCRIPTION_LEN\x20('+MAX_POLICY_DESCRIPTION_LEN+')','Move\x20aborts\x20with\x20E_POLICY_DESCRIPTION_EXCEEDED\x20(1)']},{'field_name':'policies[].id_from','move_field':'PolicyRule.id_from','value_type':'u8\x20(number\x20|\x20\x27None\x27\x20|\x20\x27Clock\x27\x20|\x20\x27Signer\x27)','semantic':'Source\x20of\x20data\x20ID\x20when\x20writing\x20data.\x20None\x20(0):\x20caller\x20provides\x20id;\x20Clock\x20(1):\x20id=timestamp;\x20'+'Signer\x20(2):\x20id=signer\x20address.\x20Determines\x20which\x20entry\x20point\x20to\x20use\x20for\x20data\x20operations.\x20'+'SDK\x20parseIdFrom\x20normalizes\x20string\x20forms\x20before\x20comparison\x20[P1-2\x20fix].','format_example':'0,\x201,\x202,\x20\x27None\x27,\x20\x27Clock\x27,\x20\x27Signer\x27','validation_rules':['Must\x20be\x20one\x20of:\x200,\x201,\x202,\x20\x27None\x27,\x20\x27Clock\x27,\x20\x27Signer\x27\x20(case-insensitive)','Move\x20aborts\x20with\x20E_INVALID_ID_FROM\x20(18)\x20for\x20invalid\x20u8\x20values','R-D-1\x20(refined):\x20None\x20requires\x20non-empty\x20write_guard;\x20Clock/Signer\x20allows\x20non-empty\x20write_guard\x20but\x20every\x20PolicyGuard.id_from_submission\x20MUST\x20be\x20None\x20(data_from_submission\x20still\x20allowed)']},{'field_name':'policies[].write_guard','move_field':'PolicyRule.write_guard','value_type':'PolicyGuard[]','semantic':'List\x20of\x20Guard\x20objects\x20that\x20must\x20be\x20verified\x20(via\x20Passport)\x20to\x20write\x20data.\x20Each\x20PolicyGuard\x20maps\x20to\x20a\x20'+'Guard\x20object\x20and\x20optionally\x20specifies\x20id_from_submission\x20/\x20data_from_submission\x20for\x20Mode\x204/5\x20routing.\x20'+'R-D-1\x20(refined):\x20must\x20be\x20non-empty\x20when\x20id_from=None;\x20when\x20id_from=Clock/Signer,\x20MAY\x20be\x20non-empty\x20but\x20'+'every\x20PolicyGuard.id_from_submission\x20MUST\x20be\x20None\x20(data_from_submission\x20is\x20still\x20allowed,\x20enabling\x20Mode\x202b\x20'+'where\x20id\x20is\x20auto-generated\x20from\x20clock/signer\x20while\x20data\x20comes\x20from\x20the\x20guard\x20submission).','format_example':'[{\x20guard:\x20\x270xaddr...\x27,\x20id_from_submission:\x200,\x20data_from_submission:\x201\x20}]','validation_rules':['Array\x20length\x20≤\x20MAX_POLICY_GUARD_COUNT\x20('+MAX_POLICY_GUARD_COUNT+')\x20per\x20policy','Move\x20aborts\x20with\x20E_POLICY_GUARD_COUNT_EXCEEDED\x20(2)','R-D-1:\x20E_POLICY_WRITE_GUARD_REQUIRED\x20(22)\x20if\x20empty\x20when\x20id_from=None','R-D-1:\x20E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN\x20(23)\x20if\x20any\x20PolicyGuard.id_from_submission\x20is\x20non-null\x20when\x20id_from=Clock/Signer\x20(data_from_submission\x20still\x20allowed)']},{'field_name':'policies[].write_guard[].id_from_submission','move_field':'PolicyGuard.id_from_submission','value_type':'Option<u8>\x20(number\x20|\x20null)','semantic':'Guard\x20table\x20data\x20index\x20whose\x20value\x20is\x20the\x20ID\x20of\x20the\x20data\x20to\x20be\x20written.\x20When\x20set,\x20the\x20ID\x20comes\x20from\x20'+'the\x20Passport\x20submission\x20(Mode\x205).\x20When\x20null,\x20the\x20caller\x20must\x20provide\x20the\x20ID\x20(Mode\x204).\x20'+'R-D-1\x20(refined):\x20MUST\x20be\x20null\x20when\x20policy\x20id_from=Clock/Signer\x20(id\x20is\x20auto-generated;\x20setting\x20this\x20'+'would\x20conflict\x20with\x20id_from\x20routing).\x20data_from_submission\x20is\x20still\x20allowed\x20in\x20that\x20case\x20(Mode\x202b).','format_example':'0,\x201,\x202,\x20or\x20null','validation_rules':['Optional\x20(null\x20→\x20caller\x20provides\x20id)','Guard\x20must\x20have\x20is_identifier_address_compatible(identifier)','Move\x20aborts\x20with\x20E_INVALID_ID_IN_GUARD_TABLE\x20(16)\x20if\x20incompatible','R-D-1:\x20MUST\x20be\x20null\x20when\x20policy\x20id_from=Clock/Signer\x20(E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN=23)']},{'field_name':'policies[].write_guard[].data_from_submission','move_field':'PolicyGuard.data_from_submission','value_type':'Option<u8>\x20(number\x20|\x20null)','semantic':'Guard\x20table\x20data\x20index\x20whose\x20value\x20is\x20the\x20data\x20to\x20be\x20written.\x20When\x20set,\x20the\x20data\x20comes\x20from\x20the\x20'+'Passport\x20submission\x20(Mode\x205).\x20When\x20null,\x20the\x20caller\x20provides\x20the\x20data\x20(Mode\x204).\x20'+'R-D-2:\x20must\x20be\x20null\x20for\x20id_data_remove_with_passport\x20(removal\x20cannot\x20consume\x20submission\x20data).','format_example':'0,\x201,\x202,\x20or\x20null','validation_rules':['Optional\x20(null\x20→\x20caller\x20provides\x20data)','Guard\x20must\x20have\x20has_identifier(identifier)','Move\x20aborts\x20with\x20E_INVALID_DATA_IN_GUARD_TABLE\x20(17)\x20if\x20missing','R-D-2:\x20E_GUARD_SPECIFIED_ID_FROM_SUBMISSION\x20(11)\x20if\x20set\x20in\x20id_data_remove_with_passport']},{'field_name':'data_add\x20/\x20data_remove','value_type':'SignerOrClock\x20|\x20{\x20name,\x20items\x20}','semantic':'Data\x20operations.\x20For\x20Clock/Signer\x20policies,\x20use\x20SignerOrClock\x20form\x20({name,\x20data}\x20or\x20{name}).\x20'+'For\x20None\x20policies,\x20use\x20items\x20form\x20with\x20id\x20+\x20write_guard\x20per\x20item.\x20SDK\x20hasSubmissionSettings\x20helper\x20'+'routes\x20to\x20the\x20correct\x20Move\x20entry\x20point\x20based\x20on\x20PolicyGuard\x20settings\x20[P1-1\x20fix].','format_example':'{\x20name:\x20\x27audit_log\x27,\x20data:\x20...\x20}\x20or\x20{\x20name:\x20\x27order_meta\x27,\x20items:\x20[{\x20id,\x20data,\x20write_guard\x20}]\x20}','validation_rules':['Policy\x20name\x20must\x20exist\x20in\x20Repository\x20(E_POLICY_NOT_FOUND=7)','write_guard\x20must\x20be\x20in\x20policy\x20(E_GUARD_SPECIFIED_NOT_IN_POLICY=13)','ID\x20count\x20≤\x20MAX_ID_COUNT_ONCE\x20per\x20call','Data\x20size\x20≤\x20MAX_DATA_SIZE\x20per\x20value']},{'field_name':'rewards','value_type':'{\x20op:\x20\x27add\x27|\x27set\x27|\x27remove\x27|\x27clear\x27,\x20objects:\x20string[]\x20}','semantic':'Reward\x20objects\x20referenced\x20by\x20this\x20Repository.\x20Rewards\x20incentivize\x20data\x20contribution.\x20When\x20a\x20writer\x20'+'adds\x20data,\x20they\x20may\x20claim\x20a\x20reward\x20(if\x20the\x20guard\x20verifies\x20eligibility).','format_example':'{\x20op:\x20\x27add\x27,\x20objects:\x20[\x270xreward1...\x27,\x20\x270xreward2...\x27]\x20}','validation_rules':['Total\x20reward\x20count\x20≤\x20MAX_REWARD_COUNT\x20('+MAX_REWARD_COUNT+')','Move\x20aborts\x20with\x20E_MAX_REWARD_COUNT_EXCEEDED\x20(19)','Reward\x20objects\x20must\x20be\x20properly\x20configured\x20(guard,\x20amounts,\x20recipients)']}];export const REPOSITORY_CONSTRAINT_RULES=[{'id':'REP_C_01','name':'policy\x20count\x20within\x20limit','description':'Total\x20policies\x20in\x20a\x20Repository\x20must\x20be\x20≤\x20MAX_POLICY_COUNT\x20('+MAX_POLICY_COUNT+').','validation_logic':'existing_policies\x20+\x20new_policies\x20<=\x20MAX_POLICY_COUNT','failure_message':'Policy\x20count\x20exceeds\x20MAX_POLICY_COUNT\x20('+MAX_POLICY_COUNT+')\x20—\x20E_POLICY_COUNT_EXCEEDED\x20(3)','related_field':'policies'},{'id':'REP_C_02','name':'write_guard\x20required\x20when\x20id_from=None\x20(R-D-1)','description':'When\x20id_from\x20is\x20None,\x20write_guard\x20MUST\x20be\x20non-empty\x20to\x20prevent\x20unauthorized\x20writes.','validation_logic':'id_from\x20==\x20None\x20=>\x20write_guard.length\x20>\x200','failure_message':'id_from=None\x20requires\x20non-empty\x20write_guard\x20—\x20E_POLICY_WRITE_GUARD_REQUIRED\x20(22)','related_field':'policies[].write_guard'},{'id':'REP_C_03','name':'id_from_submission\x20forbidden\x20when\x20id_from=Clock/Signer\x20(R-D-1\x20refined)','description':'When\x20id_from\x20is\x20Clock\x20or\x20Signer,\x20every\x20PolicyGuard.id_from_submission\x20MUST\x20be\x20None\x20(id\x20is\x20auto-generated;\x20data_from_submission\x20is\x20still\x20allowed).','validation_logic':'(id_from\x20==\x20Clock\x20||\x20id_from\x20==\x20Signer)\x20=>\x20all\x20write_guard[].id_from_submission\x20==\x20null','failure_message':'id_from=Clock/Signer\x20requires\x20id_from_submission=null\x20on\x20all\x20guards\x20—\x20E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN\x20(23)','related_field':'policies[].write_guard[].id_from_submission'},{'id':'REP_C_04','name':'policy\x20guard\x20count\x20within\x20limit','description':'Each\x20policy\x20write_guard\x20list\x20must\x20be\x20≤\x20MAX_POLICY_GUARD_COUNT\x20('+MAX_POLICY_GUARD_COUNT+').','validation_logic':'policy.write_guard.length\x20<=\x20MAX_POLICY_GUARD_COUNT','failure_message':'Policy\x20guard\x20count\x20exceeds\x20MAX_POLICY_GUARD_COUNT\x20('+MAX_POLICY_GUARD_COUNT+')\x20—\x20E_POLICY_GUARD_COUNT_EXCEEDED\x20(2)','related_field':'policies[].write_guard'},{'id':'REP_C_05','name':'data\x20size\x20within\x20limit','description':'Each\x20data\x20value\x20must\x20be\x20≤\x20MAX_DATA_SIZE\x20('+MAX_DATA_SIZE+')\x20bytes.','validation_logic':'data.length\x20<=\x20MAX_DATA_SIZE','failure_message':'Data\x20value\x20exceeds\x20MAX_DATA_SIZE\x20('+MAX_DATA_SIZE+'\x20bytes)\x20—\x20E_DATA_EXCEEDED\x20(4)','related_field':'data_add.data'},{'id':'REP_C_06','name':'id\x20count\x20per\x20op\x20within\x20limit','description':'A\x20single\x20Repository\x20call\x20may\x20operate\x20on\x20at\x20most\x20MAX_ID_COUNT_ONCE\x20('+MAX_ID_COUNT_ONCE+')\x20IDs.','validation_logic':'id_count\x20<=\x20MAX_ID_COUNT_ONCE','failure_message':'ID\x20count\x20exceeds\x20MAX_ID_COUNT_ONCE\x20('+MAX_ID_COUNT_ONCE+')\x20—\x20E_ID_COUNT_EXCEEDED\x20(5)','related_field':'data_add.items[].id\x20/\x20data_remove.items[].id'},{'id':'REP_C_07','name':'data_from_submission\x20null\x20in\x20id_data_remove_with_passport\x20(R-D-2)','description':'id_data_remove_with_passport\x20only\x20removes\x20data\x20by\x20caller\x20id;\x20it\x20cannot\x20consume\x20Passport\x20submissions.\x20'+'Both\x20id_from_submission\x20AND\x20data_from_submission\x20must\x20be\x20None.','validation_logic':'is_data_remove_with_passport\x20=>\x20!has_id_from_submission\x20&&\x20!has_data_from_submission','failure_message':'id_data_remove_with_passport\x20cannot\x20have\x20id_from_submission\x20or\x20data_from_submission\x20—\x20E_GUARD_SPECIFIED_ID_FROM_SUBMISSION\x20(11)','related_field':'policies[].write_guard[].data_from_submission'},{'id':'REP_C_08','name':'hasSubmissionSettings\x20checks\x20both\x20submission\x20fields\x20(P1-1)','description':'SDK\x20hasSubmissionSettings\x20helper\x20must\x20check\x20BOTH\x20id_from_submission\x20AND\x20data_from_submission\x20to\x20'+'correctly\x20route\x20Mode\x205\x20(id_data_mixed_with_passport).','validation_logic':'hasSubmissionSettings\x20=\x20(id_from_submission\x20!=\x20null)\x20||\x20(data_from_submission\x20!=\x20null)','failure_message':'Mode\x205\x20routing\x20missed\x20if\x20only\x20id_from_submission\x20is\x20checked\x20(P1-1\x20fix)','related_field':'policies[].write_guard'},{'id':'REP_C_09','name':'quote_guard\x20must\x20be\x20is_depended\x20(immutable\x20+\x20rep=true\x20+\x20no\x20relies)','description':'When\x20quote_guard\x20is\x20set\x20on\x20a\x20policy,\x20it\x20MUST\x20satisfy\x20guard::is_depended\x20(guard.move#L133-135):\x20'+'immutable=true,\x20relies\x20empty,\x20rep=true.\x20Move\x20aborts\x20with\x20E_NEED_DEPENDENT_GUARD\x20(repository.move#L422).\x20'+'VERIFIED:\x20passport.rs#L545-612\x20—\x20check_repository_quote_guard\x20enforces\x20this\x20when\x20any\x20guard\x20queries\x20'+'this\x20Repository\x27s\x20data\x20(query\x201167).\x20quote_guard\x20is\x20a\x20RIGID\x20verification\x20requirement.','validation_logic':'quote_guard\x20!=\x20null\x20=>\x20guard.is_depended\x20(immutable\x20&&\x20relies.empty\x20&&\x20rep)','failure_message':'quote_guard\x20must\x20be\x20is_depended\x20—\x20E_NEED_DEPENDENT_GUARD\x20(repository.move#L422)','related_field':'policies[].quote_guard'},{'id':'REP_C_10','name':'quote_guard\x20data\x20subscription\x20design\x20(Payment\x20verification\x20+\x20owner_receive)','description':'For\x20data\x20subscription\x20pattern:\x20(1)\x20quote_guard\x20should\x20verify\x20Payment\x20(for_object\x20matches\x20Repository,\x20'+'amount\x20meets\x20subscription\x20price);\x20(2)\x20Repository\x20should\x20have\x20owner_receive<T>\x20configured\x20to\x20accept\x20'+'Payment\x20as\x20subscription\x20revenue\x20(repository.move#L714-717).\x20'+'DESIGN:\x20user\x20submits\x20Payment\x20via\x20Passport\x20→\x20quote_guard\x20verifies\x20→\x20impack_list\x20updated\x20→\x20repository\x20'+'data\x20query\x20passes.\x20\x27On-chain\x20data\x20is\x20consumed\x20by\x20guard\x20verifiers.\x27','validation_logic':'quote_guard\x20!=\x20null\x20=>\x20quote_guard_verifies_payment\x20&&\x20repository_has_owner_receive','failure_message':'quote_guard\x20subscription\x20incomplete:\x20missing\x20Payment\x20verification\x20or\x20owner_receive\x20revenue','related_field':'policies[].quote_guard'}];function normalizeIdFrom(a){if(typeof a==='number')return a;const b=String(a)['toLowerCase']();if(b==='none')return 0x0;if(b==='clock')return 0x1;if(b==='signer')return 0x2;const c=Number(a);return Number['isNaN'](c)?-0x1:c;}export function explainRepository(a){const b=[],c=[],d=[];let e=0x0,f=0x0,g=!![],h=!![];if(a['policies'])for(const n of a['policies']){const o=normalizeIdFrom(n['id_from']);(o<0x0||o>0x2)&&(h=![],b['push']('Policy\x20\x22'+n['name']+'\x22:\x20id_from=\x22'+n['id_from']+'\x22\x20not\x20recognized\x20(P1-2\x20parseIdFrom)'));o===0x0&&n['write_guard_count']===0x0&&(e++,b['push']('Policy\x20\x22'+n['name']+'\x22:\x20id_from=None\x20+\x20empty\x20write_guard\x20violates\x20R-D-1\x20(E_POLICY_WRITE_GUARD_REQUIRED=22)'));(o===0x1||o===0x2)&&n['has_id_from_submission']&&(e++,b['push']('Policy\x20\x22'+n['name']+'\x22:\x20id_from=Clock/Signer\x20+\x20id_from_submission\x20set\x20violates\x20R-D-1\x20(E_POLICY_ID_FROM_SUBMISSION_FORBIDDEN=23)'));a['is_data_remove_with_passport']&&n['has_data_from_submission']&&(f++,b['push']('Policy\x20\x22'+n['name']+'\x22:\x20data_from_submission\x20set\x20but\x20used\x20in\x20id_data_remove_with_passport\x20violates\x20R-D-2'));if(o===0x0&&(n['has_id_from_submission']||n['has_data_from_submission']))n['has_data_from_submission']&&!n['has_id_from_submission']?d['push'](n['name']+':\x20Mode\x205\x20(data_from_submission\x20only)\x20—\x20SDK\x20hasSubmissionSettings\x20correctly\x20detects\x20[P1-1]'):d['push'](n['name']+':\x20Mode\x205\x20(id_data_mixed_with_passport)');else{if(o===0x0&&n['write_guard_count']>0x0)d['push'](n['name']+':\x20Mode\x204\x20(Guard\x20+\x20caller\x20id,\x20id_data_with_passport)');else{if((o===0x1||o===0x2)&&n['write_guard_count']>0x0)d['push'](n['name']+':\x20Mode\x202b\x20(auto-id\x20+\x20guard,\x20data_when_id_from_set_with_passport)');else{if(o===0x1)d['push'](n['name']+':\x20Mode\x201\x20(Clock-routed,\x20data_when_id_from_set)');else o===0x2?d['push'](n['name']+':\x20Mode\x202\x20(Signer-routed,\x20data_when_id_from_set)'):d['push'](n['name']+':\x20unknown/invalid\x20routing');}}}}if(e>0x0)c['push']('Fix\x20R-D-1\x20violations:\x20align\x20write_guard\x20presence\x20with\x20id_from');if(f>0x0)c['push']('Fix\x20R-D-2\x20violations:\x20remove\x20data_from_submission\x20for\x20id_data_remove_with_passport');if(!h)c['push']('Use\x20recognized\x20id_from\x20values:\x200/1/2\x20or\x20\x27None\x27/\x27Clock\x27/\x27Signer\x27');if(d['length']===0x0)c['push']('Define\x20at\x20least\x20one\x20policy\x20to\x20enable\x20data\x20operations');const i=e===0x0?'PASS\x20(all\x20policies\x20satisfy\x20R-D-1)':'FAIL\x20('+e+'\x20violation(s))',j=f===0x0?'PASS\x20(no\x20R-D-2\x20violations)':'FAIL\x20('+f+'\x20violation(s))',k=g?'PASS\x20(hasSubmissionSettings\x20checks\x20both\x20fields)':'FAIL',l=h?'PASS\x20(all\x20id_from\x20values\x20recognized)':'FAIL\x20(unrecognized\x20id_from\x20values)',m='Repository\x20has\x20'+(a['policies']?.['length']??0x0)+'\x20policy(ies).\x20'+('R-D-1:\x20'+i+'.\x20R-D-2:\x20'+j+'.\x20P1-1:\x20'+k+'.\x20P1-2:\x20'+l+'.');return{'summary':m,'routing_modes':d,'r_d_1_status':i,'r_d_2_status':j,'p1_1_status':k,'p1_2_status':l,'warnings':b,'recommendations':c};}
@@ -1,25 +0,0 @@
1
- export declare const RESOURCE_CONFIRM_VERSION = "1.0.0";
2
- export type ConfirmSeverity = "block" | "warn" | "info";
3
- export interface ResourceConfirmItem {
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 ResourceOpCheckInput {
13
- tags_count?: number;
14
- tag_set_return_ignored?: boolean;
15
- is_destroy?: boolean;
16
- expects_resource_permission?: boolean;
17
- }
18
- export declare function preCheckResourceOp(input: ResourceOpCheckInput): ResourceConfirmItem[];
19
- export declare function canProceedResourceOp(input: ResourceOpCheckInput): {
20
- canProceed: boolean;
21
- blockers: ResourceConfirmItem[];
22
- warnings: ResourceConfirmItem[];
23
- info: ResourceConfirmItem[];
24
- };
25
- export declare function formatResourceOpSummary(input: ResourceOpCheckInput): string;
@@ -1 +0,0 @@
1
- import{MAX_TAGS_COUNT}from'@wowok/wowok';export const RESOURCE_CONFIRM_VERSION='1.0.0';function checkTagsCount(a){if(a['tags_count']===undefined)return{'id':'C-RESOURCE-01','severity':'info','title':'tags_count\x20below\x20MAX_TAGS_COUNT\x20('+MAX_TAGS_COUNT+')','description':'add_object_tags\x20aborts\x20with\x20E_TAGS_COUNT_EXCEEDED\x20(1)\x20at\x20the\x20boundary.','passed':!![],'evidence':'not\x20provided'};const b=a['tags_count']<MAX_TAGS_COUNT;return{'id':'C-RESOURCE-01','severity':b?'info':'block','title':'tags_count\x20below\x20MAX_TAGS_COUNT\x20('+MAX_TAGS_COUNT+')','description':'A\x20single\x20object\x27s\x20AddressTag.tags\x20may\x20hold\x20up\x20to\x20MAX_TAGS_COUNT='+MAX_TAGS_COUNT+'\x20entries.\x20add_object_tags\x20aborts\x20with\x20E_TAGS_COUNT_EXCEEDED\x20(1).','passed':b,'evidence':'tags_count='+a['tags_count']+',\x20limit='+MAX_TAGS_COUNT,'fix_hint':'Remove\x20stale\x20tags\x20or\x20shard\x20across\x20multiple\x20Resource\x20objects.'};}function checkTagSetReturn(a){const b=!!a['tag_set_return_ignored'];return{'id':'C-RESOURCE-02','severity':b?'warn':'info','title':'tag_set\x20return\x20value\x20is\x20surfaced\x20(duplicate\x20detection)','description':'tag_set\x20returns\x20bool:\x20true=new\x20tag\x20added,\x20false=duplicate\x20skipped.\x20Ignoring\x20it\x20masks\x20idempotency\x20intent.','passed':!b,'evidence':b?'tag_set_return_ignored=true':'return\x20value\x20consumed','fix_hint':'Expose\x20tag_set\x27s\x20bool\x20to\x20the\x20caller;\x20surface\x20\x27tag\x20already\x20existed\x27\x20when\x20false.'};}function checkDestroy(a){if(!a['is_destroy'])return{'id':'C-RESOURCE-03','severity':'info','title':'destroy\x20is\x20irreversible\x20—\x20confirm\x20no\x20live\x20references','description':'Resource.destroy\x20deletes\x20the\x20object\x20and\x20its\x20ParentTable\x20in\x20place\x20(no\x20archive/rollback).','passed':!![],'evidence':'not\x20destroying'};return{'id':'C-RESOURCE-03','severity':'warn','title':'destroy\x20is\x20irreversible\x20—\x20no\x20recovery\x20mechanism','description':'Once\x20destroyed,\x20the\x20Resource\x20id\x20is\x20permanently\x20invalid\x20and\x20all\x20tags\x20are\x20lost.\x20Confirm\x20no\x20Personal/Entity\x20reference\x20it.','passed':![],'evidence':'is_destroy=true','fix_hint':'Verify\x20no\x20owner\x20references\x20remain\x20before\x20calling\x20destroy.'};}function checkPermission(a){const b=!!a['expects_resource_permission'];return{'id':'C-RESOURCE-04','severity':b?'warn':'info','title':'Resource\x20has\x20no\x20own\x20Permission\x20—\x20caller\x20must\x20gate\x20access','description':'All\x20Resource\x20functions\x20are\x20public(package)/public\x20with\x20no\x20on-chain\x20permission\x20check;\x20the\x20calling\x20module\x20(Personal/Entity)\x20enforces\x20its\x20own\x20gate.','passed':!b,'evidence':b?'expects_resource_permission=true\x20(none\x20exists)':'caller-side\x20gating\x20assumed','fix_hint':'Enforce\x20permission\x20in\x20the\x20calling\x20module\x20before\x20invoking\x20Resource\x20functions.'};}export function preCheckResourceOp(a){return[checkTagsCount(a),checkTagSetReturn(a),checkDestroy(a),checkPermission(a)];}export function canProceedResourceOp(a){const b=preCheckResourceOp(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 formatResourceOpSummary(a){const {canProceed:b,blockers:c,warnings:d}=canProceedResourceOp(a),e=[b?'✓\x20Resource\x20operation\x20pre-check\x20PASSED':'✗\x20Resource\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');}