@wowok/agent-mcp 2.3.14 → 2.3.18

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 (189) hide show
  1. package/dist/config/index.d.ts +1 -0
  2. package/dist/config/index.js +1 -0
  3. package/dist/config/runtime.d.ts +26 -0
  4. package/dist/config/runtime.js +217 -0
  5. package/dist/customer/index.d.ts +9 -0
  6. package/dist/customer/index.js +9 -0
  7. package/dist/customer/industry-risks.d.ts +40 -0
  8. package/dist/customer/industry-risks.js +438 -0
  9. package/dist/customer/info-puzzle.d.ts +102 -0
  10. package/dist/customer/info-puzzle.js +312 -0
  11. package/dist/customer/order-monitor.d.ts +75 -0
  12. package/dist/customer/order-monitor.js +327 -0
  13. package/dist/customer/order-strategy.d.ts +36 -0
  14. package/dist/customer/order-strategy.js +373 -0
  15. package/dist/customer/post-purchase.d.ts +42 -0
  16. package/dist/customer/post-purchase.js +350 -0
  17. package/dist/customer/reminder-system.d.ts +42 -0
  18. package/dist/customer/reminder-system.js +295 -0
  19. package/dist/customer/risk-assessment.d.ts +8 -0
  20. package/dist/customer/risk-assessment.js +337 -0
  21. package/dist/customer/types.d.ts +193 -0
  22. package/dist/customer/types.js +13 -0
  23. package/dist/customer/user-preferences.d.ts +70 -0
  24. package/dist/customer/user-preferences.js +460 -0
  25. package/dist/experience/experience-reuse.d.ts +10 -0
  26. package/dist/experience/experience-reuse.js +103 -0
  27. package/dist/experience/index.d.ts +6 -0
  28. package/dist/experience/index.js +5 -0
  29. package/dist/experience/intent-distill.d.ts +3 -0
  30. package/dist/experience/intent-distill.js +83 -0
  31. package/dist/experience/realtime-feedback.d.ts +5 -0
  32. package/dist/experience/realtime-feedback.js +94 -0
  33. package/dist/experience/types.d.ts +50 -0
  34. package/dist/experience/types.js +1 -0
  35. package/dist/experience/user-profile.d.ts +25 -0
  36. package/dist/experience/user-profile.js +171 -0
  37. package/dist/index.js +842 -371
  38. package/dist/knowledge/acquisition-flywheel.d.ts +53 -0
  39. package/dist/knowledge/acquisition-flywheel.js +192 -0
  40. package/dist/knowledge/arbitration-trust.d.ts +24 -0
  41. package/dist/knowledge/arbitration-trust.js +117 -0
  42. package/dist/knowledge/audit-rules.d.ts +28 -0
  43. package/dist/knowledge/audit-rules.js +141 -0
  44. package/dist/knowledge/demand-matching.d.ts +29 -0
  45. package/dist/knowledge/demand-matching.js +132 -0
  46. package/dist/knowledge/dynamic-pricing.d.ts +31 -0
  47. package/dist/knowledge/dynamic-pricing.js +87 -0
  48. package/dist/knowledge/flywheel-loop.d.ts +87 -0
  49. package/dist/knowledge/flywheel-loop.js +378 -0
  50. package/dist/knowledge/glossary.d.ts +18 -0
  51. package/dist/knowledge/glossary.js +209 -0
  52. package/dist/knowledge/guard-ledger.d.ts +19 -0
  53. package/dist/knowledge/guard-ledger.js +219 -0
  54. package/dist/knowledge/guard-puzzle.d.ts +93 -0
  55. package/dist/knowledge/guard-puzzle.js +278 -0
  56. package/dist/knowledge/guard-risk.d.ts +60 -0
  57. package/dist/knowledge/guard-risk.js +474 -0
  58. package/dist/knowledge/guard-translation.d.ts +46 -0
  59. package/dist/knowledge/guard-translation.js +487 -0
  60. package/dist/knowledge/index.d.ts +77 -0
  61. package/dist/knowledge/index.js +79 -0
  62. package/dist/knowledge/industry-evolution.d.ts +82 -0
  63. package/dist/knowledge/industry-evolution.js +323 -0
  64. package/dist/knowledge/industry-generalizer.d.ts +17 -0
  65. package/dist/knowledge/industry-generalizer.js +381 -0
  66. package/dist/knowledge/industry-registry.d.ts +48 -0
  67. package/dist/knowledge/industry-registry.js +187 -0
  68. package/dist/knowledge/intent-metrics.d.ts +42 -0
  69. package/dist/knowledge/intent-metrics.js +566 -0
  70. package/dist/knowledge/process-model.d.ts +24 -0
  71. package/dist/knowledge/process-model.js +160 -0
  72. package/dist/knowledge/reputation-rules.d.ts +42 -0
  73. package/dist/knowledge/reputation-rules.js +99 -0
  74. package/dist/knowledge/reward-templates.d.ts +25 -0
  75. package/dist/knowledge/reward-templates.js +125 -0
  76. package/dist/knowledge/safety-rules.d.ts +36 -0
  77. package/dist/knowledge/safety-rules.js +232 -0
  78. package/dist/knowledge/tool-constraints.d.ts +30 -0
  79. package/dist/knowledge/tool-constraints.js +175 -0
  80. package/dist/knowledge/trust-metrics.d.ts +37 -0
  81. package/dist/knowledge/trust-metrics.js +138 -0
  82. package/dist/loop-engineering/diagnose.d.ts +3 -2
  83. package/dist/loop-engineering/diagnose.js +94 -0
  84. package/dist/loop-engineering/improve.d.ts +1 -1
  85. package/dist/loop-engineering/improve.js +52 -1
  86. package/dist/project/graph.d.ts +71 -0
  87. package/dist/project/graph.js +314 -0
  88. package/dist/project/index.d.ts +62 -0
  89. package/dist/project/index.js +167 -0
  90. package/dist/project/namespace.d.ts +62 -0
  91. package/dist/project/namespace.js +181 -0
  92. package/dist/project/query.d.ts +40 -0
  93. package/dist/project/query.js +110 -0
  94. package/dist/safety/confirm-gate.d.ts +17 -0
  95. package/dist/safety/confirm-gate.js +88 -0
  96. package/dist/safety/index.d.ts +3 -0
  97. package/dist/safety/index.js +3 -0
  98. package/dist/safety/preview.d.ts +2 -0
  99. package/dist/safety/preview.js +36 -0
  100. package/dist/schema/call/allocation.d.ts +39 -14
  101. package/dist/schema/call/arbitration.d.ts +187 -162
  102. package/dist/schema/call/base.d.ts +1971 -87
  103. package/dist/schema/call/base.js +135 -3
  104. package/dist/schema/call/bridge-handler.js +15 -2
  105. package/dist/schema/call/bridge.d.ts +1478 -53
  106. package/dist/schema/call/bridge.js +50 -2
  107. package/dist/schema/call/contact.d.ts +25 -0
  108. package/dist/schema/call/demand.d.ts +79 -54
  109. package/dist/schema/call/guard.d.ts +125 -50
  110. package/dist/schema/call/handler.d.ts +3 -0
  111. package/dist/schema/call/handler.js +60 -14
  112. package/dist/schema/call/machine.d.ts +988 -938
  113. package/dist/schema/call/order.d.ts +25 -0
  114. package/dist/schema/call/payment.d.ts +25 -0
  115. package/dist/schema/call/permission.d.ts +244 -219
  116. package/dist/schema/call/personal.d.ts +25 -0
  117. package/dist/schema/call/progress.d.ts +25 -0
  118. package/dist/schema/call/proof.d.ts +62 -12
  119. package/dist/schema/call/proof.js +3 -3
  120. package/dist/schema/call/repository.d.ts +101 -76
  121. package/dist/schema/call/reward.d.ts +55 -30
  122. package/dist/schema/call/semantic.d.ts +10 -2
  123. package/dist/schema/call/semantic.js +616 -11
  124. package/dist/schema/call/service.d.ts +442 -417
  125. package/dist/schema/call/treasury.d.ts +25 -0
  126. package/dist/schema/common/index.js +3 -3
  127. package/dist/schema/config/index.d.ts +18 -0
  128. package/dist/schema/config/index.js +17 -0
  129. package/dist/schema/index.d.ts +6 -0
  130. package/dist/schema/index.js +5 -0
  131. package/dist/schema/local/index.d.ts +237 -81
  132. package/dist/schema/local/index.js +42 -6
  133. package/dist/schema/messenger/index.d.ts +1018 -79
  134. package/dist/schema/messenger/index.js +26 -17
  135. package/dist/schema/operations.d.ts +3192 -1746
  136. package/dist/schema/operations.js +93 -98
  137. package/dist/schema/project/index.d.ts +21 -0
  138. package/dist/schema/project/index.js +32 -0
  139. package/dist/schema/query/index.d.ts +2762 -1856
  140. package/dist/schema/query/index.js +38 -35
  141. package/dist/schema/schema-query/index.d.ts +33 -0
  142. package/dist/schema/schema-query/index.js +36 -0
  143. package/dist/schema/schema-version.d.ts +25 -0
  144. package/dist/schema/schema-version.js +76 -0
  145. package/dist/schema/trust/index.d.ts +407 -0
  146. package/dist/schema/trust/index.js +113 -0
  147. package/dist/schemas/account_operation.output.json +25 -16
  148. package/dist/schemas/account_operation.schema.json +1 -1
  149. package/dist/schemas/bridge_operation.output.json +744 -0
  150. package/dist/schemas/bridge_operation.schema.json +82 -8
  151. package/dist/schemas/config_operation.output.json +18 -0
  152. package/dist/schemas/config_operation.schema.json +34 -0
  153. package/dist/schemas/guard-node-schema.json +82 -0
  154. package/dist/schemas/guard2file.schema.json +23 -0
  155. package/dist/schemas/index.json +19 -1
  156. package/dist/schemas/local_info_operation.output.json +23 -0
  157. package/dist/schemas/local_info_operation.schema.json +1 -1
  158. package/dist/schemas/local_mark_operation.output.json +24 -1
  159. package/dist/schemas/local_mark_operation.schema.json +4 -4
  160. package/dist/schemas/machineNode2file.schema.json +23 -0
  161. package/dist/schemas/messenger_operation.output.json +752 -0
  162. package/dist/schemas/onchain_events.output.json +718 -0
  163. package/dist/schemas/onchain_operations.output.json +627 -18
  164. package/dist/schemas/onchain_operations.schema.json +115 -39
  165. package/dist/schemas/onchain_operations_allocation.schema.json +23 -0
  166. package/dist/schemas/onchain_operations_arbitration.schema.json +23 -0
  167. package/dist/schemas/onchain_operations_contact.schema.json +23 -0
  168. package/dist/schemas/onchain_operations_demand.schema.json +23 -0
  169. package/dist/schemas/onchain_operations_gen_passport.schema.json +46 -0
  170. package/dist/schemas/onchain_operations_guard.schema.json +26 -16
  171. package/dist/schemas/onchain_operations_machine.schema.json +89 -23
  172. package/dist/schemas/onchain_operations_order.schema.json +23 -0
  173. package/dist/schemas/onchain_operations_payment.schema.json +23 -0
  174. package/dist/schemas/onchain_operations_permission.schema.json +23 -0
  175. package/dist/schemas/onchain_operations_personal.schema.json +23 -0
  176. package/dist/schemas/onchain_operations_progress.schema.json +23 -0
  177. package/dist/schemas/onchain_operations_repository.schema.json +23 -0
  178. package/dist/schemas/onchain_operations_reward.schema.json +23 -0
  179. package/dist/schemas/onchain_operations_service.schema.json +23 -0
  180. package/dist/schemas/onchain_operations_treasury.schema.json +23 -0
  181. package/dist/schemas/onchain_table_data.output.json +939 -69
  182. package/dist/schemas/onchain_table_data.schema.json +2 -2
  183. package/dist/schemas/project_operation.output.json +18 -0
  184. package/dist/schemas/project_operation.schema.json +42 -0
  185. package/dist/schemas/query_toolkit.schema.json +360 -368
  186. package/dist/schemas/schema_query.schema.json +6 -3
  187. package/dist/schemas/trust_score.output.json +327 -0
  188. package/dist/schemas/trust_score.schema.json +46 -0
  189. package/package.json +2 -2
@@ -0,0 +1,487 @@
1
+ export const SEMANTIC_TO_SCHEMA_RULES = [
2
+ {
3
+ id: "A01_identity_single",
4
+ pattern_name: "身份检查(单地址)",
5
+ semantic_intent: "只有地址 X 能执行此操作",
6
+ match_keywords: ["只有", "允许", "授权", "身份", "指定地址", "签名者"],
7
+ schema_elements: {
8
+ root_type: "logic_equal",
9
+ table_entries: [
10
+ { value_type: "Address", b_submission: false, purpose: "授权地址常量" },
11
+ ],
12
+ tree_structure: "logic_equal(context(Signer), identifier[0])",
13
+ },
14
+ constraints: [
15
+ "root 必须 logic_equal(返回 Bool)",
16
+ "table[0] 必须 Address 类型,b_submission=false",
17
+ "context(Signer) 返回当前交易签名者地址",
18
+ ],
19
+ example: {
20
+ root: {
21
+ type: "logic_equal",
22
+ nodes: [
23
+ { type: "context", context: "Signer" },
24
+ { type: "identifier", identifier: 0 },
25
+ ],
26
+ },
27
+ table: [
28
+ { identifier: 0, b_submission: false, value_type: "Address", value: "0xabc...", name: "授权操作者地址" },
29
+ ],
30
+ },
31
+ },
32
+ {
33
+ id: "A02_identity_allowlist",
34
+ pattern_name: "身份检查(白名单)",
35
+ semantic_intent: "白名单中的地址可以执行此操作",
36
+ match_keywords: ["白名单", "多个地址", "列表", "允许列表", "名单"],
37
+ schema_elements: {
38
+ root_type: "vec_contains_address",
39
+ table_entries: [
40
+ { value_type: "VecAddress", b_submission: false, purpose: "授权地址列表" },
41
+ ],
42
+ tree_structure: "vec_contains_address(identifier[0], context(Signer))",
43
+ },
44
+ constraints: [
45
+ "root vec_contains_address 返回 Bool",
46
+ "table[0] 必须 VecAddress 类型",
47
+ "context(Signer) 作为被查找的元素",
48
+ ],
49
+ example: {
50
+ root: {
51
+ type: "vec_contains_address",
52
+ nodes: [
53
+ { type: "identifier", identifier: 0 },
54
+ { type: "context", context: "Signer" },
55
+ ],
56
+ },
57
+ table: [
58
+ { identifier: 0, b_submission: false, value_type: "VecAddress", value: ["0xabc...", "0xdef..."], name: "授权地址白名单" },
59
+ ],
60
+ },
61
+ },
62
+ {
63
+ id: "A03_time_lock",
64
+ pattern_name: "时间锁",
65
+ semantic_intent: "等待 N 毫秒后才能执行此操作",
66
+ match_keywords: ["等待", "时间", "锁定", "延迟", "小时", "天", "毫秒"],
67
+ schema_elements: {
68
+ root_type: "logic_as_u256_greater_or_equal",
69
+ table_entries: [
70
+ { value_type: "Address", b_submission: true, purpose: "目标对象地址(如 Order)" },
71
+ { value_type: "U64", b_submission: false, purpose: "锁定时长(毫秒,测试用 1000)" },
72
+ ],
73
+ query_nodes: [
74
+ { query_name: "progress.session.time", object_type: "Progress", convert_witness: 100 },
75
+ ],
76
+ tree_structure: "logic_as_u256_greater_or_equal(context(Clock), calc_number_add(query(progress.time, witness=100), identifier[1]))",
77
+ },
78
+ constraints: [
79
+ "时间单位为毫秒,测试时用 1000ms,生产环境再调整",
80
+ "convert_witness=100 (TypeOrderProgress) 从 Order 转换到 Progress",
81
+ "table[0] 的 object_type 必须匹配 witness source type (Order)",
82
+ "calc_number_add 返回 U256,context(Clock) 返回 U64,自动宽展",
83
+ ],
84
+ example: {
85
+ root: {
86
+ type: "logic_as_u256_greater_or_equal",
87
+ nodes: [
88
+ { type: "context", context: "Clock" },
89
+ {
90
+ type: "calc_number_add",
91
+ nodes: [
92
+ {
93
+ type: "query",
94
+ query: "progress.session.time",
95
+ object: { identifier: 0, convert_witness: 100 },
96
+ parameters: [],
97
+ },
98
+ { type: "identifier", identifier: 1 },
99
+ ],
100
+ },
101
+ ],
102
+ },
103
+ table: [
104
+ { identifier: 0, b_submission: true, value_type: "Address", name: "目标 Order 地址", object_type: "Order" },
105
+ { identifier: 1, b_submission: false, value_type: "U64", value: 1000, name: "锁定时长(毫秒)" },
106
+ ],
107
+ },
108
+ },
109
+ {
110
+ id: "A04_progress_state",
111
+ pattern_name: "进度状态检查",
112
+ semantic_intent: "订单进度达到指定节点才能执行此操作",
113
+ match_keywords: ["进度", "节点", "状态", "完成", "到达", "当前节点"],
114
+ schema_elements: {
115
+ root_type: "logic_equal",
116
+ table_entries: [
117
+ { value_type: "Address", b_submission: true, purpose: "目标 Order 地址" },
118
+ { value_type: "String", b_submission: false, purpose: "期望的节点名称" },
119
+ ],
120
+ query_nodes: [
121
+ { query_name: "progress.current_node_name", object_type: "Progress", convert_witness: 100 },
122
+ ],
123
+ tree_structure: "logic_equal(query(progress.node, witness=100, identifier[0]), identifier[1])",
124
+ },
125
+ constraints: [
126
+ "query 返回 String,identifier[1] 必须 String 类型",
127
+ "logic_equal 比较 String 时大小写敏感",
128
+ "如需大小写不敏感,使用 logic_string_nocase_equal",
129
+ "convert_witness=100 (TypeOrderProgress) 从 Order 转换",
130
+ ],
131
+ example: {
132
+ root: {
133
+ type: "logic_equal",
134
+ nodes: [
135
+ {
136
+ type: "query",
137
+ query: "progress.current_node_name",
138
+ object: { identifier: 0, convert_witness: 100 },
139
+ parameters: [],
140
+ },
141
+ { type: "identifier", identifier: 1 },
142
+ ],
143
+ },
144
+ table: [
145
+ { identifier: 0, b_submission: true, value_type: "Address", name: "目标 Order 地址", object_type: "Order" },
146
+ { identifier: 1, b_submission: false, value_type: "String", value: "Completed", name: "期望的进度节点名" },
147
+ ],
148
+ },
149
+ },
150
+ {
151
+ id: "A05_one_time_claim",
152
+ pattern_name: "一次性领取检查",
153
+ semantic_intent: "用户只能领取一次奖励",
154
+ match_keywords: ["一次", "领取", "重复", "已领", "领取过"],
155
+ schema_elements: {
156
+ root_type: "logic_equal",
157
+ table_entries: [
158
+ { value_type: "Address", b_submission: true, purpose: "Reward 对象地址" },
159
+ { value_type: "Address", b_submission: false, purpose: "领取者地址(从 context 派生)" },
160
+ ],
161
+ query_nodes: [
162
+ { query_name: "reward.record.count", object_type: "Reward" },
163
+ ],
164
+ tree_structure: "logic_equal(query_reward_record_count(identifier[0], identifier[1]), constant(0))",
165
+ },
166
+ constraints: [
167
+ "query_reward_record_count 返回 U64",
168
+ "比较 count == 0 表示无历史记录(可领取)",
169
+ "identifier[1] 可用 context(Signer) 替代",
170
+ ],
171
+ example: {
172
+ root: {
173
+ type: "logic_equal",
174
+ nodes: [
175
+ {
176
+ type: "query_reward_record_count",
177
+ object: { identifier: 0 },
178
+ recipient: { type: "context", context: "Signer" },
179
+ },
180
+ { type: "identifier", identifier: 1 },
181
+ ],
182
+ },
183
+ table: [
184
+ { identifier: 0, b_submission: true, value_type: "Address", name: "Reward 对象地址", object_type: "Reward" },
185
+ { identifier: 1, b_submission: false, value_type: "U64", value: 0, name: "期望的历史领取数(0)" },
186
+ ],
187
+ },
188
+ },
189
+ {
190
+ id: "A06_multi_condition_and",
191
+ pattern_name: "多条件组合(AND)",
192
+ semantic_intent: "多个条件必须同时满足",
193
+ match_keywords: ["并且", "同时", "都满足", "AND", "且", "还需要"],
194
+ schema_elements: {
195
+ root_type: "logic_and",
196
+ table_entries: [],
197
+ tree_structure: "logic_and([condition1, condition2, ...])",
198
+ },
199
+ constraints: [
200
+ "logic_and 所有子节点必须返回 Bool",
201
+ "子节点数量 2-8(MAX_MULTI_OPERANDS)",
202
+ "每个子条件可以是任何返回 Bool 的节点",
203
+ ],
204
+ example: {
205
+ root: {
206
+ type: "logic_and",
207
+ nodes: [
208
+ {},
209
+ {},
210
+ ],
211
+ },
212
+ },
213
+ },
214
+ {
215
+ id: "A07_multi_condition_or",
216
+ pattern_name: "多条件组合(OR)",
217
+ semantic_intent: "任一条件满足即可",
218
+ match_keywords: ["或者", "任一", "OR", "或", "之一"],
219
+ schema_elements: {
220
+ root_type: "logic_or",
221
+ table_entries: [],
222
+ tree_structure: "logic_or([condition1, condition2, ...])",
223
+ },
224
+ constraints: [
225
+ "logic_or 所有子节点必须返回 Bool",
226
+ "子节点数量 2-8",
227
+ "等价于 rely.logic_or=true(如果使用 rely 组合)",
228
+ ],
229
+ example: {
230
+ root: {
231
+ type: "logic_or",
232
+ nodes: [
233
+ {},
234
+ {},
235
+ ],
236
+ },
237
+ },
238
+ },
239
+ {
240
+ id: "A08_dynamic_weight",
241
+ pattern_name: "动态投票权重",
242
+ semantic_intent: "投票权重等于用户声誉分(从提交数据提取)",
243
+ match_keywords: ["权重", "投票", "声誉", "分数", "voting", "weight"],
244
+ schema_elements: {
245
+ root_type: "logic_and",
246
+ table_entries: [
247
+ { value_type: "Address", b_submission: true, purpose: "投票者地址" },
248
+ { value_type: "U64", b_submission: true, purpose: "投票者权重(GuardIdentifier 提取)" },
249
+ ],
250
+ query_nodes: [
251
+ { query_name: "entity.records.value", object_type: "EntityRegistrar" },
252
+ ],
253
+ tree_structure: "logic_and(资格检查, GuardIdentifier 提取权重[1])",
254
+ },
255
+ constraints: [
256
+ "GuardIdentifier 引用的 table 条目必须 numeric (U8-U256)",
257
+ "b_submission 必须 true(权重由 voter 运行时提交)",
258
+ "非 numeric 类型导致 E_GUARD_IDENTIFIER_NOT_NUMBER 错误",
259
+ "权重值 cast 为 u32",
260
+ ],
261
+ example: {
262
+ root: {
263
+ type: "logic_and",
264
+ nodes: [
265
+ {},
266
+ {},
267
+ ],
268
+ },
269
+ table: [
270
+ { identifier: 0, b_submission: true, value_type: "Address", name: "投票者地址" },
271
+ { identifier: 1, b_submission: true, value_type: "U64", name: "投票者权重(从声誉分提取)" },
272
+ ],
273
+ },
274
+ },
275
+ ];
276
+ export const SCHEMA_TO_SEMANTIC_RULES = [
277
+ { element_type: "node", type_name: "logic_equal", semantic: "相等比较(==),返回 Bool", return_type: "Bool", child_constraints: "2 个子节点,类型必须兼容" },
278
+ { element_type: "node", type_name: "logic_not", semantic: "逻辑非(!),返回 Bool", return_type: "Bool", child_constraints: "1 个子节点,必须 Bool" },
279
+ { element_type: "node", type_name: "logic_and", semantic: "逻辑与(AND),所有子节点为 true 则 true", return_type: "Bool", child_constraints: "2-8 个 Bool 子节点" },
280
+ { element_type: "node", type_name: "logic_or", semantic: "逻辑或(OR),任一子节点为 true 则 true", return_type: "Bool", child_constraints: "2-8 个 Bool 子节点" },
281
+ { element_type: "node", type_name: "logic_as_u256_greater", semantic: "数值大于(>),自动宽展到 U256", return_type: "Bool", child_constraints: "2 个数值子节点" },
282
+ { element_type: "node", type_name: "logic_as_u256_lesser", semantic: "数值小于(<)", return_type: "Bool", child_constraints: "2 个数值子节点" },
283
+ { element_type: "node", type_name: "logic_as_u256_equal", semantic: "数值相等(==)", return_type: "Bool", child_constraints: "2 个数值子节点" },
284
+ { element_type: "node", type_name: "logic_as_u256_greater_or_equal", semantic: "数值大于等于(>=)", return_type: "Bool", child_constraints: "2 个数值子节点" },
285
+ { element_type: "node", type_name: "logic_as_u256_lesser_or_equal", semantic: "数值小于等于(<=)", return_type: "Bool", child_constraints: "2 个数值子节点" },
286
+ { element_type: "node", type_name: "logic_string_contains", semantic: "字符串包含(大小写敏感)", return_type: "Bool", child_constraints: "2 个 String 子节点" },
287
+ { element_type: "node", type_name: "logic_string_nocase_contains", semantic: "字符串包含(大小写不敏感)", return_type: "Bool", child_constraints: "2 个 String 子节点" },
288
+ { element_type: "node", type_name: "logic_string_nocase_equal", semantic: "字符串相等(大小写不敏感)", return_type: "Bool", child_constraints: "2 个 String 子节点" },
289
+ { element_type: "node", type_name: "identifier", semantic: "引用 table 条目的值", return_type: "由 table 条目 value_type 决定", child_constraints: "无子节点,需要 identifier 字段引用 table" },
290
+ { element_type: "node", type_name: "context", semantic: "交易上下文数据(Signer 地址、Clock 时间戳、Guard 自身 ID)", return_type: "Address (Signer) / U64 (Clock) / Address (Self)", child_constraints: "无子节点" },
291
+ { element_type: "node", type_name: "query", semantic: "查询链上对象数据", return_type: "由查询指令决定", child_constraints: "需要 query + object + parameters 字段", discovery_tool: "wowok_buildin_info(info='guard instructions')" },
292
+ { element_type: "node", type_name: "calc_number_add", semantic: "数值加法", return_type: "U256", child_constraints: "2 个数值子节点" },
293
+ { element_type: "node", type_name: "calc_number_sub", semantic: "数值减法", return_type: "U256", child_constraints: "2 个数值子节点" },
294
+ { element_type: "node", type_name: "calc_number_mul", semantic: "数值乘法", return_type: "U256", child_constraints: "2 个数值子节点" },
295
+ { element_type: "node", type_name: "calc_number_div", semantic: "数值除法", return_type: "U256", child_constraints: "2 个数值子节点" },
296
+ { element_type: "node", type_name: "convert_string_number", semantic: "String → Number 转换", return_type: "U256", child_constraints: "1 个 String 子节点" },
297
+ { element_type: "node", type_name: "convert_number_string", semantic: "Number → String 转换", return_type: "String", child_constraints: "1 个数值子节点" },
298
+ { element_type: "node", type_name: "convert_number_address", semantic: "Number → Address 转换(时间戳转地址等)", return_type: "Address", child_constraints: "1 个数值子节点" },
299
+ { element_type: "node", type_name: "vec_contains_bool", semantic: "向量是否包含 Bool 值", return_type: "Bool", child_constraints: "2 个子节点:VecBool + Bool" },
300
+ { element_type: "node", type_name: "vec_contains_address", semantic: "向量是否包含 Address(白名单检查)", return_type: "Bool", child_constraints: "2 个子节点:VecAddress + Address" },
301
+ { element_type: "node", type_name: "vec_contains_string", semantic: "向量是否包含 String", return_type: "Bool", child_constraints: "2 个子节点:VecString + String" },
302
+ { element_type: "node", type_name: "vec_contains_string_nocase", semantic: "向量是否包含 String(大小写不敏感)", return_type: "Bool", child_constraints: "2 个子节点:VecString + String" },
303
+ { element_type: "node", type_name: "vec_contains_number", semantic: "向量是否包含数值", return_type: "Bool", child_constraints: "2 个子节点:Vec* + Number" },
304
+ { element_type: "node", type_name: "query_reward_record_exists", semantic: "查询奖励领取记录是否存在(Bool)", return_type: "Bool", child_constraints: "需要 object + recipient 字段" },
305
+ { element_type: "node", type_name: "query_reward_record_count", semantic: "查询奖励领取记录数(U64)", return_type: "U64", child_constraints: "需要 object + recipient 字段" },
306
+ { element_type: "node", type_name: "query_progress_history_find", semantic: "查询 Progress 历史中是否存在指定 session", return_type: "Bool", child_constraints: "需要 object + historyIdx + sessionIdx" },
307
+ { element_type: "node", type_name: "query_progress_history_session_forward_find", semantic: "查询 Progress session 中是否存在指定 forward", return_type: "Bool", child_constraints: "需要 object + historyIdx + sessionIdx + forwardIdx" },
308
+ { element_type: "node", type_name: "query_progress_history_session_forward_retained_submission_count", semantic: "查询 Progress session forward 的保留提交数", return_type: "U64", child_constraints: "需要 object + historyIdx + sessionIdx + forwardIdx" },
309
+ { element_type: "witness", type_name: "TypeOrderProgress", semantic: "从 Order 地址转换到 Progress(100)", discovery_tool: "wowok_buildin_info(info='guard instructions')" },
310
+ { element_type: "witness", type_name: "TypeOrderMachine", semantic: "从 Order 地址转换到 Machine(101)" },
311
+ { element_type: "witness", type_name: "TypeOrderService", semantic: "从 Order 地址转换到 Service(102)" },
312
+ { element_type: "witness", type_name: "TypeProgressMachine", semantic: "从 Progress 地址转换到 Machine(103)" },
313
+ { element_type: "witness", type_name: "TypeArbOrder", semantic: "从 Arb 地址转换到 Order(104)" },
314
+ { element_type: "witness", type_name: "TypeArbArbitration", semantic: "从 Arb 地址转换到 Arbitration(105,父服务)" },
315
+ { element_type: "witness", type_name: "TypeArbProgress", semantic: "从 Arb 地址转换到 Progress(106)" },
316
+ { element_type: "witness", type_name: "TypeArbMachine", semantic: "从 Arb 地址转换到 Machine(107)" },
317
+ { element_type: "witness", type_name: "TypeArbService", semantic: "从 Arb 地址转换到 Service(108)" },
318
+ { element_type: "table_entry", type_name: "Bool", semantic: "布尔值常量或提交" },
319
+ { element_type: "table_entry", type_name: "Address", semantic: "地址常量或提交" },
320
+ { element_type: "table_entry", type_name: "String", semantic: "字符串常量或提交" },
321
+ { element_type: "table_entry", type_name: "U8", semantic: "8 位无符号整数" },
322
+ { element_type: "table_entry", type_name: "U16", semantic: "16 位无符号整数" },
323
+ { element_type: "table_entry", type_name: "U32", semantic: "32 位无符号整数" },
324
+ { element_type: "table_entry", type_name: "U64", semantic: "64 位无符号整数" },
325
+ { element_type: "table_entry", type_name: "U128", semantic: "128 位无符号整数" },
326
+ { element_type: "table_entry", type_name: "U256", semantic: "256 位无符号整数" },
327
+ { element_type: "table_entry", type_name: "VecAddress", semantic: "地址向量(用于白名单)" },
328
+ { element_type: "table_entry", type_name: "VecString", semantic: "字符串向量" },
329
+ { element_type: "table_entry", type_name: "VecU64", semantic: "U64 向量" },
330
+ { element_type: "rely", type_name: "rely_and", semantic: "依赖其他 Guard,AND 逻辑(所有必须通过)", child_constraints: "最多 4 个依赖,每个 rep=true" },
331
+ { element_type: "rely", type_name: "rely_or", semantic: "依赖其他 Guard,OR 逻辑(任一通过即可)", child_constraints: "最多 4 个依赖,每个 rep=true" },
332
+ ];
333
+ export const GUARD_CONSTRAINT_RULES = [
334
+ {
335
+ id: "ROOT_01",
336
+ name: "root 返回 Bool",
337
+ description: "Guard root 节点必须返回 Bool 类型",
338
+ category: "root",
339
+ validation_logic: "root.node_type 必须在 allowedTypes 列表中(logic_*, calc_string_contains, vec_contains_*, query_reward_record_exists, query[Bool返回], identifier[Bool类型])",
340
+ failure_message: "Guard root node must be an operation that returns Bool",
341
+ pitfall_number: 7,
342
+ },
343
+ {
344
+ id: "TABLE_01",
345
+ name: "identifier 唯一性",
346
+ description: "table 中每个 identifier 必须唯一(0-255)",
347
+ category: "table",
348
+ validation_logic: "table 中无重复 identifier",
349
+ failure_message: "Duplicate table identifier",
350
+ },
351
+ {
352
+ id: "TABLE_02",
353
+ name: "identifier 引用完整性",
354
+ description: "计算树中每个 identifier 节点必须在 table 中存在",
355
+ category: "table",
356
+ validation_logic: "遍历计算树,每个 identifier 节点的 index 在 table 中存在",
357
+ failure_message: "Identifier not found in table",
358
+ pitfall_number: 1,
359
+ },
360
+ {
361
+ id: "TABLE_03",
362
+ name: "常量条目必须有值",
363
+ description: "b_submission=false 的条目必须有 value 字段",
364
+ category: "table",
365
+ validation_logic: "所有 b_submission=false 的条目 value 字段非空",
366
+ failure_message: "Constant table entry must have a value",
367
+ },
368
+ {
369
+ id: "TABLE_04",
370
+ name: "table 大小限制",
371
+ description: "最多 256 条目,序列化后不超过 40000 字节",
372
+ category: "table",
373
+ validation_logic: "table.length <= 256 && serialize(table).length <= 40000",
374
+ failure_message: "Table exceeds size limit (256 entries or 40000 bytes)",
375
+ },
376
+ {
377
+ id: "QUERY_01",
378
+ name: "query 指令有效",
379
+ description: "query 节点的 query 字段必须是有效的 GUARDQUERY ID 或 name",
380
+ category: "query",
381
+ validation_logic: "query 字段在 GUARDQUERY 中存在(通过 isValidGuardQueryIdOrName)",
382
+ failure_message: "Invalid Guard query instruction",
383
+ pitfall_number: 3,
384
+ },
385
+ {
386
+ id: "QUERY_02",
387
+ name: "query 参数匹配",
388
+ description: "query 节点的 parameters 数量和类型必须匹配指令定义",
389
+ category: "query",
390
+ validation_logic: "parameters.length === instruction.parameters.length && 类型兼容",
391
+ failure_message: "Query parameter count or type mismatch",
392
+ pitfall_number: 3,
393
+ },
394
+ {
395
+ id: "QUERY_03",
396
+ name: "query object 类型匹配",
397
+ description: "query object 的 object_type 必须匹配指令的 objectType",
398
+ category: "query",
399
+ validation_logic: "table[object.identifier].object_type === instruction.objectType(考虑 witness 转换)",
400
+ failure_message: "Query object type mismatch",
401
+ },
402
+ {
403
+ id: "WITNESS_01",
404
+ name: "witness 类型有效",
405
+ description: "convert_witness 必须是有效的 WitnessType (100-108)",
406
+ category: "witness",
407
+ validation_logic: "witness 值在 WitnessTypeSchema 允许范围内",
408
+ failure_message: "Invalid witness type",
409
+ pitfall_number: 4,
410
+ },
411
+ {
412
+ id: "WITNESS_02",
413
+ name: "witness source-target 匹配",
414
+ description: "witness 的 source type 必须匹配 table 条目 object_type,target type 必须匹配 query objectType",
415
+ category: "witness",
416
+ validation_logic: "table[identifier].object_type === witness.source_type && instruction.objectType === witness.target_type",
417
+ failure_message: "Witness source/target type mismatch",
418
+ pitfall_number: 4,
419
+ },
420
+ {
421
+ id: "RELY_01",
422
+ name: "rely 依赖数量",
423
+ description: "rely.guards 最多 4 个依赖",
424
+ category: "rely",
425
+ validation_logic: "rely.guards.length <= 4",
426
+ failure_message: "Rely dependencies exceed limit (4)",
427
+ },
428
+ {
429
+ id: "RELY_02",
430
+ name: "rely 依赖 rep=true",
431
+ description: "所有 rely 依赖的 Guard 必须 rep=true(无 Repository 依赖)",
432
+ category: "rely",
433
+ validation_logic: "查询每个依赖 Guard 的 rep 字段,必须为 true",
434
+ failure_message: "Rely dependency has rep=false (not standalone)",
435
+ pitfall_number: 8,
436
+ },
437
+ {
438
+ id: "BINDING_01",
439
+ name: "voting_guard GuardIdentifier numeric",
440
+ description: "Arbitration voting_guard 的 GuardIdentifier 引用的 table 条目必须 numeric 类型",
441
+ category: "binding",
442
+ validation_logic: "如果 binding=voting_guard,GuardIdentifier 指向的 table 条目 value_type 在 [U8,U16,U32,U64,U128,U256] 中",
443
+ failure_message: "E_GUARD_IDENTIFIER_NOT_NUMBER: voting_guard weight must be numeric",
444
+ pitfall_number: 9,
445
+ },
446
+ {
447
+ id: "BINDING_02",
448
+ name: "Repository id_from_submission Address",
449
+ description: "Repository write_guard 的 id_from_submission 引用的 table 条目必须 Address 类型",
450
+ category: "binding",
451
+ validation_logic: "如果 binding=write_guard 且 id_from_submission 设置,table[id_from_submission].value_type === Address",
452
+ failure_message: "Repository id_from_submission must be Address type",
453
+ },
454
+ {
455
+ id: "BINDING_03",
456
+ name: "Repository data_from_submission 类型匹配",
457
+ description: "Repository write_guard 的 data_from_submission 引用的 table 条目必须匹配 Repository value_type",
458
+ category: "binding",
459
+ validation_logic: "如果 binding=write_guard 且 data_from_submission 设置,table[data_from_submission].value_type === Repository.value_type",
460
+ failure_message: "Repository data_from_submission type mismatch",
461
+ },
462
+ ];
463
+ export function matchSemanticPattern(userIntent) {
464
+ const lower = userIntent.toLowerCase();
465
+ return SEMANTIC_TO_SCHEMA_RULES.filter((rule) => rule.match_keywords.some((kw) => lower.includes(kw.toLowerCase())));
466
+ }
467
+ export function explainNode(nodeType) {
468
+ return SCHEMA_TO_SEMANTIC_RULES.find((r) => r.element_type === "node" && r.type_name === nodeType);
469
+ }
470
+ export function explainWitness(witnessType) {
471
+ const witnessMap = {
472
+ 100: "TypeOrderProgress",
473
+ 101: "TypeOrderMachine",
474
+ 102: "TypeOrderService",
475
+ 103: "TypeProgressMachine",
476
+ 104: "TypeArbOrder",
477
+ 105: "TypeArbArbitration",
478
+ 106: "TypeArbProgress",
479
+ 107: "TypeArbMachine",
480
+ 108: "TypeArbService",
481
+ };
482
+ const name = witnessMap[witnessType];
483
+ return SCHEMA_TO_SEMANTIC_RULES.find((r) => r.element_type === "witness" && r.type_name === name);
484
+ }
485
+ export function getConstraintsByCategory(category) {
486
+ return GUARD_CONSTRAINT_RULES.filter((r) => r.category === category);
487
+ }
@@ -0,0 +1,77 @@
1
+ import { CONCEPT_GLOSSARY, CONCEPT_GLOSSARY_VERSION, resolveTerm, lookupEntry, validateText, auditSchemaFields, type GlossaryEntry, type GlossaryCategory, type GlossaryDrift } from "./glossary.js";
2
+ import { CONFIRMATION_RULES, SAFETY_RULES_VERSION, type ConfirmationRule, type OperationPreview, type ConfirmLevel } from "./safety-rules.js";
3
+ import { TOOL_CONSTRAINTS, TOOL_CONSTRAINTS_VERSION, validateOperation, hasBlockingViolations, getWarningViolations, type ConstraintSeverity, type FieldConstraint, type OperationConstraint, type ConstraintViolation } from "./tool-constraints.js";
4
+ import { PERMISSION_TYPES, GAME_ELEMENTS, getPermissionType, getGameElement, getGameElementsByType, PROCESS_MODEL_VERSION, type PermissionScope, type PermissionTypeDef, type GameElementType, type GameElementDef } from "./process-model.js";
5
+ import { computeTrustScore, quickRiskAssessment, ARBITRATION_TRUST_VERSION, type ArbMetrics, type TrustScore, type TrustComponent } from "./arbitration-trust.js";
6
+ import { REWARD_TEMPLATES, REWARD_TEMPLATES_VERSION, getRewardTemplate, listRewardTemplates, suggestRewardTemplate, type RewardTemplateType, type RewardTemplate } from "./reward-templates.js";
7
+ import { AUDIT_RULES, AUDIT_RULES_VERSION, auditService, hasBlockingErrors, getErrors, getWarnings, summarizeFindings, type AuditSeverity, type AuditFinding, type AuditRule, type AuditContext } from "./audit-rules.js";
8
+ import { matchDemand, extractDemandInfo, DEMAND_MATCHING_VERSION, type ServiceInfo, type DemandInfo, type DemandMatch } from "./demand-matching.js";
9
+ import { suggestPricing, getMutableFields, getMutableField, MUTABLE_FIELDS, DYNAMIC_PRICING_VERSION, type MarketSignals, type PricingSuggestion, type MutableFieldInfo } from "./dynamic-pricing.js";
10
+ import { computeServiceTrustScore, quickTrustCheck, TRUST_METRICS_VERSION, type ServiceTrustMetrics, type ServiceTrustScore, type TrustDimension } from "./trust-metrics.js";
11
+ import { buildReviewRepositorySetup, computeReviewStats, isVerifiedReview, filterVerifiedReviews, detectReviewManipulation, REPUTATION_RULES_VERSION, type Review, type ReviewStats, type ReviewRepositorySetup } from "./reputation-rules.js";
12
+ import { INDUSTRY_FLYWHEELS, getFlywheelForIndustry, listIndustries, suggestAcquisitionActions, generateTrustDescription, buildAcquisitionDashboard, ACQUISITION_FLYWHEEL_VERSION, type FlywheelAction, type AcquisitionFlywheel, type TrustDescriptionParams, type AcquisitionDashboard } from "./acquisition-flywheel.js";
13
+ import { INDUSTRY_REGISTRY_VERSION, type IndustryTraits, type IndustryProfile, type IndustrySource, type IndustryEvolutionMeta, type ExtendedIndustry, getIndustryProfile, registerIndustry, getIndustryTraits, resolveIndustryName, getRegistrySize, listBuiltinIndustryNames } from "./industry-registry.js";
14
+ import { DEFAULT_TRAITS, inferTraitsFromDescription, synthesizeProfile, findSimilarIndustries, composeIndustries, type TraitInferenceResult, type SimilarIndustryMatch } from "./industry-generalizer.js";
15
+ import { INDUSTRY_EVOLUTION_THRESHOLDS, aggregateIndustryMetrics, evaluateIndustryHealth, suggestIndustryUpdate, applyIndustryUpdate, runIndustryHealthPipeline, type IndustryMetrics, type OrderRawDataPoint, type IndustryHealthReport, type TraitDrift, type IndustryUpdateSuggestion } from "./industry-evolution.js";
16
+ import { FLYWHEEL_LOOP_VERSION, FLYWHEEL_LOOP_MIN_SIGNALS, EVOLUTION_STATE_VERSION, recordIndustrySignal, updateIndustryCognition, injectEvolutionContext, getIndustryEvolutionStatus, getIndustrySignalCount, getIndustrySignals, listIndustriesWithSignals, getPendingSuggestions, recordDecisionContext, queryDecisionsByIndustry, queryDecisionsByNode, backfillDecisionOutcome, setEvolutionSchedule, getEvolutionSchedule, setIndustryIntent, getIndustryIntent, saveEvolutionState, loadEvolutionState, hasPersistedEvolutionState, type IndustrySignal, type DecisionContext, type CognitionUpdateResult, type EvolutionContext, type IndustryEvolutionStatus, type EvolutionScheduleConfig, type EvolutionScheduleMode } from "./flywheel-loop.js";
17
+ import { BUILTIN_INTENT_SPECS, registerIntentProfile, getIntentProfile, listIntents, evaluateIndustryHealthByIntent, suggestIndustryUpdateByIntent, evaluateIndustryHealthMultiIntent, getRoleAdvice, filterSuggestionsByRole, type BusinessIntent, type MetricDimension, type IntentMetricSpec, type IntentSuggestionTrigger, type AdviceRole } from "./intent-metrics.js";
18
+ import { GUARD_SCENES, findScene, inferSceneFromAction, getImmutableScenes, getNumericIdentifierScenes, type GuardScene } from "./guard-ledger.js";
19
+ import { SEMANTIC_TO_SCHEMA_RULES, SCHEMA_TO_SEMANTIC_RULES, GUARD_CONSTRAINT_RULES, matchSemanticPattern, explainNode, explainWitness, getConstraintsByCategory, type SemanticToSchemaRule, type SchemaToSemanticRule, type GuardConstraintRule } from "./guard-translation.js";
20
+ import { checkPuzzleCompleteness, generateConfirmationText, initPuzzleFromIntent, inferBindingFromAction, type GuardPuzzle, type IntentPuzzle, type BindingPuzzle, type DataEntryPuzzle, type QueryPuzzle, type LogicNodePuzzle, type ConstraintChecklist, type PuzzleCompleteness, type PuzzleDimension } from "./guard-puzzle.js";
21
+ import { assessGuardRisks, assessGuardRisksForOperation, getRiskSummary, type GuardRisk, type GuardRiskAssessment, type GuardStakeholder, type RiskLevel, type RiskCategory } from "./guard-risk.js";
22
+ export { CONCEPT_GLOSSARY, CONCEPT_GLOSSARY_VERSION, resolveTerm, lookupEntry, validateText, auditSchemaFields, type GlossaryEntry, type GlossaryCategory, type GlossaryDrift, };
23
+ export { CONFIRMATION_RULES, SAFETY_RULES_VERSION, type ConfirmationRule, type OperationPreview, type ConfirmLevel, };
24
+ export { TOOL_CONSTRAINTS, TOOL_CONSTRAINTS_VERSION, validateOperation, hasBlockingViolations, getWarningViolations, type ConstraintSeverity, type FieldConstraint, type OperationConstraint, type ConstraintViolation, };
25
+ export { PERMISSION_TYPES, GAME_ELEMENTS, getPermissionType, getGameElement, getGameElementsByType, PROCESS_MODEL_VERSION, type PermissionScope, type PermissionTypeDef, type GameElementType, type GameElementDef, };
26
+ export { computeTrustScore, quickRiskAssessment, ARBITRATION_TRUST_VERSION, type ArbMetrics, type TrustScore, type TrustComponent, };
27
+ export { REWARD_TEMPLATES, REWARD_TEMPLATES_VERSION, getRewardTemplate, listRewardTemplates, suggestRewardTemplate, type RewardTemplateType, type RewardTemplate, };
28
+ export { AUDIT_RULES, AUDIT_RULES_VERSION, auditService, hasBlockingErrors, getErrors, getWarnings, summarizeFindings, type AuditSeverity, type AuditFinding, type AuditRule, type AuditContext, };
29
+ export { matchDemand, extractDemandInfo, DEMAND_MATCHING_VERSION, type ServiceInfo, type DemandInfo, type DemandMatch, };
30
+ export { suggestPricing, getMutableFields, getMutableField, MUTABLE_FIELDS, DYNAMIC_PRICING_VERSION, type MarketSignals, type PricingSuggestion, type MutableFieldInfo, };
31
+ export { computeServiceTrustScore, quickTrustCheck, TRUST_METRICS_VERSION, type ServiceTrustMetrics, type ServiceTrustScore, type TrustDimension, };
32
+ export { buildReviewRepositorySetup, computeReviewStats, isVerifiedReview, filterVerifiedReviews, detectReviewManipulation, REPUTATION_RULES_VERSION, type Review, type ReviewStats, type ReviewRepositorySetup, };
33
+ export { INDUSTRY_FLYWHEELS, getFlywheelForIndustry, listIndustries, suggestAcquisitionActions, generateTrustDescription, buildAcquisitionDashboard, ACQUISITION_FLYWHEEL_VERSION, type FlywheelAction, type AcquisitionFlywheel, type TrustDescriptionParams, type AcquisitionDashboard, };
34
+ export { INDUSTRY_REGISTRY_VERSION, getIndustryProfile, listIndustries as listRegistryIndustries, registerIndustry, getIndustryTraits, resolveIndustryName, getRegistrySize, listBuiltinIndustryNames, type IndustryTraits, type IndustryProfile, type IndustrySource, type IndustryEvolutionMeta, type ExtendedIndustry, };
35
+ export { DEFAULT_TRAITS, inferTraitsFromDescription, synthesizeProfile, findSimilarIndustries, composeIndustries, type TraitInferenceResult, type SimilarIndustryMatch, };
36
+ export { INDUSTRY_EVOLUTION_THRESHOLDS, aggregateIndustryMetrics, evaluateIndustryHealth, suggestIndustryUpdate, applyIndustryUpdate, runIndustryHealthPipeline, type IndustryMetrics, type OrderRawDataPoint, type IndustryHealthReport, type TraitDrift, type IndustryUpdateSuggestion, };
37
+ export { FLYWHEEL_LOOP_VERSION, FLYWHEEL_LOOP_MIN_SIGNALS, EVOLUTION_STATE_VERSION, recordIndustrySignal, updateIndustryCognition, injectEvolutionContext, getIndustryEvolutionStatus, getIndustrySignalCount, getIndustrySignals, listIndustriesWithSignals, getPendingSuggestions, recordDecisionContext, queryDecisionsByIndustry, queryDecisionsByNode, backfillDecisionOutcome, setEvolutionSchedule, getEvolutionSchedule, setIndustryIntent, getIndustryIntent, saveEvolutionState, loadEvolutionState, hasPersistedEvolutionState, type IndustrySignal, type DecisionContext, type CognitionUpdateResult, type EvolutionContext, type IndustryEvolutionStatus, type EvolutionScheduleConfig, type EvolutionScheduleMode, };
38
+ export { BUILTIN_INTENT_SPECS, registerIntentProfile, getIntentProfile, listIntents, evaluateIndustryHealthByIntent, suggestIndustryUpdateByIntent, evaluateIndustryHealthMultiIntent, getRoleAdvice, filterSuggestionsByRole, type BusinessIntent, type MetricDimension, type IntentMetricSpec, type IntentSuggestionTrigger, type AdviceRole, };
39
+ export { GUARD_SCENES, findScene, inferSceneFromAction, getImmutableScenes, getNumericIdentifierScenes, type GuardScene, };
40
+ export { SEMANTIC_TO_SCHEMA_RULES, SCHEMA_TO_SEMANTIC_RULES, GUARD_CONSTRAINT_RULES, matchSemanticPattern, explainNode, explainWitness, getConstraintsByCategory, type SemanticToSchemaRule, type SchemaToSemanticRule, type GuardConstraintRule, };
41
+ export { checkPuzzleCompleteness, generateConfirmationText, initPuzzleFromIntent, inferBindingFromAction, type GuardPuzzle, type IntentPuzzle, type BindingPuzzle, type DataEntryPuzzle, type QueryPuzzle, type LogicNodePuzzle, type ConstraintChecklist, type PuzzleCompleteness, type PuzzleDimension, };
42
+ export { assessGuardRisks, assessGuardRisksForOperation, getRiskSummary, type GuardRisk, type GuardRiskAssessment, type GuardStakeholder, type RiskLevel, type RiskCategory, };
43
+ export declare function getKnowledgeBase(): {
44
+ version: {
45
+ glossary: number;
46
+ safety: number;
47
+ tool_constraints: number;
48
+ process_model: number;
49
+ arbitration_trust: number;
50
+ reward_templates: number;
51
+ audit_rules: number;
52
+ demand_matching: number;
53
+ dynamic_pricing: number;
54
+ trust_metrics: number;
55
+ reputation_rules: number;
56
+ acquisition_flywheel: number;
57
+ industry_registry: number;
58
+ flywheel_loop: number;
59
+ };
60
+ glossary_entries: number;
61
+ confirmation_rules: number;
62
+ confirmation_rule_ids: string[];
63
+ tool_constraints_count: number;
64
+ permission_types_count: number;
65
+ game_elements_count: number;
66
+ reward_templates_count: number;
67
+ audit_rules_count: number;
68
+ mutable_fields_count: number;
69
+ industry_flywheels_count: number;
70
+ industry_registry_count: number;
71
+ intent_count: number;
72
+ guard_scenes_count: number;
73
+ guard_semantic_rules_count: number;
74
+ guard_schema_rules_count: number;
75
+ guard_constraint_rules_count: number;
76
+ guard_risk_rules_count: number;
77
+ };