@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,407 @@
1
+ import { z } from "zod";
2
+ export declare const TrustScoreInputSchema: z.ZodObject<{
3
+ service: z.ZodEffects<z.ZodString, string, string>;
4
+ order_amount: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
5
+ depth: z.ZodOptional<z.ZodEnum<["browse", "evaluate", "preorder"]>>;
6
+ network: z.ZodOptional<z.ZodString>;
7
+ no_cache: z.ZodOptional<z.ZodBoolean>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ service: string;
10
+ no_cache?: boolean | undefined;
11
+ network?: string | undefined;
12
+ order_amount?: string | number | undefined;
13
+ depth?: "browse" | "evaluate" | "preorder" | undefined;
14
+ }, {
15
+ service: string;
16
+ no_cache?: boolean | undefined;
17
+ network?: string | undefined;
18
+ order_amount?: string | number | undefined;
19
+ depth?: "browse" | "evaluate" | "preorder" | undefined;
20
+ }>;
21
+ export declare const TrustScoreOutputSchema: z.ZodObject<{
22
+ result: z.ZodObject<{
23
+ service_id: z.ZodString;
24
+ service_name: z.ZodString;
25
+ service_basics: z.ZodObject<{
26
+ bPublished: z.ZodBoolean;
27
+ bPaused: z.ZodBoolean;
28
+ sales_count: z.ZodNumber;
29
+ has_machine: z.ZodBoolean;
30
+ has_buy_guard: z.ZodBoolean;
31
+ has_um_contact: z.ZodBoolean;
32
+ arbitrations_count: z.ZodNumber;
33
+ }, "strip", z.ZodTypeAny, {
34
+ bPublished: boolean;
35
+ bPaused: boolean;
36
+ sales_count: number;
37
+ has_machine: boolean;
38
+ has_buy_guard: boolean;
39
+ has_um_contact: boolean;
40
+ arbitrations_count: number;
41
+ }, {
42
+ bPublished: boolean;
43
+ bPaused: boolean;
44
+ sales_count: number;
45
+ has_machine: boolean;
46
+ has_buy_guard: boolean;
47
+ has_um_contact: boolean;
48
+ arbitrations_count: number;
49
+ }>;
50
+ trust_score: z.ZodObject<{
51
+ score: z.ZodNumber;
52
+ level: z.ZodEnum<["high_risk", "caution", "moderate", "trusted"]>;
53
+ summary: z.ZodString;
54
+ warnings: z.ZodArray<z.ZodString, "many">;
55
+ breakdown: z.ZodArray<z.ZodObject<{
56
+ score: z.ZodNumber;
57
+ maxScore: z.ZodNumber;
58
+ description: z.ZodString;
59
+ humanReadable: z.ZodString;
60
+ }, "strip", z.ZodTypeAny, {
61
+ description: string;
62
+ score: number;
63
+ maxScore: number;
64
+ humanReadable: string;
65
+ }, {
66
+ description: string;
67
+ score: number;
68
+ maxScore: number;
69
+ humanReadable: string;
70
+ }>, "many">;
71
+ }, "strip", z.ZodTypeAny, {
72
+ score: number;
73
+ summary: string;
74
+ warnings: string[];
75
+ level: "high_risk" | "caution" | "moderate" | "trusted";
76
+ breakdown: {
77
+ description: string;
78
+ score: number;
79
+ maxScore: number;
80
+ humanReadable: string;
81
+ }[];
82
+ }, {
83
+ score: number;
84
+ summary: string;
85
+ warnings: string[];
86
+ level: "high_risk" | "caution" | "moderate" | "trusted";
87
+ breakdown: {
88
+ description: string;
89
+ score: number;
90
+ maxScore: number;
91
+ humanReadable: string;
92
+ }[];
93
+ }>;
94
+ order_amount: z.ZodString;
95
+ depth: z.ZodEnum<["browse", "evaluate", "preorder"]>;
96
+ risk_score: z.ZodOptional<z.ZodObject<{
97
+ total: z.ZodNumber;
98
+ level: z.ZodEnum<["low", "medium_low", "medium_high", "high"]>;
99
+ red_flags: z.ZodArray<z.ZodString, "many">;
100
+ advice: z.ZodArray<z.ZodString, "many">;
101
+ dimensions: z.ZodArray<z.ZodObject<{
102
+ name: z.ZodEnum<["workflow", "fund", "trust", "behavior"]>;
103
+ score: z.ZodNumber;
104
+ max_score: z.ZodNumber;
105
+ checks: z.ZodArray<z.ZodObject<{
106
+ id: z.ZodString;
107
+ dimension: z.ZodEnum<["workflow", "fund", "trust", "behavior"]>;
108
+ description: z.ZodString;
109
+ weight: z.ZodNumber;
110
+ passed: z.ZodBoolean;
111
+ advice: z.ZodOptional<z.ZodString>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ description: string;
114
+ id: string;
115
+ dimension: "fund" | "workflow" | "trust" | "behavior";
116
+ weight: number;
117
+ passed: boolean;
118
+ advice?: string | undefined;
119
+ }, {
120
+ description: string;
121
+ id: string;
122
+ dimension: "fund" | "workflow" | "trust" | "behavior";
123
+ weight: number;
124
+ passed: boolean;
125
+ advice?: string | undefined;
126
+ }>, "many">;
127
+ }, "strip", z.ZodTypeAny, {
128
+ name: "fund" | "workflow" | "trust" | "behavior";
129
+ score: number;
130
+ max_score: number;
131
+ checks: {
132
+ description: string;
133
+ id: string;
134
+ dimension: "fund" | "workflow" | "trust" | "behavior";
135
+ weight: number;
136
+ passed: boolean;
137
+ advice?: string | undefined;
138
+ }[];
139
+ }, {
140
+ name: "fund" | "workflow" | "trust" | "behavior";
141
+ score: number;
142
+ max_score: number;
143
+ checks: {
144
+ description: string;
145
+ id: string;
146
+ dimension: "fund" | "workflow" | "trust" | "behavior";
147
+ weight: number;
148
+ passed: boolean;
149
+ advice?: string | undefined;
150
+ }[];
151
+ }>, "many">;
152
+ }, "strip", z.ZodTypeAny, {
153
+ advice: string[];
154
+ level: "low" | "medium_low" | "medium_high" | "high";
155
+ total: number;
156
+ red_flags: string[];
157
+ dimensions: {
158
+ name: "fund" | "workflow" | "trust" | "behavior";
159
+ score: number;
160
+ max_score: number;
161
+ checks: {
162
+ description: string;
163
+ id: string;
164
+ dimension: "fund" | "workflow" | "trust" | "behavior";
165
+ weight: number;
166
+ passed: boolean;
167
+ advice?: string | undefined;
168
+ }[];
169
+ }[];
170
+ }, {
171
+ advice: string[];
172
+ level: "low" | "medium_low" | "medium_high" | "high";
173
+ total: number;
174
+ red_flags: string[];
175
+ dimensions: {
176
+ name: "fund" | "workflow" | "trust" | "behavior";
177
+ score: number;
178
+ max_score: number;
179
+ checks: {
180
+ description: string;
181
+ id: string;
182
+ dimension: "fund" | "workflow" | "trust" | "behavior";
183
+ weight: number;
184
+ passed: boolean;
185
+ advice?: string | undefined;
186
+ }[];
187
+ }[];
188
+ }>>;
189
+ info_puzzle: z.ZodOptional<z.ZodObject<{
190
+ completeness: z.ZodNumber;
191
+ gaps: z.ZodArray<z.ZodString, "many">;
192
+ assembled_at: z.ZodNumber;
193
+ }, "strip", z.ZodTypeAny, {
194
+ completeness: number;
195
+ gaps: string[];
196
+ assembled_at: number;
197
+ }, {
198
+ completeness: number;
199
+ gaps: string[];
200
+ assembled_at: number;
201
+ }>>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ trust_score: {
204
+ score: number;
205
+ summary: string;
206
+ warnings: string[];
207
+ level: "high_risk" | "caution" | "moderate" | "trusted";
208
+ breakdown: {
209
+ description: string;
210
+ score: number;
211
+ maxScore: number;
212
+ humanReadable: string;
213
+ }[];
214
+ };
215
+ service_id: string;
216
+ order_amount: string;
217
+ depth: "browse" | "evaluate" | "preorder";
218
+ service_name: string;
219
+ service_basics: {
220
+ bPublished: boolean;
221
+ bPaused: boolean;
222
+ sales_count: number;
223
+ has_machine: boolean;
224
+ has_buy_guard: boolean;
225
+ has_um_contact: boolean;
226
+ arbitrations_count: number;
227
+ };
228
+ risk_score?: {
229
+ advice: string[];
230
+ level: "low" | "medium_low" | "medium_high" | "high";
231
+ total: number;
232
+ red_flags: string[];
233
+ dimensions: {
234
+ name: "fund" | "workflow" | "trust" | "behavior";
235
+ score: number;
236
+ max_score: number;
237
+ checks: {
238
+ description: string;
239
+ id: string;
240
+ dimension: "fund" | "workflow" | "trust" | "behavior";
241
+ weight: number;
242
+ passed: boolean;
243
+ advice?: string | undefined;
244
+ }[];
245
+ }[];
246
+ } | undefined;
247
+ info_puzzle?: {
248
+ completeness: number;
249
+ gaps: string[];
250
+ assembled_at: number;
251
+ } | undefined;
252
+ }, {
253
+ trust_score: {
254
+ score: number;
255
+ summary: string;
256
+ warnings: string[];
257
+ level: "high_risk" | "caution" | "moderate" | "trusted";
258
+ breakdown: {
259
+ description: string;
260
+ score: number;
261
+ maxScore: number;
262
+ humanReadable: string;
263
+ }[];
264
+ };
265
+ service_id: string;
266
+ order_amount: string;
267
+ depth: "browse" | "evaluate" | "preorder";
268
+ service_name: string;
269
+ service_basics: {
270
+ bPublished: boolean;
271
+ bPaused: boolean;
272
+ sales_count: number;
273
+ has_machine: boolean;
274
+ has_buy_guard: boolean;
275
+ has_um_contact: boolean;
276
+ arbitrations_count: number;
277
+ };
278
+ risk_score?: {
279
+ advice: string[];
280
+ level: "low" | "medium_low" | "medium_high" | "high";
281
+ total: number;
282
+ red_flags: string[];
283
+ dimensions: {
284
+ name: "fund" | "workflow" | "trust" | "behavior";
285
+ score: number;
286
+ max_score: number;
287
+ checks: {
288
+ description: string;
289
+ id: string;
290
+ dimension: "fund" | "workflow" | "trust" | "behavior";
291
+ weight: number;
292
+ passed: boolean;
293
+ advice?: string | undefined;
294
+ }[];
295
+ }[];
296
+ } | undefined;
297
+ info_puzzle?: {
298
+ completeness: number;
299
+ gaps: string[];
300
+ assembled_at: number;
301
+ } | undefined;
302
+ }>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ result: {
305
+ trust_score: {
306
+ score: number;
307
+ summary: string;
308
+ warnings: string[];
309
+ level: "high_risk" | "caution" | "moderate" | "trusted";
310
+ breakdown: {
311
+ description: string;
312
+ score: number;
313
+ maxScore: number;
314
+ humanReadable: string;
315
+ }[];
316
+ };
317
+ service_id: string;
318
+ order_amount: string;
319
+ depth: "browse" | "evaluate" | "preorder";
320
+ service_name: string;
321
+ service_basics: {
322
+ bPublished: boolean;
323
+ bPaused: boolean;
324
+ sales_count: number;
325
+ has_machine: boolean;
326
+ has_buy_guard: boolean;
327
+ has_um_contact: boolean;
328
+ arbitrations_count: number;
329
+ };
330
+ risk_score?: {
331
+ advice: string[];
332
+ level: "low" | "medium_low" | "medium_high" | "high";
333
+ total: number;
334
+ red_flags: string[];
335
+ dimensions: {
336
+ name: "fund" | "workflow" | "trust" | "behavior";
337
+ score: number;
338
+ max_score: number;
339
+ checks: {
340
+ description: string;
341
+ id: string;
342
+ dimension: "fund" | "workflow" | "trust" | "behavior";
343
+ weight: number;
344
+ passed: boolean;
345
+ advice?: string | undefined;
346
+ }[];
347
+ }[];
348
+ } | undefined;
349
+ info_puzzle?: {
350
+ completeness: number;
351
+ gaps: string[];
352
+ assembled_at: number;
353
+ } | undefined;
354
+ };
355
+ }, {
356
+ result: {
357
+ trust_score: {
358
+ score: number;
359
+ summary: string;
360
+ warnings: string[];
361
+ level: "high_risk" | "caution" | "moderate" | "trusted";
362
+ breakdown: {
363
+ description: string;
364
+ score: number;
365
+ maxScore: number;
366
+ humanReadable: string;
367
+ }[];
368
+ };
369
+ service_id: string;
370
+ order_amount: string;
371
+ depth: "browse" | "evaluate" | "preorder";
372
+ service_name: string;
373
+ service_basics: {
374
+ bPublished: boolean;
375
+ bPaused: boolean;
376
+ sales_count: number;
377
+ has_machine: boolean;
378
+ has_buy_guard: boolean;
379
+ has_um_contact: boolean;
380
+ arbitrations_count: number;
381
+ };
382
+ risk_score?: {
383
+ advice: string[];
384
+ level: "low" | "medium_low" | "medium_high" | "high";
385
+ total: number;
386
+ red_flags: string[];
387
+ dimensions: {
388
+ name: "fund" | "workflow" | "trust" | "behavior";
389
+ score: number;
390
+ max_score: number;
391
+ checks: {
392
+ description: string;
393
+ id: string;
394
+ dimension: "fund" | "workflow" | "trust" | "behavior";
395
+ weight: number;
396
+ passed: boolean;
397
+ advice?: string | undefined;
398
+ }[];
399
+ }[];
400
+ } | undefined;
401
+ info_puzzle?: {
402
+ completeness: number;
403
+ gaps: string[];
404
+ assembled_at: number;
405
+ } | undefined;
406
+ };
407
+ }>;
@@ -0,0 +1,113 @@
1
+ import { z } from "zod";
2
+ import { NameOrAddressSchema } from "../common/index.js";
3
+ export const TrustScoreInputSchema = z
4
+ .object({
5
+ service: NameOrAddressSchema.describe("Service object ID or local_mark name to evaluate. " +
6
+ "Must reference an existing Service object on-chain."),
7
+ order_amount: z
8
+ .union([z.string(), z.number()])
9
+ .optional()
10
+ .describe("Optional order amount (in smallest token unit, e.g. 2000000000 for 2 WOW). " +
11
+ "Used for fund-safety dimension risk assessment. " +
12
+ "If omitted, the first active sale price of the service is used."),
13
+ depth: z
14
+ .enum(["browse", "evaluate", "preorder"])
15
+ .optional()
16
+ .describe("InfoPuzzle collection depth. " +
17
+ "browse: only Service basics + trust score; " +
18
+ "evaluate (default): + workflow/fund/trust dimensions risk assessment; " +
19
+ "preorder: + merchant behavior + market context (most thorough)."),
20
+ network: z
21
+ .string()
22
+ .optional()
23
+ .describe("Network override (e.g. 'mainnet', 'testnet'). If omitted, uses default."),
24
+ no_cache: z
25
+ .boolean()
26
+ .optional()
27
+ .describe("Skip object cache and force a fresh on-chain query."),
28
+ })
29
+ .strict();
30
+ export const TrustScoreOutputSchema = z
31
+ .object({
32
+ result: z
33
+ .object({
34
+ service_id: z.string().describe("The Service object ID or local_mark that was evaluated."),
35
+ service_name: z.string().describe("Service display name (falls back to service_id if unnamed)."),
36
+ service_basics: z
37
+ .object({
38
+ bPublished: z.boolean().describe("Whether the Service is published (open for orders)."),
39
+ bPaused: z.boolean().describe("Whether the Service is temporarily paused."),
40
+ sales_count: z.number().int().nonnegative().describe("Number of active (non-suspended) sale entries."),
41
+ has_machine: z.boolean().describe("Whether a Machine workflow is attached."),
42
+ has_buy_guard: z.boolean().describe("Whether a buy-side Guard is configured."),
43
+ has_um_contact: z.boolean().describe("Whether a Messenger (um) contact is configured."),
44
+ arbitrations_count: z.number().int().nonnegative().describe("Number of arbitration entries attached to the Service."),
45
+ })
46
+ .describe("Service snapshot — basic on-chain state."),
47
+ trust_score: z
48
+ .object({
49
+ score: z.number().min(0).max(100).describe("Overall trust score (0-100, higher = more trustworthy)."),
50
+ level: z
51
+ .enum(["high_risk", "caution", "moderate", "trusted"])
52
+ .describe("Trust level label derived from the score."),
53
+ summary: z.string().describe("One-line human-readable trust summary."),
54
+ warnings: z.array(z.string()).describe("Trust warnings (e.g. low arbitration dimension score)."),
55
+ breakdown: z
56
+ .array(z.object({
57
+ score: z.number().describe("Dimension score achieved."),
58
+ maxScore: z.number().describe("Dimension max possible score."),
59
+ description: z.string().describe("Dimension name / description."),
60
+ humanReadable: z.string().describe("Human-readable dimension explanation."),
61
+ }))
62
+ .describe("5-dimension breakdown: arbitration / reviews / fulfillment / fund_safety / transparency."),
63
+ })
64
+ .describe("ServiceTrustScore — 0-100 score across 5 trust dimensions."),
65
+ order_amount: z
66
+ .string()
67
+ .describe("Order amount used for fund-safety assessment, in smallest token unit (bigint as string)."),
68
+ depth: z
69
+ .enum(["browse", "evaluate", "preorder"])
70
+ .describe("Actual InfoPuzzle collection depth used (defaults to 'evaluate')."),
71
+ risk_score: z
72
+ .object({
73
+ total: z.number().min(0).max(100).describe("Overall risk score (0-100, higher = riskier)."),
74
+ level: z
75
+ .enum(["low", "medium_low", "medium_high", "high"])
76
+ .describe("Risk level label derived from the total score."),
77
+ red_flags: z.array(z.string()).describe("Critical risk red flags detected."),
78
+ advice: z.array(z.string()).describe("Risk mitigation advice."),
79
+ dimensions: z
80
+ .array(z.object({
81
+ name: z
82
+ .enum(["workflow", "fund", "trust", "behavior"])
83
+ .describe("Risk dimension name."),
84
+ score: z.number().describe("Dimension score achieved."),
85
+ max_score: z.number().describe("Dimension max possible score."),
86
+ checks: z.array(z.object({
87
+ id: z.string().describe("Check identifier."),
88
+ dimension: z
89
+ .enum(["workflow", "fund", "trust", "behavior"])
90
+ .describe("Dimension this check belongs to."),
91
+ description: z.string().describe("Check description."),
92
+ weight: z.number().describe("Check weight within its dimension (percentage)."),
93
+ passed: z.boolean().describe("Whether the check passed."),
94
+ advice: z.string().optional().describe("Advice when the check failed."),
95
+ })).describe("Individual risk checks within this dimension."),
96
+ }))
97
+ .describe("4-dimension breakdown: workflow / fund / trust / behavior."),
98
+ })
99
+ .optional()
100
+ .describe("RiskScore — present only when depth >= 'evaluate'."),
101
+ info_puzzle: z
102
+ .object({
103
+ completeness: z.number().min(0).max(1).describe("InfoPuzzle completeness ratio (0-1)."),
104
+ gaps: z.array(z.string()).describe("Missing key puzzle pieces."),
105
+ assembled_at: z.number().describe("Assembly timestamp (ms since epoch)."),
106
+ })
107
+ .optional()
108
+ .describe("InfoPuzzle summary — present only when depth >= 'evaluate'."),
109
+ })
110
+ .describe("Trust score result. Contains: trust_score (ServiceTrustScore), " +
111
+ "risk_score (RiskScore, when depth >= evaluate), info_puzzle summary, " +
112
+ "and service_basics snapshot."),
113
+ });
@@ -686,14 +686,7 @@
686
686
  },
687
687
  "parsedJson": {
688
688
  "type": "object",
689
- "additionalProperties": {
690
- "type": [
691
- "string",
692
- "number",
693
- "boolean",
694
- "null"
695
- ]
696
- },
689
+ "additionalProperties": {},
697
690
  "description": "Parsed JSON value of the event"
698
691
  },
699
692
  "sender": {
@@ -763,14 +756,7 @@
763
756
  },
764
757
  "parsedJson": {
765
758
  "type": "object",
766
- "additionalProperties": {
767
- "type": [
768
- "string",
769
- "number",
770
- "boolean",
771
- "null"
772
- ]
773
- },
759
+ "additionalProperties": {},
774
760
  "description": "Parsed JSON value of the event"
775
761
  },
776
762
  "sender": {
@@ -1375,6 +1361,29 @@
1375
1361
  "error": {
1376
1362
  "type": "string",
1377
1363
  "description": "Error message"
1364
+ },
1365
+ "error_code": {
1366
+ "type": "string",
1367
+ "enum": [
1368
+ "invalid_parameter",
1369
+ "guard_rejected",
1370
+ "state_conflict",
1371
+ "insufficient_balance",
1372
+ "object_not_found",
1373
+ "permission_denied",
1374
+ "immutable_violation",
1375
+ "network_error",
1376
+ "unknown"
1377
+ ],
1378
+ "description": "Error classification for programmatic recovery"
1379
+ },
1380
+ "retryable": {
1381
+ "type": "boolean",
1382
+ "description": "Whether the operation can be retried as-is"
1383
+ },
1384
+ "recovery_hint": {
1385
+ "type": "string",
1386
+ "description": "Recovery suggestion for AI or user"
1378
1387
  }
1379
1388
  },
1380
1389
  "required": [
@@ -72,7 +72,7 @@
72
72
  "properties": {
73
73
  "address": {
74
74
  "type": "string",
75
- "description": "Valid ID: 0x prefix + 64 hex characters, or builtin ID (0x5-0x9, @0xaaa, @0xaab, @0x403, @0xacc, @0xc)"
75
+ "description": "Valid ID: 0x prefix + 64 hex characters, or builtin ID (0x5-0x9, 0xa, 0xc, 0xd, 0x403, 0xaaa, 0xaab, 0xacc)"
76
76
  },
77
77
  "name": {
78
78
  "$ref": "#/definitions/account_operation/properties/gen/properties/name",