@crediolabs/policy-synth 0.1.11 → 0.1.13

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 (48) hide show
  1. package/dist/adapters/interpreter/adapter.js +21 -0
  2. package/dist/adapters/oz/adapter.js +4 -0
  3. package/dist/install/build-install-policy.d.ts +218 -0
  4. package/dist/install/build-install-policy.js +427 -0
  5. package/dist/install/get-interpreter-info.d.ts +29 -0
  6. package/dist/install/get-interpreter-info.js +41 -0
  7. package/dist/ir/types.d.ts +19 -0
  8. package/dist/predicate/index.d.ts +1 -1
  9. package/dist/predicate/index.js +1 -1
  10. package/dist/review-card/builder.js +32 -0
  11. package/dist/review-card/cross-check.js +20 -0
  12. package/dist/run/index.d.ts +49 -4
  13. package/dist/run/index.js +324 -4
  14. package/dist/run/schemas.d.ts +1500 -4
  15. package/dist/run/schemas.js +288 -0
  16. package/dist/synth/compose-from-recording.d.ts +14 -0
  17. package/dist/synth/compose-from-recording.js +41 -2
  18. package/dist-cjs/adapters/interpreter/adapter.js +21 -0
  19. package/dist-cjs/adapters/oz/adapter.js +4 -0
  20. package/dist-cjs/install/build-install-policy.d.ts +218 -0
  21. package/dist-cjs/install/build-install-policy.js +431 -0
  22. package/dist-cjs/install/get-interpreter-info.d.ts +29 -0
  23. package/dist-cjs/install/get-interpreter-info.js +44 -0
  24. package/dist-cjs/ir/types.d.ts +19 -0
  25. package/dist-cjs/predicate/index.d.ts +1 -1
  26. package/dist-cjs/predicate/index.js +3 -3
  27. package/dist-cjs/review-card/builder.js +32 -0
  28. package/dist-cjs/review-card/cross-check.js +20 -0
  29. package/dist-cjs/run/index.d.ts +49 -4
  30. package/dist-cjs/run/index.js +339 -3
  31. package/dist-cjs/run/schemas.d.ts +1500 -4
  32. package/dist-cjs/run/schemas.js +289 -1
  33. package/dist-cjs/synth/compose-from-recording.d.ts +14 -0
  34. package/dist-cjs/synth/compose-from-recording.js +41 -2
  35. package/package.json +1 -1
  36. package/src/adapters/interpreter/adapter.ts +21 -0
  37. package/src/adapters/oz/adapter.ts +4 -0
  38. package/src/install/build-install-policy.ts +686 -0
  39. package/src/install/get-interpreter-info.ts +68 -0
  40. package/src/ir/types.ts +19 -0
  41. package/src/predicate/index.ts +1 -1
  42. package/src/review-card/builder.ts +27 -0
  43. package/src/review-card/cross-check.ts +25 -1
  44. package/src/run/index.ts +405 -5
  45. package/src/run/schemas.ts +326 -0
  46. package/src/synth/compose-from-recording.ts +55 -0
  47. package/src/synth/evaluate.ts +0 -1
  48. package/src/synth/permit-context.ts +0 -1
@@ -1099,6 +1099,7 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
1099
1099
  topics: string[];
1100
1100
  data?: unknown;
1101
1101
  }[];
1102
+ sourceAccount: string;
1102
1103
  network: "mainnet" | "testnet";
1103
1104
  invocations: unknown[];
1104
1105
  tokenMovements: {
@@ -1123,7 +1124,6 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
1123
1124
  knownContracts: string[];
1124
1125
  thresholdUsed: number;
1125
1126
  };
1126
- sourceAccount: string;
1127
1127
  } & {
1128
1128
  [k: string]: unknown;
1129
1129
  };
@@ -1164,6 +1164,7 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
1164
1164
  topics: string[];
1165
1165
  data?: unknown;
1166
1166
  }[];
1167
+ sourceAccount: string;
1167
1168
  network: "mainnet" | "testnet";
1168
1169
  invocations: unknown[];
1169
1170
  tokenMovements: {
@@ -1188,7 +1189,6 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
1188
1189
  knownContracts: string[];
1189
1190
  thresholdUsed: number;
1190
1191
  };
1191
- sourceAccount: string;
1192
1192
  } & {
1193
1193
  [k: string]: unknown;
1194
1194
  };
@@ -1756,6 +1756,7 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
1756
1756
  topics: string[];
1757
1757
  data?: unknown;
1758
1758
  }[];
1759
+ sourceAccount: string;
1759
1760
  network: "mainnet" | "testnet";
1760
1761
  invocations: unknown[];
1761
1762
  tokenMovements: {
@@ -1780,7 +1781,6 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
1780
1781
  knownContracts: string[];
1781
1782
  thresholdUsed: number;
1782
1783
  };
1783
- sourceAccount: string;
1784
1784
  } & {
1785
1785
  [k: string]: unknown;
1786
1786
  };
@@ -1821,6 +1821,7 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
1821
1821
  topics: string[];
1822
1822
  data?: unknown;
1823
1823
  }[];
1824
+ sourceAccount: string;
1824
1825
  network: "mainnet" | "testnet";
1825
1826
  invocations: unknown[];
1826
1827
  tokenMovements: {
@@ -1845,7 +1846,6 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
1845
1846
  knownContracts: string[];
1846
1847
  thresholdUsed: number;
1847
1848
  };
1848
- sourceAccount: string;
1849
1849
  } & {
1850
1850
  [k: string]: unknown;
1851
1851
  };
@@ -1878,6 +1878,1502 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
1878
1878
  explain?: boolean | undefined;
1879
1879
  }>]>;
1880
1880
  export type SynthesizePolicyInput = z.infer<typeof SynthesizePolicyInputSchema>;
1881
+ /** PredicateLeaf mirrors the core `PredicateLeaf` union. Every variant
1882
+ * is a `kind` discriminator; literals carry their primitive value inline.
1883
+ * `literal_vec.elements` is recursive (a vec may contain literals that
1884
+ * themselves nest) so the leaf schema is lazily self-referential. */
1885
+ export declare const PredicateLeafSchema: z.ZodType<unknown>;
1886
+ /** PredicateNode mirrors the core `PredicateNode` union. Recursive through
1887
+ * `and`/`or`/`not`; the lazy + annotation pattern keeps the recursion
1888
+ * type-safe. */
1889
+ export declare const PredicateNodeSchema: z.ZodType<unknown>;
1890
+ /** Oracle price fixture - mirror of the entry type in `SimulateOptions` /
1891
+ * `VerifyOptions`. Discriminated by presence of `error` vs `price`. */
1892
+ export declare const OraclePriceFixtureSchema: z.ZodUnion<[z.ZodObject<{
1893
+ price: z.ZodString;
1894
+ timestampSeconds: z.ZodNumber;
1895
+ }, "strip", z.ZodTypeAny, {
1896
+ price: string;
1897
+ timestampSeconds: number;
1898
+ }, {
1899
+ price: string;
1900
+ timestampSeconds: number;
1901
+ }>, z.ZodObject<{
1902
+ error: z.ZodEnum<["stale", "missing", "deviation", "paused", "decimals", "fingerprint"]>;
1903
+ }, "strip", z.ZodTypeAny, {
1904
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
1905
+ }, {
1906
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
1907
+ }>]>;
1908
+ export declare const SimulatePolicyInputSchema: z.ZodObject<{
1909
+ predicate: z.ZodNullable<z.ZodType<unknown, z.ZodTypeDef, unknown>>;
1910
+ permitTx: z.ZodObject<{
1911
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1912
+ signers: z.ZodArray<z.ZodString, "many">;
1913
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
1914
+ tokenMovements: z.ZodArray<z.ZodObject<{
1915
+ token: z.ZodString;
1916
+ from: z.ZodString;
1917
+ to: z.ZodString;
1918
+ amount: z.ZodString;
1919
+ }, "strip", z.ZodTypeAny, {
1920
+ amount: string;
1921
+ token: string;
1922
+ from: string;
1923
+ to: string;
1924
+ }, {
1925
+ amount: string;
1926
+ token: string;
1927
+ from: string;
1928
+ to: string;
1929
+ }>, "many">;
1930
+ events: z.ZodArray<z.ZodObject<{
1931
+ contract: z.ZodString;
1932
+ topics: z.ZodArray<z.ZodString, "many">;
1933
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
1934
+ }, "strip", z.ZodTypeAny, {
1935
+ contract: string;
1936
+ topics: string[];
1937
+ data?: unknown;
1938
+ }, {
1939
+ contract: string;
1940
+ topics: string[];
1941
+ data?: unknown;
1942
+ }>, "many">;
1943
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
1944
+ ledgerSequence: z.ZodNumber;
1945
+ fetchedAt: z.ZodNumber;
1946
+ parseConfidence: z.ZodObject<{
1947
+ overall: z.ZodNumber;
1948
+ knownContracts: z.ZodArray<z.ZodString, "many">;
1949
+ unknownContracts: z.ZodArray<z.ZodObject<{
1950
+ contract: z.ZodString;
1951
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
1952
+ }, "strip", z.ZodTypeAny, {
1953
+ contract: string;
1954
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1955
+ }, {
1956
+ contract: string;
1957
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1958
+ }>, "many">;
1959
+ opaqueScVals: z.ZodArray<z.ZodObject<{
1960
+ path: z.ZodString;
1961
+ type: z.ZodString;
1962
+ }, "strip", z.ZodTypeAny, {
1963
+ type: string;
1964
+ path: string;
1965
+ }, {
1966
+ type: string;
1967
+ path: string;
1968
+ }>, "many">;
1969
+ thresholdUsed: z.ZodNumber;
1970
+ }, "strip", z.ZodTypeAny, {
1971
+ opaqueScVals: {
1972
+ type: string;
1973
+ path: string;
1974
+ }[];
1975
+ unknownContracts: {
1976
+ contract: string;
1977
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1978
+ }[];
1979
+ overall: number;
1980
+ knownContracts: string[];
1981
+ thresholdUsed: number;
1982
+ }, {
1983
+ opaqueScVals: {
1984
+ type: string;
1985
+ path: string;
1986
+ }[];
1987
+ unknownContracts: {
1988
+ contract: string;
1989
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
1990
+ }[];
1991
+ overall: number;
1992
+ knownContracts: string[];
1993
+ thresholdUsed: number;
1994
+ }>;
1995
+ sourceAccount: z.ZodString;
1996
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1997
+ network: z.ZodEnum<["mainnet", "testnet"]>;
1998
+ signers: z.ZodArray<z.ZodString, "many">;
1999
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
2000
+ tokenMovements: z.ZodArray<z.ZodObject<{
2001
+ token: z.ZodString;
2002
+ from: z.ZodString;
2003
+ to: z.ZodString;
2004
+ amount: z.ZodString;
2005
+ }, "strip", z.ZodTypeAny, {
2006
+ amount: string;
2007
+ token: string;
2008
+ from: string;
2009
+ to: string;
2010
+ }, {
2011
+ amount: string;
2012
+ token: string;
2013
+ from: string;
2014
+ to: string;
2015
+ }>, "many">;
2016
+ events: z.ZodArray<z.ZodObject<{
2017
+ contract: z.ZodString;
2018
+ topics: z.ZodArray<z.ZodString, "many">;
2019
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
2020
+ }, "strip", z.ZodTypeAny, {
2021
+ contract: string;
2022
+ topics: string[];
2023
+ data?: unknown;
2024
+ }, {
2025
+ contract: string;
2026
+ topics: string[];
2027
+ data?: unknown;
2028
+ }>, "many">;
2029
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
2030
+ ledgerSequence: z.ZodNumber;
2031
+ fetchedAt: z.ZodNumber;
2032
+ parseConfidence: z.ZodObject<{
2033
+ overall: z.ZodNumber;
2034
+ knownContracts: z.ZodArray<z.ZodString, "many">;
2035
+ unknownContracts: z.ZodArray<z.ZodObject<{
2036
+ contract: z.ZodString;
2037
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
2038
+ }, "strip", z.ZodTypeAny, {
2039
+ contract: string;
2040
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2041
+ }, {
2042
+ contract: string;
2043
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2044
+ }>, "many">;
2045
+ opaqueScVals: z.ZodArray<z.ZodObject<{
2046
+ path: z.ZodString;
2047
+ type: z.ZodString;
2048
+ }, "strip", z.ZodTypeAny, {
2049
+ type: string;
2050
+ path: string;
2051
+ }, {
2052
+ type: string;
2053
+ path: string;
2054
+ }>, "many">;
2055
+ thresholdUsed: z.ZodNumber;
2056
+ }, "strip", z.ZodTypeAny, {
2057
+ opaqueScVals: {
2058
+ type: string;
2059
+ path: string;
2060
+ }[];
2061
+ unknownContracts: {
2062
+ contract: string;
2063
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2064
+ }[];
2065
+ overall: number;
2066
+ knownContracts: string[];
2067
+ thresholdUsed: number;
2068
+ }, {
2069
+ opaqueScVals: {
2070
+ type: string;
2071
+ path: string;
2072
+ }[];
2073
+ unknownContracts: {
2074
+ contract: string;
2075
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2076
+ }[];
2077
+ overall: number;
2078
+ knownContracts: string[];
2079
+ thresholdUsed: number;
2080
+ }>;
2081
+ sourceAccount: z.ZodString;
2082
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2083
+ network: z.ZodEnum<["mainnet", "testnet"]>;
2084
+ signers: z.ZodArray<z.ZodString, "many">;
2085
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
2086
+ tokenMovements: z.ZodArray<z.ZodObject<{
2087
+ token: z.ZodString;
2088
+ from: z.ZodString;
2089
+ to: z.ZodString;
2090
+ amount: z.ZodString;
2091
+ }, "strip", z.ZodTypeAny, {
2092
+ amount: string;
2093
+ token: string;
2094
+ from: string;
2095
+ to: string;
2096
+ }, {
2097
+ amount: string;
2098
+ token: string;
2099
+ from: string;
2100
+ to: string;
2101
+ }>, "many">;
2102
+ events: z.ZodArray<z.ZodObject<{
2103
+ contract: z.ZodString;
2104
+ topics: z.ZodArray<z.ZodString, "many">;
2105
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
2106
+ }, "strip", z.ZodTypeAny, {
2107
+ contract: string;
2108
+ topics: string[];
2109
+ data?: unknown;
2110
+ }, {
2111
+ contract: string;
2112
+ topics: string[];
2113
+ data?: unknown;
2114
+ }>, "many">;
2115
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
2116
+ ledgerSequence: z.ZodNumber;
2117
+ fetchedAt: z.ZodNumber;
2118
+ parseConfidence: z.ZodObject<{
2119
+ overall: z.ZodNumber;
2120
+ knownContracts: z.ZodArray<z.ZodString, "many">;
2121
+ unknownContracts: z.ZodArray<z.ZodObject<{
2122
+ contract: z.ZodString;
2123
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
2124
+ }, "strip", z.ZodTypeAny, {
2125
+ contract: string;
2126
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2127
+ }, {
2128
+ contract: string;
2129
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2130
+ }>, "many">;
2131
+ opaqueScVals: z.ZodArray<z.ZodObject<{
2132
+ path: z.ZodString;
2133
+ type: z.ZodString;
2134
+ }, "strip", z.ZodTypeAny, {
2135
+ type: string;
2136
+ path: string;
2137
+ }, {
2138
+ type: string;
2139
+ path: string;
2140
+ }>, "many">;
2141
+ thresholdUsed: z.ZodNumber;
2142
+ }, "strip", z.ZodTypeAny, {
2143
+ opaqueScVals: {
2144
+ type: string;
2145
+ path: string;
2146
+ }[];
2147
+ unknownContracts: {
2148
+ contract: string;
2149
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2150
+ }[];
2151
+ overall: number;
2152
+ knownContracts: string[];
2153
+ thresholdUsed: number;
2154
+ }, {
2155
+ opaqueScVals: {
2156
+ type: string;
2157
+ path: string;
2158
+ }[];
2159
+ unknownContracts: {
2160
+ contract: string;
2161
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2162
+ }[];
2163
+ overall: number;
2164
+ knownContracts: string[];
2165
+ thresholdUsed: number;
2166
+ }>;
2167
+ sourceAccount: z.ZodString;
2168
+ }, z.ZodTypeAny, "passthrough">>;
2169
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
2170
+ oraclePricesByAsset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
2171
+ price: z.ZodString;
2172
+ timestampSeconds: z.ZodNumber;
2173
+ }, "strip", z.ZodTypeAny, {
2174
+ price: string;
2175
+ timestampSeconds: number;
2176
+ }, {
2177
+ price: string;
2178
+ timestampSeconds: number;
2179
+ }>, z.ZodObject<{
2180
+ error: z.ZodEnum<["stale", "missing", "deviation", "paused", "decimals", "fingerprint"]>;
2181
+ }, "strip", z.ZodTypeAny, {
2182
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2183
+ }, {
2184
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2185
+ }>]>>>;
2186
+ }, "strip", z.ZodTypeAny, {
2187
+ permitTx: {
2188
+ signers: string[];
2189
+ events: {
2190
+ contract: string;
2191
+ topics: string[];
2192
+ data?: unknown;
2193
+ }[];
2194
+ sourceAccount: string;
2195
+ network: "mainnet" | "testnet";
2196
+ invocations: unknown[];
2197
+ tokenMovements: {
2198
+ amount: string;
2199
+ token: string;
2200
+ from: string;
2201
+ to: string;
2202
+ }[];
2203
+ authEntries: unknown[];
2204
+ ledgerSequence: number;
2205
+ fetchedAt: number;
2206
+ parseConfidence: {
2207
+ opaqueScVals: {
2208
+ type: string;
2209
+ path: string;
2210
+ }[];
2211
+ unknownContracts: {
2212
+ contract: string;
2213
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2214
+ }[];
2215
+ overall: number;
2216
+ knownContracts: string[];
2217
+ thresholdUsed: number;
2218
+ };
2219
+ } & {
2220
+ [k: string]: unknown;
2221
+ };
2222
+ validUntilLedger?: number | undefined;
2223
+ predicate?: unknown;
2224
+ oraclePricesByAsset?: Record<string, {
2225
+ price: string;
2226
+ timestampSeconds: number;
2227
+ } | {
2228
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2229
+ }> | undefined;
2230
+ }, {
2231
+ permitTx: {
2232
+ signers: string[];
2233
+ events: {
2234
+ contract: string;
2235
+ topics: string[];
2236
+ data?: unknown;
2237
+ }[];
2238
+ sourceAccount: string;
2239
+ network: "mainnet" | "testnet";
2240
+ invocations: unknown[];
2241
+ tokenMovements: {
2242
+ amount: string;
2243
+ token: string;
2244
+ from: string;
2245
+ to: string;
2246
+ }[];
2247
+ authEntries: unknown[];
2248
+ ledgerSequence: number;
2249
+ fetchedAt: number;
2250
+ parseConfidence: {
2251
+ opaqueScVals: {
2252
+ type: string;
2253
+ path: string;
2254
+ }[];
2255
+ unknownContracts: {
2256
+ contract: string;
2257
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2258
+ }[];
2259
+ overall: number;
2260
+ knownContracts: string[];
2261
+ thresholdUsed: number;
2262
+ };
2263
+ } & {
2264
+ [k: string]: unknown;
2265
+ };
2266
+ validUntilLedger?: number | undefined;
2267
+ predicate?: unknown;
2268
+ oraclePricesByAsset?: Record<string, {
2269
+ price: string;
2270
+ timestampSeconds: number;
2271
+ } | {
2272
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2273
+ }> | undefined;
2274
+ }>;
2275
+ export type SimulatePolicyInput = z.infer<typeof SimulatePolicyInputSchema>;
2276
+ export declare const VerifyPolicyInputSchema: z.ZodObject<{
2277
+ predicate: z.ZodType<unknown, z.ZodTypeDef, unknown>;
2278
+ permitTx: z.ZodObject<{
2279
+ network: z.ZodEnum<["mainnet", "testnet"]>;
2280
+ signers: z.ZodArray<z.ZodString, "many">;
2281
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
2282
+ tokenMovements: z.ZodArray<z.ZodObject<{
2283
+ token: z.ZodString;
2284
+ from: z.ZodString;
2285
+ to: z.ZodString;
2286
+ amount: z.ZodString;
2287
+ }, "strip", z.ZodTypeAny, {
2288
+ amount: string;
2289
+ token: string;
2290
+ from: string;
2291
+ to: string;
2292
+ }, {
2293
+ amount: string;
2294
+ token: string;
2295
+ from: string;
2296
+ to: string;
2297
+ }>, "many">;
2298
+ events: z.ZodArray<z.ZodObject<{
2299
+ contract: z.ZodString;
2300
+ topics: z.ZodArray<z.ZodString, "many">;
2301
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
2302
+ }, "strip", z.ZodTypeAny, {
2303
+ contract: string;
2304
+ topics: string[];
2305
+ data?: unknown;
2306
+ }, {
2307
+ contract: string;
2308
+ topics: string[];
2309
+ data?: unknown;
2310
+ }>, "many">;
2311
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
2312
+ ledgerSequence: z.ZodNumber;
2313
+ fetchedAt: z.ZodNumber;
2314
+ parseConfidence: z.ZodObject<{
2315
+ overall: z.ZodNumber;
2316
+ knownContracts: z.ZodArray<z.ZodString, "many">;
2317
+ unknownContracts: z.ZodArray<z.ZodObject<{
2318
+ contract: z.ZodString;
2319
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
2320
+ }, "strip", z.ZodTypeAny, {
2321
+ contract: string;
2322
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2323
+ }, {
2324
+ contract: string;
2325
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2326
+ }>, "many">;
2327
+ opaqueScVals: z.ZodArray<z.ZodObject<{
2328
+ path: z.ZodString;
2329
+ type: z.ZodString;
2330
+ }, "strip", z.ZodTypeAny, {
2331
+ type: string;
2332
+ path: string;
2333
+ }, {
2334
+ type: string;
2335
+ path: string;
2336
+ }>, "many">;
2337
+ thresholdUsed: z.ZodNumber;
2338
+ }, "strip", z.ZodTypeAny, {
2339
+ opaqueScVals: {
2340
+ type: string;
2341
+ path: string;
2342
+ }[];
2343
+ unknownContracts: {
2344
+ contract: string;
2345
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2346
+ }[];
2347
+ overall: number;
2348
+ knownContracts: string[];
2349
+ thresholdUsed: number;
2350
+ }, {
2351
+ opaqueScVals: {
2352
+ type: string;
2353
+ path: string;
2354
+ }[];
2355
+ unknownContracts: {
2356
+ contract: string;
2357
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2358
+ }[];
2359
+ overall: number;
2360
+ knownContracts: string[];
2361
+ thresholdUsed: number;
2362
+ }>;
2363
+ sourceAccount: z.ZodString;
2364
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2365
+ network: z.ZodEnum<["mainnet", "testnet"]>;
2366
+ signers: z.ZodArray<z.ZodString, "many">;
2367
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
2368
+ tokenMovements: z.ZodArray<z.ZodObject<{
2369
+ token: z.ZodString;
2370
+ from: z.ZodString;
2371
+ to: z.ZodString;
2372
+ amount: z.ZodString;
2373
+ }, "strip", z.ZodTypeAny, {
2374
+ amount: string;
2375
+ token: string;
2376
+ from: string;
2377
+ to: string;
2378
+ }, {
2379
+ amount: string;
2380
+ token: string;
2381
+ from: string;
2382
+ to: string;
2383
+ }>, "many">;
2384
+ events: z.ZodArray<z.ZodObject<{
2385
+ contract: z.ZodString;
2386
+ topics: z.ZodArray<z.ZodString, "many">;
2387
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
2388
+ }, "strip", z.ZodTypeAny, {
2389
+ contract: string;
2390
+ topics: string[];
2391
+ data?: unknown;
2392
+ }, {
2393
+ contract: string;
2394
+ topics: string[];
2395
+ data?: unknown;
2396
+ }>, "many">;
2397
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
2398
+ ledgerSequence: z.ZodNumber;
2399
+ fetchedAt: z.ZodNumber;
2400
+ parseConfidence: z.ZodObject<{
2401
+ overall: z.ZodNumber;
2402
+ knownContracts: z.ZodArray<z.ZodString, "many">;
2403
+ unknownContracts: z.ZodArray<z.ZodObject<{
2404
+ contract: z.ZodString;
2405
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
2406
+ }, "strip", z.ZodTypeAny, {
2407
+ contract: string;
2408
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2409
+ }, {
2410
+ contract: string;
2411
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2412
+ }>, "many">;
2413
+ opaqueScVals: z.ZodArray<z.ZodObject<{
2414
+ path: z.ZodString;
2415
+ type: z.ZodString;
2416
+ }, "strip", z.ZodTypeAny, {
2417
+ type: string;
2418
+ path: string;
2419
+ }, {
2420
+ type: string;
2421
+ path: string;
2422
+ }>, "many">;
2423
+ thresholdUsed: z.ZodNumber;
2424
+ }, "strip", z.ZodTypeAny, {
2425
+ opaqueScVals: {
2426
+ type: string;
2427
+ path: string;
2428
+ }[];
2429
+ unknownContracts: {
2430
+ contract: string;
2431
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2432
+ }[];
2433
+ overall: number;
2434
+ knownContracts: string[];
2435
+ thresholdUsed: number;
2436
+ }, {
2437
+ opaqueScVals: {
2438
+ type: string;
2439
+ path: string;
2440
+ }[];
2441
+ unknownContracts: {
2442
+ contract: string;
2443
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2444
+ }[];
2445
+ overall: number;
2446
+ knownContracts: string[];
2447
+ thresholdUsed: number;
2448
+ }>;
2449
+ sourceAccount: z.ZodString;
2450
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2451
+ network: z.ZodEnum<["mainnet", "testnet"]>;
2452
+ signers: z.ZodArray<z.ZodString, "many">;
2453
+ invocations: z.ZodArray<z.ZodType<unknown, z.ZodTypeDef, unknown>, "many">;
2454
+ tokenMovements: z.ZodArray<z.ZodObject<{
2455
+ token: z.ZodString;
2456
+ from: z.ZodString;
2457
+ to: z.ZodString;
2458
+ amount: z.ZodString;
2459
+ }, "strip", z.ZodTypeAny, {
2460
+ amount: string;
2461
+ token: string;
2462
+ from: string;
2463
+ to: string;
2464
+ }, {
2465
+ amount: string;
2466
+ token: string;
2467
+ from: string;
2468
+ to: string;
2469
+ }>, "many">;
2470
+ events: z.ZodArray<z.ZodObject<{
2471
+ contract: z.ZodString;
2472
+ topics: z.ZodArray<z.ZodString, "many">;
2473
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
2474
+ }, "strip", z.ZodTypeAny, {
2475
+ contract: string;
2476
+ topics: string[];
2477
+ data?: unknown;
2478
+ }, {
2479
+ contract: string;
2480
+ topics: string[];
2481
+ data?: unknown;
2482
+ }>, "many">;
2483
+ authEntries: z.ZodArray<z.ZodUnknown, "many">;
2484
+ ledgerSequence: z.ZodNumber;
2485
+ fetchedAt: z.ZodNumber;
2486
+ parseConfidence: z.ZodObject<{
2487
+ overall: z.ZodNumber;
2488
+ knownContracts: z.ZodArray<z.ZodString, "many">;
2489
+ unknownContracts: z.ZodArray<z.ZodObject<{
2490
+ contract: z.ZodString;
2491
+ reason: z.ZodEnum<["no-abi", "version-mismatch", "opaque-result"]>;
2492
+ }, "strip", z.ZodTypeAny, {
2493
+ contract: string;
2494
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2495
+ }, {
2496
+ contract: string;
2497
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2498
+ }>, "many">;
2499
+ opaqueScVals: z.ZodArray<z.ZodObject<{
2500
+ path: z.ZodString;
2501
+ type: z.ZodString;
2502
+ }, "strip", z.ZodTypeAny, {
2503
+ type: string;
2504
+ path: string;
2505
+ }, {
2506
+ type: string;
2507
+ path: string;
2508
+ }>, "many">;
2509
+ thresholdUsed: z.ZodNumber;
2510
+ }, "strip", z.ZodTypeAny, {
2511
+ opaqueScVals: {
2512
+ type: string;
2513
+ path: string;
2514
+ }[];
2515
+ unknownContracts: {
2516
+ contract: string;
2517
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2518
+ }[];
2519
+ overall: number;
2520
+ knownContracts: string[];
2521
+ thresholdUsed: number;
2522
+ }, {
2523
+ opaqueScVals: {
2524
+ type: string;
2525
+ path: string;
2526
+ }[];
2527
+ unknownContracts: {
2528
+ contract: string;
2529
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2530
+ }[];
2531
+ overall: number;
2532
+ knownContracts: string[];
2533
+ thresholdUsed: number;
2534
+ }>;
2535
+ sourceAccount: z.ZodString;
2536
+ }, z.ZodTypeAny, "passthrough">>;
2537
+ validUntilLedger: z.ZodOptional<z.ZodNumber>;
2538
+ oraclePricesByAsset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
2539
+ price: z.ZodString;
2540
+ timestampSeconds: z.ZodNumber;
2541
+ }, "strip", z.ZodTypeAny, {
2542
+ price: string;
2543
+ timestampSeconds: number;
2544
+ }, {
2545
+ price: string;
2546
+ timestampSeconds: number;
2547
+ }>, z.ZodObject<{
2548
+ error: z.ZodEnum<["stale", "missing", "deviation", "paused", "decimals", "fingerprint"]>;
2549
+ }, "strip", z.ZodTypeAny, {
2550
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2551
+ }, {
2552
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2553
+ }>]>>>;
2554
+ }, "strip", z.ZodTypeAny, {
2555
+ permitTx: {
2556
+ signers: string[];
2557
+ events: {
2558
+ contract: string;
2559
+ topics: string[];
2560
+ data?: unknown;
2561
+ }[];
2562
+ sourceAccount: string;
2563
+ network: "mainnet" | "testnet";
2564
+ invocations: unknown[];
2565
+ tokenMovements: {
2566
+ amount: string;
2567
+ token: string;
2568
+ from: string;
2569
+ to: string;
2570
+ }[];
2571
+ authEntries: unknown[];
2572
+ ledgerSequence: number;
2573
+ fetchedAt: number;
2574
+ parseConfidence: {
2575
+ opaqueScVals: {
2576
+ type: string;
2577
+ path: string;
2578
+ }[];
2579
+ unknownContracts: {
2580
+ contract: string;
2581
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2582
+ }[];
2583
+ overall: number;
2584
+ knownContracts: string[];
2585
+ thresholdUsed: number;
2586
+ };
2587
+ } & {
2588
+ [k: string]: unknown;
2589
+ };
2590
+ validUntilLedger?: number | undefined;
2591
+ predicate?: unknown;
2592
+ oraclePricesByAsset?: Record<string, {
2593
+ price: string;
2594
+ timestampSeconds: number;
2595
+ } | {
2596
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2597
+ }> | undefined;
2598
+ }, {
2599
+ permitTx: {
2600
+ signers: string[];
2601
+ events: {
2602
+ contract: string;
2603
+ topics: string[];
2604
+ data?: unknown;
2605
+ }[];
2606
+ sourceAccount: string;
2607
+ network: "mainnet" | "testnet";
2608
+ invocations: unknown[];
2609
+ tokenMovements: {
2610
+ amount: string;
2611
+ token: string;
2612
+ from: string;
2613
+ to: string;
2614
+ }[];
2615
+ authEntries: unknown[];
2616
+ ledgerSequence: number;
2617
+ fetchedAt: number;
2618
+ parseConfidence: {
2619
+ opaqueScVals: {
2620
+ type: string;
2621
+ path: string;
2622
+ }[];
2623
+ unknownContracts: {
2624
+ contract: string;
2625
+ reason: "no-abi" | "version-mismatch" | "opaque-result";
2626
+ }[];
2627
+ overall: number;
2628
+ knownContracts: string[];
2629
+ thresholdUsed: number;
2630
+ };
2631
+ } & {
2632
+ [k: string]: unknown;
2633
+ };
2634
+ validUntilLedger?: number | undefined;
2635
+ predicate?: unknown;
2636
+ oraclePricesByAsset?: Record<string, {
2637
+ price: string;
2638
+ timestampSeconds: number;
2639
+ } | {
2640
+ error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
2641
+ }> | undefined;
2642
+ }>;
2643
+ export type VerifyPolicyInput = z.infer<typeof VerifyPolicyInputSchema>;
2644
+ /** Pinned interpreter address (testnet). Mirrors DEPLOYMENTS.md:156-157.
2645
+ * Single source for the MCP layer; do not embed elsewhere. */
2646
+ export declare const PINNED_INTERPRETER_TESTNET_ADDRESS = "CDR4NLV22STCXFGZPNKDQTEANWLF7LZ6AJLY6B7CLJXKHDZGYJWIOKGP";
2647
+ /** Pinned interpreter wasm sha256 (hex). Mirrors DEPLOYMENTS.md:156-157. */
2648
+ export declare const PINNED_INTERPRETER_WASM_SHA256 = "6e6c13d93e197aa380303a42cd120f5ddb080dd36ef2a343ee1dbd04ca52a443";
2649
+ /** The grammar version the interpreter enforces (matches SELF_VERSION in
2650
+ * packages/policy-interpreter/src/version.rs). */
2651
+ export declare const PINNED_INTERPRETER_GRAMMAR_VERSION = 1;
2652
+ /** Default Soroban RPC for the install / revoke / info tools. The recorder
2653
+ * keeps its own copy in record/rpc.ts because it hands back a fetcher rather
2654
+ * than a Server; the two are deliberately different surfaces, so this is
2655
+ * pinned beside the addresses it is used with rather than shared. */
2656
+ export declare const TESTNET_RPC_URL = "https://soroban-testnet.stellar.org";
2657
+ /** Soroban `valid_until` window (ledgers) added to the latest ledger when
2658
+ * building the auth entry. ~25 minutes at 5s/ledger. */
2659
+ export declare const DEFAULT_AUTH_VALID_UNTIL_LEDGERS = 300;
2660
+ /** Stellar network passphrases. Pinned here so the XDR envelope uses the
2661
+ * matching passphrase when the wallet signs (a mismatch yields invalid
2662
+ * hashes). */
2663
+ export declare const NETWORK_PASSPHRASES: Record<Network, string>;
2664
+ export declare const InstallPolicyInputSchema: z.ZodEffects<z.ZodObject<{
2665
+ /** The smart account contract address (C...) that will receive the rule. */
2666
+ smartAccount: z.ZodString;
2667
+ /** The signer that authorises the install (G... wallet). Used only for
2668
+ * sequence number + auth nonce simulation; never persisted, never signed. */
2669
+ sourceAccount: z.ZodString;
2670
+ /** The proposed rule draft. Mirrors the core `ContextRuleDraft` shape. */
2671
+ rule: z.ZodEffects<z.ZodObject<{
2672
+ contextRuleType: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2673
+ kind: z.ZodLiteral<"default">;
2674
+ }, "strip", z.ZodTypeAny, {
2675
+ kind: "default";
2676
+ }, {
2677
+ kind: "default";
2678
+ }>, z.ZodObject<{
2679
+ kind: z.ZodLiteral<"call_contract">;
2680
+ contract: z.ZodString;
2681
+ }, "strip", z.ZodTypeAny, {
2682
+ contract: string;
2683
+ kind: "call_contract";
2684
+ }, {
2685
+ contract: string;
2686
+ kind: "call_contract";
2687
+ }>, z.ZodObject<{
2688
+ kind: z.ZodLiteral<"create_contract">;
2689
+ wasmHash: z.ZodString;
2690
+ }, "strip", z.ZodTypeAny, {
2691
+ kind: "create_contract";
2692
+ wasmHash: string;
2693
+ }, {
2694
+ kind: "create_contract";
2695
+ wasmHash: string;
2696
+ }>]>;
2697
+ name: z.ZodString;
2698
+ validUntilLedger: z.ZodNullable<z.ZodNumber>;
2699
+ signers: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2700
+ kind: z.ZodLiteral<"delegated">;
2701
+ address: z.ZodString;
2702
+ }, "strip", z.ZodTypeAny, {
2703
+ address: string;
2704
+ kind: "delegated";
2705
+ }, {
2706
+ address: string;
2707
+ kind: "delegated";
2708
+ }>, z.ZodObject<{
2709
+ kind: z.ZodLiteral<"external">;
2710
+ verifier: z.ZodString;
2711
+ keyBytes: z.ZodString;
2712
+ }, "strip", z.ZodTypeAny, {
2713
+ kind: "external";
2714
+ verifier: string;
2715
+ keyBytes: string;
2716
+ }, {
2717
+ kind: "external";
2718
+ verifier: string;
2719
+ keyBytes: string;
2720
+ }>]>, "many">;
2721
+ policies: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2722
+ kind: z.ZodLiteral<"interpreter">;
2723
+ interpreterAddress: z.ZodString;
2724
+ predicateBlobBase64: z.ZodString;
2725
+ }, "strip", z.ZodTypeAny, {
2726
+ kind: "interpreter";
2727
+ interpreterAddress: string;
2728
+ predicateBlobBase64: string;
2729
+ }, {
2730
+ kind: "interpreter";
2731
+ interpreterAddress: string;
2732
+ predicateBlobBase64: string;
2733
+ }>, z.ZodObject<{
2734
+ kind: z.ZodLiteral<"oz_builtin">;
2735
+ primitive: z.ZodObject<{
2736
+ primitive: z.ZodEnum<["spending_limit", "simple_threshold", "weighted_threshold"]>;
2737
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2738
+ }, "strip", z.ZodTypeAny, {
2739
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2740
+ params: Record<string, unknown>;
2741
+ }, {
2742
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2743
+ params: Record<string, unknown>;
2744
+ }>;
2745
+ instanceAddress: z.ZodString;
2746
+ }, "strip", z.ZodTypeAny, {
2747
+ instanceAddress: string;
2748
+ primitive: {
2749
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2750
+ params: Record<string, unknown>;
2751
+ };
2752
+ kind: "oz_builtin";
2753
+ }, {
2754
+ instanceAddress: string;
2755
+ primitive: {
2756
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2757
+ params: Record<string, unknown>;
2758
+ };
2759
+ kind: "oz_builtin";
2760
+ }>]>, "many">;
2761
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2762
+ contextRuleType: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2763
+ kind: z.ZodLiteral<"default">;
2764
+ }, "strip", z.ZodTypeAny, {
2765
+ kind: "default";
2766
+ }, {
2767
+ kind: "default";
2768
+ }>, z.ZodObject<{
2769
+ kind: z.ZodLiteral<"call_contract">;
2770
+ contract: z.ZodString;
2771
+ }, "strip", z.ZodTypeAny, {
2772
+ contract: string;
2773
+ kind: "call_contract";
2774
+ }, {
2775
+ contract: string;
2776
+ kind: "call_contract";
2777
+ }>, z.ZodObject<{
2778
+ kind: z.ZodLiteral<"create_contract">;
2779
+ wasmHash: z.ZodString;
2780
+ }, "strip", z.ZodTypeAny, {
2781
+ kind: "create_contract";
2782
+ wasmHash: string;
2783
+ }, {
2784
+ kind: "create_contract";
2785
+ wasmHash: string;
2786
+ }>]>;
2787
+ name: z.ZodString;
2788
+ validUntilLedger: z.ZodNullable<z.ZodNumber>;
2789
+ signers: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2790
+ kind: z.ZodLiteral<"delegated">;
2791
+ address: z.ZodString;
2792
+ }, "strip", z.ZodTypeAny, {
2793
+ address: string;
2794
+ kind: "delegated";
2795
+ }, {
2796
+ address: string;
2797
+ kind: "delegated";
2798
+ }>, z.ZodObject<{
2799
+ kind: z.ZodLiteral<"external">;
2800
+ verifier: z.ZodString;
2801
+ keyBytes: z.ZodString;
2802
+ }, "strip", z.ZodTypeAny, {
2803
+ kind: "external";
2804
+ verifier: string;
2805
+ keyBytes: string;
2806
+ }, {
2807
+ kind: "external";
2808
+ verifier: string;
2809
+ keyBytes: string;
2810
+ }>]>, "many">;
2811
+ policies: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2812
+ kind: z.ZodLiteral<"interpreter">;
2813
+ interpreterAddress: z.ZodString;
2814
+ predicateBlobBase64: z.ZodString;
2815
+ }, "strip", z.ZodTypeAny, {
2816
+ kind: "interpreter";
2817
+ interpreterAddress: string;
2818
+ predicateBlobBase64: string;
2819
+ }, {
2820
+ kind: "interpreter";
2821
+ interpreterAddress: string;
2822
+ predicateBlobBase64: string;
2823
+ }>, z.ZodObject<{
2824
+ kind: z.ZodLiteral<"oz_builtin">;
2825
+ primitive: z.ZodObject<{
2826
+ primitive: z.ZodEnum<["spending_limit", "simple_threshold", "weighted_threshold"]>;
2827
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2828
+ }, "strip", z.ZodTypeAny, {
2829
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2830
+ params: Record<string, unknown>;
2831
+ }, {
2832
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2833
+ params: Record<string, unknown>;
2834
+ }>;
2835
+ instanceAddress: z.ZodString;
2836
+ }, "strip", z.ZodTypeAny, {
2837
+ instanceAddress: string;
2838
+ primitive: {
2839
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2840
+ params: Record<string, unknown>;
2841
+ };
2842
+ kind: "oz_builtin";
2843
+ }, {
2844
+ instanceAddress: string;
2845
+ primitive: {
2846
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2847
+ params: Record<string, unknown>;
2848
+ };
2849
+ kind: "oz_builtin";
2850
+ }>]>, "many">;
2851
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2852
+ contextRuleType: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2853
+ kind: z.ZodLiteral<"default">;
2854
+ }, "strip", z.ZodTypeAny, {
2855
+ kind: "default";
2856
+ }, {
2857
+ kind: "default";
2858
+ }>, z.ZodObject<{
2859
+ kind: z.ZodLiteral<"call_contract">;
2860
+ contract: z.ZodString;
2861
+ }, "strip", z.ZodTypeAny, {
2862
+ contract: string;
2863
+ kind: "call_contract";
2864
+ }, {
2865
+ contract: string;
2866
+ kind: "call_contract";
2867
+ }>, z.ZodObject<{
2868
+ kind: z.ZodLiteral<"create_contract">;
2869
+ wasmHash: z.ZodString;
2870
+ }, "strip", z.ZodTypeAny, {
2871
+ kind: "create_contract";
2872
+ wasmHash: string;
2873
+ }, {
2874
+ kind: "create_contract";
2875
+ wasmHash: string;
2876
+ }>]>;
2877
+ name: z.ZodString;
2878
+ validUntilLedger: z.ZodNullable<z.ZodNumber>;
2879
+ signers: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2880
+ kind: z.ZodLiteral<"delegated">;
2881
+ address: z.ZodString;
2882
+ }, "strip", z.ZodTypeAny, {
2883
+ address: string;
2884
+ kind: "delegated";
2885
+ }, {
2886
+ address: string;
2887
+ kind: "delegated";
2888
+ }>, z.ZodObject<{
2889
+ kind: z.ZodLiteral<"external">;
2890
+ verifier: z.ZodString;
2891
+ keyBytes: z.ZodString;
2892
+ }, "strip", z.ZodTypeAny, {
2893
+ kind: "external";
2894
+ verifier: string;
2895
+ keyBytes: string;
2896
+ }, {
2897
+ kind: "external";
2898
+ verifier: string;
2899
+ keyBytes: string;
2900
+ }>]>, "many">;
2901
+ policies: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2902
+ kind: z.ZodLiteral<"interpreter">;
2903
+ interpreterAddress: z.ZodString;
2904
+ predicateBlobBase64: z.ZodString;
2905
+ }, "strip", z.ZodTypeAny, {
2906
+ kind: "interpreter";
2907
+ interpreterAddress: string;
2908
+ predicateBlobBase64: string;
2909
+ }, {
2910
+ kind: "interpreter";
2911
+ interpreterAddress: string;
2912
+ predicateBlobBase64: string;
2913
+ }>, z.ZodObject<{
2914
+ kind: z.ZodLiteral<"oz_builtin">;
2915
+ primitive: z.ZodObject<{
2916
+ primitive: z.ZodEnum<["spending_limit", "simple_threshold", "weighted_threshold"]>;
2917
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2918
+ }, "strip", z.ZodTypeAny, {
2919
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2920
+ params: Record<string, unknown>;
2921
+ }, {
2922
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2923
+ params: Record<string, unknown>;
2924
+ }>;
2925
+ instanceAddress: z.ZodString;
2926
+ }, "strip", z.ZodTypeAny, {
2927
+ instanceAddress: string;
2928
+ primitive: {
2929
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2930
+ params: Record<string, unknown>;
2931
+ };
2932
+ kind: "oz_builtin";
2933
+ }, {
2934
+ instanceAddress: string;
2935
+ primitive: {
2936
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
2937
+ params: Record<string, unknown>;
2938
+ };
2939
+ kind: "oz_builtin";
2940
+ }>]>, "many">;
2941
+ }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
2942
+ contextRuleType: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2943
+ kind: z.ZodLiteral<"default">;
2944
+ }, "strip", z.ZodTypeAny, {
2945
+ kind: "default";
2946
+ }, {
2947
+ kind: "default";
2948
+ }>, z.ZodObject<{
2949
+ kind: z.ZodLiteral<"call_contract">;
2950
+ contract: z.ZodString;
2951
+ }, "strip", z.ZodTypeAny, {
2952
+ contract: string;
2953
+ kind: "call_contract";
2954
+ }, {
2955
+ contract: string;
2956
+ kind: "call_contract";
2957
+ }>, z.ZodObject<{
2958
+ kind: z.ZodLiteral<"create_contract">;
2959
+ wasmHash: z.ZodString;
2960
+ }, "strip", z.ZodTypeAny, {
2961
+ kind: "create_contract";
2962
+ wasmHash: string;
2963
+ }, {
2964
+ kind: "create_contract";
2965
+ wasmHash: string;
2966
+ }>]>;
2967
+ name: z.ZodString;
2968
+ validUntilLedger: z.ZodNullable<z.ZodNumber>;
2969
+ signers: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2970
+ kind: z.ZodLiteral<"delegated">;
2971
+ address: z.ZodString;
2972
+ }, "strip", z.ZodTypeAny, {
2973
+ address: string;
2974
+ kind: "delegated";
2975
+ }, {
2976
+ address: string;
2977
+ kind: "delegated";
2978
+ }>, z.ZodObject<{
2979
+ kind: z.ZodLiteral<"external">;
2980
+ verifier: z.ZodString;
2981
+ keyBytes: z.ZodString;
2982
+ }, "strip", z.ZodTypeAny, {
2983
+ kind: "external";
2984
+ verifier: string;
2985
+ keyBytes: string;
2986
+ }, {
2987
+ kind: "external";
2988
+ verifier: string;
2989
+ keyBytes: string;
2990
+ }>]>, "many">;
2991
+ policies: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2992
+ kind: z.ZodLiteral<"interpreter">;
2993
+ interpreterAddress: z.ZodString;
2994
+ predicateBlobBase64: z.ZodString;
2995
+ }, "strip", z.ZodTypeAny, {
2996
+ kind: "interpreter";
2997
+ interpreterAddress: string;
2998
+ predicateBlobBase64: string;
2999
+ }, {
3000
+ kind: "interpreter";
3001
+ interpreterAddress: string;
3002
+ predicateBlobBase64: string;
3003
+ }>, z.ZodObject<{
3004
+ kind: z.ZodLiteral<"oz_builtin">;
3005
+ primitive: z.ZodObject<{
3006
+ primitive: z.ZodEnum<["spending_limit", "simple_threshold", "weighted_threshold"]>;
3007
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3008
+ }, "strip", z.ZodTypeAny, {
3009
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3010
+ params: Record<string, unknown>;
3011
+ }, {
3012
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3013
+ params: Record<string, unknown>;
3014
+ }>;
3015
+ instanceAddress: z.ZodString;
3016
+ }, "strip", z.ZodTypeAny, {
3017
+ instanceAddress: string;
3018
+ primitive: {
3019
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3020
+ params: Record<string, unknown>;
3021
+ };
3022
+ kind: "oz_builtin";
3023
+ }, {
3024
+ instanceAddress: string;
3025
+ primitive: {
3026
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3027
+ params: Record<string, unknown>;
3028
+ };
3029
+ kind: "oz_builtin";
3030
+ }>]>, "many">;
3031
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3032
+ contextRuleType: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3033
+ kind: z.ZodLiteral<"default">;
3034
+ }, "strip", z.ZodTypeAny, {
3035
+ kind: "default";
3036
+ }, {
3037
+ kind: "default";
3038
+ }>, z.ZodObject<{
3039
+ kind: z.ZodLiteral<"call_contract">;
3040
+ contract: z.ZodString;
3041
+ }, "strip", z.ZodTypeAny, {
3042
+ contract: string;
3043
+ kind: "call_contract";
3044
+ }, {
3045
+ contract: string;
3046
+ kind: "call_contract";
3047
+ }>, z.ZodObject<{
3048
+ kind: z.ZodLiteral<"create_contract">;
3049
+ wasmHash: z.ZodString;
3050
+ }, "strip", z.ZodTypeAny, {
3051
+ kind: "create_contract";
3052
+ wasmHash: string;
3053
+ }, {
3054
+ kind: "create_contract";
3055
+ wasmHash: string;
3056
+ }>]>;
3057
+ name: z.ZodString;
3058
+ validUntilLedger: z.ZodNullable<z.ZodNumber>;
3059
+ signers: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3060
+ kind: z.ZodLiteral<"delegated">;
3061
+ address: z.ZodString;
3062
+ }, "strip", z.ZodTypeAny, {
3063
+ address: string;
3064
+ kind: "delegated";
3065
+ }, {
3066
+ address: string;
3067
+ kind: "delegated";
3068
+ }>, z.ZodObject<{
3069
+ kind: z.ZodLiteral<"external">;
3070
+ verifier: z.ZodString;
3071
+ keyBytes: z.ZodString;
3072
+ }, "strip", z.ZodTypeAny, {
3073
+ kind: "external";
3074
+ verifier: string;
3075
+ keyBytes: string;
3076
+ }, {
3077
+ kind: "external";
3078
+ verifier: string;
3079
+ keyBytes: string;
3080
+ }>]>, "many">;
3081
+ policies: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
3082
+ kind: z.ZodLiteral<"interpreter">;
3083
+ interpreterAddress: z.ZodString;
3084
+ predicateBlobBase64: z.ZodString;
3085
+ }, "strip", z.ZodTypeAny, {
3086
+ kind: "interpreter";
3087
+ interpreterAddress: string;
3088
+ predicateBlobBase64: string;
3089
+ }, {
3090
+ kind: "interpreter";
3091
+ interpreterAddress: string;
3092
+ predicateBlobBase64: string;
3093
+ }>, z.ZodObject<{
3094
+ kind: z.ZodLiteral<"oz_builtin">;
3095
+ primitive: z.ZodObject<{
3096
+ primitive: z.ZodEnum<["spending_limit", "simple_threshold", "weighted_threshold"]>;
3097
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3098
+ }, "strip", z.ZodTypeAny, {
3099
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3100
+ params: Record<string, unknown>;
3101
+ }, {
3102
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3103
+ params: Record<string, unknown>;
3104
+ }>;
3105
+ instanceAddress: z.ZodString;
3106
+ }, "strip", z.ZodTypeAny, {
3107
+ instanceAddress: string;
3108
+ primitive: {
3109
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3110
+ params: Record<string, unknown>;
3111
+ };
3112
+ kind: "oz_builtin";
3113
+ }, {
3114
+ instanceAddress: string;
3115
+ primitive: {
3116
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3117
+ params: Record<string, unknown>;
3118
+ };
3119
+ kind: "oz_builtin";
3120
+ }>]>, "many">;
3121
+ }, z.ZodTypeAny, "passthrough">>;
3122
+ /** Per-rule install nonce; 1 for a fresh install. */
3123
+ installNonce: z.ZodNumber;
3124
+ /** Optional RPC URL override. Defaults to the public testnet endpoint
3125
+ * (`TESTNET_RPC_URL`); the override is refused unless
3126
+ * `allowUnpinnedRpcUrl: true`, because the auth nonce and
3127
+ * rootInvocation in the response come from whichever RPC answered. */
3128
+ rpcUrl: z.ZodOptional<z.ZodString>;
3129
+ /** Opt-in to using a non-pinned RPC URL. Without this flag the tool
3130
+ * refuses any `rpcUrl` other than `TESTNET_RPC_URL` because the
3131
+ * caller's auth-digest binds to whatever the RPC returned. */
3132
+ allowUnpinnedRpcUrl: z.ZodOptional<z.ZodBoolean>;
3133
+ /** Opt-in to pointing the rule's interpreter policy at any address
3134
+ * other than the pinned testnet interpreter. Default-deny: a caller
3135
+ * that controls the interpreter can permit everything. */
3136
+ allowUnpinnedInterpreter: z.ZodOptional<z.ZodBoolean>;
3137
+ /** Base fee in stroops; defaults to BASE_FEE (100). */
3138
+ baseFee: z.ZodOptional<z.ZodNumber>;
3139
+ }, "strip", z.ZodTypeAny, {
3140
+ installNonce: number;
3141
+ smartAccount: string;
3142
+ sourceAccount: string;
3143
+ rule: {
3144
+ contextRuleType: {
3145
+ kind: "default";
3146
+ } | {
3147
+ contract: string;
3148
+ kind: "call_contract";
3149
+ } | {
3150
+ kind: "create_contract";
3151
+ wasmHash: string;
3152
+ };
3153
+ validUntilLedger: number | null;
3154
+ signers: ({
3155
+ address: string;
3156
+ kind: "delegated";
3157
+ } | {
3158
+ kind: "external";
3159
+ verifier: string;
3160
+ keyBytes: string;
3161
+ })[];
3162
+ policies: ({
3163
+ kind: "interpreter";
3164
+ interpreterAddress: string;
3165
+ predicateBlobBase64: string;
3166
+ } | {
3167
+ instanceAddress: string;
3168
+ primitive: {
3169
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3170
+ params: Record<string, unknown>;
3171
+ };
3172
+ kind: "oz_builtin";
3173
+ })[];
3174
+ name: string;
3175
+ } & {
3176
+ [k: string]: unknown;
3177
+ };
3178
+ rpcUrl?: string | undefined;
3179
+ allowUnpinnedRpcUrl?: boolean | undefined;
3180
+ allowUnpinnedInterpreter?: boolean | undefined;
3181
+ baseFee?: number | undefined;
3182
+ }, {
3183
+ installNonce: number;
3184
+ smartAccount: string;
3185
+ sourceAccount: string;
3186
+ rule: {
3187
+ contextRuleType: {
3188
+ kind: "default";
3189
+ } | {
3190
+ contract: string;
3191
+ kind: "call_contract";
3192
+ } | {
3193
+ kind: "create_contract";
3194
+ wasmHash: string;
3195
+ };
3196
+ validUntilLedger: number | null;
3197
+ signers: ({
3198
+ address: string;
3199
+ kind: "delegated";
3200
+ } | {
3201
+ kind: "external";
3202
+ verifier: string;
3203
+ keyBytes: string;
3204
+ })[];
3205
+ policies: ({
3206
+ kind: "interpreter";
3207
+ interpreterAddress: string;
3208
+ predicateBlobBase64: string;
3209
+ } | {
3210
+ instanceAddress: string;
3211
+ primitive: {
3212
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3213
+ params: Record<string, unknown>;
3214
+ };
3215
+ kind: "oz_builtin";
3216
+ })[];
3217
+ name: string;
3218
+ } & {
3219
+ [k: string]: unknown;
3220
+ };
3221
+ rpcUrl?: string | undefined;
3222
+ allowUnpinnedRpcUrl?: boolean | undefined;
3223
+ allowUnpinnedInterpreter?: boolean | undefined;
3224
+ baseFee?: number | undefined;
3225
+ }>, {
3226
+ installNonce: number;
3227
+ smartAccount: string;
3228
+ sourceAccount: string;
3229
+ rule: {
3230
+ contextRuleType: {
3231
+ kind: "default";
3232
+ } | {
3233
+ contract: string;
3234
+ kind: "call_contract";
3235
+ } | {
3236
+ kind: "create_contract";
3237
+ wasmHash: string;
3238
+ };
3239
+ validUntilLedger: number | null;
3240
+ signers: ({
3241
+ address: string;
3242
+ kind: "delegated";
3243
+ } | {
3244
+ kind: "external";
3245
+ verifier: string;
3246
+ keyBytes: string;
3247
+ })[];
3248
+ policies: ({
3249
+ kind: "interpreter";
3250
+ interpreterAddress: string;
3251
+ predicateBlobBase64: string;
3252
+ } | {
3253
+ instanceAddress: string;
3254
+ primitive: {
3255
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3256
+ params: Record<string, unknown>;
3257
+ };
3258
+ kind: "oz_builtin";
3259
+ })[];
3260
+ name: string;
3261
+ } & {
3262
+ [k: string]: unknown;
3263
+ };
3264
+ rpcUrl?: string | undefined;
3265
+ allowUnpinnedRpcUrl?: boolean | undefined;
3266
+ allowUnpinnedInterpreter?: boolean | undefined;
3267
+ baseFee?: number | undefined;
3268
+ }, {
3269
+ installNonce: number;
3270
+ smartAccount: string;
3271
+ sourceAccount: string;
3272
+ rule: {
3273
+ contextRuleType: {
3274
+ kind: "default";
3275
+ } | {
3276
+ contract: string;
3277
+ kind: "call_contract";
3278
+ } | {
3279
+ kind: "create_contract";
3280
+ wasmHash: string;
3281
+ };
3282
+ validUntilLedger: number | null;
3283
+ signers: ({
3284
+ address: string;
3285
+ kind: "delegated";
3286
+ } | {
3287
+ kind: "external";
3288
+ verifier: string;
3289
+ keyBytes: string;
3290
+ })[];
3291
+ policies: ({
3292
+ kind: "interpreter";
3293
+ interpreterAddress: string;
3294
+ predicateBlobBase64: string;
3295
+ } | {
3296
+ instanceAddress: string;
3297
+ primitive: {
3298
+ primitive: "spending_limit" | "simple_threshold" | "weighted_threshold";
3299
+ params: Record<string, unknown>;
3300
+ };
3301
+ kind: "oz_builtin";
3302
+ })[];
3303
+ name: string;
3304
+ } & {
3305
+ [k: string]: unknown;
3306
+ };
3307
+ rpcUrl?: string | undefined;
3308
+ allowUnpinnedRpcUrl?: boolean | undefined;
3309
+ allowUnpinnedInterpreter?: boolean | undefined;
3310
+ baseFee?: number | undefined;
3311
+ }>;
3312
+ export type InstallPolicyInput = z.infer<typeof InstallPolicyInputSchema>;
3313
+ export declare const RevokePolicyInputSchema: z.ZodEffects<z.ZodObject<{
3314
+ /** The smart account contract address (C...). */
3315
+ smartAccount: z.ZodString;
3316
+ /** The wallet that will sign the removal. The ACCOUNT decides whether it
3317
+ * accepts that signer; this schema does not assert a rule it cannot
3318
+ * verify, since the account's source is not in this repo. Proven on
3319
+ * testnet: the account's deployer can revoke. */
3320
+ sourceAccount: z.ZodString;
3321
+ /** The rule id to remove from the smart account + interpreter. */
3322
+ ruleId: z.ZodNumber;
3323
+ /** Optional RPC URL override; same pin as install. */
3324
+ rpcUrl: z.ZodOptional<z.ZodString>;
3325
+ /** Opt-in to using a non-pinned RPC URL. Same semantics as install. */
3326
+ allowUnpinnedRpcUrl: z.ZodOptional<z.ZodBoolean>;
3327
+ /** Base fee in stroops; defaults to BASE_FEE (100). */
3328
+ baseFee: z.ZodOptional<z.ZodNumber>;
3329
+ }, "strip", z.ZodTypeAny, {
3330
+ smartAccount: string;
3331
+ sourceAccount: string;
3332
+ ruleId: number;
3333
+ rpcUrl?: string | undefined;
3334
+ allowUnpinnedRpcUrl?: boolean | undefined;
3335
+ baseFee?: number | undefined;
3336
+ }, {
3337
+ smartAccount: string;
3338
+ sourceAccount: string;
3339
+ ruleId: number;
3340
+ rpcUrl?: string | undefined;
3341
+ allowUnpinnedRpcUrl?: boolean | undefined;
3342
+ baseFee?: number | undefined;
3343
+ }>, {
3344
+ smartAccount: string;
3345
+ sourceAccount: string;
3346
+ ruleId: number;
3347
+ rpcUrl?: string | undefined;
3348
+ allowUnpinnedRpcUrl?: boolean | undefined;
3349
+ baseFee?: number | undefined;
3350
+ }, {
3351
+ smartAccount: string;
3352
+ sourceAccount: string;
3353
+ ruleId: number;
3354
+ rpcUrl?: string | undefined;
3355
+ allowUnpinnedRpcUrl?: boolean | undefined;
3356
+ baseFee?: number | undefined;
3357
+ }>;
3358
+ export type RevokePolicyInput = z.infer<typeof RevokePolicyInputSchema>;
3359
+ export declare const GetInterpreterInfoInputSchema: z.ZodObject<{
3360
+ /** Network to query. The pin differs per network; defaults to testnet. */
3361
+ network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
3362
+ /** When true, perform an optional live `grammar_version()` RPC call to
3363
+ * verify the deployed contract matches the pin. */
3364
+ verifyLive: z.ZodOptional<z.ZodBoolean>;
3365
+ /** Optional RPC URL override. */
3366
+ rpcUrl: z.ZodOptional<z.ZodString>;
3367
+ }, "strip", z.ZodTypeAny, {
3368
+ network?: "mainnet" | "testnet" | undefined;
3369
+ rpcUrl?: string | undefined;
3370
+ verifyLive?: boolean | undefined;
3371
+ }, {
3372
+ network?: "mainnet" | "testnet" | undefined;
3373
+ rpcUrl?: string | undefined;
3374
+ verifyLive?: boolean | undefined;
3375
+ }>;
3376
+ export type GetInterpreterInfoInput = z.infer<typeof GetInterpreterInfoInputSchema>;
1881
3377
  export declare const ToolErrorSchema: z.ZodObject<{
1882
3378
  code: z.ZodString;
1883
3379
  message: z.ZodString;