@crediolabs/policy-builder-mcp 0.2.0 → 0.3.1
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.
- package/README.md +3 -3
- package/dist/src/schemas.d.ts +45 -346
- package/dist/src/schemas.js +21 -38
- package/dist/src/server.js +5 -6
- package/dist/src/transports/http.js +32 -34
- package/dist-cjs/package.json +3 -0
- package/dist-cjs/src/index.d.ts +7 -0
- package/dist-cjs/src/index.js +20 -0
- package/dist-cjs/src/schemas.d.ts +871 -0
- package/dist-cjs/src/schemas.js +121 -0
- package/dist-cjs/src/server.d.ts +6 -0
- package/dist-cjs/src/server.js +42 -0
- package/dist-cjs/src/tools/result.d.ts +24 -0
- package/dist-cjs/src/tools/result.js +38 -0
- package/dist-cjs/src/transports/http.d.ts +21 -0
- package/dist-cjs/src/transports/http.js +181 -0
- package/dist-cjs/src/transports/stdio.d.ts +1 -0
- package/dist-cjs/src/transports/stdio.js +18 -0
- package/package.json +11 -7
- package/src/schemas.ts +19 -50
- package/src/server.ts +5 -14
- package/src/transports/http.ts +32 -35
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @crediolabs/policy-builder-mcp
|
|
2
2
|
|
|
3
|
-
MCP server exposing the
|
|
3
|
+
MCP server exposing the OZ Policy Builder toolchain to agents. It wraps
|
|
4
4
|
[`@crediolabs/policy-synth`](https://www.npmjs.com/package/@crediolabs/policy-synth):
|
|
5
5
|
an agent records a Soroban transaction, synthesises the minimal policy that
|
|
6
6
|
permits exactly that flow, verifies and simulates it, and receives an
|
|
@@ -55,9 +55,9 @@ branch on them.
|
|
|
55
55
|
embedding caller explicitly opts out (`allowExternalHost: true` via the
|
|
56
56
|
programmatic API), because the surface is unauthenticated by design.
|
|
57
57
|
- See the
|
|
58
|
-
[architecture document](https://github.com/untangledfinance/
|
|
58
|
+
[architecture document](https://github.com/untangledfinance/oz-policy-builder/blob/main/docs/architecture.md)
|
|
59
59
|
for what the on-chain interpreter does and does not enforce, and the
|
|
60
|
-
[repository README](https://github.com/untangledfinance/
|
|
60
|
+
[repository README](https://github.com/untangledfinance/oz-policy-builder#readme)
|
|
61
61
|
for the contracts' audit status.
|
|
62
62
|
|
|
63
63
|
## License
|
package/dist/src/schemas.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComposeUserResponsesSchema, GetInterpreterInfoInputSchema, InstallPolicyInputSchema, InterpreterOptionsSchema,
|
|
1
|
+
import { ComposeUserResponsesSchema, GetInterpreterInfoInputSchema, InstallPolicyInputSchema, InterpreterOptionsSchema, NetworkSchema, PredicateNodeSchema, RecordedTransactionSchema, RecordTransactionInputSchema, RevokePolicyInputSchema, SynthesizePolicyInputSchema, ToolErrorSchema } from '@crediolabs/policy-synth/run';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export { ComposeUserResponsesSchema, GetInterpreterInfoInputSchema, InstallPolicyInputSchema, InterpreterOptionsSchema,
|
|
3
|
+
export { ComposeUserResponsesSchema, GetInterpreterInfoInputSchema, InstallPolicyInputSchema, InterpreterOptionsSchema, NetworkSchema, PredicateNodeSchema, RecordedTransactionSchema, RecordTransactionInputSchema, RevokePolicyInputSchema, SynthesizePolicyInputSchema, ToolErrorSchema, };
|
|
4
4
|
/** Flat ZodRawShape used for the MCP SDK tool registration. The body
|
|
5
5
|
* re-validates against `RecordTransactionInputSchema` so the mutual-exclusion
|
|
6
6
|
* rule still fires (the SDK does not invoke `.refine()` at registration time). */
|
|
@@ -11,156 +11,10 @@ export declare const RecordTransactionToolShape: {
|
|
|
11
11
|
readonly confidenceOverride: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
};
|
|
13
13
|
/** Flat ZodRawShape used for MCP tool registration. Every field is optional
|
|
14
|
-
* so the JSON-Schema the SDK exposes to clients
|
|
15
|
-
*
|
|
14
|
+
* so the JSON-Schema the SDK exposes to clients stays permissive; the body
|
|
15
|
+
* re-validates against the strict schema. */
|
|
16
16
|
export declare const SynthesizePolicyToolShape: {
|
|
17
|
-
readonly source: z.ZodOptional<z.
|
|
18
|
-
readonly mandate: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
19
|
-
chain: z.ZodLiteral<"stellar">;
|
|
20
|
-
contract: z.ZodString;
|
|
21
|
-
method: z.ZodOptional<z.ZodString>;
|
|
22
|
-
spendingLimit: z.ZodOptional<z.ZodObject<{
|
|
23
|
-
token: z.ZodString;
|
|
24
|
-
limit: z.ZodString;
|
|
25
|
-
windowSeconds: z.ZodNumber;
|
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
token: string;
|
|
28
|
-
limit: string;
|
|
29
|
-
windowSeconds: number;
|
|
30
|
-
}, {
|
|
31
|
-
token: string;
|
|
32
|
-
limit: string;
|
|
33
|
-
windowSeconds: number;
|
|
34
|
-
}>>;
|
|
35
|
-
approvalThreshold: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
-
expiry: z.ZodOptional<z.ZodObject<{
|
|
38
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
validUntilLedger?: number | undefined;
|
|
42
|
-
validUntilUnixSeconds?: number | undefined;
|
|
43
|
-
}, {
|
|
44
|
-
validUntilLedger?: number | undefined;
|
|
45
|
-
validUntilUnixSeconds?: number | undefined;
|
|
46
|
-
}>>;
|
|
47
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
48
|
-
chain: z.ZodLiteral<"stellar">;
|
|
49
|
-
contract: z.ZodString;
|
|
50
|
-
method: z.ZodOptional<z.ZodString>;
|
|
51
|
-
spendingLimit: z.ZodOptional<z.ZodObject<{
|
|
52
|
-
token: z.ZodString;
|
|
53
|
-
limit: z.ZodString;
|
|
54
|
-
windowSeconds: z.ZodNumber;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
token: string;
|
|
57
|
-
limit: string;
|
|
58
|
-
windowSeconds: number;
|
|
59
|
-
}, {
|
|
60
|
-
token: string;
|
|
61
|
-
limit: string;
|
|
62
|
-
windowSeconds: number;
|
|
63
|
-
}>>;
|
|
64
|
-
approvalThreshold: z.ZodOptional<z.ZodNumber>;
|
|
65
|
-
recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
66
|
-
expiry: z.ZodOptional<z.ZodObject<{
|
|
67
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
68
|
-
validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
validUntilLedger?: number | undefined;
|
|
71
|
-
validUntilUnixSeconds?: number | undefined;
|
|
72
|
-
}, {
|
|
73
|
-
validUntilLedger?: number | undefined;
|
|
74
|
-
validUntilUnixSeconds?: number | undefined;
|
|
75
|
-
}>>;
|
|
76
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
77
|
-
chain: z.ZodLiteral<"stellar">;
|
|
78
|
-
contract: z.ZodString;
|
|
79
|
-
method: z.ZodOptional<z.ZodString>;
|
|
80
|
-
spendingLimit: z.ZodOptional<z.ZodObject<{
|
|
81
|
-
token: z.ZodString;
|
|
82
|
-
limit: z.ZodString;
|
|
83
|
-
windowSeconds: z.ZodNumber;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
token: string;
|
|
86
|
-
limit: string;
|
|
87
|
-
windowSeconds: number;
|
|
88
|
-
}, {
|
|
89
|
-
token: string;
|
|
90
|
-
limit: string;
|
|
91
|
-
windowSeconds: number;
|
|
92
|
-
}>>;
|
|
93
|
-
approvalThreshold: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
95
|
-
expiry: z.ZodOptional<z.ZodObject<{
|
|
96
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
|
|
98
|
-
}, "strip", z.ZodTypeAny, {
|
|
99
|
-
validUntilLedger?: number | undefined;
|
|
100
|
-
validUntilUnixSeconds?: number | undefined;
|
|
101
|
-
}, {
|
|
102
|
-
validUntilLedger?: number | undefined;
|
|
103
|
-
validUntilUnixSeconds?: number | undefined;
|
|
104
|
-
}>>;
|
|
105
|
-
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
106
|
-
chain: z.ZodLiteral<"stellar">;
|
|
107
|
-
contract: z.ZodString;
|
|
108
|
-
method: z.ZodOptional<z.ZodString>;
|
|
109
|
-
spendingLimit: z.ZodOptional<z.ZodObject<{
|
|
110
|
-
token: z.ZodString;
|
|
111
|
-
limit: z.ZodString;
|
|
112
|
-
windowSeconds: z.ZodNumber;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
token: string;
|
|
115
|
-
limit: string;
|
|
116
|
-
windowSeconds: number;
|
|
117
|
-
}, {
|
|
118
|
-
token: string;
|
|
119
|
-
limit: string;
|
|
120
|
-
windowSeconds: number;
|
|
121
|
-
}>>;
|
|
122
|
-
approvalThreshold: z.ZodOptional<z.ZodNumber>;
|
|
123
|
-
recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
124
|
-
expiry: z.ZodOptional<z.ZodObject<{
|
|
125
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
126
|
-
validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
|
|
127
|
-
}, "strip", z.ZodTypeAny, {
|
|
128
|
-
validUntilLedger?: number | undefined;
|
|
129
|
-
validUntilUnixSeconds?: number | undefined;
|
|
130
|
-
}, {
|
|
131
|
-
validUntilLedger?: number | undefined;
|
|
132
|
-
validUntilUnixSeconds?: number | undefined;
|
|
133
|
-
}>>;
|
|
134
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
135
|
-
chain: z.ZodLiteral<"stellar">;
|
|
136
|
-
contract: z.ZodString;
|
|
137
|
-
method: z.ZodOptional<z.ZodString>;
|
|
138
|
-
spendingLimit: z.ZodOptional<z.ZodObject<{
|
|
139
|
-
token: z.ZodString;
|
|
140
|
-
limit: z.ZodString;
|
|
141
|
-
windowSeconds: z.ZodNumber;
|
|
142
|
-
}, "strip", z.ZodTypeAny, {
|
|
143
|
-
token: string;
|
|
144
|
-
limit: string;
|
|
145
|
-
windowSeconds: number;
|
|
146
|
-
}, {
|
|
147
|
-
token: string;
|
|
148
|
-
limit: string;
|
|
149
|
-
windowSeconds: number;
|
|
150
|
-
}>>;
|
|
151
|
-
approvalThreshold: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
153
|
-
expiry: z.ZodOptional<z.ZodObject<{
|
|
154
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
155
|
-
validUntilUnixSeconds: z.ZodOptional<z.ZodNumber>;
|
|
156
|
-
}, "strip", z.ZodTypeAny, {
|
|
157
|
-
validUntilLedger?: number | undefined;
|
|
158
|
-
validUntilUnixSeconds?: number | undefined;
|
|
159
|
-
}, {
|
|
160
|
-
validUntilLedger?: number | undefined;
|
|
161
|
-
validUntilUnixSeconds?: number | undefined;
|
|
162
|
-
}>>;
|
|
163
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
17
|
+
readonly source: z.ZodOptional<z.ZodLiteral<"recording">>;
|
|
164
18
|
readonly recordedTx: z.ZodOptional<z.ZodObject<{
|
|
165
19
|
network: z.ZodEnum<["mainnet", "testnet"]>;
|
|
166
20
|
signers: z.ZodArray<z.ZodString, "many">;
|
|
@@ -171,15 +25,15 @@ export declare const SynthesizePolicyToolShape: {
|
|
|
171
25
|
to: z.ZodString;
|
|
172
26
|
amount: z.ZodString;
|
|
173
27
|
}, "strip", z.ZodTypeAny, {
|
|
174
|
-
amount: string;
|
|
175
|
-
token: string;
|
|
176
28
|
from: string;
|
|
177
29
|
to: string;
|
|
178
|
-
}, {
|
|
179
30
|
amount: string;
|
|
180
31
|
token: string;
|
|
32
|
+
}, {
|
|
181
33
|
from: string;
|
|
182
34
|
to: string;
|
|
35
|
+
amount: string;
|
|
36
|
+
token: string;
|
|
183
37
|
}>, "many">;
|
|
184
38
|
events: z.ZodArray<z.ZodObject<{
|
|
185
39
|
contract: z.ZodString;
|
|
@@ -257,15 +111,15 @@ export declare const SynthesizePolicyToolShape: {
|
|
|
257
111
|
to: z.ZodString;
|
|
258
112
|
amount: z.ZodString;
|
|
259
113
|
}, "strip", z.ZodTypeAny, {
|
|
260
|
-
amount: string;
|
|
261
|
-
token: string;
|
|
262
114
|
from: string;
|
|
263
115
|
to: string;
|
|
264
|
-
}, {
|
|
265
116
|
amount: string;
|
|
266
117
|
token: string;
|
|
118
|
+
}, {
|
|
267
119
|
from: string;
|
|
268
120
|
to: string;
|
|
121
|
+
amount: string;
|
|
122
|
+
token: string;
|
|
269
123
|
}>, "many">;
|
|
270
124
|
events: z.ZodArray<z.ZodObject<{
|
|
271
125
|
contract: z.ZodString;
|
|
@@ -343,15 +197,15 @@ export declare const SynthesizePolicyToolShape: {
|
|
|
343
197
|
to: z.ZodString;
|
|
344
198
|
amount: z.ZodString;
|
|
345
199
|
}, "strip", z.ZodTypeAny, {
|
|
346
|
-
amount: string;
|
|
347
|
-
token: string;
|
|
348
200
|
from: string;
|
|
349
201
|
to: string;
|
|
350
|
-
}, {
|
|
351
202
|
amount: string;
|
|
352
203
|
token: string;
|
|
204
|
+
}, {
|
|
353
205
|
from: string;
|
|
354
206
|
to: string;
|
|
207
|
+
amount: string;
|
|
208
|
+
token: string;
|
|
355
209
|
}>, "many">;
|
|
356
210
|
events: z.ZodArray<z.ZodObject<{
|
|
357
211
|
contract: z.ZodString;
|
|
@@ -422,72 +276,18 @@ export declare const SynthesizePolicyToolShape: {
|
|
|
422
276
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
423
277
|
readonly network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
424
278
|
readonly userResponses: z.ZodOptional<z.ZodObject<{
|
|
425
|
-
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
426
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
427
|
-
limitAmount: z.ZodOptional<z.ZodString>;
|
|
428
|
-
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
429
|
-
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
430
|
-
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
431
|
-
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
432
|
-
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
433
|
-
value: z.ZodString;
|
|
434
|
-
decimals: z.ZodNumber;
|
|
435
|
-
}, "strip", z.ZodTypeAny, {
|
|
436
|
-
value: string;
|
|
437
|
-
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
438
|
-
asset: string;
|
|
439
|
-
decimals: number;
|
|
440
|
-
}, {
|
|
441
|
-
value: string;
|
|
442
|
-
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
443
|
-
asset: string;
|
|
444
|
-
decimals: number;
|
|
445
|
-
}>, "many">>;
|
|
446
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
447
|
-
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
448
|
-
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
449
|
-
limitAmount: z.ZodOptional<z.ZodString>;
|
|
450
|
-
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
451
|
-
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
452
|
-
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
453
|
-
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
454
|
-
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
455
|
-
value: z.ZodString;
|
|
456
|
-
decimals: z.ZodNumber;
|
|
457
|
-
}, "strip", z.ZodTypeAny, {
|
|
458
|
-
value: string;
|
|
459
|
-
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
460
|
-
asset: string;
|
|
461
|
-
decimals: number;
|
|
462
|
-
}, {
|
|
463
|
-
value: string;
|
|
464
|
-
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
465
|
-
asset: string;
|
|
466
|
-
decimals: number;
|
|
467
|
-
}>, "many">>;
|
|
468
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
469
|
-
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
470
279
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
471
280
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
472
|
-
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
473
281
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
decimals: number;
|
|
484
|
-
}, {
|
|
485
|
-
value: string;
|
|
486
|
-
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
487
|
-
asset: string;
|
|
488
|
-
decimals: number;
|
|
489
|
-
}>, "many">>;
|
|
490
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
282
|
+
}, "strict", z.ZodTypeAny, {
|
|
283
|
+
limitAmount?: string | undefined;
|
|
284
|
+
validUntilLedger?: number | undefined;
|
|
285
|
+
swapRecipientAllowlist?: string[] | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
limitAmount?: string | undefined;
|
|
288
|
+
validUntilLedger?: number | undefined;
|
|
289
|
+
swapRecipientAllowlist?: string[] | undefined;
|
|
290
|
+
}>>;
|
|
491
291
|
readonly confidenceOverride: z.ZodOptional<z.ZodObject<{
|
|
492
292
|
threshold: z.ZodNumber;
|
|
493
293
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -498,73 +298,17 @@ export declare const SynthesizePolicyToolShape: {
|
|
|
498
298
|
readonly interpreter: z.ZodOptional<z.ZodObject<{
|
|
499
299
|
smartAccountAddress: z.ZodString;
|
|
500
300
|
installNonce: z.ZodOptional<z.ZodNumber>;
|
|
501
|
-
oracleParams: z.ZodOptional<z.ZodObject<{
|
|
502
|
-
maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
|
|
503
|
-
maxDeviationBps: z.ZodOptional<z.ZodNumber>;
|
|
504
|
-
}, "strip", z.ZodTypeAny, {
|
|
505
|
-
maxStalenessSeconds?: number | undefined;
|
|
506
|
-
maxDeviationBps?: number | undefined;
|
|
507
|
-
}, {
|
|
508
|
-
maxStalenessSeconds?: number | undefined;
|
|
509
|
-
maxDeviationBps?: number | undefined;
|
|
510
|
-
}>>;
|
|
511
301
|
}, "strip", z.ZodTypeAny, {
|
|
512
302
|
smartAccountAddress: string;
|
|
513
|
-
oracleParams?: {
|
|
514
|
-
maxStalenessSeconds?: number | undefined;
|
|
515
|
-
maxDeviationBps?: number | undefined;
|
|
516
|
-
} | undefined;
|
|
517
303
|
installNonce?: number | undefined;
|
|
518
304
|
}, {
|
|
519
305
|
smartAccountAddress: string;
|
|
520
|
-
oracleParams?: {
|
|
521
|
-
maxStalenessSeconds?: number | undefined;
|
|
522
|
-
maxDeviationBps?: number | undefined;
|
|
523
|
-
} | undefined;
|
|
524
306
|
installNonce?: number | undefined;
|
|
525
307
|
}>>;
|
|
526
|
-
readonly ozConfig: z.ZodOptional<z.ZodObject<{
|
|
527
|
-
network: z.ZodEnum<["mainnet", "testnet"]>;
|
|
528
|
-
instances: z.ZodObject<{
|
|
529
|
-
spending_limit: z.ZodString;
|
|
530
|
-
simple_threshold: z.ZodString;
|
|
531
|
-
weighted_threshold: z.ZodString;
|
|
532
|
-
}, "strip", z.ZodTypeAny, {
|
|
533
|
-
spending_limit: string;
|
|
534
|
-
simple_threshold: string;
|
|
535
|
-
weighted_threshold: string;
|
|
536
|
-
}, {
|
|
537
|
-
spending_limit: string;
|
|
538
|
-
simple_threshold: string;
|
|
539
|
-
weighted_threshold: string;
|
|
540
|
-
}>;
|
|
541
|
-
}, "strip", z.ZodTypeAny, {
|
|
542
|
-
network: "mainnet" | "testnet";
|
|
543
|
-
instances: {
|
|
544
|
-
spending_limit: string;
|
|
545
|
-
simple_threshold: string;
|
|
546
|
-
weighted_threshold: string;
|
|
547
|
-
};
|
|
548
|
-
}, {
|
|
549
|
-
network: "mainnet" | "testnet";
|
|
550
|
-
instances: {
|
|
551
|
-
spending_limit: string;
|
|
552
|
-
simple_threshold: string;
|
|
553
|
-
weighted_threshold: string;
|
|
554
|
-
};
|
|
555
|
-
}>>;
|
|
556
308
|
readonly explain: z.ZodOptional<z.ZodBoolean>;
|
|
557
309
|
};
|
|
558
|
-
/** Flat ZodRawShape for `simulate_policy`. The `predicate` is typed as
|
|
559
|
-
* `z.unknown()` at the tool boundary because the recursive
|
|
560
|
-
* `PredicateNodeSchema` is a `z.lazy()` union (the SDK does not accept
|
|
561
|
-
* unions at the tool-registration boundary); the body re-validates
|
|
562
|
-
* against `SimulatePolicyInputSchema`, which fails closed on a
|
|
563
|
-
* malformed predicate. `predicate` is nullable here (vs required for
|
|
564
|
-
* verify_policy) so the SDK-emitted JSON Schema mirrors the engine's
|
|
565
|
-
* "OZ-only / no interpreter predicate" contract. */
|
|
566
310
|
export declare const SimulatePolicyToolShape: {
|
|
567
|
-
readonly predicate: z.
|
|
311
|
+
readonly predicate: z.ZodType<unknown, z.ZodTypeDef, unknown>;
|
|
568
312
|
readonly permitTx: z.ZodObject<{
|
|
569
313
|
network: z.ZodEnum<["mainnet", "testnet"]>;
|
|
570
314
|
signers: z.ZodArray<z.ZodString, "many">;
|
|
@@ -575,15 +319,15 @@ export declare const SimulatePolicyToolShape: {
|
|
|
575
319
|
to: z.ZodString;
|
|
576
320
|
amount: z.ZodString;
|
|
577
321
|
}, "strip", z.ZodTypeAny, {
|
|
578
|
-
amount: string;
|
|
579
|
-
token: string;
|
|
580
322
|
from: string;
|
|
581
323
|
to: string;
|
|
582
|
-
}, {
|
|
583
324
|
amount: string;
|
|
584
325
|
token: string;
|
|
326
|
+
}, {
|
|
585
327
|
from: string;
|
|
586
328
|
to: string;
|
|
329
|
+
amount: string;
|
|
330
|
+
token: string;
|
|
587
331
|
}>, "many">;
|
|
588
332
|
events: z.ZodArray<z.ZodObject<{
|
|
589
333
|
contract: z.ZodString;
|
|
@@ -661,15 +405,15 @@ export declare const SimulatePolicyToolShape: {
|
|
|
661
405
|
to: z.ZodString;
|
|
662
406
|
amount: z.ZodString;
|
|
663
407
|
}, "strip", z.ZodTypeAny, {
|
|
664
|
-
amount: string;
|
|
665
|
-
token: string;
|
|
666
408
|
from: string;
|
|
667
409
|
to: string;
|
|
668
|
-
}, {
|
|
669
410
|
amount: string;
|
|
670
411
|
token: string;
|
|
412
|
+
}, {
|
|
671
413
|
from: string;
|
|
672
414
|
to: string;
|
|
415
|
+
amount: string;
|
|
416
|
+
token: string;
|
|
673
417
|
}>, "many">;
|
|
674
418
|
events: z.ZodArray<z.ZodObject<{
|
|
675
419
|
contract: z.ZodString;
|
|
@@ -747,15 +491,15 @@ export declare const SimulatePolicyToolShape: {
|
|
|
747
491
|
to: z.ZodString;
|
|
748
492
|
amount: z.ZodString;
|
|
749
493
|
}, "strip", z.ZodTypeAny, {
|
|
750
|
-
amount: string;
|
|
751
|
-
token: string;
|
|
752
494
|
from: string;
|
|
753
495
|
to: string;
|
|
754
|
-
}, {
|
|
755
496
|
amount: string;
|
|
756
497
|
token: string;
|
|
498
|
+
}, {
|
|
757
499
|
from: string;
|
|
758
500
|
to: string;
|
|
501
|
+
amount: string;
|
|
502
|
+
token: string;
|
|
759
503
|
}>, "many">;
|
|
760
504
|
events: z.ZodArray<z.ZodObject<{
|
|
761
505
|
contract: z.ZodString;
|
|
@@ -825,29 +569,9 @@ export declare const SimulatePolicyToolShape: {
|
|
|
825
569
|
sourceAccount: z.ZodString;
|
|
826
570
|
}, z.ZodTypeAny, "passthrough">>;
|
|
827
571
|
readonly validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
828
|
-
readonly oraclePricesByAsset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
829
|
-
price: z.ZodString;
|
|
830
|
-
timestampSeconds: z.ZodNumber;
|
|
831
|
-
}, "strip", z.ZodTypeAny, {
|
|
832
|
-
price: string;
|
|
833
|
-
timestampSeconds: number;
|
|
834
|
-
}, {
|
|
835
|
-
price: string;
|
|
836
|
-
timestampSeconds: number;
|
|
837
|
-
}>, z.ZodObject<{
|
|
838
|
-
error: z.ZodEnum<["stale", "missing", "deviation", "paused", "decimals", "fingerprint"]>;
|
|
839
|
-
}, "strip", z.ZodTypeAny, {
|
|
840
|
-
error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
|
|
841
|
-
}, {
|
|
842
|
-
error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
|
|
843
|
-
}>]>>>;
|
|
844
572
|
};
|
|
845
|
-
/** Flat ZodRawShape for `verify_policy`. Same `z.unknown()` boundary
|
|
846
|
-
* trick for `predicate` as `SimulatePolicyToolShape`; `predicate` is
|
|
847
|
-
* required at the strict-schema level (`VerifyPolicyInputSchema`) so
|
|
848
|
-
* the body fails closed on a missing predicate. */
|
|
849
573
|
export declare const VerifyPolicyToolShape: {
|
|
850
|
-
readonly predicate: z.
|
|
574
|
+
readonly predicate: z.ZodType<unknown, z.ZodTypeDef, unknown>;
|
|
851
575
|
readonly permitTx: z.ZodObject<{
|
|
852
576
|
network: z.ZodEnum<["mainnet", "testnet"]>;
|
|
853
577
|
signers: z.ZodArray<z.ZodString, "many">;
|
|
@@ -858,15 +582,15 @@ export declare const VerifyPolicyToolShape: {
|
|
|
858
582
|
to: z.ZodString;
|
|
859
583
|
amount: z.ZodString;
|
|
860
584
|
}, "strip", z.ZodTypeAny, {
|
|
861
|
-
amount: string;
|
|
862
|
-
token: string;
|
|
863
585
|
from: string;
|
|
864
586
|
to: string;
|
|
865
|
-
}, {
|
|
866
587
|
amount: string;
|
|
867
588
|
token: string;
|
|
589
|
+
}, {
|
|
868
590
|
from: string;
|
|
869
591
|
to: string;
|
|
592
|
+
amount: string;
|
|
593
|
+
token: string;
|
|
870
594
|
}>, "many">;
|
|
871
595
|
events: z.ZodArray<z.ZodObject<{
|
|
872
596
|
contract: z.ZodString;
|
|
@@ -944,15 +668,15 @@ export declare const VerifyPolicyToolShape: {
|
|
|
944
668
|
to: z.ZodString;
|
|
945
669
|
amount: z.ZodString;
|
|
946
670
|
}, "strip", z.ZodTypeAny, {
|
|
947
|
-
amount: string;
|
|
948
|
-
token: string;
|
|
949
671
|
from: string;
|
|
950
672
|
to: string;
|
|
951
|
-
}, {
|
|
952
673
|
amount: string;
|
|
953
674
|
token: string;
|
|
675
|
+
}, {
|
|
954
676
|
from: string;
|
|
955
677
|
to: string;
|
|
678
|
+
amount: string;
|
|
679
|
+
token: string;
|
|
956
680
|
}>, "many">;
|
|
957
681
|
events: z.ZodArray<z.ZodObject<{
|
|
958
682
|
contract: z.ZodString;
|
|
@@ -1030,15 +754,15 @@ export declare const VerifyPolicyToolShape: {
|
|
|
1030
754
|
to: z.ZodString;
|
|
1031
755
|
amount: z.ZodString;
|
|
1032
756
|
}, "strip", z.ZodTypeAny, {
|
|
1033
|
-
amount: string;
|
|
1034
|
-
token: string;
|
|
1035
757
|
from: string;
|
|
1036
758
|
to: string;
|
|
1037
|
-
}, {
|
|
1038
759
|
amount: string;
|
|
1039
760
|
token: string;
|
|
761
|
+
}, {
|
|
1040
762
|
from: string;
|
|
1041
763
|
to: string;
|
|
764
|
+
amount: string;
|
|
765
|
+
token: string;
|
|
1042
766
|
}>, "many">;
|
|
1043
767
|
events: z.ZodArray<z.ZodObject<{
|
|
1044
768
|
contract: z.ZodString;
|
|
@@ -1108,22 +832,6 @@ export declare const VerifyPolicyToolShape: {
|
|
|
1108
832
|
sourceAccount: z.ZodString;
|
|
1109
833
|
}, z.ZodTypeAny, "passthrough">>;
|
|
1110
834
|
readonly validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
1111
|
-
readonly oraclePricesByAsset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
1112
|
-
price: z.ZodString;
|
|
1113
|
-
timestampSeconds: z.ZodNumber;
|
|
1114
|
-
}, "strip", z.ZodTypeAny, {
|
|
1115
|
-
price: string;
|
|
1116
|
-
timestampSeconds: number;
|
|
1117
|
-
}, {
|
|
1118
|
-
price: string;
|
|
1119
|
-
timestampSeconds: number;
|
|
1120
|
-
}>, z.ZodObject<{
|
|
1121
|
-
error: z.ZodEnum<["stale", "missing", "deviation", "paused", "decimals", "fingerprint"]>;
|
|
1122
|
-
}, "strip", z.ZodTypeAny, {
|
|
1123
|
-
error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
|
|
1124
|
-
}, {
|
|
1125
|
-
error: "stale" | "missing" | "deviation" | "paused" | "decimals" | "fingerprint";
|
|
1126
|
-
}>]>>>;
|
|
1127
835
|
};
|
|
1128
836
|
export type { GetInterpreterInfoInput, InstallPolicyInput, RevokePolicyInput, SimulatePolicyInput, VerifyPolicyInput, } from '@crediolabs/policy-synth/run';
|
|
1129
837
|
/** Flat ZodRawShape for `install_policy`. `rule` is typed as `z.unknown()`
|
|
@@ -1139,6 +847,7 @@ export declare const InstallPolicyToolShape: {
|
|
|
1139
847
|
readonly interpreterAddress: z.ZodOptional<z.ZodString>;
|
|
1140
848
|
readonly smartAccount: z.ZodOptional<z.ZodString>;
|
|
1141
849
|
readonly sourceAccount: z.ZodOptional<z.ZodString>;
|
|
850
|
+
readonly network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
1142
851
|
readonly rpcUrl: z.ZodOptional<z.ZodString>;
|
|
1143
852
|
readonly baseFee: z.ZodOptional<z.ZodNumber>;
|
|
1144
853
|
};
|
|
@@ -1148,17 +857,7 @@ export declare const RevokePolicyToolShape: {
|
|
|
1148
857
|
readonly interpreterAddress: z.ZodOptional<z.ZodString>;
|
|
1149
858
|
readonly smartAccount: z.ZodOptional<z.ZodString>;
|
|
1150
859
|
readonly sourceAccount: z.ZodOptional<z.ZodString>;
|
|
1151
|
-
readonly
|
|
1152
|
-
readonly baseFee: z.ZodOptional<z.ZodNumber>;
|
|
1153
|
-
};
|
|
1154
|
-
/** Flat ZodRawShape for `merge_policy`: the tightening remedy when two rules
|
|
1155
|
-
* our interpreter polices can serve the same calls. Two steps, in order. */
|
|
1156
|
-
export declare const MergePolicyToolShape: {
|
|
1157
|
-
readonly ruleId: z.ZodNumber;
|
|
1158
|
-
readonly incomingPredicateBlobBase64: z.ZodString;
|
|
1159
|
-
readonly step: z.ZodEnum<["detach", "reinstall"]>;
|
|
1160
|
-
readonly smartAccount: z.ZodOptional<z.ZodString>;
|
|
1161
|
-
readonly sourceAccount: z.ZodOptional<z.ZodString>;
|
|
860
|
+
readonly network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
1162
861
|
readonly rpcUrl: z.ZodOptional<z.ZodString>;
|
|
1163
862
|
readonly baseFee: z.ZodOptional<z.ZodNumber>;
|
|
1164
863
|
};
|