@vorionsys/contracts 0.1.0
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/dist/aci/aci-string.d.ts +539 -0
- package/dist/aci/aci-string.d.ts.map +1 -0
- package/dist/aci/aci-string.js +563 -0
- package/dist/aci/aci-string.js.map +1 -0
- package/dist/aci/attestation.d.ts +648 -0
- package/dist/aci/attestation.d.ts.map +1 -0
- package/dist/aci/attestation.js +289 -0
- package/dist/aci/attestation.js.map +1 -0
- package/dist/aci/domains.d.ts +260 -0
- package/dist/aci/domains.d.ts.map +1 -0
- package/dist/aci/domains.js +322 -0
- package/dist/aci/domains.js.map +1 -0
- package/dist/aci/effective-permission.d.ts +371 -0
- package/dist/aci/effective-permission.d.ts.map +1 -0
- package/dist/aci/effective-permission.js +351 -0
- package/dist/aci/effective-permission.js.map +1 -0
- package/dist/aci/identity.d.ts +1100 -0
- package/dist/aci/identity.d.ts.map +1 -0
- package/dist/aci/identity.js +328 -0
- package/dist/aci/identity.js.map +1 -0
- package/dist/aci/index.d.ts +67 -0
- package/dist/aci/index.d.ts.map +1 -0
- package/dist/aci/index.js +157 -0
- package/dist/aci/index.js.map +1 -0
- package/dist/aci/jwt-claims.d.ts +756 -0
- package/dist/aci/jwt-claims.d.ts.map +1 -0
- package/dist/aci/jwt-claims.js +335 -0
- package/dist/aci/jwt-claims.js.map +1 -0
- package/dist/aci/levels.d.ts +279 -0
- package/dist/aci/levels.d.ts.map +1 -0
- package/dist/aci/levels.js +467 -0
- package/dist/aci/levels.js.map +1 -0
- package/dist/aci/mapping.d.ts +291 -0
- package/dist/aci/mapping.d.ts.map +1 -0
- package/dist/aci/mapping.js +427 -0
- package/dist/aci/mapping.js.map +1 -0
- package/dist/aci/skills.d.ts +314 -0
- package/dist/aci/skills.d.ts.map +1 -0
- package/dist/aci/skills.js +404 -0
- package/dist/aci/skills.js.map +1 -0
- package/dist/aci/tiers.d.ts +403 -0
- package/dist/aci/tiers.d.ts.map +1 -0
- package/dist/aci/tiers.js +659 -0
- package/dist/aci/tiers.js.map +1 -0
- package/dist/canonical/agent.d.ts +796 -0
- package/dist/canonical/agent.d.ts.map +1 -0
- package/dist/canonical/agent.js +527 -0
- package/dist/canonical/agent.js.map +1 -0
- package/dist/canonical/governance.d.ts +905 -0
- package/dist/canonical/governance.d.ts.map +1 -0
- package/dist/canonical/governance.js +454 -0
- package/dist/canonical/governance.js.map +1 -0
- package/dist/canonical/index.d.ts +17 -0
- package/dist/canonical/index.d.ts.map +1 -0
- package/dist/canonical/index.js +21 -0
- package/dist/canonical/index.js.map +1 -0
- package/dist/canonical/intent.d.ts +727 -0
- package/dist/canonical/intent.d.ts.map +1 -0
- package/dist/canonical/intent.js +203 -0
- package/dist/canonical/intent.js.map +1 -0
- package/dist/canonical/risk-level.d.ts +344 -0
- package/dist/canonical/risk-level.d.ts.map +1 -0
- package/dist/canonical/risk-level.js +472 -0
- package/dist/canonical/risk-level.js.map +1 -0
- package/dist/canonical/trust-band.d.ts +239 -0
- package/dist/canonical/trust-band.d.ts.map +1 -0
- package/dist/canonical/trust-band.js +298 -0
- package/dist/canonical/trust-band.js.map +1 -0
- package/dist/canonical/trust-score.d.ts +301 -0
- package/dist/canonical/trust-score.d.ts.map +1 -0
- package/dist/canonical/trust-score.js +390 -0
- package/dist/canonical/trust-score.js.map +1 -0
- package/dist/canonical/trust-signal.d.ts +617 -0
- package/dist/canonical/trust-signal.d.ts.map +1 -0
- package/dist/canonical/trust-signal.js +355 -0
- package/dist/canonical/trust-signal.js.map +1 -0
- package/dist/canonical/validation.d.ts +231 -0
- package/dist/canonical/validation.d.ts.map +1 -0
- package/dist/canonical/validation.js +558 -0
- package/dist/canonical/validation.js.map +1 -0
- package/dist/common/index.d.ts +7 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +7 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/primitives.d.ts +56 -0
- package/dist/common/primitives.d.ts.map +1 -0
- package/dist/common/primitives.js +70 -0
- package/dist/common/primitives.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/v2/canary-probe.d.ts +201 -0
- package/dist/v2/canary-probe.d.ts.map +1 -0
- package/dist/v2/canary-probe.js +99 -0
- package/dist/v2/canary-probe.js.map +1 -0
- package/dist/v2/component.d.ts +132 -0
- package/dist/v2/component.d.ts.map +1 -0
- package/dist/v2/component.js +5 -0
- package/dist/v2/component.js.map +1 -0
- package/dist/v2/decision.d.ts +310 -0
- package/dist/v2/decision.d.ts.map +1 -0
- package/dist/v2/decision.js +21 -0
- package/dist/v2/decision.js.map +1 -0
- package/dist/v2/enums.d.ts +185 -0
- package/dist/v2/enums.d.ts.map +1 -0
- package/dist/v2/enums.js +203 -0
- package/dist/v2/enums.js.map +1 -0
- package/dist/v2/evidence.d.ts +368 -0
- package/dist/v2/evidence.d.ts.map +1 -0
- package/dist/v2/evidence.js +152 -0
- package/dist/v2/evidence.js.map +1 -0
- package/dist/v2/execution.d.ts +190 -0
- package/dist/v2/execution.d.ts.map +1 -0
- package/dist/v2/execution.js +5 -0
- package/dist/v2/execution.js.map +1 -0
- package/dist/v2/index.d.ts +19 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.js +32 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/intent.d.ts +89 -0
- package/dist/v2/intent.d.ts.map +1 -0
- package/dist/v2/intent.js +5 -0
- package/dist/v2/intent.js.map +1 -0
- package/dist/v2/policy-bundle.d.ts +166 -0
- package/dist/v2/policy-bundle.d.ts.map +1 -0
- package/dist/v2/policy-bundle.js +20 -0
- package/dist/v2/policy-bundle.js.map +1 -0
- package/dist/v2/pre-action-gate.d.ts +185 -0
- package/dist/v2/pre-action-gate.d.ts.map +1 -0
- package/dist/v2/pre-action-gate.js +64 -0
- package/dist/v2/pre-action-gate.js.map +1 -0
- package/dist/v2/proof-event.d.ts +201 -0
- package/dist/v2/proof-event.d.ts.map +1 -0
- package/dist/v2/proof-event.js +5 -0
- package/dist/v2/proof-event.js.map +1 -0
- package/dist/v2/retention.d.ts +329 -0
- package/dist/v2/retention.d.ts.map +1 -0
- package/dist/v2/retention.js +162 -0
- package/dist/v2/retention.js.map +1 -0
- package/dist/v2/trust-delta.d.ts +119 -0
- package/dist/v2/trust-delta.d.ts.map +1 -0
- package/dist/v2/trust-delta.js +28 -0
- package/dist/v2/trust-delta.js.map +1 -0
- package/dist/v2/trust-profile.d.ts +337 -0
- package/dist/v2/trust-profile.d.ts.map +1 -0
- package/dist/v2/trust-profile.js +96 -0
- package/dist/v2/trust-profile.js.map +1 -0
- package/dist/validators/decision.d.ts +430 -0
- package/dist/validators/decision.d.ts.map +1 -0
- package/dist/validators/decision.js +61 -0
- package/dist/validators/decision.js.map +1 -0
- package/dist/validators/enums.d.ts +24 -0
- package/dist/validators/enums.d.ts.map +1 -0
- package/dist/validators/enums.js +24 -0
- package/dist/validators/enums.js.map +1 -0
- package/dist/validators/index.d.ts +30 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +42 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/intent.d.ts +229 -0
- package/dist/validators/intent.d.ts.map +1 -0
- package/dist/validators/intent.js +47 -0
- package/dist/validators/intent.js.map +1 -0
- package/dist/validators/proof-event.d.ts +981 -0
- package/dist/validators/proof-event.d.ts.map +1 -0
- package/dist/validators/proof-event.js +134 -0
- package/dist/validators/proof-event.js.map +1 -0
- package/dist/validators/trust-profile.d.ts +350 -0
- package/dist/validators/trust-profile.d.ts.map +1 -0
- package/dist/validators/trust-profile.js +65 -0
- package/dist/validators/trust-profile.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for decision types
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/** Rate limit validator */
|
|
6
|
+
export declare const rateLimitSchema: z.ZodObject<{
|
|
7
|
+
resource: z.ZodString;
|
|
8
|
+
limit: z.ZodNumber;
|
|
9
|
+
windowSeconds: z.ZodNumber;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
resource: string;
|
|
12
|
+
limit: number;
|
|
13
|
+
windowSeconds: number;
|
|
14
|
+
}, {
|
|
15
|
+
resource: string;
|
|
16
|
+
limit: number;
|
|
17
|
+
windowSeconds: number;
|
|
18
|
+
}>;
|
|
19
|
+
/** Approval requirement validator */
|
|
20
|
+
export declare const approvalRequirementSchema: z.ZodObject<{
|
|
21
|
+
type: z.ZodNativeEnum<typeof import("../index.js").ApprovalType>;
|
|
22
|
+
approver: z.ZodString;
|
|
23
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
reason: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
type: import("../index.js").ApprovalType;
|
|
27
|
+
reason: string;
|
|
28
|
+
approver: string;
|
|
29
|
+
timeoutMs?: number | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
type: import("../index.js").ApprovalType;
|
|
32
|
+
reason: string;
|
|
33
|
+
approver: string;
|
|
34
|
+
timeoutMs?: number | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
/** Decision constraints validator */
|
|
37
|
+
export declare const decisionConstraintsSchema: z.ZodObject<{
|
|
38
|
+
requiredApprovals: z.ZodArray<z.ZodObject<{
|
|
39
|
+
type: z.ZodNativeEnum<typeof import("../index.js").ApprovalType>;
|
|
40
|
+
approver: z.ZodString;
|
|
41
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
reason: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
type: import("../index.js").ApprovalType;
|
|
45
|
+
reason: string;
|
|
46
|
+
approver: string;
|
|
47
|
+
timeoutMs?: number | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
type: import("../index.js").ApprovalType;
|
|
50
|
+
reason: string;
|
|
51
|
+
approver: string;
|
|
52
|
+
timeoutMs?: number | undefined;
|
|
53
|
+
}>, "many">;
|
|
54
|
+
allowedTools: z.ZodArray<z.ZodString, "many">;
|
|
55
|
+
dataScopes: z.ZodArray<z.ZodString, "many">;
|
|
56
|
+
rateLimits: z.ZodArray<z.ZodObject<{
|
|
57
|
+
resource: z.ZodString;
|
|
58
|
+
limit: z.ZodNumber;
|
|
59
|
+
windowSeconds: z.ZodNumber;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
resource: string;
|
|
62
|
+
limit: number;
|
|
63
|
+
windowSeconds: number;
|
|
64
|
+
}, {
|
|
65
|
+
resource: string;
|
|
66
|
+
limit: number;
|
|
67
|
+
windowSeconds: number;
|
|
68
|
+
}>, "many">;
|
|
69
|
+
reversibilityRequired: z.ZodBoolean;
|
|
70
|
+
maxExecutionTimeMs: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
resourceQuotas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
requiredApprovals: {
|
|
75
|
+
type: import("../index.js").ApprovalType;
|
|
76
|
+
reason: string;
|
|
77
|
+
approver: string;
|
|
78
|
+
timeoutMs?: number | undefined;
|
|
79
|
+
}[];
|
|
80
|
+
allowedTools: string[];
|
|
81
|
+
dataScopes: string[];
|
|
82
|
+
rateLimits: {
|
|
83
|
+
resource: string;
|
|
84
|
+
limit: number;
|
|
85
|
+
windowSeconds: number;
|
|
86
|
+
}[];
|
|
87
|
+
reversibilityRequired: boolean;
|
|
88
|
+
maxExecutionTimeMs?: number | undefined;
|
|
89
|
+
maxRetries?: number | undefined;
|
|
90
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
requiredApprovals: {
|
|
93
|
+
type: import("../index.js").ApprovalType;
|
|
94
|
+
reason: string;
|
|
95
|
+
approver: string;
|
|
96
|
+
timeoutMs?: number | undefined;
|
|
97
|
+
}[];
|
|
98
|
+
allowedTools: string[];
|
|
99
|
+
dataScopes: string[];
|
|
100
|
+
rateLimits: {
|
|
101
|
+
resource: string;
|
|
102
|
+
limit: number;
|
|
103
|
+
windowSeconds: number;
|
|
104
|
+
}[];
|
|
105
|
+
reversibilityRequired: boolean;
|
|
106
|
+
maxExecutionTimeMs?: number | undefined;
|
|
107
|
+
maxRetries?: number | undefined;
|
|
108
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
/** Decision validator */
|
|
111
|
+
export declare const decisionSchema: z.ZodObject<{
|
|
112
|
+
decisionId: z.ZodString;
|
|
113
|
+
intentId: z.ZodString;
|
|
114
|
+
agentId: z.ZodString;
|
|
115
|
+
correlationId: z.ZodString;
|
|
116
|
+
permitted: z.ZodBoolean;
|
|
117
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
requiredApprovals: z.ZodArray<z.ZodObject<{
|
|
119
|
+
type: z.ZodNativeEnum<typeof import("../index.js").ApprovalType>;
|
|
120
|
+
approver: z.ZodString;
|
|
121
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
reason: z.ZodString;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
type: import("../index.js").ApprovalType;
|
|
125
|
+
reason: string;
|
|
126
|
+
approver: string;
|
|
127
|
+
timeoutMs?: number | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
type: import("../index.js").ApprovalType;
|
|
130
|
+
reason: string;
|
|
131
|
+
approver: string;
|
|
132
|
+
timeoutMs?: number | undefined;
|
|
133
|
+
}>, "many">;
|
|
134
|
+
allowedTools: z.ZodArray<z.ZodString, "many">;
|
|
135
|
+
dataScopes: z.ZodArray<z.ZodString, "many">;
|
|
136
|
+
rateLimits: z.ZodArray<z.ZodObject<{
|
|
137
|
+
resource: z.ZodString;
|
|
138
|
+
limit: z.ZodNumber;
|
|
139
|
+
windowSeconds: z.ZodNumber;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
resource: string;
|
|
142
|
+
limit: number;
|
|
143
|
+
windowSeconds: number;
|
|
144
|
+
}, {
|
|
145
|
+
resource: string;
|
|
146
|
+
limit: number;
|
|
147
|
+
windowSeconds: number;
|
|
148
|
+
}>, "many">;
|
|
149
|
+
reversibilityRequired: z.ZodBoolean;
|
|
150
|
+
maxExecutionTimeMs: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
resourceQuotas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
requiredApprovals: {
|
|
155
|
+
type: import("../index.js").ApprovalType;
|
|
156
|
+
reason: string;
|
|
157
|
+
approver: string;
|
|
158
|
+
timeoutMs?: number | undefined;
|
|
159
|
+
}[];
|
|
160
|
+
allowedTools: string[];
|
|
161
|
+
dataScopes: string[];
|
|
162
|
+
rateLimits: {
|
|
163
|
+
resource: string;
|
|
164
|
+
limit: number;
|
|
165
|
+
windowSeconds: number;
|
|
166
|
+
}[];
|
|
167
|
+
reversibilityRequired: boolean;
|
|
168
|
+
maxExecutionTimeMs?: number | undefined;
|
|
169
|
+
maxRetries?: number | undefined;
|
|
170
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
requiredApprovals: {
|
|
173
|
+
type: import("../index.js").ApprovalType;
|
|
174
|
+
reason: string;
|
|
175
|
+
approver: string;
|
|
176
|
+
timeoutMs?: number | undefined;
|
|
177
|
+
}[];
|
|
178
|
+
allowedTools: string[];
|
|
179
|
+
dataScopes: string[];
|
|
180
|
+
rateLimits: {
|
|
181
|
+
resource: string;
|
|
182
|
+
limit: number;
|
|
183
|
+
windowSeconds: number;
|
|
184
|
+
}[];
|
|
185
|
+
reversibilityRequired: boolean;
|
|
186
|
+
maxExecutionTimeMs?: number | undefined;
|
|
187
|
+
maxRetries?: number | undefined;
|
|
188
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
189
|
+
}>>;
|
|
190
|
+
trustBand: z.ZodNativeEnum<typeof import("../index.js").TrustBand>;
|
|
191
|
+
trustScore: z.ZodNumber;
|
|
192
|
+
policySetId: z.ZodOptional<z.ZodString>;
|
|
193
|
+
reasoning: z.ZodArray<z.ZodString, "many">;
|
|
194
|
+
decidedAt: z.ZodDate;
|
|
195
|
+
expiresAt: z.ZodDate;
|
|
196
|
+
latencyMs: z.ZodNumber;
|
|
197
|
+
version: z.ZodNumber;
|
|
198
|
+
}, "strip", z.ZodTypeAny, {
|
|
199
|
+
correlationId: string;
|
|
200
|
+
intentId: string;
|
|
201
|
+
decisionId: string;
|
|
202
|
+
expiresAt: Date;
|
|
203
|
+
version: number;
|
|
204
|
+
agentId: string;
|
|
205
|
+
trustScore: number;
|
|
206
|
+
trustBand: import("../index.js").TrustBand;
|
|
207
|
+
permitted: boolean;
|
|
208
|
+
reasoning: string[];
|
|
209
|
+
decidedAt: Date;
|
|
210
|
+
latencyMs: number;
|
|
211
|
+
constraints?: {
|
|
212
|
+
requiredApprovals: {
|
|
213
|
+
type: import("../index.js").ApprovalType;
|
|
214
|
+
reason: string;
|
|
215
|
+
approver: string;
|
|
216
|
+
timeoutMs?: number | undefined;
|
|
217
|
+
}[];
|
|
218
|
+
allowedTools: string[];
|
|
219
|
+
dataScopes: string[];
|
|
220
|
+
rateLimits: {
|
|
221
|
+
resource: string;
|
|
222
|
+
limit: number;
|
|
223
|
+
windowSeconds: number;
|
|
224
|
+
}[];
|
|
225
|
+
reversibilityRequired: boolean;
|
|
226
|
+
maxExecutionTimeMs?: number | undefined;
|
|
227
|
+
maxRetries?: number | undefined;
|
|
228
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
229
|
+
} | undefined;
|
|
230
|
+
policySetId?: string | undefined;
|
|
231
|
+
}, {
|
|
232
|
+
correlationId: string;
|
|
233
|
+
intentId: string;
|
|
234
|
+
decisionId: string;
|
|
235
|
+
expiresAt: Date;
|
|
236
|
+
version: number;
|
|
237
|
+
agentId: string;
|
|
238
|
+
trustScore: number;
|
|
239
|
+
trustBand: import("../index.js").TrustBand;
|
|
240
|
+
permitted: boolean;
|
|
241
|
+
reasoning: string[];
|
|
242
|
+
decidedAt: Date;
|
|
243
|
+
latencyMs: number;
|
|
244
|
+
constraints?: {
|
|
245
|
+
requiredApprovals: {
|
|
246
|
+
type: import("../index.js").ApprovalType;
|
|
247
|
+
reason: string;
|
|
248
|
+
approver: string;
|
|
249
|
+
timeoutMs?: number | undefined;
|
|
250
|
+
}[];
|
|
251
|
+
allowedTools: string[];
|
|
252
|
+
dataScopes: string[];
|
|
253
|
+
rateLimits: {
|
|
254
|
+
resource: string;
|
|
255
|
+
limit: number;
|
|
256
|
+
windowSeconds: number;
|
|
257
|
+
}[];
|
|
258
|
+
reversibilityRequired: boolean;
|
|
259
|
+
maxExecutionTimeMs?: number | undefined;
|
|
260
|
+
maxRetries?: number | undefined;
|
|
261
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
policySetId?: string | undefined;
|
|
264
|
+
}>;
|
|
265
|
+
/** Authorization request validator */
|
|
266
|
+
export declare const authorizationRequestSchema: z.ZodObject<{
|
|
267
|
+
intent: z.ZodObject<{
|
|
268
|
+
agentId: z.ZodString;
|
|
269
|
+
action: z.ZodString;
|
|
270
|
+
actionType: z.ZodString;
|
|
271
|
+
resourceScope: z.ZodArray<z.ZodString, "many">;
|
|
272
|
+
dataSensitivity: z.ZodString;
|
|
273
|
+
reversibility: z.ZodString;
|
|
274
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
agentId: string;
|
|
277
|
+
action: string;
|
|
278
|
+
actionType: string;
|
|
279
|
+
resourceScope: string[];
|
|
280
|
+
dataSensitivity: string;
|
|
281
|
+
reversibility: string;
|
|
282
|
+
context?: Record<string, unknown> | undefined;
|
|
283
|
+
}, {
|
|
284
|
+
agentId: string;
|
|
285
|
+
action: string;
|
|
286
|
+
actionType: string;
|
|
287
|
+
resourceScope: string[];
|
|
288
|
+
dataSensitivity: string;
|
|
289
|
+
reversibility: string;
|
|
290
|
+
context?: Record<string, unknown> | undefined;
|
|
291
|
+
}>;
|
|
292
|
+
policySetId: z.ZodOptional<z.ZodString>;
|
|
293
|
+
requestedConstraints: z.ZodOptional<z.ZodObject<{
|
|
294
|
+
requiredApprovals: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
295
|
+
type: z.ZodNativeEnum<typeof import("../index.js").ApprovalType>;
|
|
296
|
+
approver: z.ZodString;
|
|
297
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
reason: z.ZodString;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
type: import("../index.js").ApprovalType;
|
|
301
|
+
reason: string;
|
|
302
|
+
approver: string;
|
|
303
|
+
timeoutMs?: number | undefined;
|
|
304
|
+
}, {
|
|
305
|
+
type: import("../index.js").ApprovalType;
|
|
306
|
+
reason: string;
|
|
307
|
+
approver: string;
|
|
308
|
+
timeoutMs?: number | undefined;
|
|
309
|
+
}>, "many">>;
|
|
310
|
+
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
311
|
+
dataScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
312
|
+
rateLimits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
313
|
+
resource: z.ZodString;
|
|
314
|
+
limit: z.ZodNumber;
|
|
315
|
+
windowSeconds: z.ZodNumber;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
resource: string;
|
|
318
|
+
limit: number;
|
|
319
|
+
windowSeconds: number;
|
|
320
|
+
}, {
|
|
321
|
+
resource: string;
|
|
322
|
+
limit: number;
|
|
323
|
+
windowSeconds: number;
|
|
324
|
+
}>, "many">>;
|
|
325
|
+
reversibilityRequired: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
maxExecutionTimeMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
327
|
+
maxRetries: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
328
|
+
resourceQuotas: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
requiredApprovals?: {
|
|
331
|
+
type: import("../index.js").ApprovalType;
|
|
332
|
+
reason: string;
|
|
333
|
+
approver: string;
|
|
334
|
+
timeoutMs?: number | undefined;
|
|
335
|
+
}[] | undefined;
|
|
336
|
+
allowedTools?: string[] | undefined;
|
|
337
|
+
dataScopes?: string[] | undefined;
|
|
338
|
+
rateLimits?: {
|
|
339
|
+
resource: string;
|
|
340
|
+
limit: number;
|
|
341
|
+
windowSeconds: number;
|
|
342
|
+
}[] | undefined;
|
|
343
|
+
reversibilityRequired?: boolean | undefined;
|
|
344
|
+
maxExecutionTimeMs?: number | undefined;
|
|
345
|
+
maxRetries?: number | undefined;
|
|
346
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
347
|
+
}, {
|
|
348
|
+
requiredApprovals?: {
|
|
349
|
+
type: import("../index.js").ApprovalType;
|
|
350
|
+
reason: string;
|
|
351
|
+
approver: string;
|
|
352
|
+
timeoutMs?: number | undefined;
|
|
353
|
+
}[] | undefined;
|
|
354
|
+
allowedTools?: string[] | undefined;
|
|
355
|
+
dataScopes?: string[] | undefined;
|
|
356
|
+
rateLimits?: {
|
|
357
|
+
resource: string;
|
|
358
|
+
limit: number;
|
|
359
|
+
windowSeconds: number;
|
|
360
|
+
}[] | undefined;
|
|
361
|
+
reversibilityRequired?: boolean | undefined;
|
|
362
|
+
maxExecutionTimeMs?: number | undefined;
|
|
363
|
+
maxRetries?: number | undefined;
|
|
364
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
365
|
+
}>>;
|
|
366
|
+
}, "strip", z.ZodTypeAny, {
|
|
367
|
+
intent: {
|
|
368
|
+
agentId: string;
|
|
369
|
+
action: string;
|
|
370
|
+
actionType: string;
|
|
371
|
+
resourceScope: string[];
|
|
372
|
+
dataSensitivity: string;
|
|
373
|
+
reversibility: string;
|
|
374
|
+
context?: Record<string, unknown> | undefined;
|
|
375
|
+
};
|
|
376
|
+
policySetId?: string | undefined;
|
|
377
|
+
requestedConstraints?: {
|
|
378
|
+
requiredApprovals?: {
|
|
379
|
+
type: import("../index.js").ApprovalType;
|
|
380
|
+
reason: string;
|
|
381
|
+
approver: string;
|
|
382
|
+
timeoutMs?: number | undefined;
|
|
383
|
+
}[] | undefined;
|
|
384
|
+
allowedTools?: string[] | undefined;
|
|
385
|
+
dataScopes?: string[] | undefined;
|
|
386
|
+
rateLimits?: {
|
|
387
|
+
resource: string;
|
|
388
|
+
limit: number;
|
|
389
|
+
windowSeconds: number;
|
|
390
|
+
}[] | undefined;
|
|
391
|
+
reversibilityRequired?: boolean | undefined;
|
|
392
|
+
maxExecutionTimeMs?: number | undefined;
|
|
393
|
+
maxRetries?: number | undefined;
|
|
394
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
395
|
+
} | undefined;
|
|
396
|
+
}, {
|
|
397
|
+
intent: {
|
|
398
|
+
agentId: string;
|
|
399
|
+
action: string;
|
|
400
|
+
actionType: string;
|
|
401
|
+
resourceScope: string[];
|
|
402
|
+
dataSensitivity: string;
|
|
403
|
+
reversibility: string;
|
|
404
|
+
context?: Record<string, unknown> | undefined;
|
|
405
|
+
};
|
|
406
|
+
policySetId?: string | undefined;
|
|
407
|
+
requestedConstraints?: {
|
|
408
|
+
requiredApprovals?: {
|
|
409
|
+
type: import("../index.js").ApprovalType;
|
|
410
|
+
reason: string;
|
|
411
|
+
approver: string;
|
|
412
|
+
timeoutMs?: number | undefined;
|
|
413
|
+
}[] | undefined;
|
|
414
|
+
allowedTools?: string[] | undefined;
|
|
415
|
+
dataScopes?: string[] | undefined;
|
|
416
|
+
rateLimits?: {
|
|
417
|
+
resource: string;
|
|
418
|
+
limit: number;
|
|
419
|
+
windowSeconds: number;
|
|
420
|
+
}[] | undefined;
|
|
421
|
+
reversibilityRequired?: boolean | undefined;
|
|
422
|
+
maxExecutionTimeMs?: number | undefined;
|
|
423
|
+
maxRetries?: number | undefined;
|
|
424
|
+
resourceQuotas?: Record<string, number> | undefined;
|
|
425
|
+
} | undefined;
|
|
426
|
+
}>;
|
|
427
|
+
export type ValidatedDecision = z.infer<typeof decisionSchema>;
|
|
428
|
+
export type ValidatedDecisionConstraints = z.infer<typeof decisionConstraintsSchema>;
|
|
429
|
+
export type ValidatedAuthorizationRequest = z.infer<typeof authorizationRequestSchema>;
|
|
430
|
+
//# sourceMappingURL=decision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/validators/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,2BAA2B;AAC3B,eAAO,MAAM,eAAe;;;;;;;;;;;;EAIK,CAAC;AAElC,qCAAqC;AACrC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKK,CAAC;AAE5C,qCAAqC;AACrC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASK,CAAC;AAE5C,yBAAyB;AACzB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeK,CAAC;AAEjC,sCAAsC;AACtC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYrC,CAAC;AAGH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC/D,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACrF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for decision types
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { approvalTypeSchema, trustBandSchema } from './enums.js';
|
|
6
|
+
/** Rate limit validator */
|
|
7
|
+
export const rateLimitSchema = z.object({
|
|
8
|
+
resource: z.string().min(1),
|
|
9
|
+
limit: z.number().int().positive(),
|
|
10
|
+
windowSeconds: z.number().int().positive(),
|
|
11
|
+
});
|
|
12
|
+
/** Approval requirement validator */
|
|
13
|
+
export const approvalRequirementSchema = z.object({
|
|
14
|
+
type: approvalTypeSchema,
|
|
15
|
+
approver: z.string().min(1),
|
|
16
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
17
|
+
reason: z.string().min(1),
|
|
18
|
+
});
|
|
19
|
+
/** Decision constraints validator */
|
|
20
|
+
export const decisionConstraintsSchema = z.object({
|
|
21
|
+
requiredApprovals: z.array(approvalRequirementSchema),
|
|
22
|
+
allowedTools: z.array(z.string()),
|
|
23
|
+
dataScopes: z.array(z.string()),
|
|
24
|
+
rateLimits: z.array(rateLimitSchema),
|
|
25
|
+
reversibilityRequired: z.boolean(),
|
|
26
|
+
maxExecutionTimeMs: z.number().int().positive().optional(),
|
|
27
|
+
maxRetries: z.number().int().min(0).optional(),
|
|
28
|
+
resourceQuotas: z.record(z.number()).optional(),
|
|
29
|
+
});
|
|
30
|
+
/** Decision validator */
|
|
31
|
+
export const decisionSchema = z.object({
|
|
32
|
+
decisionId: z.string().uuid(),
|
|
33
|
+
intentId: z.string().uuid(),
|
|
34
|
+
agentId: z.string().uuid(),
|
|
35
|
+
correlationId: z.string().uuid(),
|
|
36
|
+
permitted: z.boolean(),
|
|
37
|
+
constraints: decisionConstraintsSchema.optional(),
|
|
38
|
+
trustBand: trustBandSchema,
|
|
39
|
+
trustScore: z.number().min(0).max(100),
|
|
40
|
+
policySetId: z.string().uuid().optional(),
|
|
41
|
+
reasoning: z.array(z.string()),
|
|
42
|
+
decidedAt: z.coerce.date(),
|
|
43
|
+
expiresAt: z.coerce.date(),
|
|
44
|
+
latencyMs: z.number().min(0),
|
|
45
|
+
version: z.number().int().min(0),
|
|
46
|
+
});
|
|
47
|
+
/** Authorization request validator */
|
|
48
|
+
export const authorizationRequestSchema = z.object({
|
|
49
|
+
intent: z.object({
|
|
50
|
+
agentId: z.string().uuid(),
|
|
51
|
+
action: z.string().min(1),
|
|
52
|
+
actionType: z.string(),
|
|
53
|
+
resourceScope: z.array(z.string()),
|
|
54
|
+
dataSensitivity: z.string(),
|
|
55
|
+
reversibility: z.string(),
|
|
56
|
+
context: z.record(z.unknown()).optional(),
|
|
57
|
+
}),
|
|
58
|
+
policySetId: z.string().uuid().optional(),
|
|
59
|
+
requestedConstraints: decisionConstraintsSchema.partial().optional(),
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=decision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../src/validators/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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C;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAClC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;QAC3B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC1C,CAAC;IACF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACzC,oBAAoB,EAAE,yBAAyB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrE,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for Vorion enums
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { TrustBand, ObservationTier, DataSensitivity, Reversibility, ActionType, ProofEventType, ComponentType, ComponentStatus, ApprovalType } from '../v2/enums.js';
|
|
6
|
+
/** Trust band validator */
|
|
7
|
+
export declare const trustBandSchema: z.ZodNativeEnum<typeof TrustBand>;
|
|
8
|
+
/** Observation tier validator */
|
|
9
|
+
export declare const observationTierSchema: z.ZodNativeEnum<typeof ObservationTier>;
|
|
10
|
+
/** Data sensitivity validator */
|
|
11
|
+
export declare const dataSensitivitySchema: z.ZodNativeEnum<typeof DataSensitivity>;
|
|
12
|
+
/** Reversibility validator */
|
|
13
|
+
export declare const reversibilitySchema: z.ZodNativeEnum<typeof Reversibility>;
|
|
14
|
+
/** Action type validator */
|
|
15
|
+
export declare const actionTypeSchema: z.ZodNativeEnum<typeof ActionType>;
|
|
16
|
+
/** Proof event type validator */
|
|
17
|
+
export declare const proofEventTypeSchema: z.ZodNativeEnum<typeof ProofEventType>;
|
|
18
|
+
/** Component type validator */
|
|
19
|
+
export declare const componentTypeSchema: z.ZodNativeEnum<typeof ComponentType>;
|
|
20
|
+
/** Component status validator */
|
|
21
|
+
export declare const componentStatusSchema: z.ZodNativeEnum<typeof ComponentStatus>;
|
|
22
|
+
/** Approval type validator */
|
|
23
|
+
export declare const approvalTypeSchema: z.ZodNativeEnum<typeof ApprovalType>;
|
|
24
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/validators/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,SAAS,EACT,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,2BAA2B;AAC3B,eAAO,MAAM,eAAe,mCAA0B,CAAC;AAEvD,iCAAiC;AACjC,eAAO,MAAM,qBAAqB,yCAAgC,CAAC;AAEnE,iCAAiC;AACjC,eAAO,MAAM,qBAAqB,yCAAgC,CAAC;AAEnE,8BAA8B;AAC9B,eAAO,MAAM,mBAAmB,uCAA8B,CAAC;AAE/D,4BAA4B;AAC5B,eAAO,MAAM,gBAAgB,oCAA2B,CAAC;AAEzD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,wCAA+B,CAAC;AAEjE,+BAA+B;AAC/B,eAAO,MAAM,mBAAmB,uCAA8B,CAAC;AAE/D,iCAAiC;AACjC,eAAO,MAAM,qBAAqB,yCAAgC,CAAC;AAEnE,8BAA8B;AAC9B,eAAO,MAAM,kBAAkB,sCAA6B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for Vorion enums
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { TrustBand, ObservationTier, DataSensitivity, Reversibility, ActionType, ProofEventType, ComponentType, ComponentStatus, ApprovalType, } from '../v2/enums.js';
|
|
6
|
+
/** Trust band validator */
|
|
7
|
+
export const trustBandSchema = z.nativeEnum(TrustBand);
|
|
8
|
+
/** Observation tier validator */
|
|
9
|
+
export const observationTierSchema = z.nativeEnum(ObservationTier);
|
|
10
|
+
/** Data sensitivity validator */
|
|
11
|
+
export const dataSensitivitySchema = z.nativeEnum(DataSensitivity);
|
|
12
|
+
/** Reversibility validator */
|
|
13
|
+
export const reversibilitySchema = z.nativeEnum(Reversibility);
|
|
14
|
+
/** Action type validator */
|
|
15
|
+
export const actionTypeSchema = z.nativeEnum(ActionType);
|
|
16
|
+
/** Proof event type validator */
|
|
17
|
+
export const proofEventTypeSchema = z.nativeEnum(ProofEventType);
|
|
18
|
+
/** Component type validator */
|
|
19
|
+
export const componentTypeSchema = z.nativeEnum(ComponentType);
|
|
20
|
+
/** Component status validator */
|
|
21
|
+
export const componentStatusSchema = z.nativeEnum(ComponentStatus);
|
|
22
|
+
/** Approval type validator */
|
|
23
|
+
export const approvalTypeSchema = z.nativeEnum(ApprovalType);
|
|
24
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/validators/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,SAAS,EACT,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,2BAA2B;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAEvD,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEnE,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEnE,8BAA8B;AAC9B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAE/D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAEzD,iCAAiC;AACjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAE/D,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEnE,8BAA8B;AAC9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validators index - re-exports all Zod schemas and validation utilities
|
|
3
|
+
*/
|
|
4
|
+
export * from './enums.js';
|
|
5
|
+
export * from './trust-profile.js';
|
|
6
|
+
export * from './intent.js';
|
|
7
|
+
export * from './decision.js';
|
|
8
|
+
export * from './proof-event.js';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
/**
|
|
11
|
+
* Validate data against a schema
|
|
12
|
+
* @throws ZodError if validation fails
|
|
13
|
+
*/
|
|
14
|
+
export declare function validate<T>(schema: z.ZodSchema<T>, data: unknown): T;
|
|
15
|
+
/**
|
|
16
|
+
* Safely validate data, returning result object
|
|
17
|
+
*/
|
|
18
|
+
export declare function safeValidate<T>(schema: z.ZodSchema<T>, data: unknown): {
|
|
19
|
+
success: true;
|
|
20
|
+
data: T;
|
|
21
|
+
} | {
|
|
22
|
+
success: false;
|
|
23
|
+
errors: z.ZodIssue[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Format validation errors for display
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatValidationErrors(errors: z.ZodIssue[]): string[];
|
|
29
|
+
export { z } from 'zod';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,CAAC,CAEpE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,IAAI,EAAE,OAAO,GACZ;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;CAAE,CAMvE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,GAAG,MAAM,EAAE,CAKrE;AAGD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validators index - re-exports all Zod schemas and validation utilities
|
|
3
|
+
*/
|
|
4
|
+
// Enum validators
|
|
5
|
+
export * from './enums.js';
|
|
6
|
+
// Trust profile validators
|
|
7
|
+
export * from './trust-profile.js';
|
|
8
|
+
// Intent validators
|
|
9
|
+
export * from './intent.js';
|
|
10
|
+
// Decision validators
|
|
11
|
+
export * from './decision.js';
|
|
12
|
+
// Proof event validators
|
|
13
|
+
export * from './proof-event.js';
|
|
14
|
+
/**
|
|
15
|
+
* Validate data against a schema
|
|
16
|
+
* @throws ZodError if validation fails
|
|
17
|
+
*/
|
|
18
|
+
export function validate(schema, data) {
|
|
19
|
+
return schema.parse(data);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Safely validate data, returning result object
|
|
23
|
+
*/
|
|
24
|
+
export function safeValidate(schema, data) {
|
|
25
|
+
const result = schema.safeParse(data);
|
|
26
|
+
if (result.success) {
|
|
27
|
+
return { success: true, data: result.data };
|
|
28
|
+
}
|
|
29
|
+
return { success: false, errors: result.error.issues };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Format validation errors for display
|
|
33
|
+
*/
|
|
34
|
+
export function formatValidationErrors(errors) {
|
|
35
|
+
return errors.map((issue) => {
|
|
36
|
+
const path = issue.path.join('.');
|
|
37
|
+
return path ? `${path}: ${issue.message}` : issue.message;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// Re-export Zod for convenience
|
|
41
|
+
export { z } from 'zod';
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAE3B,2BAA2B;AAC3B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