@crediolabs/policy-synth 0.1.3 → 0.1.5

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +193 -5
  3. package/dist/adapters/interpreter/adapter.d.ts +38 -0
  4. package/dist/adapters/interpreter/adapter.js +522 -0
  5. package/dist/adapters/interpreter/index.d.ts +1 -0
  6. package/dist/adapters/interpreter/index.js +2 -0
  7. package/dist/adapters/oz/adapter.js +2 -0
  8. package/dist/codegen/compile-gate.d.ts +33 -0
  9. package/dist/codegen/compile-gate.js +119 -0
  10. package/dist/codegen/index.d.ts +2 -0
  11. package/dist/codegen/index.js +8 -0
  12. package/dist/codegen/template.d.ts +18 -0
  13. package/dist/codegen/template.js +131 -0
  14. package/dist/errors.d.ts +1 -1
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.js +2 -0
  17. package/dist/ir/types.d.ts +13 -2
  18. package/dist/predicate/encode.d.ts +10 -0
  19. package/dist/predicate/encode.js +249 -0
  20. package/dist/predicate/index.d.ts +1 -0
  21. package/dist/predicate/index.js +2 -0
  22. package/dist/record/decode.d.ts +6 -3
  23. package/dist/record/decode.js +13 -3
  24. package/dist/review-card/builder.d.ts +14 -0
  25. package/dist/review-card/builder.js +261 -0
  26. package/dist/review-card/conflict.d.ts +40 -0
  27. package/dist/review-card/conflict.js +111 -0
  28. package/dist/review-card/cross-check.d.ts +11 -0
  29. package/dist/review-card/cross-check.js +148 -0
  30. package/dist/review-card/index.d.ts +3 -0
  31. package/dist/review-card/index.js +4 -0
  32. package/dist/run/index.d.ts +31 -0
  33. package/dist/run/index.js +164 -0
  34. package/dist/run/schemas.d.ts +2003 -0
  35. package/dist/run/schemas.js +215 -0
  36. package/dist/synth/compose-from-recording.d.ts +35 -7
  37. package/dist/synth/compose-from-recording.js +225 -34
  38. package/dist/synth/deny-cases.d.ts +12 -0
  39. package/dist/synth/deny-cases.js +377 -0
  40. package/dist/synth/evaluate.d.ts +39 -0
  41. package/dist/synth/evaluate.js +425 -0
  42. package/dist/synth/harness.d.ts +16 -0
  43. package/dist/synth/harness.js +26 -0
  44. package/dist/synth/index.d.ts +4 -0
  45. package/dist/synth/index.js +4 -0
  46. package/dist/synth/minimize.d.ts +4 -0
  47. package/dist/synth/minimize.js +38 -0
  48. package/dist/synth/predicate-literals.d.ts +5 -0
  49. package/dist/synth/predicate-literals.js +25 -0
  50. package/dist/synth/synthesize-from-recording.d.ts +37 -5
  51. package/dist/synth/synthesize-from-recording.js +550 -18
  52. package/dist/types.d.ts +40 -1
  53. package/dist/types.js +17 -0
  54. package/dist/verify/envelope.d.ts +15 -0
  55. package/dist/verify/envelope.js +22 -0
  56. package/dist/verify/index.d.ts +3 -0
  57. package/dist/verify/index.js +3 -0
  58. package/dist/verify/simulate.d.ts +31 -0
  59. package/dist/verify/simulate.js +258 -0
  60. package/dist/verify/verify.d.ts +21 -0
  61. package/dist/verify/verify.js +189 -0
  62. package/dist-cjs/adapters/interpreter/adapter.d.ts +38 -0
  63. package/dist-cjs/adapters/interpreter/adapter.js +527 -0
  64. package/dist-cjs/adapters/interpreter/index.d.ts +1 -0
  65. package/dist-cjs/adapters/interpreter/index.js +8 -0
  66. package/dist-cjs/adapters/oz/adapter.d.ts +20 -0
  67. package/dist-cjs/adapters/oz/adapter.js +289 -0
  68. package/dist-cjs/adapters/oz/index.d.ts +1 -0
  69. package/dist-cjs/adapters/oz/index.js +8 -0
  70. package/dist-cjs/codegen/compile-gate.d.ts +33 -0
  71. package/dist-cjs/codegen/compile-gate.js +123 -0
  72. package/dist-cjs/codegen/index.d.ts +2 -0
  73. package/dist-cjs/codegen/index.js +14 -0
  74. package/dist-cjs/codegen/template.d.ts +18 -0
  75. package/dist-cjs/codegen/template.js +134 -0
  76. package/dist-cjs/errors.d.ts +37 -0
  77. package/dist-cjs/errors.js +3 -0
  78. package/dist-cjs/index.d.ts +11 -0
  79. package/dist-cjs/index.js +27 -0
  80. package/dist-cjs/ir/index.d.ts +1 -0
  81. package/dist-cjs/ir/index.js +3 -0
  82. package/dist-cjs/ir/types.d.ts +108 -0
  83. package/dist-cjs/ir/types.js +12 -0
  84. package/dist-cjs/mandate/index.d.ts +2 -0
  85. package/dist-cjs/mandate/index.js +6 -0
  86. package/dist-cjs/mandate/to-ir.d.ts +3 -0
  87. package/dist-cjs/mandate/to-ir.js +63 -0
  88. package/dist-cjs/mandate/types.d.ts +20 -0
  89. package/dist-cjs/mandate/types.js +9 -0
  90. package/dist-cjs/package.json +3 -0
  91. package/dist-cjs/predicate/encode.d.ts +10 -0
  92. package/dist-cjs/predicate/encode.js +252 -0
  93. package/dist-cjs/predicate/index.d.ts +1 -0
  94. package/dist-cjs/predicate/index.js +6 -0
  95. package/dist-cjs/record/decode.d.ts +79 -0
  96. package/dist-cjs/record/decode.js +398 -0
  97. package/dist-cjs/record/freshness.d.ts +17 -0
  98. package/dist-cjs/record/freshness.js +55 -0
  99. package/dist-cjs/record/index.d.ts +21 -0
  100. package/dist-cjs/record/index.js +166 -0
  101. package/dist-cjs/record/movements.d.ts +20 -0
  102. package/dist-cjs/record/movements.js +192 -0
  103. package/dist-cjs/record/rpc.d.ts +22 -0
  104. package/dist-cjs/record/rpc.js +74 -0
  105. package/dist-cjs/record/validate.d.ts +22 -0
  106. package/dist-cjs/record/validate.js +63 -0
  107. package/dist-cjs/registry/identify.d.ts +11 -0
  108. package/dist-cjs/registry/identify.js +87 -0
  109. package/dist-cjs/registry/index.d.ts +3 -0
  110. package/dist-cjs/registry/index.js +15 -0
  111. package/dist-cjs/registry/known-addresses.d.ts +16 -0
  112. package/dist-cjs/registry/known-addresses.js +53 -0
  113. package/dist-cjs/registry/protocols.d.ts +38 -0
  114. package/dist-cjs/registry/protocols.js +153 -0
  115. package/dist-cjs/review-card/builder.d.ts +14 -0
  116. package/dist-cjs/review-card/builder.js +264 -0
  117. package/dist-cjs/review-card/conflict.d.ts +40 -0
  118. package/dist-cjs/review-card/conflict.js +114 -0
  119. package/dist-cjs/review-card/cross-check.d.ts +11 -0
  120. package/dist-cjs/review-card/cross-check.js +151 -0
  121. package/dist-cjs/review-card/index.d.ts +3 -0
  122. package/dist-cjs/review-card/index.js +10 -0
  123. package/dist-cjs/run/index.d.ts +31 -0
  124. package/dist-cjs/run/index.js +178 -0
  125. package/dist-cjs/run/schemas.d.ts +2003 -0
  126. package/dist-cjs/run/schemas.js +218 -0
  127. package/dist-cjs/seams/index.d.ts +1 -0
  128. package/dist-cjs/seams/index.js +3 -0
  129. package/dist-cjs/seams/types.d.ts +66 -0
  130. package/dist-cjs/seams/types.js +12 -0
  131. package/dist-cjs/synth/compose-from-recording.d.ts +64 -0
  132. package/dist-cjs/synth/compose-from-recording.js +356 -0
  133. package/dist-cjs/synth/deny-cases.d.ts +12 -0
  134. package/dist-cjs/synth/deny-cases.js +380 -0
  135. package/dist-cjs/synth/evaluate.d.ts +39 -0
  136. package/dist-cjs/synth/evaluate.js +428 -0
  137. package/dist-cjs/synth/harness.d.ts +16 -0
  138. package/dist-cjs/synth/harness.js +29 -0
  139. package/dist-cjs/synth/index.d.ts +9 -0
  140. package/dist-cjs/synth/index.js +23 -0
  141. package/dist-cjs/synth/lower.d.ts +23 -0
  142. package/dist-cjs/synth/lower.js +119 -0
  143. package/dist-cjs/synth/minimize.d.ts +4 -0
  144. package/dist-cjs/synth/minimize.js +41 -0
  145. package/dist-cjs/synth/predicate-literals.d.ts +5 -0
  146. package/dist-cjs/synth/predicate-literals.js +28 -0
  147. package/dist-cjs/synth/scope.d.ts +26 -0
  148. package/dist-cjs/synth/scope.js +81 -0
  149. package/dist-cjs/synth/synthesize-from-mandate.d.ts +5 -0
  150. package/dist-cjs/synth/synthesize-from-mandate.js +37 -0
  151. package/dist-cjs/synth/synthesize-from-recording.d.ts +49 -0
  152. package/dist-cjs/synth/synthesize-from-recording.js +711 -0
  153. package/dist-cjs/types.d.ts +288 -0
  154. package/dist-cjs/types.js +55 -0
  155. package/dist-cjs/verify/envelope.d.ts +15 -0
  156. package/dist-cjs/verify/envelope.js +23 -0
  157. package/dist-cjs/verify/index.d.ts +3 -0
  158. package/dist-cjs/verify/index.js +8 -0
  159. package/dist-cjs/verify/simulate.d.ts +31 -0
  160. package/dist-cjs/verify/simulate.js +261 -0
  161. package/dist-cjs/verify/verify.d.ts +21 -0
  162. package/dist-cjs/verify/verify.js +192 -0
  163. package/package.json +43 -3
  164. package/src/adapters/interpreter/adapter.ts +642 -0
  165. package/src/adapters/interpreter/index.ts +8 -0
  166. package/src/adapters/oz/adapter.ts +2 -0
  167. package/src/codegen/compile-gate.ts +162 -0
  168. package/src/codegen/index.ts +17 -0
  169. package/src/codegen/template.ts +148 -0
  170. package/src/errors.ts +2 -0
  171. package/src/index.ts +2 -0
  172. package/src/ir/types.ts +9 -2
  173. package/src/predicate/encode.ts +307 -0
  174. package/src/predicate/index.ts +3 -0
  175. package/src/record/decode.ts +21 -10
  176. package/src/review-card/builder.ts +303 -0
  177. package/src/review-card/conflict.ts +143 -0
  178. package/src/review-card/cross-check.ts +158 -0
  179. package/src/review-card/index.ts +12 -0
  180. package/src/run/index.ts +213 -0
  181. package/src/run/schemas.ts +242 -0
  182. package/src/synth/compose-from-recording.ts +277 -43
  183. package/src/synth/deny-cases.ts +466 -0
  184. package/src/synth/evaluate.ts +493 -0
  185. package/src/synth/harness.ts +40 -0
  186. package/src/synth/index.ts +12 -0
  187. package/src/synth/minimize.ts +44 -0
  188. package/src/synth/predicate-literals.ts +27 -0
  189. package/src/synth/synthesize-from-recording.ts +655 -19
  190. package/src/types.ts +38 -2
  191. package/src/verify/envelope.ts +28 -0
  192. package/src/verify/index.ts +5 -0
  193. package/src/verify/simulate.ts +311 -0
  194. package/src/verify/verify.ts +243 -0
@@ -0,0 +1,2003 @@
1
+ import { z } from 'zod';
2
+ export declare const NetworkSchema: z.ZodEnum<["mainnet", "testnet"]>;
3
+ export type Network = z.infer<typeof NetworkSchema>;
4
+ /** ScVal subset - normalised subset the synth consumes. Mirrors
5
+ * `ScVal` in packages/policy-synth/src/types.ts. */
6
+ export declare const ScValSchema: z.ZodType<unknown>;
7
+ /** ContractInvocation mirrors the core. Annotated with an explicit
8
+ * `z.ZodType<unknown>` (like ScValSchema above) so the self-referential
9
+ * `subInvocations` field does not trip TS's circular type inference. */
10
+ export declare const ContractInvocationSchema: z.ZodType<unknown>;
11
+ export declare const TokenMovementSchema: z.ZodObject<{
12
+ token: z.ZodString;
13
+ from: z.ZodString;
14
+ to: z.ZodString;
15
+ amount: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ amount: string;
18
+ token: string;
19
+ from: string;
20
+ to: string;
21
+ }, {
22
+ amount: string;
23
+ token: string;
24
+ from: string;
25
+ to: string;
26
+ }>;
27
+ export declare const OnChainEventSchema: z.ZodObject<{
28
+ contract: z.ZodString;
29
+ topics: z.ZodArray<z.ZodString, "many">;
30
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ contract: string;
33
+ topics: string[];
34
+ data?: unknown;
35
+ }, {
36
+ contract: string;
37
+ topics: string[];
38
+ data?: unknown;
39
+ }>;
40
+ export declare const ParseConfidenceSchema: z.ZodObject<{
41
+ overall: z.ZodNumber;
42
+ knownContracts: z.ZodArray<z.ZodString, "many">;
43
+ unknownContracts: z.ZodArray<z.ZodObject<{
44
+ contract: z.ZodString;
45
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ contract: string;
48
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
49
+ }, {
50
+ contract: string;
51
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
52
+ }>, "many">;
53
+ opaqueScVals: z.ZodArray<z.ZodObject<{
54
+ path: z.ZodString;
55
+ type: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ type: string;
58
+ path: string;
59
+ }, {
60
+ type: string;
61
+ path: string;
62
+ }>, "many">;
63
+ thresholdUsed: z.ZodNumber;
64
+ }, "strip", z.ZodTypeAny, {
65
+ opaqueScVals: {
66
+ type: string;
67
+ path: string;
68
+ }[];
69
+ unknownContracts: {
70
+ contract: string;
71
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
72
+ }[];
73
+ overall: number;
74
+ knownContracts: string[];
75
+ thresholdUsed: number;
76
+ }, {
77
+ opaqueScVals: {
78
+ type: string;
79
+ path: string;
80
+ }[];
81
+ unknownContracts: {
82
+ contract: string;
83
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
84
+ }[];
85
+ overall: number;
86
+ knownContracts: string[];
87
+ thresholdUsed: number;
88
+ }>;
89
+ /** RecordedTransaction mirrors the core RecordedTransaction. The output shape
90
+ * is referenced by name in the tool result structured content; we deliberately
91
+ * type it loosely (`z.unknown()`) on the success path so the core remains the
92
+ * single source of truth for the wire payload. */
93
+ export declare const RecordedTransactionSchema: z.ZodObject<{
94
+ network: z.ZodEnum<["mainnet", "testnet"]>;
95
+ signers: z.ZodArray<z.ZodString, "many">;
96
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
97
+ tokenMovements: z.ZodArray<z.ZodObject<{
98
+ token: z.ZodString;
99
+ from: z.ZodString;
100
+ to: z.ZodString;
101
+ amount: z.ZodString;
102
+ }, "strip", z.ZodTypeAny, {
103
+ amount: string;
104
+ token: string;
105
+ from: string;
106
+ to: string;
107
+ }, {
108
+ amount: string;
109
+ token: string;
110
+ from: string;
111
+ to: string;
112
+ }>, "many">;
113
+ events: z.ZodArray<z.ZodObject<{
114
+ contract: z.ZodString;
115
+ topics: z.ZodArray<z.ZodString, "many">;
116
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ contract: string;
119
+ topics: string[];
120
+ data?: unknown;
121
+ }, {
122
+ contract: string;
123
+ topics: string[];
124
+ data?: unknown;
125
+ }>, "many">;
126
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
127
+ ledgerSequence: z.ZodNumber;
128
+ fetchedAt: z.ZodNumber;
129
+ parseConfidence: z.ZodObject<{
130
+ overall: z.ZodNumber;
131
+ knownContracts: z.ZodArray<z.ZodString, "many">;
132
+ unknownContracts: z.ZodArray<z.ZodObject<{
133
+ contract: z.ZodString;
134
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ contract: string;
137
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
138
+ }, {
139
+ contract: string;
140
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
141
+ }>, "many">;
142
+ opaqueScVals: z.ZodArray<z.ZodObject<{
143
+ path: z.ZodString;
144
+ type: z.ZodString;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: string;
147
+ path: string;
148
+ }, {
149
+ type: string;
150
+ path: string;
151
+ }>, "many">;
152
+ thresholdUsed: z.ZodNumber;
153
+ }, "strip", z.ZodTypeAny, {
154
+ opaqueScVals: {
155
+ type: string;
156
+ path: string;
157
+ }[];
158
+ unknownContracts: {
159
+ contract: string;
160
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
161
+ }[];
162
+ overall: number;
163
+ knownContracts: string[];
164
+ thresholdUsed: number;
165
+ }, {
166
+ opaqueScVals: {
167
+ type: string;
168
+ path: string;
169
+ }[];
170
+ unknownContracts: {
171
+ contract: string;
172
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
173
+ }[];
174
+ overall: number;
175
+ knownContracts: string[];
176
+ thresholdUsed: number;
177
+ }>;
178
+ sourceAccount: z.ZodString;
179
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
180
+ network: z.ZodEnum<["mainnet", "testnet"]>;
181
+ signers: z.ZodArray<z.ZodString, "many">;
182
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
183
+ tokenMovements: z.ZodArray<z.ZodObject<{
184
+ token: z.ZodString;
185
+ from: z.ZodString;
186
+ to: z.ZodString;
187
+ amount: z.ZodString;
188
+ }, "strip", z.ZodTypeAny, {
189
+ amount: string;
190
+ token: string;
191
+ from: string;
192
+ to: string;
193
+ }, {
194
+ amount: string;
195
+ token: string;
196
+ from: string;
197
+ to: string;
198
+ }>, "many">;
199
+ events: z.ZodArray<z.ZodObject<{
200
+ contract: z.ZodString;
201
+ topics: z.ZodArray<z.ZodString, "many">;
202
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ contract: string;
205
+ topics: string[];
206
+ data?: unknown;
207
+ }, {
208
+ contract: string;
209
+ topics: string[];
210
+ data?: unknown;
211
+ }>, "many">;
212
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
213
+ ledgerSequence: z.ZodNumber;
214
+ fetchedAt: z.ZodNumber;
215
+ parseConfidence: z.ZodObject<{
216
+ overall: z.ZodNumber;
217
+ knownContracts: z.ZodArray<z.ZodString, "many">;
218
+ unknownContracts: z.ZodArray<z.ZodObject<{
219
+ contract: z.ZodString;
220
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ contract: string;
223
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
224
+ }, {
225
+ contract: string;
226
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
227
+ }>, "many">;
228
+ opaqueScVals: z.ZodArray<z.ZodObject<{
229
+ path: z.ZodString;
230
+ type: z.ZodString;
231
+ }, "strip", z.ZodTypeAny, {
232
+ type: string;
233
+ path: string;
234
+ }, {
235
+ type: string;
236
+ path: string;
237
+ }>, "many">;
238
+ thresholdUsed: z.ZodNumber;
239
+ }, "strip", z.ZodTypeAny, {
240
+ opaqueScVals: {
241
+ type: string;
242
+ path: string;
243
+ }[];
244
+ unknownContracts: {
245
+ contract: string;
246
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
247
+ }[];
248
+ overall: number;
249
+ knownContracts: string[];
250
+ thresholdUsed: number;
251
+ }, {
252
+ opaqueScVals: {
253
+ type: string;
254
+ path: string;
255
+ }[];
256
+ unknownContracts: {
257
+ contract: string;
258
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
259
+ }[];
260
+ overall: number;
261
+ knownContracts: string[];
262
+ thresholdUsed: number;
263
+ }>;
264
+ sourceAccount: z.ZodString;
265
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
266
+ network: z.ZodEnum<["mainnet", "testnet"]>;
267
+ signers: z.ZodArray<z.ZodString, "many">;
268
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
269
+ tokenMovements: z.ZodArray<z.ZodObject<{
270
+ token: z.ZodString;
271
+ from: z.ZodString;
272
+ to: z.ZodString;
273
+ amount: z.ZodString;
274
+ }, "strip", z.ZodTypeAny, {
275
+ amount: string;
276
+ token: string;
277
+ from: string;
278
+ to: string;
279
+ }, {
280
+ amount: string;
281
+ token: string;
282
+ from: string;
283
+ to: string;
284
+ }>, "many">;
285
+ events: z.ZodArray<z.ZodObject<{
286
+ contract: z.ZodString;
287
+ topics: z.ZodArray<z.ZodString, "many">;
288
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
289
+ }, "strip", z.ZodTypeAny, {
290
+ contract: string;
291
+ topics: string[];
292
+ data?: unknown;
293
+ }, {
294
+ contract: string;
295
+ topics: string[];
296
+ data?: unknown;
297
+ }>, "many">;
298
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
299
+ ledgerSequence: z.ZodNumber;
300
+ fetchedAt: z.ZodNumber;
301
+ parseConfidence: z.ZodObject<{
302
+ overall: z.ZodNumber;
303
+ knownContracts: z.ZodArray<z.ZodString, "many">;
304
+ unknownContracts: z.ZodArray<z.ZodObject<{
305
+ contract: z.ZodString;
306
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ contract: string;
309
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
310
+ }, {
311
+ contract: string;
312
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
313
+ }>, "many">;
314
+ opaqueScVals: z.ZodArray<z.ZodObject<{
315
+ path: z.ZodString;
316
+ type: z.ZodString;
317
+ }, "strip", z.ZodTypeAny, {
318
+ type: string;
319
+ path: string;
320
+ }, {
321
+ type: string;
322
+ path: string;
323
+ }>, "many">;
324
+ thresholdUsed: z.ZodNumber;
325
+ }, "strip", z.ZodTypeAny, {
326
+ opaqueScVals: {
327
+ type: string;
328
+ path: string;
329
+ }[];
330
+ unknownContracts: {
331
+ contract: string;
332
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
333
+ }[];
334
+ overall: number;
335
+ knownContracts: string[];
336
+ thresholdUsed: number;
337
+ }, {
338
+ opaqueScVals: {
339
+ type: string;
340
+ path: string;
341
+ }[];
342
+ unknownContracts: {
343
+ contract: string;
344
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
345
+ }[];
346
+ overall: number;
347
+ knownContracts: string[];
348
+ thresholdUsed: number;
349
+ }>;
350
+ sourceAccount: z.ZodString;
351
+ }, z.ZodTypeAny, "passthrough">>;
352
+ /** MandateSpec mirrors the core MandateSpec. The deterministic Mandate
353
+ * front-end needs no parseConfidence; the tool adapter injects the full
354
+ * confidence after synthesis so the orchestrator can compare. */
355
+ export declare const MandateSpecSchema: z.ZodObject<{
356
+ chain: z.ZodLiteral<"stellar">;
357
+ contract: z.ZodString;
358
+ method: z.ZodOptional<z.ZodString>;
359
+ spendingLimit: z.ZodOptional<z.ZodObject<{
360
+ token: z.ZodString;
361
+ limit: z.ZodString;
362
+ windowSeconds: z.ZodNumber;
363
+ }, "strip", z.ZodTypeAny, {
364
+ token: string;
365
+ limit: string;
366
+ windowSeconds: number;
367
+ }, {
368
+ token: string;
369
+ limit: string;
370
+ windowSeconds: number;
371
+ }>>;
372
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
373
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
374
+ expiry: z.ZodOptional<z.ZodObject<{
375
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
376
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
377
+ }, "strip", z.ZodTypeAny, {
378
+ validUntilLedger?: number | undefined;
379
+ validUntilUnixSeconds?: number | undefined;
380
+ }, {
381
+ validUntilLedger?: number | undefined;
382
+ validUntilUnixSeconds?: number | undefined;
383
+ }>>;
384
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
385
+ chain: z.ZodLiteral<"stellar">;
386
+ contract: z.ZodString;
387
+ method: z.ZodOptional<z.ZodString>;
388
+ spendingLimit: z.ZodOptional<z.ZodObject<{
389
+ token: z.ZodString;
390
+ limit: z.ZodString;
391
+ windowSeconds: z.ZodNumber;
392
+ }, "strip", z.ZodTypeAny, {
393
+ token: string;
394
+ limit: string;
395
+ windowSeconds: number;
396
+ }, {
397
+ token: string;
398
+ limit: string;
399
+ windowSeconds: number;
400
+ }>>;
401
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
402
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
403
+ expiry: z.ZodOptional<z.ZodObject<{
404
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
405
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
406
+ }, "strip", z.ZodTypeAny, {
407
+ validUntilLedger?: number | undefined;
408
+ validUntilUnixSeconds?: number | undefined;
409
+ }, {
410
+ validUntilLedger?: number | undefined;
411
+ validUntilUnixSeconds?: number | undefined;
412
+ }>>;
413
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
414
+ chain: z.ZodLiteral<"stellar">;
415
+ contract: z.ZodString;
416
+ method: z.ZodOptional<z.ZodString>;
417
+ spendingLimit: z.ZodOptional<z.ZodObject<{
418
+ token: z.ZodString;
419
+ limit: z.ZodString;
420
+ windowSeconds: z.ZodNumber;
421
+ }, "strip", z.ZodTypeAny, {
422
+ token: string;
423
+ limit: string;
424
+ windowSeconds: number;
425
+ }, {
426
+ token: string;
427
+ limit: string;
428
+ windowSeconds: number;
429
+ }>>;
430
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
431
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
432
+ expiry: z.ZodOptional<z.ZodObject<{
433
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
434
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ validUntilLedger?: number | undefined;
437
+ validUntilUnixSeconds?: number | undefined;
438
+ }, {
439
+ validUntilLedger?: number | undefined;
440
+ validUntilUnixSeconds?: number | undefined;
441
+ }>>;
442
+ }, z.ZodTypeAny, "passthrough">>;
443
+ /** ComposeUserResponses mirrors the core. */
444
+ export declare const ComposeUserResponsesSchema: z.ZodObject<{
445
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
446
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
447
+ limitAmount: z.ZodOptional<z.ZodString>;
448
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
449
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
450
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
451
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
452
+ limitAmount: z.ZodOptional<z.ZodString>;
453
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
454
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
455
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
456
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
457
+ limitAmount: z.ZodOptional<z.ZodString>;
458
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
459
+ }, z.ZodTypeAny, "passthrough">>;
460
+ /** OzAdapterConfig - the per-network OZ built-in instance addresses. */
461
+ export declare const OzAdapterConfigSchema: z.ZodObject<{
462
+ network: z.ZodEnum<["mainnet", "testnet"]>;
463
+ instances: z.ZodObject<{
464
+ spending_limit: z.ZodString;
465
+ simple_threshold: z.ZodString;
466
+ weighted_threshold: z.ZodString;
467
+ }, "strip", z.ZodTypeAny, {
468
+ spending_limit: string;
469
+ simple_threshold: string;
470
+ weighted_threshold: string;
471
+ }, {
472
+ spending_limit: string;
473
+ simple_threshold: string;
474
+ weighted_threshold: string;
475
+ }>;
476
+ }, "strip", z.ZodTypeAny, {
477
+ network: "mainnet" | "testnet";
478
+ instances: {
479
+ spending_limit: string;
480
+ simple_threshold: string;
481
+ weighted_threshold: string;
482
+ };
483
+ }, {
484
+ network: "mainnet" | "testnet";
485
+ instances: {
486
+ spending_limit: string;
487
+ simple_threshold: string;
488
+ weighted_threshold: string;
489
+ };
490
+ }>;
491
+ export declare const RecordTransactionInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
492
+ hash: z.ZodOptional<z.ZodString>;
493
+ xdr: z.ZodOptional<z.ZodString>;
494
+ network: z.ZodEnum<["mainnet", "testnet"]>;
495
+ confidenceOverride: z.ZodOptional<z.ZodNumber>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ network: "mainnet" | "testnet";
498
+ hash?: string | undefined;
499
+ xdr?: string | undefined;
500
+ confidenceOverride?: number | undefined;
501
+ }, {
502
+ network: "mainnet" | "testnet";
503
+ hash?: string | undefined;
504
+ xdr?: string | undefined;
505
+ confidenceOverride?: number | undefined;
506
+ }>, {
507
+ network: "mainnet" | "testnet";
508
+ hash?: string | undefined;
509
+ xdr?: string | undefined;
510
+ confidenceOverride?: number | undefined;
511
+ }, {
512
+ network: "mainnet" | "testnet";
513
+ hash?: string | undefined;
514
+ xdr?: string | undefined;
515
+ confidenceOverride?: number | undefined;
516
+ }>, {
517
+ network: "mainnet" | "testnet";
518
+ hash?: string | undefined;
519
+ xdr?: string | undefined;
520
+ confidenceOverride?: number | undefined;
521
+ }, {
522
+ network: "mainnet" | "testnet";
523
+ hash?: string | undefined;
524
+ xdr?: string | undefined;
525
+ confidenceOverride?: number | undefined;
526
+ }>;
527
+ export type RecordTransactionInput = z.infer<typeof RecordTransactionInputSchema>;
528
+ export declare const SynthesizePolicyMandateInputSchema: z.ZodObject<{
529
+ source: z.ZodLiteral<"mandate">;
530
+ mandate: z.ZodObject<{
531
+ chain: z.ZodLiteral<"stellar">;
532
+ contract: z.ZodString;
533
+ method: z.ZodOptional<z.ZodString>;
534
+ spendingLimit: z.ZodOptional<z.ZodObject<{
535
+ token: z.ZodString;
536
+ limit: z.ZodString;
537
+ windowSeconds: z.ZodNumber;
538
+ }, "strip", z.ZodTypeAny, {
539
+ token: string;
540
+ limit: string;
541
+ windowSeconds: number;
542
+ }, {
543
+ token: string;
544
+ limit: string;
545
+ windowSeconds: number;
546
+ }>>;
547
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
548
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
549
+ expiry: z.ZodOptional<z.ZodObject<{
550
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
551
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
552
+ }, "strip", z.ZodTypeAny, {
553
+ validUntilLedger?: number | undefined;
554
+ validUntilUnixSeconds?: number | undefined;
555
+ }, {
556
+ validUntilLedger?: number | undefined;
557
+ validUntilUnixSeconds?: number | undefined;
558
+ }>>;
559
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
560
+ chain: z.ZodLiteral<"stellar">;
561
+ contract: z.ZodString;
562
+ method: z.ZodOptional<z.ZodString>;
563
+ spendingLimit: z.ZodOptional<z.ZodObject<{
564
+ token: z.ZodString;
565
+ limit: z.ZodString;
566
+ windowSeconds: z.ZodNumber;
567
+ }, "strip", z.ZodTypeAny, {
568
+ token: string;
569
+ limit: string;
570
+ windowSeconds: number;
571
+ }, {
572
+ token: string;
573
+ limit: string;
574
+ windowSeconds: number;
575
+ }>>;
576
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
577
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
578
+ expiry: z.ZodOptional<z.ZodObject<{
579
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
580
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
581
+ }, "strip", z.ZodTypeAny, {
582
+ validUntilLedger?: number | undefined;
583
+ validUntilUnixSeconds?: number | undefined;
584
+ }, {
585
+ validUntilLedger?: number | undefined;
586
+ validUntilUnixSeconds?: number | undefined;
587
+ }>>;
588
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
589
+ chain: z.ZodLiteral<"stellar">;
590
+ contract: z.ZodString;
591
+ method: z.ZodOptional<z.ZodString>;
592
+ spendingLimit: z.ZodOptional<z.ZodObject<{
593
+ token: z.ZodString;
594
+ limit: z.ZodString;
595
+ windowSeconds: z.ZodNumber;
596
+ }, "strip", z.ZodTypeAny, {
597
+ token: string;
598
+ limit: string;
599
+ windowSeconds: number;
600
+ }, {
601
+ token: string;
602
+ limit: string;
603
+ windowSeconds: number;
604
+ }>>;
605
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
606
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
607
+ expiry: z.ZodOptional<z.ZodObject<{
608
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
609
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ validUntilLedger?: number | undefined;
612
+ validUntilUnixSeconds?: number | undefined;
613
+ }, {
614
+ validUntilLedger?: number | undefined;
615
+ validUntilUnixSeconds?: number | undefined;
616
+ }>>;
617
+ }, z.ZodTypeAny, "passthrough">>;
618
+ ozConfig: z.ZodOptional<z.ZodObject<{
619
+ network: z.ZodEnum<["mainnet", "testnet"]>;
620
+ instances: z.ZodObject<{
621
+ spending_limit: z.ZodString;
622
+ simple_threshold: z.ZodString;
623
+ weighted_threshold: z.ZodString;
624
+ }, "strip", z.ZodTypeAny, {
625
+ spending_limit: string;
626
+ simple_threshold: string;
627
+ weighted_threshold: string;
628
+ }, {
629
+ spending_limit: string;
630
+ simple_threshold: string;
631
+ weighted_threshold: string;
632
+ }>;
633
+ }, "strip", z.ZodTypeAny, {
634
+ network: "mainnet" | "testnet";
635
+ instances: {
636
+ spending_limit: string;
637
+ simple_threshold: string;
638
+ weighted_threshold: string;
639
+ };
640
+ }, {
641
+ network: "mainnet" | "testnet";
642
+ instances: {
643
+ spending_limit: string;
644
+ simple_threshold: string;
645
+ weighted_threshold: string;
646
+ };
647
+ }>>;
648
+ }, "strip", z.ZodTypeAny, {
649
+ source: "mandate";
650
+ mandate: {
651
+ contract: string;
652
+ chain: "stellar";
653
+ expiry?: {
654
+ validUntilLedger?: number | undefined;
655
+ validUntilUnixSeconds?: number | undefined;
656
+ } | undefined;
657
+ method?: string | undefined;
658
+ spendingLimit?: {
659
+ token: string;
660
+ limit: string;
661
+ windowSeconds: number;
662
+ } | undefined;
663
+ approvalThreshold?: number | undefined;
664
+ recipients?: string[] | undefined;
665
+ } & {
666
+ [k: string]: unknown;
667
+ };
668
+ ozConfig?: {
669
+ network: "mainnet" | "testnet";
670
+ instances: {
671
+ spending_limit: string;
672
+ simple_threshold: string;
673
+ weighted_threshold: string;
674
+ };
675
+ } | undefined;
676
+ }, {
677
+ source: "mandate";
678
+ mandate: {
679
+ contract: string;
680
+ chain: "stellar";
681
+ expiry?: {
682
+ validUntilLedger?: number | undefined;
683
+ validUntilUnixSeconds?: number | undefined;
684
+ } | undefined;
685
+ method?: string | undefined;
686
+ spendingLimit?: {
687
+ token: string;
688
+ limit: string;
689
+ windowSeconds: number;
690
+ } | undefined;
691
+ approvalThreshold?: number | undefined;
692
+ recipients?: string[] | undefined;
693
+ } & {
694
+ [k: string]: unknown;
695
+ };
696
+ ozConfig?: {
697
+ network: "mainnet" | "testnet";
698
+ instances: {
699
+ spending_limit: string;
700
+ simple_threshold: string;
701
+ weighted_threshold: string;
702
+ };
703
+ } | undefined;
704
+ }>;
705
+ /** Interpreter opt-in for the recording path. Present -> constraints OZ cannot
706
+ * express (per-method scoping, invocation-count windows, oracle bounds, exact
707
+ * hop paths) lower to a real interpreter predicate document instead of being
708
+ * surfaced as warnings. The core deep-validates `smartAccountAddress` (a C...
709
+ * contract, not the recording's G... source) and the tighten-only oracle
710
+ * bounds; the schema stays light so the core owns the friendly ToolErrors. */
711
+ export declare const InterpreterOptionsSchema: z.ZodObject<{
712
+ smartAccountAddress: z.ZodString;
713
+ installNonce: z.ZodOptional<z.ZodNumber>;
714
+ oracleParams: z.ZodOptional<z.ZodObject<{
715
+ maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
716
+ maxDeviationBps: z.ZodOptional<z.ZodNumber>;
717
+ }, "strip", z.ZodTypeAny, {
718
+ maxStalenessSeconds?: number | undefined;
719
+ maxDeviationBps?: number | undefined;
720
+ }, {
721
+ maxStalenessSeconds?: number | undefined;
722
+ maxDeviationBps?: number | undefined;
723
+ }>>;
724
+ }, "strip", z.ZodTypeAny, {
725
+ smartAccountAddress: string;
726
+ oracleParams?: {
727
+ maxStalenessSeconds?: number | undefined;
728
+ maxDeviationBps?: number | undefined;
729
+ } | undefined;
730
+ installNonce?: number | undefined;
731
+ }, {
732
+ smartAccountAddress: string;
733
+ oracleParams?: {
734
+ maxStalenessSeconds?: number | undefined;
735
+ maxDeviationBps?: number | undefined;
736
+ } | undefined;
737
+ installNonce?: number | undefined;
738
+ }>;
739
+ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
740
+ source: z.ZodLiteral<"recording">;
741
+ recordedTx: z.ZodObject<{
742
+ network: z.ZodEnum<["mainnet", "testnet"]>;
743
+ signers: z.ZodArray<z.ZodString, "many">;
744
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
745
+ tokenMovements: z.ZodArray<z.ZodObject<{
746
+ token: z.ZodString;
747
+ from: z.ZodString;
748
+ to: z.ZodString;
749
+ amount: z.ZodString;
750
+ }, "strip", z.ZodTypeAny, {
751
+ amount: string;
752
+ token: string;
753
+ from: string;
754
+ to: string;
755
+ }, {
756
+ amount: string;
757
+ token: string;
758
+ from: string;
759
+ to: string;
760
+ }>, "many">;
761
+ events: z.ZodArray<z.ZodObject<{
762
+ contract: z.ZodString;
763
+ topics: z.ZodArray<z.ZodString, "many">;
764
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
765
+ }, "strip", z.ZodTypeAny, {
766
+ contract: string;
767
+ topics: string[];
768
+ data?: unknown;
769
+ }, {
770
+ contract: string;
771
+ topics: string[];
772
+ data?: unknown;
773
+ }>, "many">;
774
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
775
+ ledgerSequence: z.ZodNumber;
776
+ fetchedAt: z.ZodNumber;
777
+ parseConfidence: z.ZodObject<{
778
+ overall: z.ZodNumber;
779
+ knownContracts: z.ZodArray<z.ZodString, "many">;
780
+ unknownContracts: z.ZodArray<z.ZodObject<{
781
+ contract: z.ZodString;
782
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
783
+ }, "strip", z.ZodTypeAny, {
784
+ contract: string;
785
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
786
+ }, {
787
+ contract: string;
788
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
789
+ }>, "many">;
790
+ opaqueScVals: z.ZodArray<z.ZodObject<{
791
+ path: z.ZodString;
792
+ type: z.ZodString;
793
+ }, "strip", z.ZodTypeAny, {
794
+ type: string;
795
+ path: string;
796
+ }, {
797
+ type: string;
798
+ path: string;
799
+ }>, "many">;
800
+ thresholdUsed: z.ZodNumber;
801
+ }, "strip", z.ZodTypeAny, {
802
+ opaqueScVals: {
803
+ type: string;
804
+ path: string;
805
+ }[];
806
+ unknownContracts: {
807
+ contract: string;
808
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
809
+ }[];
810
+ overall: number;
811
+ knownContracts: string[];
812
+ thresholdUsed: number;
813
+ }, {
814
+ opaqueScVals: {
815
+ type: string;
816
+ path: string;
817
+ }[];
818
+ unknownContracts: {
819
+ contract: string;
820
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
821
+ }[];
822
+ overall: number;
823
+ knownContracts: string[];
824
+ thresholdUsed: number;
825
+ }>;
826
+ sourceAccount: z.ZodString;
827
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
828
+ network: z.ZodEnum<["mainnet", "testnet"]>;
829
+ signers: z.ZodArray<z.ZodString, "many">;
830
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
831
+ tokenMovements: z.ZodArray<z.ZodObject<{
832
+ token: z.ZodString;
833
+ from: z.ZodString;
834
+ to: z.ZodString;
835
+ amount: z.ZodString;
836
+ }, "strip", z.ZodTypeAny, {
837
+ amount: string;
838
+ token: string;
839
+ from: string;
840
+ to: string;
841
+ }, {
842
+ amount: string;
843
+ token: string;
844
+ from: string;
845
+ to: string;
846
+ }>, "many">;
847
+ events: z.ZodArray<z.ZodObject<{
848
+ contract: z.ZodString;
849
+ topics: z.ZodArray<z.ZodString, "many">;
850
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
851
+ }, "strip", z.ZodTypeAny, {
852
+ contract: string;
853
+ topics: string[];
854
+ data?: unknown;
855
+ }, {
856
+ contract: string;
857
+ topics: string[];
858
+ data?: unknown;
859
+ }>, "many">;
860
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
861
+ ledgerSequence: z.ZodNumber;
862
+ fetchedAt: z.ZodNumber;
863
+ parseConfidence: z.ZodObject<{
864
+ overall: z.ZodNumber;
865
+ knownContracts: z.ZodArray<z.ZodString, "many">;
866
+ unknownContracts: z.ZodArray<z.ZodObject<{
867
+ contract: z.ZodString;
868
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
869
+ }, "strip", z.ZodTypeAny, {
870
+ contract: string;
871
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
872
+ }, {
873
+ contract: string;
874
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
875
+ }>, "many">;
876
+ opaqueScVals: z.ZodArray<z.ZodObject<{
877
+ path: z.ZodString;
878
+ type: z.ZodString;
879
+ }, "strip", z.ZodTypeAny, {
880
+ type: string;
881
+ path: string;
882
+ }, {
883
+ type: string;
884
+ path: string;
885
+ }>, "many">;
886
+ thresholdUsed: z.ZodNumber;
887
+ }, "strip", z.ZodTypeAny, {
888
+ opaqueScVals: {
889
+ type: string;
890
+ path: string;
891
+ }[];
892
+ unknownContracts: {
893
+ contract: string;
894
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
895
+ }[];
896
+ overall: number;
897
+ knownContracts: string[];
898
+ thresholdUsed: number;
899
+ }, {
900
+ opaqueScVals: {
901
+ type: string;
902
+ path: string;
903
+ }[];
904
+ unknownContracts: {
905
+ contract: string;
906
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
907
+ }[];
908
+ overall: number;
909
+ knownContracts: string[];
910
+ thresholdUsed: number;
911
+ }>;
912
+ sourceAccount: z.ZodString;
913
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
914
+ network: z.ZodEnum<["mainnet", "testnet"]>;
915
+ signers: z.ZodArray<z.ZodString, "many">;
916
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
917
+ tokenMovements: z.ZodArray<z.ZodObject<{
918
+ token: z.ZodString;
919
+ from: z.ZodString;
920
+ to: z.ZodString;
921
+ amount: z.ZodString;
922
+ }, "strip", z.ZodTypeAny, {
923
+ amount: string;
924
+ token: string;
925
+ from: string;
926
+ to: string;
927
+ }, {
928
+ amount: string;
929
+ token: string;
930
+ from: string;
931
+ to: string;
932
+ }>, "many">;
933
+ events: z.ZodArray<z.ZodObject<{
934
+ contract: z.ZodString;
935
+ topics: z.ZodArray<z.ZodString, "many">;
936
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
937
+ }, "strip", z.ZodTypeAny, {
938
+ contract: string;
939
+ topics: string[];
940
+ data?: unknown;
941
+ }, {
942
+ contract: string;
943
+ topics: string[];
944
+ data?: unknown;
945
+ }>, "many">;
946
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
947
+ ledgerSequence: z.ZodNumber;
948
+ fetchedAt: z.ZodNumber;
949
+ parseConfidence: z.ZodObject<{
950
+ overall: z.ZodNumber;
951
+ knownContracts: z.ZodArray<z.ZodString, "many">;
952
+ unknownContracts: z.ZodArray<z.ZodObject<{
953
+ contract: z.ZodString;
954
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
955
+ }, "strip", z.ZodTypeAny, {
956
+ contract: string;
957
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
958
+ }, {
959
+ contract: string;
960
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
961
+ }>, "many">;
962
+ opaqueScVals: z.ZodArray<z.ZodObject<{
963
+ path: z.ZodString;
964
+ type: z.ZodString;
965
+ }, "strip", z.ZodTypeAny, {
966
+ type: string;
967
+ path: string;
968
+ }, {
969
+ type: string;
970
+ path: string;
971
+ }>, "many">;
972
+ thresholdUsed: z.ZodNumber;
973
+ }, "strip", z.ZodTypeAny, {
974
+ opaqueScVals: {
975
+ type: string;
976
+ path: string;
977
+ }[];
978
+ unknownContracts: {
979
+ contract: string;
980
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
981
+ }[];
982
+ overall: number;
983
+ knownContracts: string[];
984
+ thresholdUsed: number;
985
+ }, {
986
+ opaqueScVals: {
987
+ type: string;
988
+ path: string;
989
+ }[];
990
+ unknownContracts: {
991
+ contract: string;
992
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
993
+ }[];
994
+ overall: number;
995
+ knownContracts: string[];
996
+ thresholdUsed: number;
997
+ }>;
998
+ sourceAccount: z.ZodString;
999
+ }, z.ZodTypeAny, "passthrough">>;
1000
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1001
+ userResponses: z.ZodOptional<z.ZodObject<{
1002
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1003
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1004
+ limitAmount: z.ZodOptional<z.ZodString>;
1005
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1006
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1007
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1008
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1009
+ limitAmount: z.ZodOptional<z.ZodString>;
1010
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1011
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1012
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1013
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1014
+ limitAmount: z.ZodOptional<z.ZodString>;
1015
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1016
+ }, z.ZodTypeAny, "passthrough">>>;
1017
+ confidenceOverride: z.ZodOptional<z.ZodObject<{
1018
+ threshold: z.ZodNumber;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ threshold: number;
1021
+ }, {
1022
+ threshold: number;
1023
+ }>>;
1024
+ interpreter: z.ZodOptional<z.ZodObject<{
1025
+ smartAccountAddress: z.ZodString;
1026
+ installNonce: z.ZodOptional<z.ZodNumber>;
1027
+ oracleParams: z.ZodOptional<z.ZodObject<{
1028
+ maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
1029
+ maxDeviationBps: z.ZodOptional<z.ZodNumber>;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ maxStalenessSeconds?: number | undefined;
1032
+ maxDeviationBps?: number | undefined;
1033
+ }, {
1034
+ maxStalenessSeconds?: number | undefined;
1035
+ maxDeviationBps?: number | undefined;
1036
+ }>>;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ smartAccountAddress: string;
1039
+ oracleParams?: {
1040
+ maxStalenessSeconds?: number | undefined;
1041
+ maxDeviationBps?: number | undefined;
1042
+ } | undefined;
1043
+ installNonce?: number | undefined;
1044
+ }, {
1045
+ smartAccountAddress: string;
1046
+ oracleParams?: {
1047
+ maxStalenessSeconds?: number | undefined;
1048
+ maxDeviationBps?: number | undefined;
1049
+ } | undefined;
1050
+ installNonce?: number | undefined;
1051
+ }>>;
1052
+ ozConfig: z.ZodOptional<z.ZodObject<{
1053
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1054
+ instances: z.ZodObject<{
1055
+ spending_limit: z.ZodString;
1056
+ simple_threshold: z.ZodString;
1057
+ weighted_threshold: z.ZodString;
1058
+ }, "strip", z.ZodTypeAny, {
1059
+ spending_limit: string;
1060
+ simple_threshold: string;
1061
+ weighted_threshold: string;
1062
+ }, {
1063
+ spending_limit: string;
1064
+ simple_threshold: string;
1065
+ weighted_threshold: string;
1066
+ }>;
1067
+ }, "strip", z.ZodTypeAny, {
1068
+ network: "mainnet" | "testnet";
1069
+ instances: {
1070
+ spending_limit: string;
1071
+ simple_threshold: string;
1072
+ weighted_threshold: string;
1073
+ };
1074
+ }, {
1075
+ network: "mainnet" | "testnet";
1076
+ instances: {
1077
+ spending_limit: string;
1078
+ simple_threshold: string;
1079
+ weighted_threshold: string;
1080
+ };
1081
+ }>>;
1082
+ }, "strip", z.ZodTypeAny, {
1083
+ network: "mainnet" | "testnet";
1084
+ source: "recording";
1085
+ recordedTx: {
1086
+ events: {
1087
+ contract: string;
1088
+ topics: string[];
1089
+ data?: unknown;
1090
+ }[];
1091
+ network: "mainnet" | "testnet";
1092
+ signers: string[];
1093
+ invocations: unknown[];
1094
+ tokenMovements: {
1095
+ amount: string;
1096
+ token: string;
1097
+ from: string;
1098
+ to: string;
1099
+ }[];
1100
+ authEntries: unknown[];
1101
+ ledgerSequence: number;
1102
+ fetchedAt: number;
1103
+ parseConfidence: {
1104
+ opaqueScVals: {
1105
+ type: string;
1106
+ path: string;
1107
+ }[];
1108
+ unknownContracts: {
1109
+ contract: string;
1110
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1111
+ }[];
1112
+ overall: number;
1113
+ knownContracts: string[];
1114
+ thresholdUsed: number;
1115
+ };
1116
+ sourceAccount: string;
1117
+ } & {
1118
+ [k: string]: unknown;
1119
+ };
1120
+ interpreter?: {
1121
+ smartAccountAddress: string;
1122
+ oracleParams?: {
1123
+ maxStalenessSeconds?: number | undefined;
1124
+ maxDeviationBps?: number | undefined;
1125
+ } | undefined;
1126
+ installNonce?: number | undefined;
1127
+ } | undefined;
1128
+ userResponses?: z.objectOutputType<{
1129
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1130
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1131
+ limitAmount: z.ZodOptional<z.ZodString>;
1132
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1133
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1134
+ confidenceOverride?: {
1135
+ threshold: number;
1136
+ } | undefined;
1137
+ ozConfig?: {
1138
+ network: "mainnet" | "testnet";
1139
+ instances: {
1140
+ spending_limit: string;
1141
+ simple_threshold: string;
1142
+ weighted_threshold: string;
1143
+ };
1144
+ } | undefined;
1145
+ }, {
1146
+ network: "mainnet" | "testnet";
1147
+ source: "recording";
1148
+ recordedTx: {
1149
+ events: {
1150
+ contract: string;
1151
+ topics: string[];
1152
+ data?: unknown;
1153
+ }[];
1154
+ network: "mainnet" | "testnet";
1155
+ signers: string[];
1156
+ invocations: unknown[];
1157
+ tokenMovements: {
1158
+ amount: string;
1159
+ token: string;
1160
+ from: string;
1161
+ to: string;
1162
+ }[];
1163
+ authEntries: unknown[];
1164
+ ledgerSequence: number;
1165
+ fetchedAt: number;
1166
+ parseConfidence: {
1167
+ opaqueScVals: {
1168
+ type: string;
1169
+ path: string;
1170
+ }[];
1171
+ unknownContracts: {
1172
+ contract: string;
1173
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1174
+ }[];
1175
+ overall: number;
1176
+ knownContracts: string[];
1177
+ thresholdUsed: number;
1178
+ };
1179
+ sourceAccount: string;
1180
+ } & {
1181
+ [k: string]: unknown;
1182
+ };
1183
+ interpreter?: {
1184
+ smartAccountAddress: string;
1185
+ oracleParams?: {
1186
+ maxStalenessSeconds?: number | undefined;
1187
+ maxDeviationBps?: number | undefined;
1188
+ } | undefined;
1189
+ installNonce?: number | undefined;
1190
+ } | undefined;
1191
+ userResponses?: z.objectInputType<{
1192
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1193
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1194
+ limitAmount: z.ZodOptional<z.ZodString>;
1195
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1196
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1197
+ confidenceOverride?: {
1198
+ threshold: number;
1199
+ } | undefined;
1200
+ ozConfig?: {
1201
+ network: "mainnet" | "testnet";
1202
+ instances: {
1203
+ spending_limit: string;
1204
+ simple_threshold: string;
1205
+ weighted_threshold: string;
1206
+ };
1207
+ } | undefined;
1208
+ }>;
1209
+ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
1210
+ source: z.ZodLiteral<"mandate">;
1211
+ mandate: z.ZodObject<{
1212
+ chain: z.ZodLiteral<"stellar">;
1213
+ contract: z.ZodString;
1214
+ method: z.ZodOptional<z.ZodString>;
1215
+ spendingLimit: z.ZodOptional<z.ZodObject<{
1216
+ token: z.ZodString;
1217
+ limit: z.ZodString;
1218
+ windowSeconds: z.ZodNumber;
1219
+ }, "strip", z.ZodTypeAny, {
1220
+ token: string;
1221
+ limit: string;
1222
+ windowSeconds: number;
1223
+ }, {
1224
+ token: string;
1225
+ limit: string;
1226
+ windowSeconds: number;
1227
+ }>>;
1228
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
1229
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1230
+ expiry: z.ZodOptional<z.ZodObject<{
1231
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1232
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
1233
+ }, "strip", z.ZodTypeAny, {
1234
+ validUntilLedger?: number | undefined;
1235
+ validUntilUnixSeconds?: number | undefined;
1236
+ }, {
1237
+ validUntilLedger?: number | undefined;
1238
+ validUntilUnixSeconds?: number | undefined;
1239
+ }>>;
1240
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1241
+ chain: z.ZodLiteral<"stellar">;
1242
+ contract: z.ZodString;
1243
+ method: z.ZodOptional<z.ZodString>;
1244
+ spendingLimit: z.ZodOptional<z.ZodObject<{
1245
+ token: z.ZodString;
1246
+ limit: z.ZodString;
1247
+ windowSeconds: z.ZodNumber;
1248
+ }, "strip", z.ZodTypeAny, {
1249
+ token: string;
1250
+ limit: string;
1251
+ windowSeconds: number;
1252
+ }, {
1253
+ token: string;
1254
+ limit: string;
1255
+ windowSeconds: number;
1256
+ }>>;
1257
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
1258
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1259
+ expiry: z.ZodOptional<z.ZodObject<{
1260
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1261
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
1262
+ }, "strip", z.ZodTypeAny, {
1263
+ validUntilLedger?: number | undefined;
1264
+ validUntilUnixSeconds?: number | undefined;
1265
+ }, {
1266
+ validUntilLedger?: number | undefined;
1267
+ validUntilUnixSeconds?: number | undefined;
1268
+ }>>;
1269
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1270
+ chain: z.ZodLiteral<"stellar">;
1271
+ contract: z.ZodString;
1272
+ method: z.ZodOptional<z.ZodString>;
1273
+ spendingLimit: z.ZodOptional<z.ZodObject<{
1274
+ token: z.ZodString;
1275
+ limit: z.ZodString;
1276
+ windowSeconds: z.ZodNumber;
1277
+ }, "strip", z.ZodTypeAny, {
1278
+ token: string;
1279
+ limit: string;
1280
+ windowSeconds: number;
1281
+ }, {
1282
+ token: string;
1283
+ limit: string;
1284
+ windowSeconds: number;
1285
+ }>>;
1286
+ approvalThreshold: z.ZodOptional<z.ZodNumber>;
1287
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1288
+ expiry: z.ZodOptional<z.ZodObject<{
1289
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1290
+ validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
1291
+ }, "strip", z.ZodTypeAny, {
1292
+ validUntilLedger?: number | undefined;
1293
+ validUntilUnixSeconds?: number | undefined;
1294
+ }, {
1295
+ validUntilLedger?: number | undefined;
1296
+ validUntilUnixSeconds?: number | undefined;
1297
+ }>>;
1298
+ }, z.ZodTypeAny, "passthrough">>;
1299
+ ozConfig: z.ZodOptional<z.ZodObject<{
1300
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1301
+ instances: z.ZodObject<{
1302
+ spending_limit: z.ZodString;
1303
+ simple_threshold: z.ZodString;
1304
+ weighted_threshold: z.ZodString;
1305
+ }, "strip", z.ZodTypeAny, {
1306
+ spending_limit: string;
1307
+ simple_threshold: string;
1308
+ weighted_threshold: string;
1309
+ }, {
1310
+ spending_limit: string;
1311
+ simple_threshold: string;
1312
+ weighted_threshold: string;
1313
+ }>;
1314
+ }, "strip", z.ZodTypeAny, {
1315
+ network: "mainnet" | "testnet";
1316
+ instances: {
1317
+ spending_limit: string;
1318
+ simple_threshold: string;
1319
+ weighted_threshold: string;
1320
+ };
1321
+ }, {
1322
+ network: "mainnet" | "testnet";
1323
+ instances: {
1324
+ spending_limit: string;
1325
+ simple_threshold: string;
1326
+ weighted_threshold: string;
1327
+ };
1328
+ }>>;
1329
+ }, "strip", z.ZodTypeAny, {
1330
+ source: "mandate";
1331
+ mandate: {
1332
+ contract: string;
1333
+ chain: "stellar";
1334
+ expiry?: {
1335
+ validUntilLedger?: number | undefined;
1336
+ validUntilUnixSeconds?: number | undefined;
1337
+ } | undefined;
1338
+ method?: string | undefined;
1339
+ spendingLimit?: {
1340
+ token: string;
1341
+ limit: string;
1342
+ windowSeconds: number;
1343
+ } | undefined;
1344
+ approvalThreshold?: number | undefined;
1345
+ recipients?: string[] | undefined;
1346
+ } & {
1347
+ [k: string]: unknown;
1348
+ };
1349
+ ozConfig?: {
1350
+ network: "mainnet" | "testnet";
1351
+ instances: {
1352
+ spending_limit: string;
1353
+ simple_threshold: string;
1354
+ weighted_threshold: string;
1355
+ };
1356
+ } | undefined;
1357
+ }, {
1358
+ source: "mandate";
1359
+ mandate: {
1360
+ contract: string;
1361
+ chain: "stellar";
1362
+ expiry?: {
1363
+ validUntilLedger?: number | undefined;
1364
+ validUntilUnixSeconds?: number | undefined;
1365
+ } | undefined;
1366
+ method?: string | undefined;
1367
+ spendingLimit?: {
1368
+ token: string;
1369
+ limit: string;
1370
+ windowSeconds: number;
1371
+ } | undefined;
1372
+ approvalThreshold?: number | undefined;
1373
+ recipients?: string[] | undefined;
1374
+ } & {
1375
+ [k: string]: unknown;
1376
+ };
1377
+ ozConfig?: {
1378
+ network: "mainnet" | "testnet";
1379
+ instances: {
1380
+ spending_limit: string;
1381
+ simple_threshold: string;
1382
+ weighted_threshold: string;
1383
+ };
1384
+ } | undefined;
1385
+ }>, z.ZodObject<{
1386
+ source: z.ZodLiteral<"recording">;
1387
+ recordedTx: z.ZodObject<{
1388
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1389
+ signers: z.ZodArray<z.ZodString, "many">;
1390
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
1391
+ tokenMovements: z.ZodArray<z.ZodObject<{
1392
+ token: z.ZodString;
1393
+ from: z.ZodString;
1394
+ to: z.ZodString;
1395
+ amount: z.ZodString;
1396
+ }, "strip", z.ZodTypeAny, {
1397
+ amount: string;
1398
+ token: string;
1399
+ from: string;
1400
+ to: string;
1401
+ }, {
1402
+ amount: string;
1403
+ token: string;
1404
+ from: string;
1405
+ to: string;
1406
+ }>, "many">;
1407
+ events: z.ZodArray<z.ZodObject<{
1408
+ contract: z.ZodString;
1409
+ topics: z.ZodArray<z.ZodString, "many">;
1410
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
1411
+ }, "strip", z.ZodTypeAny, {
1412
+ contract: string;
1413
+ topics: string[];
1414
+ data?: unknown;
1415
+ }, {
1416
+ contract: string;
1417
+ topics: string[];
1418
+ data?: unknown;
1419
+ }>, "many">;
1420
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
1421
+ ledgerSequence: z.ZodNumber;
1422
+ fetchedAt: z.ZodNumber;
1423
+ parseConfidence: z.ZodObject<{
1424
+ overall: z.ZodNumber;
1425
+ knownContracts: z.ZodArray<z.ZodString, "many">;
1426
+ unknownContracts: z.ZodArray<z.ZodObject<{
1427
+ contract: z.ZodString;
1428
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
1429
+ }, "strip", z.ZodTypeAny, {
1430
+ contract: string;
1431
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1432
+ }, {
1433
+ contract: string;
1434
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1435
+ }>, "many">;
1436
+ opaqueScVals: z.ZodArray<z.ZodObject<{
1437
+ path: z.ZodString;
1438
+ type: z.ZodString;
1439
+ }, "strip", z.ZodTypeAny, {
1440
+ type: string;
1441
+ path: string;
1442
+ }, {
1443
+ type: string;
1444
+ path: string;
1445
+ }>, "many">;
1446
+ thresholdUsed: z.ZodNumber;
1447
+ }, "strip", z.ZodTypeAny, {
1448
+ opaqueScVals: {
1449
+ type: string;
1450
+ path: string;
1451
+ }[];
1452
+ unknownContracts: {
1453
+ contract: string;
1454
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1455
+ }[];
1456
+ overall: number;
1457
+ knownContracts: string[];
1458
+ thresholdUsed: number;
1459
+ }, {
1460
+ opaqueScVals: {
1461
+ type: string;
1462
+ path: string;
1463
+ }[];
1464
+ unknownContracts: {
1465
+ contract: string;
1466
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1467
+ }[];
1468
+ overall: number;
1469
+ knownContracts: string[];
1470
+ thresholdUsed: number;
1471
+ }>;
1472
+ sourceAccount: z.ZodString;
1473
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1474
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1475
+ signers: z.ZodArray<z.ZodString, "many">;
1476
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
1477
+ tokenMovements: z.ZodArray<z.ZodObject<{
1478
+ token: z.ZodString;
1479
+ from: z.ZodString;
1480
+ to: z.ZodString;
1481
+ amount: z.ZodString;
1482
+ }, "strip", z.ZodTypeAny, {
1483
+ amount: string;
1484
+ token: string;
1485
+ from: string;
1486
+ to: string;
1487
+ }, {
1488
+ amount: string;
1489
+ token: string;
1490
+ from: string;
1491
+ to: string;
1492
+ }>, "many">;
1493
+ events: z.ZodArray<z.ZodObject<{
1494
+ contract: z.ZodString;
1495
+ topics: z.ZodArray<z.ZodString, "many">;
1496
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
1497
+ }, "strip", z.ZodTypeAny, {
1498
+ contract: string;
1499
+ topics: string[];
1500
+ data?: unknown;
1501
+ }, {
1502
+ contract: string;
1503
+ topics: string[];
1504
+ data?: unknown;
1505
+ }>, "many">;
1506
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
1507
+ ledgerSequence: z.ZodNumber;
1508
+ fetchedAt: z.ZodNumber;
1509
+ parseConfidence: z.ZodObject<{
1510
+ overall: z.ZodNumber;
1511
+ knownContracts: z.ZodArray<z.ZodString, "many">;
1512
+ unknownContracts: z.ZodArray<z.ZodObject<{
1513
+ contract: z.ZodString;
1514
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
1515
+ }, "strip", z.ZodTypeAny, {
1516
+ contract: string;
1517
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1518
+ }, {
1519
+ contract: string;
1520
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1521
+ }>, "many">;
1522
+ opaqueScVals: z.ZodArray<z.ZodObject<{
1523
+ path: z.ZodString;
1524
+ type: z.ZodString;
1525
+ }, "strip", z.ZodTypeAny, {
1526
+ type: string;
1527
+ path: string;
1528
+ }, {
1529
+ type: string;
1530
+ path: string;
1531
+ }>, "many">;
1532
+ thresholdUsed: z.ZodNumber;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ opaqueScVals: {
1535
+ type: string;
1536
+ path: string;
1537
+ }[];
1538
+ unknownContracts: {
1539
+ contract: string;
1540
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1541
+ }[];
1542
+ overall: number;
1543
+ knownContracts: string[];
1544
+ thresholdUsed: number;
1545
+ }, {
1546
+ opaqueScVals: {
1547
+ type: string;
1548
+ path: string;
1549
+ }[];
1550
+ unknownContracts: {
1551
+ contract: string;
1552
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1553
+ }[];
1554
+ overall: number;
1555
+ knownContracts: string[];
1556
+ thresholdUsed: number;
1557
+ }>;
1558
+ sourceAccount: z.ZodString;
1559
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1560
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1561
+ signers: z.ZodArray<z.ZodString, "many">;
1562
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
1563
+ tokenMovements: z.ZodArray<z.ZodObject<{
1564
+ token: z.ZodString;
1565
+ from: z.ZodString;
1566
+ to: z.ZodString;
1567
+ amount: z.ZodString;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ amount: string;
1570
+ token: string;
1571
+ from: string;
1572
+ to: string;
1573
+ }, {
1574
+ amount: string;
1575
+ token: string;
1576
+ from: string;
1577
+ to: string;
1578
+ }>, "many">;
1579
+ events: z.ZodArray<z.ZodObject<{
1580
+ contract: z.ZodString;
1581
+ topics: z.ZodArray<z.ZodString, "many">;
1582
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
1583
+ }, "strip", z.ZodTypeAny, {
1584
+ contract: string;
1585
+ topics: string[];
1586
+ data?: unknown;
1587
+ }, {
1588
+ contract: string;
1589
+ topics: string[];
1590
+ data?: unknown;
1591
+ }>, "many">;
1592
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
1593
+ ledgerSequence: z.ZodNumber;
1594
+ fetchedAt: z.ZodNumber;
1595
+ parseConfidence: z.ZodObject<{
1596
+ overall: z.ZodNumber;
1597
+ knownContracts: z.ZodArray<z.ZodString, "many">;
1598
+ unknownContracts: z.ZodArray<z.ZodObject<{
1599
+ contract: z.ZodString;
1600
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
1601
+ }, "strip", z.ZodTypeAny, {
1602
+ contract: string;
1603
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1604
+ }, {
1605
+ contract: string;
1606
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1607
+ }>, "many">;
1608
+ opaqueScVals: z.ZodArray<z.ZodObject<{
1609
+ path: z.ZodString;
1610
+ type: z.ZodString;
1611
+ }, "strip", z.ZodTypeAny, {
1612
+ type: string;
1613
+ path: string;
1614
+ }, {
1615
+ type: string;
1616
+ path: string;
1617
+ }>, "many">;
1618
+ thresholdUsed: z.ZodNumber;
1619
+ }, "strip", z.ZodTypeAny, {
1620
+ opaqueScVals: {
1621
+ type: string;
1622
+ path: string;
1623
+ }[];
1624
+ unknownContracts: {
1625
+ contract: string;
1626
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1627
+ }[];
1628
+ overall: number;
1629
+ knownContracts: string[];
1630
+ thresholdUsed: number;
1631
+ }, {
1632
+ opaqueScVals: {
1633
+ type: string;
1634
+ path: string;
1635
+ }[];
1636
+ unknownContracts: {
1637
+ contract: string;
1638
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1639
+ }[];
1640
+ overall: number;
1641
+ knownContracts: string[];
1642
+ thresholdUsed: number;
1643
+ }>;
1644
+ sourceAccount: z.ZodString;
1645
+ }, z.ZodTypeAny, "passthrough">>;
1646
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1647
+ userResponses: z.ZodOptional<z.ZodObject<{
1648
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1649
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1650
+ limitAmount: z.ZodOptional<z.ZodString>;
1651
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1652
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1653
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1654
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1655
+ limitAmount: z.ZodOptional<z.ZodString>;
1656
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1657
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1658
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1659
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1660
+ limitAmount: z.ZodOptional<z.ZodString>;
1661
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1662
+ }, z.ZodTypeAny, "passthrough">>>;
1663
+ confidenceOverride: z.ZodOptional<z.ZodObject<{
1664
+ threshold: z.ZodNumber;
1665
+ }, "strip", z.ZodTypeAny, {
1666
+ threshold: number;
1667
+ }, {
1668
+ threshold: number;
1669
+ }>>;
1670
+ interpreter: z.ZodOptional<z.ZodObject<{
1671
+ smartAccountAddress: z.ZodString;
1672
+ installNonce: z.ZodOptional<z.ZodNumber>;
1673
+ oracleParams: z.ZodOptional<z.ZodObject<{
1674
+ maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
1675
+ maxDeviationBps: z.ZodOptional<z.ZodNumber>;
1676
+ }, "strip", z.ZodTypeAny, {
1677
+ maxStalenessSeconds?: number | undefined;
1678
+ maxDeviationBps?: number | undefined;
1679
+ }, {
1680
+ maxStalenessSeconds?: number | undefined;
1681
+ maxDeviationBps?: number | undefined;
1682
+ }>>;
1683
+ }, "strip", z.ZodTypeAny, {
1684
+ smartAccountAddress: string;
1685
+ oracleParams?: {
1686
+ maxStalenessSeconds?: number | undefined;
1687
+ maxDeviationBps?: number | undefined;
1688
+ } | undefined;
1689
+ installNonce?: number | undefined;
1690
+ }, {
1691
+ smartAccountAddress: string;
1692
+ oracleParams?: {
1693
+ maxStalenessSeconds?: number | undefined;
1694
+ maxDeviationBps?: number | undefined;
1695
+ } | undefined;
1696
+ installNonce?: number | undefined;
1697
+ }>>;
1698
+ ozConfig: z.ZodOptional<z.ZodObject<{
1699
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1700
+ instances: z.ZodObject<{
1701
+ spending_limit: z.ZodString;
1702
+ simple_threshold: z.ZodString;
1703
+ weighted_threshold: z.ZodString;
1704
+ }, "strip", z.ZodTypeAny, {
1705
+ spending_limit: string;
1706
+ simple_threshold: string;
1707
+ weighted_threshold: string;
1708
+ }, {
1709
+ spending_limit: string;
1710
+ simple_threshold: string;
1711
+ weighted_threshold: string;
1712
+ }>;
1713
+ }, "strip", z.ZodTypeAny, {
1714
+ network: "mainnet" | "testnet";
1715
+ instances: {
1716
+ spending_limit: string;
1717
+ simple_threshold: string;
1718
+ weighted_threshold: string;
1719
+ };
1720
+ }, {
1721
+ network: "mainnet" | "testnet";
1722
+ instances: {
1723
+ spending_limit: string;
1724
+ simple_threshold: string;
1725
+ weighted_threshold: string;
1726
+ };
1727
+ }>>;
1728
+ }, "strip", z.ZodTypeAny, {
1729
+ network: "mainnet" | "testnet";
1730
+ source: "recording";
1731
+ recordedTx: {
1732
+ events: {
1733
+ contract: string;
1734
+ topics: string[];
1735
+ data?: unknown;
1736
+ }[];
1737
+ network: "mainnet" | "testnet";
1738
+ signers: string[];
1739
+ invocations: unknown[];
1740
+ tokenMovements: {
1741
+ amount: string;
1742
+ token: string;
1743
+ from: string;
1744
+ to: string;
1745
+ }[];
1746
+ authEntries: unknown[];
1747
+ ledgerSequence: number;
1748
+ fetchedAt: number;
1749
+ parseConfidence: {
1750
+ opaqueScVals: {
1751
+ type: string;
1752
+ path: string;
1753
+ }[];
1754
+ unknownContracts: {
1755
+ contract: string;
1756
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1757
+ }[];
1758
+ overall: number;
1759
+ knownContracts: string[];
1760
+ thresholdUsed: number;
1761
+ };
1762
+ sourceAccount: string;
1763
+ } & {
1764
+ [k: string]: unknown;
1765
+ };
1766
+ interpreter?: {
1767
+ smartAccountAddress: string;
1768
+ oracleParams?: {
1769
+ maxStalenessSeconds?: number | undefined;
1770
+ maxDeviationBps?: number | undefined;
1771
+ } | undefined;
1772
+ installNonce?: number | undefined;
1773
+ } | undefined;
1774
+ userResponses?: z.objectOutputType<{
1775
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1776
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1777
+ limitAmount: z.ZodOptional<z.ZodString>;
1778
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1779
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1780
+ confidenceOverride?: {
1781
+ threshold: number;
1782
+ } | undefined;
1783
+ ozConfig?: {
1784
+ network: "mainnet" | "testnet";
1785
+ instances: {
1786
+ spending_limit: string;
1787
+ simple_threshold: string;
1788
+ weighted_threshold: string;
1789
+ };
1790
+ } | undefined;
1791
+ }, {
1792
+ network: "mainnet" | "testnet";
1793
+ source: "recording";
1794
+ recordedTx: {
1795
+ events: {
1796
+ contract: string;
1797
+ topics: string[];
1798
+ data?: unknown;
1799
+ }[];
1800
+ network: "mainnet" | "testnet";
1801
+ signers: string[];
1802
+ invocations: unknown[];
1803
+ tokenMovements: {
1804
+ amount: string;
1805
+ token: string;
1806
+ from: string;
1807
+ to: string;
1808
+ }[];
1809
+ authEntries: unknown[];
1810
+ ledgerSequence: number;
1811
+ fetchedAt: number;
1812
+ parseConfidence: {
1813
+ opaqueScVals: {
1814
+ type: string;
1815
+ path: string;
1816
+ }[];
1817
+ unknownContracts: {
1818
+ contract: string;
1819
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1820
+ }[];
1821
+ overall: number;
1822
+ knownContracts: string[];
1823
+ thresholdUsed: number;
1824
+ };
1825
+ sourceAccount: string;
1826
+ } & {
1827
+ [k: string]: unknown;
1828
+ };
1829
+ interpreter?: {
1830
+ smartAccountAddress: string;
1831
+ oracleParams?: {
1832
+ maxStalenessSeconds?: number | undefined;
1833
+ maxDeviationBps?: number | undefined;
1834
+ } | undefined;
1835
+ installNonce?: number | undefined;
1836
+ } | undefined;
1837
+ userResponses?: z.objectInputType<{
1838
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
1839
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
1840
+ limitAmount: z.ZodOptional<z.ZodString>;
1841
+ invocationLimit: z.ZodOptional<z.ZodNumber>;
1842
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1843
+ confidenceOverride?: {
1844
+ threshold: number;
1845
+ } | undefined;
1846
+ ozConfig?: {
1847
+ network: "mainnet" | "testnet";
1848
+ instances: {
1849
+ spending_limit: string;
1850
+ simple_threshold: string;
1851
+ weighted_threshold: string;
1852
+ };
1853
+ } | undefined;
1854
+ }>]>;
1855
+ export type SynthesizePolicyInput = z.infer<typeof SynthesizePolicyInputSchema>;
1856
+ export declare const ToolErrorSchema: z.ZodObject<{
1857
+ code: z.ZodString;
1858
+ message: z.ZodString;
1859
+ severity: z.ZodEnum<["info", "warning", "error", "fatal"]>;
1860
+ retryable: z.ZodBoolean;
1861
+ remediation: z.ZodOptional<z.ZodObject<{
1862
+ toolCall: z.ZodOptional<z.ZodObject<{
1863
+ name: z.ZodString;
1864
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1865
+ }, "strip", z.ZodTypeAny, {
1866
+ args: Record<string, unknown>;
1867
+ name: string;
1868
+ }, {
1869
+ args: Record<string, unknown>;
1870
+ name: string;
1871
+ }>>;
1872
+ userQuestion: z.ZodOptional<z.ZodObject<{
1873
+ code: z.ZodString;
1874
+ question: z.ZodString;
1875
+ }, "strip", z.ZodTypeAny, {
1876
+ code: string;
1877
+ question: string;
1878
+ }, {
1879
+ code: string;
1880
+ question: string;
1881
+ }>>;
1882
+ docsUrl: z.ZodOptional<z.ZodString>;
1883
+ }, "strip", z.ZodTypeAny, {
1884
+ toolCall?: {
1885
+ args: Record<string, unknown>;
1886
+ name: string;
1887
+ } | undefined;
1888
+ userQuestion?: {
1889
+ code: string;
1890
+ question: string;
1891
+ } | undefined;
1892
+ docsUrl?: string | undefined;
1893
+ }, {
1894
+ toolCall?: {
1895
+ args: Record<string, unknown>;
1896
+ name: string;
1897
+ } | undefined;
1898
+ userQuestion?: {
1899
+ code: string;
1900
+ question: string;
1901
+ } | undefined;
1902
+ docsUrl?: string | undefined;
1903
+ }>>;
1904
+ details: z.ZodOptional<z.ZodUnknown>;
1905
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1906
+ code: z.ZodString;
1907
+ message: z.ZodString;
1908
+ severity: z.ZodEnum<["info", "warning", "error", "fatal"]>;
1909
+ retryable: z.ZodBoolean;
1910
+ remediation: z.ZodOptional<z.ZodObject<{
1911
+ toolCall: z.ZodOptional<z.ZodObject<{
1912
+ name: z.ZodString;
1913
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1914
+ }, "strip", z.ZodTypeAny, {
1915
+ args: Record<string, unknown>;
1916
+ name: string;
1917
+ }, {
1918
+ args: Record<string, unknown>;
1919
+ name: string;
1920
+ }>>;
1921
+ userQuestion: z.ZodOptional<z.ZodObject<{
1922
+ code: z.ZodString;
1923
+ question: z.ZodString;
1924
+ }, "strip", z.ZodTypeAny, {
1925
+ code: string;
1926
+ question: string;
1927
+ }, {
1928
+ code: string;
1929
+ question: string;
1930
+ }>>;
1931
+ docsUrl: z.ZodOptional<z.ZodString>;
1932
+ }, "strip", z.ZodTypeAny, {
1933
+ toolCall?: {
1934
+ args: Record<string, unknown>;
1935
+ name: string;
1936
+ } | undefined;
1937
+ userQuestion?: {
1938
+ code: string;
1939
+ question: string;
1940
+ } | undefined;
1941
+ docsUrl?: string | undefined;
1942
+ }, {
1943
+ toolCall?: {
1944
+ args: Record<string, unknown>;
1945
+ name: string;
1946
+ } | undefined;
1947
+ userQuestion?: {
1948
+ code: string;
1949
+ question: string;
1950
+ } | undefined;
1951
+ docsUrl?: string | undefined;
1952
+ }>>;
1953
+ details: z.ZodOptional<z.ZodUnknown>;
1954
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1955
+ code: z.ZodString;
1956
+ message: z.ZodString;
1957
+ severity: z.ZodEnum<["info", "warning", "error", "fatal"]>;
1958
+ retryable: z.ZodBoolean;
1959
+ remediation: z.ZodOptional<z.ZodObject<{
1960
+ toolCall: z.ZodOptional<z.ZodObject<{
1961
+ name: z.ZodString;
1962
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1963
+ }, "strip", z.ZodTypeAny, {
1964
+ args: Record<string, unknown>;
1965
+ name: string;
1966
+ }, {
1967
+ args: Record<string, unknown>;
1968
+ name: string;
1969
+ }>>;
1970
+ userQuestion: z.ZodOptional<z.ZodObject<{
1971
+ code: z.ZodString;
1972
+ question: z.ZodString;
1973
+ }, "strip", z.ZodTypeAny, {
1974
+ code: string;
1975
+ question: string;
1976
+ }, {
1977
+ code: string;
1978
+ question: string;
1979
+ }>>;
1980
+ docsUrl: z.ZodOptional<z.ZodString>;
1981
+ }, "strip", z.ZodTypeAny, {
1982
+ toolCall?: {
1983
+ args: Record<string, unknown>;
1984
+ name: string;
1985
+ } | undefined;
1986
+ userQuestion?: {
1987
+ code: string;
1988
+ question: string;
1989
+ } | undefined;
1990
+ docsUrl?: string | undefined;
1991
+ }, {
1992
+ toolCall?: {
1993
+ args: Record<string, unknown>;
1994
+ name: string;
1995
+ } | undefined;
1996
+ userQuestion?: {
1997
+ code: string;
1998
+ question: string;
1999
+ } | undefined;
2000
+ docsUrl?: string | undefined;
2001
+ }>>;
2002
+ details: z.ZodOptional<z.ZodUnknown>;
2003
+ }, z.ZodTypeAny, "passthrough">>;